:root {
  color-scheme: light;
  --canvas: #f4f1ea;
  --paper: rgba(255, 252, 246, 0.92);
  --paper-solid: #fffdf8;
  --ink: #14221e;
  --ink-soft: #51605b;
  --muted: #73807a;
  --line: rgba(29, 47, 41, 0.13);
  --deep: #10241f;
  --teal: #0d7f70;
  --teal-soft: #dff3ee;
  --rose: #b44d62;
  --rose-soft: #f6e2e5;
  --gold: #f2b500;
  --gold-deep: #947019;
  --gold-soft: #f7edce;
  --shadow-soft: 0 20px 55px rgba(41, 54, 48, 0.1);
  --shadow-tight: 0 10px 26px rgba(41, 54, 48, 0.08);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(110deg, rgba(16, 36, 31, 0.08), transparent 34%),
    linear-gradient(180deg, #fbf6ee 0%, var(--canvas) 48%, #edf3ef 100%);
}

button {
  font: inherit;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 36, 31, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 36, 31, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), transparent 78%);
}

body.auth-checking .layout-shell,
body.auth-locked .layout-shell {
  filter: blur(14px);
  transform: scale(0.99);
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 253, 248, 0.56), transparent 34%),
    rgba(16, 36, 31, 0.48);
  backdrop-filter: blur(18px);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: #fff8ed;
  background: linear-gradient(155deg, rgba(16, 36, 31, 0.96), rgba(13, 86, 76, 0.92));
  box-shadow: 0 28px 80px rgba(11, 25, 21, 0.36);
}

.auth-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-mark img {
  width: 36px;
  height: 36px;
}

.auth-card h2 {
  margin: 0;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1;
}

.auth-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 4px;
}

.auth-input-row input {
  min-width: 0;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 0 14px;
  color: #fff8ed;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.auth-input-row input:focus {
  border-color: rgba(242, 181, 0, 0.86);
  box-shadow: 0 0 0 3px rgba(242, 181, 0, 0.18);
}

.auth-input-row input::placeholder {
  color: rgba(255, 248, 237, 0.64);
}

.auth-input-row button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  color: #10241f;
  background: var(--gold);
  cursor: pointer;
}

.auth-input-row button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.auth-error {
  min-height: 20px;
  margin: 0;
  color: #ffd7df;
  font-size: 13px;
}

.layout-shell {
  width: min(1580px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 42px;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 20px;
}

.app-shell {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.side-rail {
  position: sticky;
  top: 18px;
  align-self: start;
  min-width: 0;
  max-height: calc(100vh - 36px);
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.78);
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(18px);
}

.side-brand,
.side-brand > div,
.side-panel,
.side-panel-head,
.side-nav,
.history-list,
.today-mini-list,
.today-mini-item,
.today-mini-item > div,
.side-help,
.side-footnote,
.history-item {
  min-width: 0;
}

.side-brand,
.side-panel-head,
.history-item {
  display: flex;
  align-items: center;
}

.side-brand {
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.side-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.side-brand strong,
.side-panel-head strong {
  display: block;
  font-size: 16px;
}

.side-brand span,
.side-help,
.side-footnote,
.history-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.side-nav,
.history-list {
  display: grid;
  gap: 7px;
}

.side-nav-item,
.history-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.side-nav-item span,
.history-item strong,
.history-item span {
  display: block;
}

.side-nav-item span {
  font-size: 15px;
  font-weight: 900;
}

.side-nav-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.side-nav-item.active,
.history-item.active {
  color: #fffaf0;
  background: var(--deep);
}

.side-nav-item:hover,
.history-item:hover {
  border-color: rgba(13, 127, 112, 0.24);
  background: rgba(223, 243, 238, 0.55);
}

.side-nav-item.active:hover,
.history-item.active:hover {
  background: var(--deep);
}

.side-panel {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.side-panel-head {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.side-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.history-item {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.history-item span {
  max-width: 100%;
  color: inherit;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.history-item.ghost {
  color: var(--muted);
  cursor: default;
}

.side-sync-button {
  width: 100%;
  min-height: 32px;
  margin-top: 8px;
  border: 1px solid rgba(13, 127, 112, 0.18);
  border-radius: 8px;
  color: var(--teal);
  background: rgba(223, 243, 238, 0.48);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.side-sync-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.today-mini-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.today-mini-empty {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.today-mini-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(13, 127, 112, 0.14);
  border-radius: 8px;
  background: rgba(223, 243, 238, 0.44);
}

.today-mini-item.writing {
  border-color: rgba(242, 181, 0, 0.32);
  background: rgba(247, 237, 206, 0.58);
}

.today-mini-item.completed {
  border-color: rgba(13, 127, 112, 0.2);
  background: rgba(255, 253, 248, 0.7);
}

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

.today-mini-item strong {
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.today-mini-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.today-mini-item button {
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.8);
  cursor: pointer;
}

.today-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.side-footnote {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(247, 237, 206, 0.58);
  line-height: 1.55;
}

.topbar,
.brand-lockup,
.top-actions,
.toolbar,
.toolbar-meta,
.section-title,
.small-tags,
.rank-card-top,
.score-block,
.evidence-grid,
.card-actions,
.audit-line {
  display: flex;
  align-items: center;
}

.topbar {
  min-height: 84px;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(16, 36, 31, 0.18);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

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

h1 {
  max-width: 980px;
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.08;
  font-weight: 900;
  overflow-wrap: anywhere;
}

h1 span {
  display: inline;
}

h2 {
  font-size: 21px;
  line-height: 1.25;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.status-pill,
.tag {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill {
  color: #0a6055;
  background: rgba(223, 243, 238, 0.92);
  border: 1px solid rgba(13, 127, 112, 0.18);
}

.status-pill.demo {
  color: var(--gold-deep);
  background: var(--gold-soft);
  border-color: rgba(148, 112, 25, 0.24);
}

.status-pill.ai {
  color: var(--rose);
  background: var(--rose-soft);
  border-color: rgba(180, 77, 98, 0.22);
}

.status-pill.ai.live {
  color: var(--teal);
  background: var(--teal-soft);
}

.icon-button,
.ghost-button,
.text-button {
  border: 1px solid rgba(16, 36, 31, 0.16);
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  height: 39px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #f9f4ea;
  background: var(--deep);
  box-shadow: var(--shadow-tight);
}

.icon-button:hover {
  background: #18362f;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.hero-rank {
  display: grid;
  grid-template-columns: minmax(420px, 1.3fr) minmax(220px, 0.45fr) minmax(220px, 0.45fr);
  gap: 14px;
  margin: 18px 0 14px;
}

.hero-copy,
.hero-side,
.metric-box,
.rank-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(18px);
}

.hero-copy {
  min-height: 176px;
  display: grid;
  align-content: end;
  position: relative;
  overflow: hidden;
  padding: 20px;
  color: #f9f4ea;
  background:
    linear-gradient(135deg, rgba(16, 36, 31, 0.98), rgba(15, 84, 74, 0.92)),
    var(--deep);
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -60px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(248, 242, 230, 0.3);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(248, 242, 230, 0.05),
    0 0 0 72px rgba(248, 242, 230, 0.035);
}

.hero-copy h2 {
  position: relative;
  z-index: 1;
  max-width: 780px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.hero-copy p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin: 10px 0 0;
  color: rgba(248, 242, 230, 0.76);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.hero-side {
  min-height: 176px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 20px;
  border-top: 4px solid rgba(13, 127, 112, 0.4);
}

.hero-side span,
.hero-side small {
  color: var(--muted);
  font-weight: 700;
}

.hero-side strong {
  font-size: 34px;
}

.toolbar {
  min-height: 64px;
  justify-content: space-between;
  gap: 16px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  min-width: 300px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.segment-button {
  flex: 1 1 0;
  min-width: 86px;
  height: 35px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.segment-button.active {
  color: #fff9ef;
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(13, 127, 112, 0.22);
}

.toolbar-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.snapshot-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -4px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(13, 127, 112, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.snapshot-strip.history {
  border-color: rgba(148, 112, 25, 0.24);
  background: rgba(247, 237, 206, 0.48);
}

.snapshot-strip span,
.snapshot-strip small {
  display: block;
}

.snapshot-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.snapshot-strip strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.snapshot-strip small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 6px 0 20px;
}

.metric-box {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 17px;
}

.metric-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-box strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 25px;
  line-height: 1.12;
}

.method-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.method-strip div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(13, 127, 112, 0.16);
  border-radius: 8px;
  background: rgba(223, 243, 238, 0.48);
}

.method-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.method-strip strong {
  font-size: 18px;
  line-height: 1.2;
}

.section-title {
  min-height: 54px;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.small-tags {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  min-height: 26px;
  padding: 0 9px;
  color: var(--teal);
  background: var(--teal-soft);
}

.ranking-list {
  display: grid;
  gap: 13px;
}

.workspace-section {
  margin-top: 28px;
}

.workspace-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workspace-stats span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.72);
  font-size: 12px;
  font-weight: 800;
}

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

.workspace-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
}

.workspace-empty strong,
.workspace-empty span {
  display: block;
}

.workspace-empty span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.workspace-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(16, 36, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow-tight);
}

.workspace-card.writing {
  border-color: rgba(242, 181, 0, 0.34);
}

.workspace-card.completed {
  border-color: rgba(13, 127, 112, 0.24);
}

.workspace-card.archived {
  opacity: 0.72;
}

.workspace-card-head,
.workspace-meta,
.workspace-evidence,
.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.workspace-card-head {
  justify-content: space-between;
}

.status-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 12px;
  font-weight: 900;
}

.workspace-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.workspace-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.workspace-meta span,
.workspace-evidence span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 0 8px;
  color: var(--ink-soft);
  background: rgba(245, 241, 231, 0.75);
  font-size: 12px;
  font-weight: 800;
}

.published-box {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(13, 127, 112, 0.12);
  border-radius: 8px;
  background: rgba(223, 243, 238, 0.45);
}

.published-box.muted {
  background: rgba(245, 241, 231, 0.58);
}

.published-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.published-box a {
  color: var(--deep);
  font-weight: 900;
  text-decoration: none;
}

.published-box small {
  color: var(--muted);
  line-height: 1.45;
}

.workspace-actions {
  justify-content: flex-start;
}

.rank-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.rank-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--teal), transparent);
}

.rank-card-top {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rank-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff8ed;
  background: var(--deep);
  font-weight: 900;
  box-shadow: var(--shadow-tight);
}

.score-block {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stars {
  display: inline-flex;
  gap: 1px;
  font-size: 20px;
  line-height: 1;
}

.stars .on,
.stars .half {
  color: var(--gold);
}

.stars .half {
  opacity: 0.75;
}

.stars .off {
  color: #d5d1c8;
}

.score-block strong {
  font-size: 24px;
}

.score-block span:last-child {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--gold-deep);
  background: var(--gold-soft);
  font-weight: 900;
  white-space: nowrap;
}

.rank-card h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.core-view {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

.reason-box {
  margin-top: 13px;
  padding: 12px 14px;
  border: 1px solid rgba(13, 127, 112, 0.16);
  border-radius: 8px;
  color: #17352f;
  background: rgba(223, 243, 238, 0.55);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.evidence-item {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 7px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(20, 34, 30, 0.055);
}

.evidence-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.evidence-item strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.audit-line {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.text-button,
.ghost-button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--deep);
  background: #fffaf0;
}

.text-button:hover,
.ghost-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.detail-dialog {
  width: min(1040px, calc(100% - 28px));
  max-height: min(86vh, 920px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--paper-solid);
  box-shadow: 0 32px 80px rgba(16, 36, 31, 0.22);
}

.detail-dialog::backdrop {
  background: rgba(16, 36, 31, 0.36);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.detail-overview,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: rgba(255, 252, 246, 0.82);
}

.detail-overview {
  display: grid;
  gap: 12px;
}

.detail-section.focus {
  outline: 2px solid rgba(242, 181, 0, 0.45);
}

.detail-section h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.detail-text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-text p {
  margin: 5px 0 0;
  line-height: 1.7;
}

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

.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.score-row span {
  color: var(--ink-soft);
  font-size: 13px;
}

.score-row div {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 34, 30, 0.09);
}

.score-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.checks {
  display: grid;
  gap: 8px;
}

.check {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(20, 34, 30, 0.055);
}

.check.pass {
  border-left: 4px solid var(--teal);
}

.check.warning {
  border-left: 4px solid var(--gold);
}

.check.fail {
  border-left: 4px solid var(--rose);
}

.check span,
.article-item small {
  color: var(--muted);
}

.article-list {
  display: grid;
  gap: 9px;
}

.article-item {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.article-item a {
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.article-item a:hover {
  text-decoration: underline;
}

.article-title-line {
  font-size: 16px;
  line-height: 1.45;
}

.article-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-metrics span {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--ink-soft);
  background: rgba(16, 36, 31, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.article-extra {
  display: grid;
  gap: 8px;
}

.evidence-fetch {
  width: fit-content;
  margin-top: 4px;
}

.article-item p,
.article-item blockquote {
  margin: 0;
  line-height: 1.7;
}

.article-item p {
  color: var(--ink-soft);
}

.article-item blockquote {
  border-left: 3px solid rgba(13, 127, 112, 0.35);
  padding: 8px 10px;
  color: #213b35;
  background: rgba(223, 243, 238, 0.38);
}

.comment-list {
  display: grid;
  gap: 7px;
}

.comment-item,
.comment-empty {
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(244, 241, 234, 0.72);
}

.comment-item {
  display: grid;
  gap: 4px;
}

.comment-item strong {
  font-size: 12px;
}

.comment-item span {
  line-height: 1.55;
}

.comment-empty {
  color: var(--muted);
  font-size: 12px;
}

.simple-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.75;
}

.empty {
  border: 1px dashed rgba(20, 34, 30, 0.2);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.66);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff8ed;
  background: var(--deep);
  box-shadow: var(--shadow-soft);
  font-size: 14px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

  .side-rail {
    position: static;
    max-height: none;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-rank,
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-copy {
    grid-column: 1 / -1;
  }

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

@media (max-width: 720px) {
  .layout-shell {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding: 16px 0 34px;
    gap: 12px;
  }

  .side-rail {
    order: 2;
    padding: 12px;
  }

  .app-shell {
    order: 1;
  }

  .side-nav,
  .history-list,
  .method-strip {
    grid-template-columns: 1fr;
  }

  .side-nav-item {
    padding: 9px 10px;
  }

  .app-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding-top: 16px;
    overflow-x: hidden;
  }

  .topbar,
  .toolbar,
  .snapshot-strip,
  .section-title {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .toolbar-meta,
  .small-tags {
    justify-content: flex-start;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-lockup {
    width: 100%;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: flex-start;
  }

  .brand-lockup > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  h1 {
    max-width: 100%;
    font-size: 23px;
    line-height: 1.16;
    word-break: break-all;
  }

  h1 span {
    display: block;
  }

  .top-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .status-pill {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-actions .icon-button {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .metrics-grid,
  .score-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }

  main {
    display: flex;
    flex-direction: column;
  }

  .hero-rank {
    order: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    order: 2;
  }

  .snapshot-strip {
    order: 3;
  }

  .ranking-section {
    order: 4;
  }

  .metrics-grid {
    order: 5;
  }

  .method-strip {
    order: 6;
  }

  .workspace-section {
    order: 7;
  }

  .hero-copy,
  .hero-side {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px;
    min-width: 0;
  }

  .hero-copy {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .hero-side {
    min-height: 96px;
    overflow: hidden;
  }

  .hero-side small {
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .hero-side strong {
    font-size: 30px;
    line-height: 1.05;
  }

  .hero-copy h2 {
    max-width: 100%;
    font-size: 24px;
    word-break: break-all;
  }

  .hero-copy p:not(.eyebrow),
  .core-view,
  .reason-box {
    max-width: min(100%, 320px);
    word-break: break-all;
  }

  .segmented {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .segment-button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 6px;
  }

  #windowTabs {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  #windowTabs .segment-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .rank-card {
    padding: 15px;
  }

  .rank-card-top,
  .score-block,
  .audit-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .rank-card h3 {
    font-size: 22px;
  }

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

  .workspace-stats {
    justify-content: flex-start;
  }

  .workspace-card h3 {
    font-size: 18px;
  }

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

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

@media (max-width: 430px) {
  .hero-rank {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-side {
    padding: 14px;
  }

  .hero-side {
    min-height: 82px;
  }
}
