:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d9d9df;
  --line-soft: #ececf1;
  --blue: #0071e3;
  --blue-deep: #005bb5;
  --green: #1d8f5b;
  --amber: #b56a00;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 32%, #eeeeF3 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(245, 245, 247, 0.78);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.auth-controls,
.status-strip,
.actions,
.feature-row,
.mode-switch,
.metric-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  justify-self: start;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, #ffffff 0 12%, transparent 13%),
    conic-gradient(from 210deg, #0071e3, #5ac8fa, #1d8f5b, #0071e3);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.nav-links {
  justify-self: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  font-size: 13px;
}

.nav-links a {
  padding: 7px 10px;
  border-radius: 999px;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.nav-links a[aria-current="true"] {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.auth-controls {
  justify-self: end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.auth-open,
.auth-controls .button {
  min-height: 34px;
  font-size: 13px;
}

.user-chip {
  overflow: hidden;
  max-width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

main {
  padding: 0 24px;
}

[hidden] {
  display: none !important;
}

.page-view {
  animation: page-in 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-page {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 56px);
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(36px, 7svh, 92px) 0;
}

.hero-copy {
  width: min(100%, 1420px);
  margin: 0 auto;
  text-align: center;
  animation: rise-in 700ms ease both;
}

.hero-page h1 {
  font-size: clamp(48px, 9vw, 132px);
  line-height: 0.98;
  text-wrap: balance;
}

.hero-subtitle {
  max-width: min(920px, 88vw);
  margin: clamp(18px, 3svh, 34px) auto 0;
  color: var(--muted);
  font-size: clamp(20px, 2.35vw, 38px);
  line-height: 1.48;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(28px, 5svh, 48px);
}

.hero-primary {
  min-height: 52px;
  padding: 0 28px;
  font-size: 20px;
}

.hero-visual {
  width: min(820px, 100%);
  margin: 0 auto;
  min-width: 0;
  animation: rise-in 800ms ease 120ms both;
}

.feature-row {
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(26px, 5svh, 50px);
}

.feature-row span {
  padding: 10px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: clamp(12px, 1.1vw, 16px);
  font-weight: 650;
}

.version-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.version-strip span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 650;
}

.preview-shell {
  padding: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.preview-topline strong {
  color: var(--text);
}

.preview-score {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 0;
}

.preview-score h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.preview-score p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.mini-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--score) * 1%), #e6e6eb 0);
}

.mini-ring::after {
  position: absolute;
  inset: 9px;
  content: "";
  border-radius: 50%;
  background: #ffffff;
}

.mini-ring strong,
.mini-ring span {
  position: relative;
  z-index: 1;
}

.mini-ring strong {
  align-self: end;
  font-size: 34px;
  line-height: 1;
}

.mini-ring span {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}

.preview-bars {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.preview-bars div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
}

.preview-bars span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

meter {
  width: 100%;
  height: 8px;
}

meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: #e6e6eb;
}

meter::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: var(--blue);
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
}

.preview-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(29, 143, 91, 0.28);
  border-radius: 999px;
  color: #0f6d43;
  background: rgba(29, 143, 91, 0.08);
  font-size: 12px;
  font-weight: 650;
}

.preview-tags span[data-muted="true"] {
  border-color: rgba(181, 106, 0, 0.26);
  color: #8a5100;
  background: rgba(181, 106, 0, 0.08);
}

.workspace {
  max-width: 1240px;
  margin: 0 auto;
  min-height: calc(100svh - 56px);
  padding: 26px 0 44px;
}

.result-page {
  max-width: 1280px;
}

.page-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 18px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.page-back:hover {
  color: var(--text);
  background: #ffffff;
  transform: translateY(-1px);
}

.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 15px;
  letter-spacing: 0;
}

.workspace-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.status-strip {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 420px;
}

.status-strip span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.input-panel,
.loading-panel,
.result-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.input-panel {
  grid-column: 1 / -1;
  padding: 22px;
}

.loading-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: auto;
  margin: 0 0 16px;
  padding: 16px;
  box-shadow: none;
}

.result-panel {
  grid-column: 1 / -1;
  padding: 22px;
}

.panel-heading,
.command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.command-bar {
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.command-title {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 220px;
}

.command-title .eyebrow {
  margin: 0;
}

.command-title p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.command-tools {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.tool-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.command-bar .tool-group {
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.actions {
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button.primary {
  color: #ffffff;
  background: var(--blue);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-deep);
}

.button.secondary {
  color: var(--text);
  border-color: var(--line);
  background: #ffffff;
}

.button.ghost {
  color: var(--muted);
  background: transparent;
}

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

.analysis-page textarea {
  height: clamp(240px, 36svh, 420px);
  min-height: 240px;
}

.upload-chip {
  position: relative;
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 132px;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.upload-chip:hover {
  border-color: rgba(0, 113, 227, 0.5);
  transform: translateY(-1px);
}

.upload-chip span {
  font-size: 13px;
  font-weight: 750;
}

.upload-chip small {
  color: var(--muted);
  font-size: 11px;
}

.upload-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 9px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 440px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  line-height: 1.62;
  outline: none;
}

textarea.is-dragging {
  border-color: rgba(0, 113, 227, 0.72);
  background: rgba(0, 113, 227, 0.05);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.input-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid rgba(29, 143, 91, 0.22);
  border-radius: 999px;
  color: #0f6d43;
  background: rgba(29, 143, 91, 0.08);
  font-size: 12px;
  font-weight: 650;
}

.input-status::before {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
  content: "✓";
  font-size: 11px;
  line-height: 1;
  flex: 0 0 auto;
}

.input-status strong,
.input-status small {
  min-width: 0;
}

.input-status small {
  overflow: hidden;
  max-width: min(320px, 52vw);
  color: #337d57;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}

select {
  cursor: pointer;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(0, 113, 227, 0.72);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.run-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  margin-top: 0;
  border-radius: 999px;
  background: #e6e6eb;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 260ms ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
}

.progress-meta strong {
  color: var(--text);
}

.score-board {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 156px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--score) * 1%), #e6e6eb 0);
}

.score-ring::after {
  position: absolute;
  inset: 12px;
  content: "";
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.score-ring > div {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.score-ring strong {
  font-size: 44px;
  line-height: 1;
}

.score-ring span {
  color: var(--muted);
  font-size: 13px;
}

.score-label {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 750;
}

.score-meta p:not(.score-label) {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.metric-row {
  flex-wrap: wrap;
  gap: 10px;
}

.metric-row span {
  padding: 9px 11px;
  border-radius: var(--radius);
  color: var(--muted);
  background: #f5f5f7;
  font-size: 13px;
}

.metric-row strong {
  color: var(--text);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

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

.result-left,
.result-right {
  display: grid;
  gap: 14px;
}

.result-block {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
  font-size: 12px;
  font-weight: 650;
}

.pill[data-type="matched"] {
  border-color: rgba(29, 143, 91, 0.28);
  color: #0f6d43;
  background: rgba(29, 143, 91, 0.08);
}

.pill[data-type="missing"] {
  border-color: rgba(181, 106, 0, 0.26);
  color: #8a5100;
  background: rgba(181, 106, 0, 0.08);
}

.pill small {
  color: var(--muted);
  font-weight: 650;
}

.suggestions {
  margin-top: 14px;
}

.suggestions ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.58;
}

.suggestions li {
  padding-left: 2px;
}

.suggestions strong {
  font-weight: 750;
}

.suggestions span {
  color: var(--muted);
}

.capability-breakdown,
.priority-gaps {
  margin-top: 14px;
}

.ai-advice {
  margin-top: 16px;
}

.ai-advice-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.ai-advice-heading h3 {
  margin-bottom: 6px;
}

.ai-advice-heading p,
.ai-advice-status {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-advice-status {
  margin-top: 10px;
}

.ai-settings {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1fr) minmax(160px, 0.9fr) minmax(170px, 0.9fr) minmax(150px, 0.8fr);
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfbfd;
}

.ai-settings[hidden] {
  display: none;
}

.mode-switch {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mode-switch label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
  font-weight: 650;
}

.mode-switch input {
  width: auto;
  min-height: auto;
}

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

.compact-field span {
  font-size: 12px;
}

.ai-advice-content {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ai-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfbfd;
}

.ai-card h4 {
  margin: 0;
  font-size: 14px;
}

.ai-card p {
  margin: 0;
  white-space: pre-line;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

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

.category-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfbfd;
}

.category-card-header,
.priority-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-card-header span,
.priority-card-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.category-card p,
.priority-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.category-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e6eb;
}

.category-bar::before {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  content: "";
}

.category-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfbfd;
}

.priority-card-top span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #8a5100;
  background: rgba(181, 106, 0, 0.08);
}

.history-status {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.history-list,
.privacy-list {
  display: grid;
  gap: 12px;
}

.history-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfbfd;
}

.history-card-top,
.history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-score {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: var(--blue);
  font-weight: 760;
}

.history-score strong {
  font-size: 28px;
  line-height: 1;
}

.history-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.history-snippet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.history-snippet p {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
  line-height: 1.58;
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-tags span {
  padding: 6px 9px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 650;
}

.privacy-panel .command-title {
  margin-bottom: 18px;
}

.privacy-list .result-block {
  margin: 0;
}

.privacy-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.empty-state {
  color: var(--muted);
  font-size: 13px;
}

.example-modal,
.dialog-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(245, 245, 247, 0.76);
  backdrop-filter: blur(22px);
}

.example-card,
.dialog-card {
  width: min(760px, 100%);
  padding: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  animation: page-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dialog-card {
  width: min(430px, 100%);
}

.dialog-card p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.example-heading,
.example-actions,
.auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.example-heading {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

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

.example-grid section {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfbfd;
}

.auth-card {
  display: grid;
  gap: 14px;
}

.auth-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.auth-copy,
.auth-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-status[data-state="error"] {
  color: #b42318;
}

.auth-status[data-state="success"] {
  color: #0f6d43;
}

.split-actions {
  justify-content: space-between;
}

.example-grid p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.example-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.doc-main {
  padding-top: 42px;
}

.doc-article {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.doc-article h1 {
  margin-bottom: 30px;
}

.doc-article section {
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
}

.doc-article section:first-of-type {
  border-top: 0;
}

.doc-article p {
  color: var(--muted);
  line-height: 1.75;
}

.doc-article code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #f1f1f4;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
}

.doc-article pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8f8fa;
}

.doc-article pre code {
  padding: 0;
  background: transparent;
}

.doc-table {
  display: grid;
  gap: 10px;
}

.doc-table div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #ffffff;
}

.doc-table span {
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero-page {
    min-height: calc(100svh - 56px);
    padding: 38px 0 28px;
  }

  .workspace-heading,
  .command-bar,
  .result-layout,
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .command-bar {
    display: grid;
  }

  .command-tools,
  .result-command-bar .tool-group {
    justify-content: flex-start;
  }

  .workspace-heading {
    display: grid;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .tool-layout {
    display: grid;
  }

  .loading-panel,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .text-grid,
  .result-grid,
  .category-grid,
  .history-snippet,
  .ai-settings {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 280px;
  }

  .analysis-page textarea {
    height: clamp(250px, 34svh, 380px);
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
    padding: 14px 18px;
  }

  .brand,
  .nav-links,
  .auth-controls {
    justify-self: start;
  }

  .nav-links {
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .auth-controls {
    width: 100%;
    justify-content: space-between;
  }

  .user-chip {
    max-width: 58vw;
  }

  main {
    padding: 0 14px;
  }

  .hero-page {
    min-height: calc(100svh - 104px);
    padding: 28px 0;
  }

  .hero-page h1 {
    font-size: clamp(42px, 14vw, 76px);
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .hero-actions .button {
    flex: 1;
  }

  .version-strip,
  .example-heading,
  .example-actions,
  .auth-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-score {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .preview-bars div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .input-panel,
  .loading-panel,
  .result-panel,
  .doc-article {
    padding: 16px;
  }

  .panel-heading,
  .ai-advice-heading,
  .history-card-top,
  .history-actions,
  .command-tools,
  .tool-group {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-chip,
  .tool-group .button {
    width: 100%;
  }

  .actions {
    width: 100%;
  }

  .actions .button {
    flex: 1;
  }

  .score-board {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .score-meta {
    width: 100%;
  }

  .metric-row {
    justify-content: center;
  }

  .doc-table div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
