:root {
  color-scheme: light;
  --ink: #202020;
  --muted: #7b7b7b;
  --soft: #f7f7f7;
  --paper: #ece8df;
  --panel: #ffffff;
  --line: #e6e3dc;
  --blue-row: #eef6ff;
  --yellow-row: #fffde9;
  --green-row: #eefff4;
  --green-pill: #d8fae4;
  --blue-pill: #d9e9ff;
  --orange-pill: #ffe5cc;
  --shadow: 0 2px 8px rgba(20, 20, 20, 0.08);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-weight: 400;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1410px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.sidebar {
  display: grid;
  gap: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 10px;
  width: min(420px, 54vw);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82px;
  object-fit: contain;
  object-position: left center;
}

.brand small {
  color: #858585;
  font-size: 1rem;
  font-weight: 400;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 66px;
  padding: 8px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mode-button {
  min-width: 120px;
  border: 0;
  background: transparent;
  color: #5f5f5f;
  border-radius: 16px;
  padding: 16px 22px;
  font-weight: 500;
  text-align: center;
}

.mode-button.active {
  background: #000;
  color: #fff;
}

.mode-button:hover:not(.active) {
  background: #f4f4f4;
  color: var(--ink);
}

.progress-card,
.sidebar-note,
.form-panel,
.preview-card,
.admin-card,
.strategy-grid article {
  background: var(--panel);
  border: 1px solid rgba(230, 227, 220, 0.9);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.progress-card,
.sidebar-note {
  padding: 22px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #777;
  font-size: 0.95rem;
}

.progress-label strong,
.sidebar-note strong {
  color: var(--ink);
  font-size: 1.65rem;
  line-height: 1.1;
  font-weight: 500;
}

.progress-track {
  margin: 16px 0 14px;
  height: 8px;
  background: #eeeeec;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #8e8e82;
  transition: width 220ms ease;
}

.progress-card p,
.sidebar-note p,
.hero p,
.admin-hero p,
.strategy-grid p,
.strategy-grid li,
.section-heading p,
.preview-text {
  color: var(--muted);
  line-height: 1.55;
}

.note-kicker,
.eyebrow,
.preview-head span,
.strategy-tag {
  color: #787878;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

main {
  min-width: 0;
  margin-top: 26px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero,
.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 24px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: min(1120px, 100%);
  font-size: clamp(1.95rem, 2.75vw, 3rem);
  line-height: 1.08;
  font-weight: 450;
}

.hero p:not(.eyebrow) {
  max-width: min(1040px, 100%);
}

h2 {
  font-size: 1.12rem;
  font-weight: 500;
}

.portal-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.progress-sidebar {
  position: sticky;
  top: 20px;
}

.progress-steps {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.progress-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #8a8a8a;
  padding: 12px;
  text-align: left;
}

.progress-step-number {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border-radius: 11px;
  background: #f1f1f1;
  color: #8a8a8a;
  font-size: 0.83rem;
  font-weight: 520;
}

.progress-step-title,
.progress-step-hint {
  display: block;
}

.progress-step-title {
  color: inherit;
  font-size: 0.96rem;
  font-weight: 500;
}

.progress-step-hint {
  margin-top: 3px;
  color: #9a9a9a;
  font-size: 0.82rem;
  line-height: 1.35;
}

.progress-step.done {
  color: #555;
}

.progress-step.done .progress-step-number {
  background: #eeeeec;
  color: #555;
}

.progress-step.active {
  background: #000;
  color: #fff;
}

.progress-step.active .progress-step-number {
  background: #fff;
  color: #000;
}

.progress-step.active .progress-step-title,
.progress-step.active .progress-step-hint {
  color: #fff;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.form-panel {
  overflow: hidden;
}

.stepper {
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 22px 22px 0;
}

.step-dot {
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: #efefef;
}

.step-dot.active,
.step-dot.done {
  background: #000;
}

.step {
  display: none;
  padding: 24px;
}

.step.active {
  display: block;
}

.section-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading > span {
  display: grid;
  place-items: center;
  width: 52px;
  aspect-ratio: 1;
  border-radius: 17px;
  background: #000;
  color: #fff;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #303030;
  font-size: 0.9rem;
  font-weight: 500;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #dedede;
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
  outline: none;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a1a1a1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

.choice-row,
.toggle-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.choice-row {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.toggle-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.choice,
.toggle-list label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border: 0;
  background: var(--soft);
  padding: 12px 15px;
  border-radius: 16px;
  font-weight: 520;
}

.choice input,
.toggle-list input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.choice span,
.toggle-list label {
  min-width: 0;
}

.choice span {
  overflow-wrap: anywhere;
}

.conditional.hidden,
.hidden {
  display: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 18px 24px 24px;
  border-top: 1px solid #eeeeee;
  background: #fff;
}

.primary,
.secondary,
.ghost,
.mini {
  border-radius: 16px;
  border: 1px solid transparent;
  padding: 13px 18px;
  font-weight: 560;
}

.primary {
  background: #000;
  color: #fff;
}

.secondary {
  background: #f7f7f7;
  color: var(--ink);
  border-color: #e2e2e2;
}

.ghost,
.mini {
  background: #fff;
  border-color: #e2e2e2;
  color: #555;
  box-shadow: var(--shadow);
}

.mini {
  padding: 8px 12px;
  font-size: 0.85rem;
  box-shadow: none;
}

.preview-panel {
  display: none;
  position: static;
}

.workspace.review-mode .form-panel {
  display: none;
}

.workspace.review-mode .preview-panel {
  display: block;
}

.workspace.submitted-mode .preview-head,
.workspace.submitted-mode .preview-text,
.workspace.submitted-mode .review-actions {
  display: none;
}

.workspace.submitted-mode .success-message {
  display: grid;
}

.preview-card {
  overflow: hidden;
}

.preview-head,
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid #eeeeee;
}

.preview-text {
  padding: 24px;
  min-height: 360px;
  background: #fff;
}

.preview-text h3 {
  font-size: 1.9rem;
  font-weight: 450;
  margin-bottom: 18px;
}

.preview-text dl {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px 22px;
  margin: 0;
}

.preview-text dt {
  color: var(--ink);
  font-weight: 520;
}

.preview-text dd {
  margin: 0;
}

.review-actions {
  justify-content: flex-end;
}

.success-message {
  display: none;
  place-items: start;
  gap: 12px;
  min-height: 360px;
  padding: 42px;
  align-content: center;
  width: 100%;
}

.success-message span {
  color: #787878;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.success-message h2 {
  max-width: min(980px, 100%);
  font-size: clamp(1.85rem, 2.55vw, 2.85rem);
  line-height: 1.08;
  font-weight: 450;
}

.success-message p {
  max-width: min(940px, 100%);
  color: var(--muted);
  line-height: 1.6;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
}

.admin-card {
  min-height: 420px;
  overflow: hidden;
}

.admin-card h2 {
  font-size: 1.2rem;
}

.submission-list {
  display: grid;
}

.submission-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eeeeee;
  background: #fff;
  padding: 18px 20px;
  text-align: left;
}

.submission-item:nth-child(1) {
  background: var(--blue-row);
}

.submission-item:nth-child(2) {
  background: var(--yellow-row);
}

.submission-item:nth-child(n + 3) {
  background: var(--green-row);
}

.submission-item.active {
  box-shadow: inset 5px 0 0 #000;
}

.submission-item strong,
.submission-item span {
  display: block;
}

.submission-item span {
  color: var(--muted);
  margin-top: 4px;
}

.submission-detail {
  padding: 22px;
}

.submission-detail.empty {
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid div {
  border: 1px solid #ededed;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.detail-grid strong,
.checklist strong {
  display: block;
  margin-bottom: 5px;
}

.checklist {
  margin-top: 18px;
  display: grid;
  gap: 9px;
}

.checklist label {
  display: flex;
  gap: 9px;
  align-items: center;
  width: fit-content;
  background: var(--green-pill);
  border-radius: 14px;
  padding: 10px 12px;
  color: #16843b;
  font-weight: 540;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.strategy-grid article {
  padding: 24px;
}

.strategy-grid h2 {
  margin: 12px 0 10px;
  font-size: 1.35rem;
}

.strategy-tag {
  display: inline-flex;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--blue-pill);
  color: #2d6ee8;
}

.strategy-tag.recommended {
  background: var(--green-pill);
  color: #16843b;
}

.strategy-tag.avoid {
  background: var(--orange-pill);
  color: #d75c10;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: #000;
  color: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: 180ms ease;
  pointer-events: none;
  max-width: min(520px, calc(100vw - 32px));
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 1100px) {
  .shell {
    width: min(940px, calc(100vw - 32px));
    padding-top: 28px;
  }

  .topbar,
  .portal-layout,
  .workspace,
  .admin-grid,
  .strategy-grid,
  .progress-steps {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .mode-switch {
    gap: 8px;
    overflow-x: auto;
  }

  .preview-panel {
    position: static;
  }

  .progress-sidebar {
    position: static;
  }

  .progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: calc(100vw - 24px);
    padding: 20px 0 44px;
  }

  .brand {
    width: min(330px, 76vw);
  }

  .brand-logo {
    max-height: 64px;
  }

  .form-actions {
    align-items: stretch;
  }

  .form-actions button {
    flex: 1 1 140px;
  }

  .field-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero,
  .admin-hero {
    padding: 18px;
  }

  h1 {
    font-size: 2rem;
  }

  .preview-text dl {
    grid-template-columns: 1fr;
  }

  .progress-steps {
    grid-template-columns: 1fr;
  }
}
