:root {
  color-scheme: light;
  --page: #f6f7f9;
  --card: #ffffff;
  --card-soft: #f9fafc;
  --panel: #f2f7ff;
  --ink: #16181d;
  --ink-soft: #4d5663;
  --muted: #8b94a3;
  --line: #e8ebf0;
  --line-strong: #d8dde6;
  --accent: #3f7df6;
  --accent-deep: #2563eb;
  --accent-soft: #eaf2ff;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fff7ed;
  --red: #f97373;
  --red-soft: #fff1f2;
  --shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.045);
}

* {
  box-sizing: border-box;
}

*::selection {
  background: rgba(63, 125, 246, 0.18);
}

[hidden] {
  display: none !important;
}

html {
  min-width: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter,
    "Noto Sans SC",
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(63, 125, 246, 0.24);
  outline-offset: 2px;
}

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

.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  width: min(1460px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.surface-label {
  margin: 0 0 8px;
  color: #c4c9d2;
  font-size: 16px;
  line-height: 1.2;
}

.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  padding: 12px 30px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.brand-lockup,
.topbar-actions,
.board-actions,
.action-row,
.brief-tags,
.radar-head,
.dimension-heading,
.section-title,
.dimension-item-top {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: block;
  border-radius: 10px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 14px rgba(120, 53, 15, 0.16));
}

.brand-lockup h1 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.brand-lockup p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  background: var(--card-soft);
  color: #7d8695;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.is-progress {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.is-progress span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.diagnosis-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 22px;
  align-items: start;
  transition: grid-template-columns 180ms ease;
}

.diagnosis-workspace:has(.mobile-result-details[open]) {
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
}

.input-board,
.result-panel,
.project-brief,
.history-panel,
.seed-card,
.question-card,
.why-card,
.score-summary,
.radar-wrap,
.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.input-board {
  min-height: calc(100vh - 132px);
  display: grid;
  grid-template-areas:
    "brief"
    "head"
    "question"
    "history";
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 0;
  box-shadow: none;
  background: transparent;
  border: 0;
}

.input-board[data-started="false"] {
  grid-template-areas:
    "seed"
    "why";
  grid-template-rows: auto auto;
  align-content: start;
}

.seed-card {
  grid-area: seed;
}

.why-card {
  grid-area: why;
}

.project-brief {
  grid-area: brief;
}

.board-head {
  grid-area: head;
}

.question-card {
  grid-area: question;
}

.history-panel {
  grid-area: history;
}

.input-board[data-started="false"] .project-brief,
.input-board[data-started="false"] .board-head,
.input-board[data-started="false"] .history-panel,
.input-board[data-started="false"] .question-card {
  display: none !important;
}

.input-board[data-started="true"] .seed-card,
.input-board[data-started="true"] .why-card {
  display: none !important;
}

.project-brief {
  padding: 18px 20px;
  border-color: #cfe0ff;
  background: var(--panel);
  box-shadow: none;
}

.project-brief-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.project-brief-top span,
.project-brief-top strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.project-brief-top strong {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #dceaff;
  padding: 0 10px;
  white-space: nowrap;
}

.project-brief h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
}

.project-brief p {
  max-width: 760px;
  margin: 0;
  color: #425064;
  font-size: 14px;
  line-height: 1.65;
}

.brief-tags {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.brief-tags span {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.brief-tags span:nth-child(2) {
  border-color: #bbf7d0;
  color: var(--green);
}

.board-head,
.history-panel,
.seed-card,
.question-card {
  background: var(--card);
}

.board-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 24px;
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  display: block;
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.board-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.28;
}

.board-actions {
  justify-content: flex-end;
  gap: 8px;
}

.history-panel {
  min-height: clamp(260px, 38vh, 520px);
  max-height: min(560px, 54vh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.panel-title {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #edf0f5;
  padding: 13px 16px;
}

.panel-title span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.panel-title strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.question-history {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px;
}

.question-history,
.dimension-list {
  scrollbar-color: #c7d6f5 transparent;
  scrollbar-width: thin;
}

.history-empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--card-soft);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.history-item {
  border: 1px solid #edf0f5;
  border-radius: 8px;
  padding: 13px 14px;
  background: #fbfcfe;
}

.history-item + .history-item {
  margin-top: 10px;
}

.history-item span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.history-item strong {
  display: block;
  margin: 9px 0 5px;
  color: var(--ink);
  line-height: 1.45;
}

.history-item p {
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.history-item.is-unsure span {
  background: var(--amber-soft);
  color: var(--amber);
}

.seed-card,
.question-card {
  padding-bottom: 18px;
}

.question-card {
  scroll-margin-top: 18px;
}

.diagnosis-loading {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border-bottom: 1px solid #edf0f5;
  background:
    radial-gradient(circle at 28px 16px, rgba(16, 185, 129, 0.14), transparent 28px),
    linear-gradient(90deg, #f8fbff 0%, #ffffff 54%, #f2f7ff 100%);
  color: var(--accent);
  padding: 13px 18px 17px;
  font-size: 13px;
  font-weight: 900;
}

.loading-spinner {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(63, 125, 246, 0.16);
  border-top-color: var(--accent);
  border-right-color: rgba(16, 185, 129, 0.8);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(63, 125, 246, 0.06);
  animation: orbit 900ms linear infinite;
}

.loading-spinner::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(63, 125, 246, 0.12);
}

.loading-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transform: translateY(1px);
}

.loading-pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--green);
  opacity: 0.35;
  animation: pulseDot 900ms ease-in-out infinite;
}

.loading-pulse-dot:nth-child(2) {
  animation-delay: 140ms;
}

.loading-pulse-dot:nth-child(3) {
  animation-delay: 280ms;
}

.loading-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: #dceaff;
}

.loading-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), var(--green), transparent);
  animation: loadingSweep 1.25s ease-in-out infinite;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  45% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes loadingSweep {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(260%);
  }
}

.input-board[data-started="false"] .seed-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.input-board[data-started="false"] .seed-card textarea {
  min-height: clamp(126px, 20vh, 180px);
}

.seed-content > h2,
.seed-content > p,
.seed-content > label,
.seed-content > textarea,
.question-card > h2,
.question-card > p,
.answer-suggestion,
.alternative-block,
.question-card > label,
.question-card > textarea,
.action-row,
.document-status {
  margin-left: 18px;
  margin-right: 18px;
}

.seed-content > h2,
.question-card > h2 {
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.42;
  letter-spacing: 0;
}

.question-card > h2 {
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.35;
}

.question-card .question-reason {
  margin-bottom: 10px;
}

.question-card textarea {
  min-height: 0;
  height: 96px;
}

.seed-content > h2,
.seed-content > p,
.seed-content > label,
.seed-content > textarea,
.seed-content > .document-status,
.seed-actions {
  margin-left: 0;
  margin-right: 0;
}

.seed-content > h2 {
  margin-top: 0;
}

.seed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.seed-actions .primary-button {
  min-width: 118px;
}

.question-reason {
  margin-bottom: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

label,
.answer-suggestion > span,
.alternative-block > span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

textarea {
  width: calc(100% - 36px);
  min-height: 102px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  padding: 15px 16px;
  outline: none;
  resize: vertical;
  line-height: 1.72;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.035);
}

.seed-content textarea {
  width: 100%;
}

textarea::placeholder {
  color: #a4acb8;
}

textarea:focus {
  border-color: #9fc0ff;
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(63, 125, 246, 0.12),
    inset 0 1px 2px rgba(15, 23, 42, 0.035);
}

.answer-suggestion,
.alternative-block {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

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

.suggestion-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.suggestion-button:hover {
  border-color: #bcd2ff;
  background: #f8fbff;
  color: var(--ink);
}

.suggestion-button.recommended {
  border-color: #bfd7ff;
  background: #f2f7ff;
  color: #1e4eb4;
}

.action-row {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.primary-button,
.ghost-button,
.soft-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 17px;
  font-weight: 900;
  white-space: nowrap;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(63, 125, 246, 0.22);
}

.primary-button:hover {
  background: var(--accent-deep);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.top-continue {
  min-width: 98px;
}

.ghost-button {
  border-color: #d8dde6;
  background: #fff;
  color: #404958;
  box-shadow: none;
}

.ghost-button:hover {
  border-color: #bcd2ff;
  color: var(--accent);
}

.soft-button {
  border-color: #fed7aa;
  background: var(--amber-soft);
  color: #c2410c;
}

.soft-button:hover {
  border-color: #fdba74;
  background: #ffedd5;
}

.document-status {
  margin-top: 12px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.58;
}

.document-status.is-loading,
.document-status.is-success,
.document-status.is-error {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.document-status.is-loading {
  border-color: #bfdbfe;
  background: #f7fbff;
  color: #315a9c;
}

.document-status.is-success {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f3fff8 0%, #ecfdf5 100%);
  color: #166534;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.1);
}

.document-status.is-error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

.attachment-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  padding: 6px;
  background: #eef6ff;
  color: var(--accent);
}

.attachment-icon--pdf {
  background: #fff1f2;
  color: #e11d48;
}

.attachment-icon--doc {
  background: #eff6ff;
  color: #2563eb;
}

.attachment-icon--md,
.attachment-icon--txt {
  background: #f0fdf4;
  color: #15803d;
}

.attachment-icon--image {
  background: #fff7ed;
  color: #c2410c;
}

.attachment-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.attachment-label {
  color: #3f6b4e;
  font-size: 11px;
  font-weight: 900;
}

.attachment-filename {
  width: fit-content;
  max-width: 100%;
  display: block;
  border-radius: 6px;
  background: #dff9eb;
  padding: 2px 7px;
  color: #14532d;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.attachment-meta {
  color: #4d7c5c;
  font-size: 11px;
}

.why-card {
  border-color: #fed7aa;
  background: #fffdf7;
  padding: 16px 18px;
  box-shadow: none;
}

.why-card h2 {
  margin: 0 0 6px;
  color: #b45309;
  font-size: 15px;
  line-height: 1.4;
}

.why-card p {
  margin: 0;
  color: #6b5b44;
  font-size: 13px;
  line-height: 1.58;
}

.result-panel {
  min-height: calc(100vh - 132px);
  position: sticky;
  top: 18px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.mobile-result-strip {
  min-height: 128px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.mobile-result-strip span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.mobile-result-strip strong {
  color: var(--accent);
  font-size: 36px;
  font-weight: 950;
  line-height: 0.96;
  font-variant-numeric: tabular-nums;
}

.mobile-result-strip p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
}

.mobile-result-details {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.mobile-result-details > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.mobile-result-details > summary::-webkit-details-marker {
  display: none;
}

.mobile-result-details > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.mobile-result-details[open] > summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.mobile-detail-content {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 0 0;
}

.mobile-result-details[open] {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.mobile-result-details[open] > summary {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.mobile-result-details[open] .mobile-detail-content {
  border-top: 0;
  padding: 0;
}

.score-summary {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.score-lockup {
  min-height: 86px;
  display: grid;
  align-content: center;
  border-right: 1px solid var(--line);
  padding-right: 22px;
}

.score-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.score-lockup strong {
  color: var(--accent);
  font-size: 43px;
  font-weight: 900;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.score-lockup small {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.2;
}

.score-copy h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.38;
}

.summary {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.radar-wrap {
  min-height: 330px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}

.radar-head,
.dimension-heading {
  justify-content: space-between;
  gap: 14px;
}

.radar-head h2,
.dimension-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
}

.radar-head span,
.dimension-heading span {
  color: var(--muted);
  font-size: 12px;
}

.radar-wrap canvas {
  width: 100%;
  max-width: 520px;
  height: auto;
  align-self: center;
  justify-self: center;
}

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

.meta-grid div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 13px 14px;
  box-shadow: var(--shadow-soft);
}

.meta-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta-grid strong {
  color: var(--ink);
  line-height: 1.4;
}

.dimension-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}

.dimension-labels {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.58;
}

.dimension-list {
  display: grid;
  gap: 0;
}

.dimension-item {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(128px, 0.95fr) minmax(0, 2fr) minmax(96px, 0.9fr);
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid #edf0f5;
  padding: 12px 0;
}

.dimension-item:last-child {
  border-bottom: 0;
}

.dimension-item-top {
  justify-content: space-between;
  gap: 10px;
}

.dimension-item strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.dimension-item-top span {
  min-width: 36px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dimension-item small {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  border-radius: 6px;
  background: var(--card-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.dimension-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.dimension-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.dimension-item[data-level="pending"] {
  min-height: 46px;
}

.dimension-item[data-level="pending"] p {
  justify-self: end;
  color: var(--muted);
}

.dimension-item[data-level="strong"] .dimension-item-top span {
  color: var(--green);
}

.dimension-item[data-level="strong"] small {
  background: var(--green-soft);
  color: var(--green);
}

.dimension-item[data-level="medium"] .dimension-item-top span {
  color: var(--amber);
}

.dimension-item[data-level="medium"] small {
  background: var(--amber-soft);
  color: var(--amber);
}

.dimension-item[data-level="weak"] .dimension-item-top span {
  color: var(--red);
}

.dimension-item[data-level="weak"] small {
  background: var(--red-soft);
  color: #ef4444;
}

.section-block {
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}

.section-title {
  gap: 10px;
  margin-bottom: 10px;
}

.section-title span {
  min-width: 42px;
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.section-title strong {
  color: var(--ink);
}

#firstVersion,
#reportCompleteness {
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

#reportCompleteness {
  margin-bottom: 12px;
}

.report-download {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  text-decoration: none;
}

.cut-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cut-list li {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #c2410c;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1160px) {
  .diagnosis-workspace {
    grid-template-columns: minmax(0, 1fr) 224px;
    gap: 16px;
  }

  .diagnosis-workspace:has(.mobile-result-details[open]) {
    grid-template-columns: minmax(0, 0.92fr) minmax(390px, 1.08fr);
  }

  .topbar {
    padding-left: 22px;
    padding-right: 22px;
  }

  .score-summary {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .dimension-item {
    grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.7fr);
  }

  .dimension-item em {
    grid-column: 2;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100vw - 20px, 760px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .diagnosis-workspace {
    grid-template-columns: 1fr;
  }

  .diagnosis-workspace:has(.mobile-result-details[open]) {
    grid-template-columns: 1fr;
  }

  .input-board,
  .result-panel {
    min-height: auto;
  }

  .history-panel {
    min-height: clamp(360px, 54vh, 620px);
    max-height: none;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100vw - 14px, 480px);
    padding-top: 10px;
  }

  .surface-label {
    font-size: 15px;
  }

  .topbar,
  .board-head,
  .project-brief,
  .score-summary,
  .radar-wrap,
  .dimension-section,
  .section-block {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .diagnosis-workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .input-board {
    gap: 12px;
  }

  .input-board[data-started="false"] {
    grid-template-areas:
      "seed"
      "why";
    grid-template-rows: auto auto;
    min-height: auto;
  }

  .input-board[data-started="true"] {
    grid-template-areas:
      "brief"
      "question"
      "history";
    grid-template-rows: auto auto auto;
    min-height: auto;
  }

  body:has(.input-board[data-started="false"]) .result-panel {
    display: none;
  }

  .input-board[data-started="true"] + .result-panel {
    order: 2;
  }

  .input-board[data-started="true"] .project-brief {
    order: 0;
  }

  .input-board[data-started="true"] .question-card {
    order: 1;
  }

  .input-board[data-started="true"] .history-panel {
    order: 2;
  }

  .topbar-actions,
  .board-head,
  .project-brief-top,
  .radar-head,
  .dimension-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-continue,
  .primary-button,
  .ghost-button,
  .soft-button {
    width: 100%;
  }

  .alternative-answers,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .diagnosis-loading {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 64px;
    align-items: start;
    padding-top: 13px;
  }

  .loading-copy {
    display: grid;
    gap: 6px;
  }

  .result-panel {
    min-height: auto;
    position: static;
    gap: 10px;
    order: 2;
  }

  .mobile-result-strip {
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(60px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 4px 12px;
    border: 1px solid #cfe0ff;
    border-radius: 8px;
    background: var(--panel);
    padding: 12px 14px;
  }

  .mobile-result-strip span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-result-strip strong {
    grid-row: span 2;
    min-width: 58px;
    color: var(--accent);
    font-size: 31px;
    font-weight: 950;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  .mobile-result-strip p {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.45;
  }

  .mobile-result-details {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    overflow: hidden;
  }

  .mobile-result-details > summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 14px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
  }

  .mobile-result-details > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-result-details > summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
  }

  .mobile-result-details[open] > summary::after {
    transform: rotate(225deg) translateY(-2px);
  }

  .mobile-detail-content {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 10px;
    background: var(--card-soft);
  }

  .score-summary {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .score-lockup {
    min-height: 70px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 14px;
  }

  .dimension-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .dimension-item em {
    grid-column: auto;
  }

  .radar-wrap {
    min-height: 280px;
  }

  .project-brief {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .question-card > h2 {
    font-size: 18px;
  }

  .question-card textarea {
    height: 112px;
  }

  .history-panel {
    min-height: 0;
    max-height: 260px;
    overflow: auto;
  }

  .question-history {
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .loading-spinner,
  .loading-pulse-dot,
  .loading-progress::after {
    animation: none;
  }
}
