:root {
  color-scheme: light;
  --background: #f5f7f8;
  --surface: #fff;
  --raised: #f8fafb;
  --ink: #17292c;
  --muted: #526669;
  --border: #dce5e7;
  --accent: #06665a;
  --accent-soft: #e5f4ef;
  --on-accent: #fff;
  --danger: #a32134;
  --danger-soft: #fceef0;
  --warning: #79500d;
  --warning-soft: #fcf3df;
  --sidebar: #12282a;
  --sidebar-text: #e5eeee;
  --sidebar-muted: #a0b7b7;
  --sidebar-active: #254744;
  --focus: #1d8f81;
  --radius: 13px;
  font: 15px/1.45 "Segoe UI", "Inter", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #10191b;
  --surface: #172326;
  --raised: #1b2b2e;
  --ink: #e4eeee;
  --muted: #a3b8b8;
  --border: #314447;
  --accent: #78d7c3;
  --accent-soft: #233e38;
  --on-accent: #102b28;
  --danger: #ff9aab;
  --danger-soft: #482831;
  --warning: #f3cb78;
  --warning-soft: #493a26;
  --sidebar: #0c2022;
  --sidebar-active: #24413e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--ink); min-width: 290px; }
a { color: var(--accent); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: 2px; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
button, input, select, textarea { border-radius: 8px; border: 1px solid var(--border); }
button { padding: .62rem .95rem; font-weight: 650; color: var(--ink); background: var(--surface); }
button:disabled, button[aria-disabled="true"] { opacity: .58; cursor: wait; }
button:hover { filter: brightness(.94); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, select, textarea { min-width: 0; background: var(--surface); color: var(--ink); padding: .58rem .68rem; min-height: 38px; }
input[type="checkbox"] { min-height: auto; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 95px; }
label { display: grid; gap: .35rem; font-size: .87rem; font-weight: 650; color: var(--muted); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.45rem); line-height: 1.12; letter-spacing: -.055em; font-weight: 730; overflow-wrap: anywhere; }
h2 { font-size: 1.17rem; letter-spacing: -.022em; }
h3 { font-size: 1.02rem; }
p + p { margin-top: .55rem; }
.small { font-size: .84rem; padding: .47rem .71rem; }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.secondary { background: var(--surface); }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.stack { display: grid; gap: .9rem; }
.row { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.row > label { flex: 1 1 155px; }
.wide { grid-column: 1 / -1; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 21px 16px 14px; gap: 20px; background: var(--sidebar); color: var(--sidebar-text); z-index: 4; }
.brand { display: flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; line-height: 1.22; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; background: #75d8c0; color: #0d352e; border-radius: 10px; font-size: 1.95rem; font-weight: bold; }
.brand small { display: block; padding-top: 3px; color: var(--sidebar-muted); font-weight: 400; }
.project-picker { color: var(--sidebar-muted); gap: 5px; }
.project-picker select { background: #1c3738; color: var(--sidebar-text); border-color: #3a5556; }
.sidebar nav { display: grid; gap: 4px; overflow-y: auto; scrollbar-color: #506968 transparent; padding: 1px 5px 1px 1px; align-content: start; }
.nav-label { color: var(--sidebar-muted); font-size: .75rem; margin: .55rem .5rem .16rem; }
.side-button, .nav-link { border: 0; border-radius: 7px; color: var(--sidebar-text); background: transparent; padding: .53rem .58rem; text-decoration: none; text-align: left; white-space: normal; font-size: .86rem; font-weight: 550; display: flex; align-items: baseline; gap: .6rem; }
.side-button { margin-top: auto; }
.nav-link:hover, .nav-link[aria-current="page"], .side-button:hover { background: var(--sidebar-active); }
.nav-icon { display: inline-block; width: 1rem; text-align: center; color: #97d8ca; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 3; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 9px max(21px, 3vw); gap: .7rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: .55rem; }
.topbar-left { font-weight: 660; min-width: 0; }
#breadcrumb { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-right { flex-shrink: 0; }
.mobile-menu { display: none; }
main { max-width: 1450px; margin: auto; padding: clamp(18px, 3vw, 43px); display: grid; align-content: start; gap: 21px; min-width: 0; }
.header { display: flex; justify-content: space-between; gap: 17px; align-items: end; flex-wrap: wrap; }
.header > div:first-child { min-width: 0; }
.header p { margin-top: .5rem; overflow-wrap: anywhere; }
.toolbar { align-items: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(154px, 1fr)); gap: 13px; }
.stat, .panel, .empty, .alert-note { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.stat, .panel, .empty { padding: clamp(14px, 2vw, 21px); }
.stat { min-height: 108px; display: grid; gap: .25rem; align-content: center; }
.stat strong { font-size: 1.85rem; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.stat small, .pill { font-size: .77rem; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { display: grid; gap: 13px; align-content: start; }
.panel, .empty { overflow-wrap: anywhere; }
.panel + .panel.stacked { margin-top: 3px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.alert-note { display: flex; align-items: center; justify-content: space-between; gap: .85rem; padding: 15px 19px; background: var(--accent-soft); }
.empty { display: grid; gap: .35rem; color: var(--muted); padding-block: 25px; }
.empty h3 { color: var(--ink); }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .87rem; }
td, th { padding: .72rem .77rem; border-bottom: 1px solid var(--border); min-width: 75px; overflow-wrap: anywhere; vertical-align: middle; }
.content-history td { vertical-align: top; }
th { color: var(--muted); background: var(--raised); font-weight: 650; white-space: nowrap; }
th button { font: inherit; font-weight: inherit; color: inherit; padding: 0; border: 0; background: transparent; }
td:first-child { font-weight: 620; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--raised); }
.pill { color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .21rem .48rem; font-weight: 680; display: inline-block; white-space: nowrap; }
.pill[data-level="critical"], .pill[data-level="high"], .pill[data-level="failed"] { background: var(--danger-soft); color: var(--danger); }
.pill[data-level="medium"], .pill[data-level="approval"] { background: var(--warning-soft); color: var(--warning); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(154px, 1fr)); gap: 11px; align-items: end; }
.report-list { display: grid; gap: 8px; }
.report-list > article { display: grid; gap: .35rem; padding: 10px 0; border-bottom: 1px solid var(--border); }
.report-list > article:last-child { border-bottom: 0; }
.detail { display: grid; grid-template-columns: minmax(85px, 140px) minmax(0, 1fr); margin: 0; gap: .55rem .75rem; }
.detail dt { color: var(--muted); font-weight: 650; }
.detail dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
pre { padding: 10px; border-radius: 8px; background: var(--raised); margin: 0; max-height: 420px; overflow: auto; font-size: .79rem; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--radius); width: min(91vw, 780px); max-height: 87dvh; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #0c1d22a0; }
.dialog-inner { display: grid; gap: 15px; padding: clamp(15px, 3vw, 26px); }
.login-layout { display: grid; min-height: 100dvh; place-items: center; background: radial-gradient(ellipse at 75% 15%, var(--accent-soft), var(--background) 54%); padding: 18px; }
.login-card { display: grid; gap: 16px; width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: clamp(20px, 6vw, 40px); box-shadow: 0 12px 50px #19323719; }
.login-card .brand { margin-bottom: 7px; }
.login-card button { margin-top: 4px; }
#toast { position: fixed; bottom: 17px; right: 17px; z-index: 8; width: max-content; max-width: calc(100vw - 34px); padding: 12px 16px; border-radius: 9px; color: var(--sidebar-text); background: var(--sidebar); box-shadow: 0 12px 20px #0002; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 208px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: 56px auto 0 0; height: auto; width: min(295px, 89vw); display: none; box-shadow: 0 10px 32px #0004; }
  .sidebar.open { display: flex; }
  .topbar { min-height: 56px; padding-inline: 10px; }
  .mobile-menu { display: inline-block; padding: .4rem .58rem; }
  .topbar .small { padding-inline: .5rem; font-size: .76rem; }
  main { gap: 15px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 9px; }
  .stat { min-height: 89px; }
  .alert-note { align-items: start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}
.answer-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.content-metrics .detail { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .65rem; }
.content-metrics { min-width: 155px; }
.responsive-table td button { white-space: nowrap; }
.content-sources p { overflow-wrap: anywhere; }
.task-group-list, .task-group-content, .task-group-task-list { min-width: 0; overflow-wrap: anywhere; }
.task-detail-content { min-width: 0; overflow-wrap: anywhere; }
.task-detail-content .responsive-table td button { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.assessment-sample { min-width: 0; margin: 0; padding: .8rem; border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; }
.assessment-sample legend { max-width: 100%; overflow-wrap: anywhere; }
.task-group-task-list .responsive-table td button, .task-group-list .responsive-table td button {
  white-space: normal; overflow-wrap: anywhere; max-width: 100%;
}
.impact-metrics { display: grid; gap: .8rem; }
.impact-metric { padding: .8rem; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.impact-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin: 0; }
.impact-values dt { color: var(--muted); font-size: .8rem; }
.impact-values dd { margin: .3rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
@media (max-width: 660px) {
  .impact-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .responsive-table { overflow: visible; border: 0; }
  .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr,
  .responsive-table th, .responsive-table td { display: block; min-width: 0; }
  .responsive-table thead tr { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: .8rem; }
  .responsive-table th { padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 6px; white-space: normal; }
  .responsive-table tbody { display: grid; gap: .9rem; }
  .responsive-table tbody tr { display: grid; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 9px; }
  .responsive-table td { padding: 0; border: 0; }
  .responsive-table td::before { content: attr(data-label); display: block; margin-bottom: .35rem; color: var(--muted); font-weight: 650; }
  .responsive-table td[data-label="Search Console"]::before, .responsive-table td[data-label="GA4 · Organic Search"]::before { display: none; }
}
