:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #edf3f9;
  font-synthesis: none;
  --amcham-blue: #00458d;
  --amcham-blue-dark: #073a6b;
  --amcham-blue-soft: #e7f0fa;
  --amcham-gold: #d4a62a;
  --panel-border: #dbe5ef;
  --muted: #64748b;
  --shadow: 0 18px 55px rgba(20, 54, 91, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #edf3f9;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 69, 141, 0.12), transparent 34%),
    radial-gradient(circle at 95% 15%, rgba(212, 166, 42, 0.12), transparent 28%),
    #edf3f9;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(120deg, var(--amcham-blue-dark), var(--amcham-blue));
  border-bottom: 4px solid var(--amcham-gold);
}

.site-header::after {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  top: -285px;
  right: -115px;
  border: 70px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.site-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 24px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.brand-mark img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 5px;
  color: #d9eafe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.header-copy {
  max-width: 720px;
  margin-bottom: 0;
  color: #deebf8;
  font-size: 15px;
  line-height: 1.55;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 24px;
  width: min(1240px, calc(100% - 36px));
  margin: 28px auto 18px;
}

.control-panel,
.preview-panel {
  min-width: 0;
  border: 1px solid rgba(210, 224, 237, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.control-panel {
  align-self: start;
  padding: 24px;
}

.preview-panel {
  overflow: hidden;
}

.preview-panel__header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.section-heading--compact {
  margin-bottom: 0;
}

.section-heading h2 {
  margin: 1px 0 4px;
  color: #17324f;
  font-size: 19px;
  line-height: 1.25;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--amcham-blue);
  box-shadow: 0 5px 14px rgba(0, 69, 141, 0.25);
  font-size: 14px;
  font-weight: 800;
}

.field-group {
  min-width: 0;
}

label,
.signature-style-fieldset legend {
  display: block;
  margin: 0 0 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

select,
input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c9d6e3;
  border-radius: 10px;
  color: #1f2937;
  background: #ffffff;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

select:hover,
input:hover {
  border-color: #9cb6d0;
}

select:focus,
input:focus {
  border-color: var(--amcham-blue);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(0, 69, 141, 0.12);
}

.signature-style-fieldset {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.signature-style-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border: 1px solid #d8e2ec;
  border-radius: 13px;
  background: #f2f6fa;
}

.style-button {
  display: flex;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  background: transparent;
  text-align: left;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.style-button:hover {
  background: #ffffff;
}

.style-button.is-active {
  border-color: rgba(0, 69, 141, 0.28);
  color: var(--amcham-blue);
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(18, 54, 92, 0.12);
  transform: translateY(-1px);
}

.style-button__title {
  font-size: 14px;
  font-weight: 850;
}

.style-button__meta {
  margin-top: 2px;
  color: #718096;
  font-size: 11px;
  font-weight: 600;
}

.style-note,
.copy-help,
.settings-note {
  color: var(--muted);
  line-height: 1.5;
}

.style-note {
  min-height: 38px;
  margin: 8px 2px 0;
  font-size: 12px;
}

.primary-action-wrap {
  margin-top: 19px;
  padding-top: 19px;
  border-top: 1px solid #e2e8f0;
}

.primary-action,
.secondary-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.primary-action {
  display: flex;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 11px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--amcham-blue), #0a5aac);
  box-shadow: 0 9px 22px rgba(0, 69, 141, 0.23);
}

.primary-action:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.primary-action:active,
.secondary-button:active {
  transform: translateY(0);
}

.button-icon {
  font-size: 20px;
  line-height: 1;
}

.copy-help {
  margin: 8px 3px 0;
  font-size: 11px;
  text-align: center;
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.secondary-button {
  min-height: 41px;
  padding: 10px 12px;
  border: 1px solid #d5e0eb;
  border-radius: 10px;
  color: #29445f;
  background: #f5f8fb;
  font-size: 12px;
}

.status-message {
  min-height: 20px;
  margin: 12px 2px 0;
  color: #18743a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.shared-settings {
  margin-top: 17px;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: #fbfdff;
}

.shared-settings summary {
  display: flex;
  padding: 13px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: #29445f;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.shared-settings summary::-webkit-details-marker {
  display: none;
}

.shared-settings summary::after {
  content: "+";
  color: var(--amcham-blue);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.shared-settings[open] summary::after {
  content: "−";
}

.summary-hint {
  margin-left: auto;
  color: #8a9bad;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-content {
  padding: 0 14px 14px;
  border-top: 1px solid #e4ebf2;
}

.settings-note {
  margin: 13px 0;
  font-size: 11px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-grid label {
  font-size: 11px;
}

.settings-grid input {
  min-height: 39px;
  padding: 8px 9px;
  font-size: 11px;
}

.settings-grid__wide {
  grid-column: 1 / -1;
}

.settings-button {
  width: 100%;
  margin-top: 13px;
}

.preview-stage {
  min-height: 520px;
  overflow: auto;
  padding: 36px;
  background:
    linear-gradient(45deg, rgba(72, 102, 133, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(72, 102, 133, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(72, 102, 133, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(72, 102, 133, 0.035) 75%),
    #eef3f8;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
}

.preview-card {
  width: fit-content;
  min-width: 632px;
  margin: 0 auto;
  padding: 15px;
  border: 1px solid #d7e0e9;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 16px 35px rgba(45, 67, 89, 0.16);
}

#signature-preview {
  width: fit-content;
  min-width: 600px;
  background: #ffffff;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #194b78;
  background: #edf4fb;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.site-footer {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 10px 0 24px;
  color: #718096;
  font-size: 11px;
  text-align: center;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 69, 141, 0.22);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header__inner,
  .app-shell,
  .site-footer {
    width: min(100% - 20px, 1240px);
  }

  .site-header__inner {
    gap: 13px;
    padding: 18px 0;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .brand-mark img {
    width: 50px;
    height: 50px;
  }

  .header-copy {
    font-size: 13px;
  }

  .app-shell {
    gap: 15px;
    margin-top: 15px;
  }

  .control-panel,
  .preview-panel {
    border-radius: 15px;
  }

  .control-panel,
  .preview-panel__header {
    padding: 18px;
  }

  .signature-style-toggle,
  .secondary-actions,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid__wide {
    grid-column: auto;
  }

  .preview-stage {
    min-height: 390px;
    padding: 14px;
  }

  .preview-card {
    min-width: 624px;
    margin: 0;
    padding: 11px;
  }
}

/* ============================================================
   ADMIN PANEL (admin.html)
   ============================================================ */

.admin-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 28px auto 40px;
}

.admin-login-card {
  max-width: 420px;
  margin: 60px auto;
  padding: 28px;
  border: 1px solid rgba(210, 224, 237, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.admin-login-card h2 {
  color: #17324f;
  font-size: 20px;
}

.admin-login-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.admin-login-card input {
  margin-bottom: 12px;
}

.admin-error {
  min-height: 18px;
  margin-top: 10px;
  color: #b42318;
  font-size: 12.5px;
  font-weight: 700;
}

.admin-success {
  min-height: 18px;
  margin-top: 10px;
  color: #18743a;
  font-size: 12.5px;
  font-weight: 700;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 22px;
  color: #17324f;
}

.admin-topbar .secondary-button {
  width: auto;
  min-height: 38px;
  padding: 8px 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid #d8e2ec;
  border-radius: 13px;
  background: #f2f6fa;
  width: fit-content;
}

.admin-tab {
  padding: 9px 18px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: #334155;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.admin-tab.is-active {
  color: var(--amcham-blue);
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(18, 54, 92, 0.12);
}

.admin-panel {
  padding: 24px;
  border: 1px solid rgba(210, 224, 237, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.admin-panel + .admin-panel {
  margin-top: 18px;
}

.admin-panel h2 {
  margin: 0 0 4px;
  color: #17324f;
  font-size: 18px;
}

.admin-panel > p.section-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-grid label {
  font-size: 12px;
}

.admin-grid input {
  min-height: 41px;
  font-size: 13px;
}

.admin-grid__wide {
  grid-column: 1 / -1;
}

.admin-member-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-member-card {
  padding: 16px;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  background: #fbfdff;
}

.admin-member-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-member-card__head strong {
  color: #17324f;
  font-size: 14px;
}

.admin-member-card__actions {
  display: flex;
  gap: 8px;
}

.admin-icon-button {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #d5e0eb;
  border-radius: 8px;
  cursor: pointer;
  color: #29445f;
  background: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
}

.admin-icon-button.is-danger {
  color: #b42318;
  border-color: #f3c9c4;
  background: #fff5f4;
}

.admin-member-card details {
  margin-top: 6px;
}

.admin-member-card summary {
  cursor: pointer;
  color: var(--amcham-blue);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.admin-member-card summary::-webkit-details-marker {
  display: none;
}

.admin-member-card textarea {
  width: 100%;
  min-height: 70px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #c9d6e3;
  border-radius: 10px;
  font: inherit;
  font-size: 12.5px;
  resize: vertical;
}

.admin-add-button {
  align-self: flex-start;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px dashed #9cb6d0;
  border-radius: 10px;
  cursor: pointer;
  color: var(--amcham-blue);
  background: #f5f9fd;
  font-size: 13px;
  font-weight: 800;
}

.admin-save-bar {
  position: sticky;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(210, 224, 237, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.admin-save-bar .primary-action {
  width: auto;
  padding: 12px 26px;
}

@media (max-width: 720px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-save-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
