/* White Clay HQ. Brand: navy #13294B, teal #0B8A9A, cyan #13C2C2 (BRAND.md). */
:root {
  --navy: #13294B; --teal: #0B8A9A; --cyan: #13C2C2;
  --bg: #f4f7fa; --card: #fff; --ink: #16222f; --muted: #5b6b7b; --line: #dbe3ea;
  --ok: #17794a; --ok-bg: #e3f5ec; --warn: #8a5a00; --warn-bg: #fff3d6; --bad: #b3261e; --bad-bg: #fde8e6;
  --radius: 10px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--teal); }
h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 0 0 12px; color: var(--navy); }
h2 { font-size: 19px; margin: 0 0 10px; color: var(--navy); }
h3 { font-size: 16px; margin: 18px 0 8px; }
p { margin: 0 0 12px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); font-size: 14.5px; }
.wrap { width: min(1180px, 100% - 32px); margin: 24px auto 48px; }
.narrow { max-width: 440px; margin: 40px auto; }

.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 16px; min-height: 58px; flex-wrap: wrap; }
.top a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; white-space: nowrap; }
.brand b { color: var(--cyan); font-weight: 600; }
.mark { width: 34px; height: 34px; display: block; }
nav.main { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
nav.main a { padding: 8px 10px; border-radius: 6px; font-size: 15px; opacity: .88; }
nav.main a:hover { background: rgba(255, 255, 255, .1); opacity: 1; }
nav.main a[aria-current] { background: var(--teal); opacity: 1; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; margin-left: auto; }
.who form { margin: 0; }
.navtoggle, .navbtn { display: none; }
@media (max-width: 900px) {
  .navbtn { display: block; color: #fff; font-weight: 600; margin-left: auto; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px; cursor: pointer; }
  nav.main, .who { display: none; flex-basis: 100%; flex-direction: column; padding-bottom: 12px; }
  .navtoggle:checked ~ nav.main, .navtoggle:checked ~ .who { display: flex; }
  .who { flex-direction: row; margin-left: 0; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 18px; }
.card.attention { border-color: var(--teal); box-shadow: inset 4px 0 0 var(--teal); }
.grid { display: grid; gap: 18px; }
.grid.tight { gap: 12px; }
@media (min-width: 820px) { .grid.two { grid-template-columns: 1fr 1fr; align-items: start; } }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.head h1, .head h2 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat b { font-size: 26px; color: var(--navy); line-height: 1.25; }
.stat small { color: var(--muted); }
.stat.bad b { color: var(--bad); }
.stat.warn b { color: var(--warn); }

.btn { display: inline-block; background: var(--teal); color: #fff; border: 2px solid var(--teal); border-radius: 8px; padding: 9px 16px; font: 600 15px var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: #09727f; border-color: #09727f; }
.btn.line { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn.line:hover { background: var(--navy); color: #fff; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
button.link { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; text-decoration: underline; cursor: pointer; }
.top button.link { color: #fff; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: var(--navy); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
input, select, textarea { font: 16px var(--font); padding: 9px 10px; border: 1px solid #b9c5d0; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
input[type="checkbox"] { width: 18px; height: 18px; flex: none; }
input[type="file"] { padding: 6px; }
textarea { resize: vertical; }
.stack { display: grid; gap: 12px; }
.stack > .btn { justify-self: start; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 12px 0 0; }
.row > label { flex: 1 1 160px; }
.row > label.check { flex: 0 1 auto; padding-bottom: 10px; }
.row form { margin: 0; }
.filter { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; }
.filter label { flex-direction: row; }
.filter select { width: auto; }
.addr { display: flex; align-items: center; gap: 4px; font-weight: 400; }
.invline { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
@media (min-width: 700px) { .invline { grid-template-columns: 4fr 1fr 1.4fr; } }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.off td { color: var(--muted); }
td.actions { white-space: nowrap; text-align: right; }
td.actions form, .actions form { display: inline; margin-left: 10px; }
td.detail { max-width: 340px; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
.card > .tablewrap { margin: 0 -6px; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #e8eef3; color: var(--navy); vertical-align: middle; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.flash { padding: 11px 14px; border-radius: 8px; margin: 0 0 16px; background: #e8eef3; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .muted { display: block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.big dd { text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.subnav a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; font-size: 14px; color: var(--navy); }
.subnav a[aria-current] { background: var(--navy); color: #fff; border-color: var(--navy); }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details.card { border: 1px solid var(--line); padding: 18px; }
summary { cursor: pointer; }
summary h2 { display: inline; }
details[open] > summary { margin-bottom: 12px; }
.notes { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 8px; margin: 12px 0 0; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.secret { display: inline-block; padding: 4px 8px; background: var(--bg); border-radius: 6px; font-size: 15px; letter-spacing: .06em; }
.hash { font-size: 12px; overflow-wrap: anywhere; }
.qr { margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; }
.doc { max-width: 820px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0 0 20px; align-items: start; }
.tile { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile > a { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #e8eef3; overflow: hidden; }
.tile img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; display: block; }
.filetype { font-weight: 700; color: var(--muted); font-size: 20px; }
.tile figcaption { padding: 8px 10px; display: grid; gap: 2px; font-size: 13.5px; }
.tile .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .actions form { margin-left: 8px; }

.thread { display: grid; gap: 12px; margin: 0 0 18px; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; max-width: 760px; }
.msg.staff { border-left: 4px solid var(--teal); margin-left: auto; width: 100%; }
.msg.internal { background: var(--warn-bg); border-style: dashed; }
.msg header { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.msg time { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.atts { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.mail { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 28px; }
