/* Downburst portal. Desert Editorial tokens from the studio site (light = desert day, dark = monsoon night).
   Every color is a token; system fonts keep the portal light and fast. */
:root {
  --bone: #f6f1e9; --sand: #ede3d3; --card: #fffcf7; --ink: #2b211b; --muted: #6a5f55; --rust: #8a3a1f;
  --terra: #a0431f; --on-terra: #ffffff; --btn-hover: #8a3a1f; --copper: #b87333; --hair: rgba(43, 33, 27, 0.13);
  --field: #8c7f70; --input: #fffcf7; --focus: #2b211b; --slate: #2f3a44; --on-slate: #f6f1e9;
  --ok-bg: rgba(138, 154, 123, 0.18); --ok-ink: #3f4d33; --warn-bg: rgba(217, 164, 65, 0.16); --warn-ink: #7a4f00;
  --err-bg: rgba(160, 67, 31, 0.1); --err-ink: #8a3a1f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bone: #0e1217; --sand: #161b22; --card: #12161c; --ink: #e8ecf1; --muted: #8c96a5; --rust: #5bd4ee;
    --terra: #5bd4ee; --on-terra: #0e1217; --btn-hover: #e8ecf1; --copper: #d9925a; --hair: rgba(255, 255, 255, 0.1);
    --field: #66758a; --input: #0e1217; --focus: #cfe8ff; --slate: #1c2530; --on-slate: #e8ecf1;
    --ok-bg: rgba(102, 117, 138, 0.25); --ok-ink: #c9e3b5; --warn-bg: rgba(242, 199, 107, 0.12); --warn-ink: #f2c76b;
    --err-bg: rgba(91, 212, 238, 0.08); --err-ink: #ffb59a;
    color-scheme: dark;
  }
}
:root {
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --pad: clamp(16px, 3vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bone); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--rust); text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1 { font: 400 clamp(2rem, 4vw, 2.75rem)/1.1 var(--serif); letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 650; margin-bottom: 12px; }
h3 { font-size: 1.05rem; font-weight: 650; margin-bottom: 8px; }
h4 { font-size: 0.95rem; font-weight: 650; margin: 12px 0 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: 12px; padding: 10px 16px; background: var(--ink); color: var(--bone); transform: translateY(-300%); }
.skip:focus { transform: none; }
main:focus { outline: none; }

.wrap { max-width: 1100px; margin-inline: auto; padding-inline: var(--pad); }
.top { border-bottom: 1px solid var(--hair); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 64px; padding-block: 10px; }
.brand { font: 400 1.35rem/1 var(--serif); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.tag { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 8px; background: var(--slate); color: var(--on-slate); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-size: 0.95rem; }
nav a { color: var(--ink); text-decoration: none; }
nav a:hover { text-decoration: underline; }
main.wrap { padding-block: 32px 64px; min-height: 60vh; }
.foot { border-top: 1px solid var(--hair); padding-block: 24px 40px; color: var(--muted); font-size: 0.9rem; }

.narrow { max-width: 620px; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 12px 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.8rem; word-break: break-all; }
.crumb { font-size: 0.9rem; margin-bottom: 12px; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.block { border-top: 1px solid var(--hair); padding-block: 24px; }
.two { display: grid; gap: 0 40px; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; } }
.plain li { padding: 6px 0; }
.bullets { list-style: disc; padding-left: 20px; }
.bullets li { margin: 4px 0; }

/* forms */
.stack { display: grid; gap: 8px; margin-top: 8px; }
.stack label { font-weight: 600; font-size: 0.95rem; margin-top: 8px; }
input:not([type='hidden']):not([type='file']), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--input); border: 1px solid var(--field); border-radius: 2px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.5; }
input[type='file'] { font: inherit; font-size: 0.95rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 2px;
  background: var(--terra); color: var(--on-terra); font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; justify-self: start;
}
.btn:hover { background: var(--btn-hover); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--ink); border: 1px solid var(--field); }
.btn-quiet:hover { background: var(--sand); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--rust); font: inherit; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.inline { display: inline; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.inline-form input { flex: 1 1 220px; width: auto; }
details { margin: 12px 0; }
summary { cursor: pointer; color: var(--rust); font-weight: 600; }

/* notices and pills */
.notice { padding: 12px 16px; background: var(--warn-bg); color: var(--ink); border-left: 3px solid var(--copper); margin: 12px 0; }
.notice-ok { background: var(--ok-bg); border-left-color: var(--ok-ink); }
.notice-err { background: var(--err-bg); border-left-color: var(--err-ink); }
.pill { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 650; background: var(--sand); color: var(--ink); white-space: nowrap; }
.pill-flagged, .pill-question { background: var(--warn-bg); color: var(--warn-ink); }
.pill-in_progress { background: var(--slate); color: var(--on-slate); }
.pill-done { background: var(--ok-bg); color: var(--ok-ink); }
.pill-rejected { background: var(--sand); color: var(--muted); }
.late { color: var(--err-ink); font-weight: 650; }
.flag-count { color: var(--warn-ink); font-weight: 650; font-size: 0.85rem; }

/* client cards */
.cards { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--hair); }
.card-link { display: grid; gap: 8px; padding: 16px 18px; color: var(--ink); text-decoration: none; }
.card-link:hover { background: var(--sand); }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.9rem; }
.quote { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--hair); border-left: 3px solid var(--copper); padding: 14px 16px; }
.files { margin-top: 12px; }
.files li { padding: 4px 0; }

/* checklist */
.checklist { display: grid; gap: 6px; margin: 8px 0; }
.ck { display: flex; align-items: flex-start; gap: 10px; }
.ck .inline-form { margin: 0; flex-wrap: nowrap; align-items: flex-start; width: 100%; }
.ck-text { flex: 1; }
.ck-box { flex: none; width: 20px; height: 20px; margin-top: 3px; border: 2px solid var(--field); border-radius: 2px; position: relative; }
.ck-done .ck-box { background: var(--terra); border-color: var(--terra); }
.ck-done .ck-box::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--on-terra); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ck-done .ck-text, .ck-done > span:last-child { color: var(--muted); text-decoration: line-through; }
.ck-btn { background: none; border: 0; padding: 0; cursor: pointer; min-width: 28px; min-height: 28px; display: grid; place-items: start; }

/* messages */
.thread { display: grid; gap: 10px; margin-bottom: 16px; }
.msg { padding: 12px 14px; border: 1px solid var(--hair); background: var(--card); }
.msg div { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-us { border-left: 3px solid var(--terra); }
.msg-them { border-left: 3px solid var(--copper); }
.msg-note { border-style: dashed; }

/* admin */
.who-banner { background: var(--slate); color: var(--on-slate); padding: 18px 20px; margin-bottom: 20px; }
.who-client { font: 400 clamp(1.6rem, 3.4vw, 2.2rem)/1.15 var(--serif); }
.who-site { font-size: 1.1rem; margin-top: 4px; }
.who-banner a { color: var(--on-slate); }
.flag-block { background: var(--warn-bg); padding: 20px; border: 1px solid var(--copper); margin-bottom: 8px; }
.flags { display: grid; gap: 10px; margin-top: 10px; }
.flag-open { font-weight: 600; }
.flag-ok { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair); }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.row-flag td:first-child { box-shadow: inset 3px 0 0 var(--copper); padding-left: 10px; }
@media (max-width: 700px) {
  .table thead { display: none; }
  .table tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--hair); }
  .table td { border: 0; padding: 2px 0; }
}
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.thumbs li { display: grid; gap: 4px; width: 160px; }
.thumbs img { width: 160px; height: 120px; object-fit: cover; border: 1px solid var(--hair); }
.file-chip { display: grid; place-items: center; width: 160px; height: 120px; border: 1px solid var(--hair); background: var(--card); padding: 8px; text-align: center; font-size: 0.85rem; overflow-wrap: anywhere; }
.site-block h3 { margin-bottom: 4px; }
