:root {
  color-scheme:light;
  --bg:#f5f6f8;
  --surface:#fff;
  --ink:#202329;
  --muted:#606976;
  --line:#dfe3e9;
  --accent:#b73716;
  --soft:#fff0e9;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--bg);
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  font-size:14px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a {
  color:var(--accent);
  text-underline-offset:3px;
}
a:hover {
  text-decoration-thickness:2px;
}
.shell {
  display:flex;
  min-height:100vh;
}
.sidebar {
  width:248px;
  flex:0 0 248px;
  position:sticky;
  top:0;
  align-self:flex-start;
  height:100vh;
  overflow:auto;
  background:var(--surface);
  border-right:1px solid var(--line);
  padding:28px 18px;
  display:flex;
  flex-direction:column;
}
.wordmark {
  display:flex;
  gap:9px;
  align-items:center;
  font-size:23px;
  font-weight:750;
  letter-spacing:-1px;
  color:var(--ink);
  text-decoration:none;
  padding:0 10px;
}
.wordmark span:last-child {
  font-weight:400;
  color:var(--muted);
}
.brand-square {
  width:23px;
  height:23px;
  background:#e64010;
  border-radius:6px;
}
.workspace-label {
  font-size:10px;
  letter-spacing:1.8px;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:700;
  margin:32px 12px 12px;
}
.sidebar nav ul {
  list-style:none;
  padding:0;
  margin:0;
}
.sidebar nav li {
  margin:3px 0;
}
.sidebar nav a {
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 13px;
  min-height:44px;
  color:var(--muted);
  text-decoration:none;
  border-radius:10px;
  font-weight:550;
}
.sidebar nav a:before {
  content:'';
  width:6px;
  height:6px;
  border:1.5px solid currentColor;
  border-radius:2px;
}
.sidebar nav a:hover {
  background:var(--bg);
  color:var(--ink);
}
.sidebar nav a[aria-current] {
  background:var(--soft);
  color:var(--accent);
  font-weight:700;
}
.sidebar nav a[aria-current]:before {
  background:currentColor;
}
.sidebar .account {
  border-top:1px solid var(--line);
  padding:20px 10px 0;
  margin-top:auto;
  color:var(--muted);
  font-size:12px;
}
.sidebar .account form {
  padding:0;
  border:0;
  background:none;
  margin:0;
}
.sidebar button {
  background:var(--bg);
  color:var(--ink);
  border:1px solid var(--line);
  width:100%;
  min-height:40px;
  margin-top:10px;
}
.content {
  min-width:0;
  flex:1;
  padding:40px clamp(24px,3.4vw,64px) 64px;
  max-width:1800px;
}
.topline {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  color:var(--muted);
  border-bottom:1px solid var(--line);
  padding-bottom:20px;
  margin-bottom:32px;
}
.topline span {
  letter-spacing:1.5px;
  text-transform:uppercase;
  font-size:10px;
  font-weight:700;
}
.topline a {
  text-decoration:none;
  color:var(--muted);
}
h1 {
  font-size:36px;
  line-height:1.15;
  letter-spacing:-1.3px;
  margin:0 0 28px;
  font-weight:720;
}
h2 {
  font-size:22px;
  line-height:1.25;
  letter-spacing:-.5px;
  margin:0 0 20px;
}
h3 {
  font-size:17px;
  margin:0 0 14px;
}
p {
  margin:0 0 18px;
}
.page-heading {
  display:flex;
  gap:24px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:30px;
}
.page-heading h1 {
  margin:0 0 8px;
}
.page-heading p {
  margin:0;
  color:var(--muted);
}
.metrics-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px;
  margin:0;
}
.metrics-grid>div {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:18px;
  padding:24px;
  min-width:0;
}
.metrics-grid dt {
  font-size:12px;
  font-weight:550;
  color:var(--muted);
  margin-bottom:16px;
}
.metrics-grid dd {
  font-size:34px;
  line-height:1.15;
  font-weight:650;
  letter-spacing:-1px;
  margin:0;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums;
}
.metrics-grid>div:first-child {
  background:var(--ink);
  color:var(--surface);
  border-color:var(--ink);
}
.metrics-grid>div:first-child dt {
  color:#c8cdd5;
}
.metrics-grid>div:nth-last-child(-n+2) {
  grid-column:span 2;
}
.metrics-grid>div:nth-last-child(-n+2) dd {
  font-size:24px;
}
.dashboard-actions {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
  margin-top:28px;
}
.dashboard-actions a {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  padding:24px;
  text-decoration:none;
  color:var(--ink);
  font-weight:650;
}
.dashboard-actions a:hover {
  border-color:var(--accent);
}
.dashboard-actions span {
  display:block;
  font-size:13px;
  color:var(--muted);
  font-weight:400;
  margin-top:7px;
}
label {
  display:block;
  font-size:13px;
  font-weight:600;
  margin:14px 0 7px;
}
input,select,textarea,button {
  font:inherit;
}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea {
  background:var(--surface);
  color:var(--ink);
  border:1px solid #a9b1bd;
  border-radius:9px;
  min-height:44px;
  padding:10px 12px;
  width:100%;
  max-width:680px;
}
textarea {
  min-height:100px;
}
input[type=checkbox],input[type=radio] {
  accent-color:var(--accent);
  width:17px;
  height:17px;
}
button,.button {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  min-height:44px;
  background:var(--accent);
  color:#fff;
  border:1px solid transparent;
  border-radius:10px;
  padding:10px 18px;
  font-weight:600;
  cursor:pointer;
  margin-top:12px;
  text-decoration:none;
}
button:hover,.button:hover {
  filter:brightness(.9);
}
.page-heading .button {
  margin:0;
  white-space:nowrap;
}
button:disabled {
  opacity:.5;
  cursor:wait;
}
.content>form,.content>section,.content>details,.content>fieldset {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:18px;
  padding:26px;
  margin:24px 0;
}
.content section form {
  margin-bottom:24px;
}
.content form[action$="/delete"] button {
  background:#a52720;
}
.content table {
  display:block;
  max-width:100%;
  overflow:auto;
  width:100%;
  border-spacing:0;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  margin:24px 0;
  font-size:13px;
}
.content table th {
  text-align:left;
  padding:14px 18px;
  background:var(--bg);
  color:var(--muted);
  font-weight:600;
  white-space:nowrap;
}
.content table td {
  padding:16px 18px;
  border-top:1px solid var(--line);
  max-width:480px;
  overflow-wrap:anywhere;
  vertical-align:top;
}
.content table tbody tr:hover {
  background:var(--bg);
}
.content dl:not(.metrics-grid) {
  margin:16px 0;
}
.content dl:not(.metrics-grid) dt {
  color:var(--muted);
  font-size:12px;
  margin-top:14px;
}
.content dl:not(.metrics-grid) dd {
  margin:4px 0;
  overflow-wrap:anywhere;
}
.content ul {
  padding-left:22px;
}
.content li {
  padding:5px 0;
  overflow-wrap:anywhere;
}
summary {
  cursor:pointer;
  min-height:44px;
  font-weight:600;
}
progress {
  display:block;
  width:100%;
  accent-color:var(--accent);
  height:8px;
  margin-top:16px;
}
pre {
  padding:20px;
  border-radius:12px;
  background:#202329;
  color:#e0e5ee;
  overflow:auto;
  max-height:500px;
  font-size:12px;
}
code {
  font-size:12px;
  overflow-wrap:anywhere;
}
[role=alert] {
  border-left:3px solid #b73716;
  background:var(--soft);
  padding:14px 18px;
  border-radius:8px;
}
[role=status] {
  color:var(--muted);
}
#scan-status {
  display:inline-block;
  background:var(--soft);
  color:var(--accent);
  border-radius:30px;
  padding:5px 13px;
  font-size:12px;
  font-weight:700;
}
#scan-url {
  font-size:22px;
  letter-spacing:-.5px;
  overflow-wrap:anywhere;
}
#overall-score {
  font-size:30px;
  font-weight:700;
}
#scan-progress {
  background:var(--surface);
  border:1px solid var(--line);
  padding:24px;
  border-radius:18px;
}
.activity-list {
  list-style:none!important;
  padding:0!important;
  max-height:340px;
  overflow:auto;
}
.activity-list li {
  padding:12px 0;
  border-top:1px solid var(--line);
  font-size:13px;
}
.activity-list time {
  display:inline-block;
  font-size:11px;
  color:var(--muted);
  margin-right:16px;
}
.activity-list small {
  color:var(--muted);
  display:block;
}
.scan-stage {
  font-size:13px;
  padding:10px;
  background:var(--bg);
  border-radius:8px;
}
.scan-stages {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px;
  margin:18px 0;
}
.scan-stage strong,.scan-stage span {
  display:block;
}
.scan-stage span {
  color:var(--muted);
  font-size:11px;
}
.scan-stage[data-state=running] {
  outline:1px solid var(--accent);
}
.status-meta,.connection-note {
  font-size:12px;
  color:var(--muted);
}
.status-meta {
  display:flex;
  gap:24px;
}
.status-badge {
  font-size:12px;
  color:var(--accent);
}
.skip-link {
  position:absolute;
  left:12px;
  top:12px;
  transform:translateY(-200%);
  background:var(--surface);
  padding:12px;
  z-index:20;
}
.skip-link:focus {
  transform:none;
}
:focus-visible {
  outline:3px solid #2775d1;
  outline-offset:3px;
}
.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
}
@media(min-width:1100px) {
  .content>form[method=get] {
    display:flex;
    align-items:end;
    gap:16px;
    flex-wrap:wrap;
  }
  .content>form[method=get]>div {
    flex:1 1 150px;
  }
  .content>form[method=get] button {
    margin-bottom:0;
  }
}
@media(max-width:1100px) {
  .metrics-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .dashboard-actions {
    grid-template-columns:1fr;
  }
  .sidebar {
    width:215px;
    flex-basis:215px;
  }
  .scan-stages {
    grid-template-columns:repeat(3,1fr);
  }
}
@media(max-width:700px) {
  .shell {
    display:block;
  }
  .sidebar {
    position:relative;
    height:auto;
    width:100%;
    padding:20px;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .sidebar nav ul {
    display:flex;
    overflow:auto;
    gap:6px;
    padding-top:14px;
  }
  .sidebar nav li {
    flex-shrink:0;
  }
  .sidebar nav a {
    padding:8px 12px;
    font-size:12px;
  }
  .workspace-label,.sidebar .account {
    display:none;
  }
  .content {
    padding:28px 18px;
  }
  .topline {
    margin-bottom:24px;
  }
  .metrics-grid {
    gap:12px;
  }
  .metrics-grid>div {
    padding:18px;
  }
  .metrics-grid dd {
    font-size:28px;
  }
  .metrics-grid>div:nth-last-child(-n+2) {
    grid-column:span 2;
  }
  .page-heading {
    align-items:flex-start;
    flex-direction:column;
  }
  .content>form,.content>section {
    padding:20px;
  }
  h1 {
    font-size:30px;
  }
  .scan-stages {
    grid-template-columns:repeat(2,1fr);
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation:none!important;
    transition:none!important;
  }
}
@media(prefers-color-scheme:dark) {
  :root {
    color-scheme:dark;
    --bg:#141619;
    --surface:#1e2126;
    --ink:#f2f3f5;
    --muted:#b1b7c2;
    --line:#383e47;
    --accent:#ffac91;
    --soft:#382820;
  }
  button,.button {
    background:#b73716;
    color:white;
  }
  .metrics-grid>div:first-child {
    background:#343c48;
    border-color:#343c48;
    color:#fff;
  }
}
fieldset {
  border:1px solid var(--line);
  border-radius:12px;
  padding:18px 22px;
  margin:24px 0;
  max-width:900px;
}
legend {
  font-weight:650;
  padding:0 8px;
}
.check {
  display:flex;
  align-items:center;
  gap:9px;
}
.content>form[action="/scans/new"] {
  max-width:960px;
}
@media(max-width:700px) {
  .sidebar .account {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-top:16px;
    padding:12px 8px 0;
  }
  .sidebar .account p {
    margin:0;
  }
  .sidebar .account button {
    width:auto;
    margin:0;
    min-height:36px;
  }
}

.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll table { display: table; width: 100%; }

.result-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));
  gap:16px;
}
.result-card {
  min-width:0;
  padding:22px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
}
.result-card h3 {
  margin:8px 0 12px;
  font-size:16px;
}
.result-card .result-score {
  margin:0;
  font-size:32px;
  font-weight:650;
  font-variant-numeric:tabular-nums;
}
.result-score small {
  font-size:14px;
  font-weight:400;
}
.result-card small, .result-card .muted {
  color:var(--muted);
}
