/* PACT: a light, quiet workspace in the brand's navy and cyan. Clear lines, dense where an expert scans. */
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f7f7f8; --surface: #ffffff; --subtle: #fafafa; --hover: #f4f4f5; --line: #e7e7ea; --line-strong: #d6d6db;
  --ink: #18181b; --ink-2: #3f3f46; --muted: #71717a; --faint: #a1a1aa;
  /* The brand: navy #011D41 carries, cyan #01C0FA marks. Links take a darker cyan that reads on white. */
  --navy: #011d41; --cyan: #01c0fa;
  --accent: #011d41; --accent-hover: #0b3266; --accent-soft: #e6f8fe; --accent-line: #a6e8fc; --accent-ink: #ffffff;
  --link: #0072a8;
  --ok: #15803d; --ok-soft: #f0fdf4; --ok-line: #bbf7d0;
  --warn: #b45309; --warn-soft: #fffbeb; --warn-line: #fde68a;
  --bad: #b91c1c; --bad-soft: #fef2f2; --bad-line: #fecaca;
  --info: #1d4ed8; --info-soft: #eff6ff; --info-line: #bfdbfe;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 1px 3px rgba(24, 24, 27, .04);
  --shadow-lg: 0 10px 30px rgba(24, 24, 27, .10);
  --side: 248px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; color: var(--ink); }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
h4 { font-size: 13px; font-weight: 600; margin: 1rem 0 .3rem; }
p { margin: 0 0 .6rem; }
code, pre { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
code { background: var(--hover); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; }
pre { background: var(--subtle); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto;
      white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
pre code { background: none; border: 0; padding: 0; }
svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* -- the frame: a sidebar and the page ---------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh;
         background: linear-gradient(90deg, var(--surface) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px) var(--side), transparent var(--side)); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px;
        background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: var(--ink); font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 26px; width: auto; }
.brand .mark-only { display: none; height: 26px; }
.side .group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 6px; }
.side nav { display: flex; flex-direction: column; gap: 1px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.side nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.side nav a[aria-current] { background: var(--accent-soft); color: var(--navy); box-shadow: inset 3px 0 0 var(--cyan); }
.side nav a .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--warn-soft); color: var(--warn);
                     border: 1px solid var(--warn-line); border-radius: 999px; padding: 0 7px; }
.side .foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.side .foot form { margin: 0; }
.side .foot button { width: 100%; justify-content: flex-start; }
.page { min-width: 0; }
.topbar { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line);
          position: sticky; top: 0; z-index: 5; font-size: 13px; color: var(--muted); }
.topbar a { color: var(--muted); }
.topbar a:hover { color: var(--ink); }
.topbar .sep { color: var(--faint); }
.topbar .here { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1480px; margin: 0 auto; padding: 24px 28px 64px; }
main.wide { max-width: none; }
main.narrow { max-width: 820px; }

/* -- page head --------------------------------------------------------------------- */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin: 4px 0 0; font-size: 13.5px; }
.head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.empty { color: var(--muted); padding: 40px 16px; text-align: center; }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* -- surfaces ---------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, section + section { margin-top: 16px; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card > .body, .card > form > .body { padding: 16px 18px; }
.card > .body > :last-child { margin-bottom: 0; }
.card > footer { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--subtle); border-radius: 0 0 var(--radius) var(--radius); }
.card.flush > .table { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.card + .grid, .banner + .grid { margin-top: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.attention { border-color: var(--warn-line); background: linear-gradient(var(--warn-soft), var(--surface) 70%); }
.stat.attention .value { color: var(--warn); }

/* -- badges ------------------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 1; padding: 4px 8px; border-radius: 999px;
         border: 1px solid var(--line); background: var(--subtle); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); } .badge.ok::before { background: var(--ok); }
.badge.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); } .badge.warn::before { background: var(--warn); }
.badge.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); } .badge.bad::before { background: var(--bad); }
.badge.info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); } .badge.info::before { background: var(--info); }
.badge.live::before { background: var(--info); box-shadow: 0 0 0 0 rgba(29, 78, 216, .5); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29, 78, 216, .45); } 70% { box-shadow: 0 0 0 6px rgba(29, 78, 216, 0); } 100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0); } }
@media (prefers-reduced-motion: reduce) { .badge.live::before { animation: none; } }

/* -- buttons and forms ------------------------------------------------------------- */
button, .button { font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
                  height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
                  text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(1, 29, 65, .22); }
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
button.second, .button.second { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); }
button.second:hover, .button.second:hover { background: var(--hover); }
button.danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); box-shadow: none; }
button.danger:hover { background: var(--bad-soft); }
button.quiet { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
button.quiet:hover { background: var(--hover); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 500; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 7px 10px; min-height: 34px; box-shadow: 0 1px 1px rgba(24, 24, 27, .03); }
select { appearance: none; padding-right: 30px; background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
         background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); margin: 12px 0; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; }
.check span small { display: block; color: var(--muted); font-size: 12.5px; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(247, 247, 248, .92); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
                  padding: 12px 0; margin-top: 20px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.sticky-actions .hint { margin: 0 auto 0 0; }
form { margin: 0; }

/* -- banners ----------------------------------------------------------------------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; border: 1px solid; font-size: 13.5px; }
.banner.error { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.banner.info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }

/* -- tables ------------------------------------------------------------------------ */
.table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); background: var(--subtle); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.cause { color: var(--muted); max-width: 30rem; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
td select, td input:not([type=checkbox]):not([type=radio]) { min-width: 120px; }
table.runs td.num, table.runs td.num-left { white-space: nowrap; }
table.runs td.cause { min-width: 12rem; }
table.runs .badge { white-space: nowrap; }
table.ledger td:nth-child(5) { width: 60%; }
tr.failed td:first-child, tr.hangs td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.waiting td:first-child, tr.attention td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.running td:first-child { box-shadow: inset 3px 0 0 var(--info); }

/* -- orders on the overview -------------------------------------------------------- */
.orders { display: grid; gap: 12px; }
a.order { display: block; color: inherit; padding: 16px 18px; transition: border-color .15s, box-shadow .15s; }
a.order:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
a.order header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 0; border: 0; }
a.order h2 { font-size: 15.5px; }
a.order .prose { color: var(--ink-2); font-size: 13.5px; }
a.order .prose p:last-child { margin: 0; }
a.order footer { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 12px; padding: 0; border: 0; background: none; }
a.order .steps { margin-bottom: 14px; }

/* the phases */
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 12px; gap: 4px; counter-reset: step; }
.steps li { flex: 1; min-width: 0; font-size: 12px; color: var(--faint); padding-top: 8px; border-top: 3px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.done { border-top-color: var(--accent); color: var(--muted); }
.steps li.now { border-top-color: var(--accent); color: var(--accent); font-weight: 600; }
.card .steps { margin: 0; }

/* -- what is the owner's to decide ------------------------------------------------- */
.needs { border-color: var(--warn-line); }
.needs > header { background: var(--warn-soft); border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: var(--warn-line); }
.needs > header h2 { color: var(--warn); }
.need { padding: 16px 18px; }
.need + .need { border-top: 1px solid var(--line); }
.need h3 { margin-bottom: 6px; }
.need form + form { margin-top: 12px; }
.calm { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--muted); }
.calm svg { color: var(--ok); }

/* -- the plan ---------------------------------------------------------------------- */
ol.plan { list-style: none; margin: 0; padding: 0; }
.package { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.package:last-child { border-bottom: 0; }
.package .number { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600;
                   background: var(--hover); color: var(--muted); border: 1px solid var(--line); }
.package.accepted .number { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.package.in_work .number { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.package.delivered .number { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.package.dropped { opacity: .55; }
.package h3 { font-weight: 500; }
.package .meta { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }
.live { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.live.running { color: var(--info); }
.live.attention { color: var(--warn); font-weight: 500; }

/* -- reports, documents and prose -------------------------------------------------- */
.word .who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.avatar { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--ink); }
.word.earlier { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.prose { overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 .6rem; }
.prose li { margin: .15rem 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.1rem 0 .4rem; }
.prose h1 { font-size: 18px; } .prose h2 { font-size: 16px; } .prose h3 { font-size: 14.5px; }
.prose table { margin: .6rem 0; border: 1px solid var(--line); }
.prose blockquote { margin: .6rem 0; padding: .2rem 0 .2rem 12px; border-left: 3px solid var(--line-strong); color: var(--muted); }
article.document { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow); font-size: 14.5px; line-height: 1.65; }
.brief { max-height: 26rem; overflow-y: auto; }

details { border-top: 1px solid var(--line); }
details:first-child { border-top: 0; }
details > summary { cursor: pointer; padding: 11px 18px; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
                            transform: rotate(-45deg); transition: transform .15s; flex: none; }
details[open] > summary::before { transform: rotate(45deg); }
details > summary:hover { background: var(--subtle); }
details > :not(summary) { margin-left: 18px; margin-right: 18px; }
details[open] > :last-child { margin-bottom: 14px; }
details .hint { font-weight: 400; }
td details { border: 0; }
td details > summary { padding: 0; font-weight: 400; }
td details > summary:hover { background: none; }
td details > :not(summary) { margin: 8px 0 0; }
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { padding: 9px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
ul.list li:first-child { border-top: 0; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* -- pictures ---------------------------------------------------------------------- */
.shots-group + .shots-group { margin-top: 18px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 8px; }
.shot { display: block; color: var(--ink-2); font-size: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--subtle); }
.shot:hover { border-color: var(--accent-line); text-decoration: none; box-shadow: var(--shadow-lg); }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; display: block; border-bottom: 1px solid var(--line); background: #fff; }
.shot span { display: block; padding: 6px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shots-group:not(.all) .shot.more { display: none; }
.shots-group.all .show-all { display: none; }
dialog#picture { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
dialog#picture::backdrop { background: rgba(24, 24, 27, .78); }
dialog#picture img { max-width: 94vw; max-height: 88vh; display: block; border-radius: var(--radius-sm); background: #fff; }
dialog#picture p { color: #fff; text-align: center; margin: 8px 0 0; }

/* -- expert's files, logs and health ----------------------------------------------- */
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
ul.files { list-style: none; margin: 0; padding: 6px; }
ul.files a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); }
ul.files a:hover { background: var(--hover); text-decoration: none; }
ul.files a[aria-current] { background: var(--accent-soft); color: var(--accent); }
ul.files .hint { margin: 0; font-size: 12px; }
pre.file { max-height: 75vh; overflow-y: auto; border: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); }
pre.log { background: #0f0f12; color: #e4e4e7; border: 0; max-height: 78vh; border-radius: var(--radius); }
ul.health { list-style: none; margin: 0; padding: 0; }
ul.health li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 18px; border-top: 1px solid var(--line); }
ul.health li:first-child { border-top: 0; }
ul.health li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--ok); }
ul.health li.missing::before { background: var(--bad); }
ul.health li.not-yet::before { background: var(--warn); }
ul.health li.missing { color: var(--bad); }

/* -- settings ---------------------------------------------------------------------- */
.settings-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.settings-nav a { padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.settings-nav a:hover { color: var(--ink); text-decoration: none; }
.settings-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.models td { vertical-align: middle; }
.models td:first-child { min-width: 220px; }
.models .changed td { background: var(--accent-soft); }
.models .default { color: var(--faint); font-size: 12px; display: block; margin-top: 3px; }

/* -- the sign-in ------------------------------------------------------------------- */
body.signin { display: grid; place-items: center; min-height: 100vh; padding: 16px;
              background: radial-gradient(1200px 500px at 50% -10%, #dff6fe, transparent), var(--bg); }
.login { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; padding-bottom: 6px; }
.login .brand img { height: 44px; }
.login .tagline { text-align: center; color: var(--navy); font-weight: 600; letter-spacing: .02em; margin: 0 0 22px; }
.login .tagline::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--cyan); margin: 0 auto 10px; }
.login .motto { text-align: center; color: var(--faint); font-size: 12px; margin-top: 28px; }
.login .card { padding: 24px; }
.login button { width: 100%; margin-top: 16px; height: 38px; }
.login .hint { text-align: center; margin-top: 16px; }

/* -- a newer state is there -------------------------------------------------------- */
#fresh { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 8px 8px 16px;
         border-radius: 999px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; z-index: 20; font-size: 13px; }
#fresh[hidden] { display: none; }
#fresh button { height: 28px; border-radius: 999px; }

/* -- narrow screens ---------------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 4px 8px 4px 0; }
  .brand .name, .side .group { display: none; }
  .brand .mark-only { display: block; }
  .side nav { flex-direction: row; }
  .side nav a { white-space: nowrap; padding: 6px 8px; }
  .side nav a .label-long { display: none; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .topbar { padding: 0 16px; }
  main { padding: 18px 16px 48px; }
  .grid.halves, .split { grid-template-columns: minmax(0, 1fr); }
  .package { grid-template-columns: 28px minmax(0, 1fr); }
  .package > :last-child:not(div) { grid-column: 2; }
  article.document { padding: 18px; }
}
.check.tight { margin: 4px 0; }
.check.flat { margin: 0; }
td .check.tight { display: inline-flex; margin: 2px 16px 2px 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); background: var(--subtle); }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { flex: 0 1 220px; width: auto; }
.filters .hint { margin: 0; }
.filters .filter-actions { margin-left: auto; display: flex; gap: 6px; }
tr[hidden] { display: none; }

/* -- the provider's windows, as bars ----------------------------------------------- */
.quota + .quota { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.quota-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.quota-title .hint { margin: 0; }
.quota-row + .quota-row { margin-top: 12px; }
.quota-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.quota-head strong.ok { color: var(--ok); } .quota-head strong.warn { color: var(--warn); } .quota-head strong.bad { color: var(--bad); }
.quota-row .hint { margin: 4px 0 0; font-size: 12px; }
.bar { height: 8px; border-radius: 999px; background: var(--hover); border: 1px solid var(--line); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 999px; }
.bar .fill.ok { background: #22c55e; } .bar .fill.warn { background: #f59e0b; } .bar .fill.bad { background: #ef4444; }
td.quota-cell { min-width: 280px; }
td.quota-cell .quota-title { display: none; }
.bar .w0 { width: 0%; }
.bar .w2 { width: 2%; }
.bar .w4 { width: 4%; }
.bar .w6 { width: 6%; }
.bar .w8 { width: 8%; }
.bar .w10 { width: 10%; }
.bar .w12 { width: 12%; }
.bar .w14 { width: 14%; }
.bar .w16 { width: 16%; }
.bar .w18 { width: 18%; }
.bar .w20 { width: 20%; }
.bar .w22 { width: 22%; }
.bar .w24 { width: 24%; }
.bar .w26 { width: 26%; }
.bar .w28 { width: 28%; }
.bar .w30 { width: 30%; }
.bar .w32 { width: 32%; }
.bar .w34 { width: 34%; }
.bar .w36 { width: 36%; }
.bar .w38 { width: 38%; }
.bar .w40 { width: 40%; }
.bar .w42 { width: 42%; }
.bar .w44 { width: 44%; }
.bar .w46 { width: 46%; }
.bar .w48 { width: 48%; }
.bar .w50 { width: 50%; }
.bar .w52 { width: 52%; }
.bar .w54 { width: 54%; }
.bar .w56 { width: 56%; }
.bar .w58 { width: 58%; }
.bar .w60 { width: 60%; }
.bar .w62 { width: 62%; }
.bar .w64 { width: 64%; }
.bar .w66 { width: 66%; }
.bar .w68 { width: 68%; }
.bar .w70 { width: 70%; }
.bar .w72 { width: 72%; }
.bar .w74 { width: 74%; }
.bar .w76 { width: 76%; }
.bar .w78 { width: 78%; }
.bar .w80 { width: 80%; }
.bar .w82 { width: 82%; }
.bar .w84 { width: 84%; }
.bar .w86 { width: 86%; }
.bar .w88 { width: 88%; }
.bar .w90 { width: 90%; }
.bar .w92 { width: 92%; }
.bar .w94 { width: 94%; }
.bar .w96 { width: 96%; }
.bar .w98 { width: 98%; }
.bar .w100 { width: 100%; }

/* -- review reports ------------------------------------------------------------------ */
:root { --sev-critical: #9f1239; --sev-critical-soft: #fff1f2; --sev-critical-line: #fecdd3;
        --sev-high: #c2410c; --sev-high-soft: #fff7ed; --sev-high-line: #fed7aa;
        --sev-medium: #a16207; --sev-medium-soft: #fefce8; --sev-medium-line: #fde68a;
        --sev-low: #1d4ed8; --sev-low-soft: #eff6ff; --sev-low-line: #bfdbfe;
        --sev-info: #52525b; --sev-info-soft: #f4f4f5; --sev-info-line: #e4e4e7; }
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
       padding: 3px 8px; border-radius: 6px; border: 1px solid; white-space: nowrap; line-height: 1.2; }
.sev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev-critical { color: #fff; background: var(--sev-critical); border-color: var(--sev-critical); }
.sev-critical::before { background: #fff; }
.sev-high { color: var(--sev-high); background: var(--sev-high-soft); border-color: var(--sev-high-line); }
.sev-medium { color: var(--sev-medium); background: var(--sev-medium-soft); border-color: var(--sev-medium-line); }
.sev-low { color: var(--sev-low); background: var(--sev-low-soft); border-color: var(--sev-low-line); }
.sev-info { color: var(--sev-info); background: var(--sev-info-soft); border-color: var(--sev-info-line); }
.state-tag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.state-pass { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.state-fail { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.state-skip { color: var(--muted); background: var(--hover); border-color: var(--line); }
.state-partial { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }

.report > * + * { margin-top: 18px; }
.report-part h3 { font-size: 15px; margin-bottom: 8px; }
.report-part.callout { background: var(--accent-soft); border: 1px solid var(--accent-line); border-left: 4px solid var(--accent);
                       border-radius: var(--radius-sm); padding: 14px 16px; }
.report-part .table { margin: 8px 0; }
.sev-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sev-tile { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm);
            border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; }
.sev-tile .count { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.sev-tile.sev-critical { color: var(--sev-critical); background: var(--sev-critical-soft); border-color: var(--sev-critical-line); }
.sev-tile.sev-critical::before, .sev-tile::before { display: none; }
.sev-tile:disabled { opacity: .45; cursor: default; }
.sev-tile[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 1px; }
.sev-tile:focus-visible { outline: 2px solid var(--accent); }
.findings { display: grid; gap: 14px; }
.finding { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--sev-info); border-radius: var(--radius);
           box-shadow: var(--shadow); overflow: hidden; }
.finding[hidden] { display: none; }
.sev-border-critical { border-left-color: var(--sev-critical); } .sev-border-high { border-left-color: var(--sev-high); }
.sev-border-medium { border-left-color: #eab308; } .sev-border-low { border-left-color: var(--sev-low); }
.finding > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.finding > header h3 { font-size: 15px; flex: 1 1 260px; }
.finding > header .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
                         background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); }
.finding .proof { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px;
                  background: var(--surface); border: 1px dashed var(--line-strong); color: var(--ink-2); }
.finding .lead { padding: 12px 18px 0; }
.fparts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 18px 16px; }
.fpart { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.fpart-fix, .fpart-evidence { grid-column: 1 / -1; }
.fpart h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fpart h4 .icon { width: 15px; height: 15px; }
.fpart .effort { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--ink-2); }
.fpart .prose { font-size: 13.5px; }
.fpart-where { border-color: var(--sev-low-line); background: #f8fbff; } .fpart-where h4 { color: var(--sev-low); }
.fpart-attacker { border-color: var(--sev-critical-line); background: #fffafa; } .fpart-attacker h4 { color: var(--sev-critical); }
.fpart-evidence { background: var(--subtle); } .fpart-evidence h4 { color: var(--ink-2); }
.fpart-impact { border-color: var(--sev-medium-line); background: #fffdf5; } .fpart-impact h4 { color: var(--sev-medium); }
.fpart-fix { border-color: var(--ok-line); background: #f7fdf9; } .fpart-fix h4 { color: var(--ok); }
.fpart-other h4 { color: var(--muted); }
@media (max-width: 820px) { .fparts { grid-template-columns: minmax(0, 1fr); } .sev-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fparts > section + section, .report section + section { margin-top: 0; }
.report > section + section, .report > * + * { margin-top: 18px; }
.fpart-impact { grid-column: 1 / -1; }
.fpart-where:not(:has(+ .fpart-attacker)), .fpart-attacker:not(.fpart-where + .fpart-attacker) { grid-column: 1 / -1; }
.report > .report-part:first-child:not(.callout) { color: var(--ink-2); font-size: 13.5px; background: var(--surface); border: 1px solid var(--line);
                                                    border-radius: var(--radius-sm); padding: 12px 16px; }
.sev-tile.sev-high { color: var(--sev-high); background: var(--sev-high-soft); border-color: var(--sev-high-line); }
.sev-tile.sev-medium { color: var(--sev-medium); background: var(--sev-medium-soft); border-color: var(--sev-medium-line); }
.sev-tile.sev-low { color: var(--sev-low); background: var(--sev-low-soft); border-color: var(--sev-low-line); }
.sev-tile.sev-info { color: var(--sev-info); background: var(--sev-info-soft); border-color: var(--sev-info-line); }

/* -- the chat beside an order ---------------------------------------------------------- */
.with-chat { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.with-chat .stats { margin-bottom: 0; }
.chat { position: sticky; top: 68px; height: calc(100vh - 176px); min-height: 420px; display: flex; flex-direction: column;
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat > header { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat > header .hint { margin: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--subtle); }
.msg { display: flex; gap: 8px; max-width: 100%; }
.msg .bubble { padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg .bubble p:last-child, .msg .bubble ul:last-child { margin-bottom: 0; }
.msg.me { flex-direction: column; align-items: flex-end; }
.msg.me .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; max-width: 88%; }
.msg.me .bubble a, .msg.me .bubble code { color: #fff; }
.msg.me .bubble code { background: rgba(255, 255, 255, .15); border-color: transparent; }
.msg.ceo .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.ceo > div { min-width: 0; flex: 1; }
.msg .when { display: block; font-size: 11px; color: var(--faint); margin-top: 3px; }
.msg .avatar { flex: none; margin-top: 2px; width: 30px; height: 22px; font-size: 9.5px; letter-spacing: .02em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-act { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
            max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing .bubble { color: var(--muted); }
.dots { display: inline-flex; gap: 3px; margin-right: 4px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; } }
.chat-empty { margin: auto 0; text-align: center; padding: 8px; }
.chat-empty strong { display: block; font-size: 16px; margin-bottom: 6px; }
.suggests { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
button.suggest { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); box-shadow: none; height: auto;
                 padding: 7px 10px; white-space: normal; text-align: left; font-weight: 500; justify-content: flex-start; }
button.suggest:hover { background: var(--hover); color: var(--ink); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-input textarea { min-height: 44px; max-height: 160px; resize: none; }
.chat-closed { padding: 12px 16px; margin: 0; border-top: 1px solid var(--line); }
@media (max-width: 1080px) {
  .with-chat { grid-template-columns: minmax(0, 1fr); }
  .chat { position: static; height: 70vh; }
}
