/* Editing Desk admin. Same slate-blue as the AZ LIVE working files; calm, one column. */
:root {
  --bg: #f2f4f5; --paper: #ffffff; --ink: #172027; --mute: #56636d; --line: #d8dfe4;
  --accent: #1f5b80; --accent-ink: #ffffff; --accent-soft: #e2edf4;
  --ok: #2c7551; --ok-soft: #dcefe3; --bad: #a33a2c; --bad-soft: #f7e2de; --warn: #8a5a12; --warn-soft: #f6ead3;
  --radius: 10px;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418; --paper: #171e24; --ink: #e5eaee; --mute: #9aa8b3; --line: #2a343c;
    --accent: #8fc3e6; --accent-ink: #0f1418; --accent-soft: #1a2a36;
    --ok: #6cc095; --ok-soft: #17321f; --bad: #e48a7d; --bad-soft: #3a221e; --warn: #e2b36a; --warn-soft: #3a2e17;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* labels and forms set display, which would otherwise beat the hidden attribute */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f-body); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 880px; margin: 0 auto; padding-inline: 16px; }

.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-height: 56px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand-sub { font-weight: 400; color: var(--mute); }
.mark { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { padding: 6px 10px; border-radius: 6px; color: var(--mute); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: .92rem; margin: 0; }

main { padding-block: 28px 48px; display: flex; flex-direction: column; gap: 16px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h2.section { margin: 12px 0 0; }
h3 { font-size: 1.02rem; margin: 0; }
p { margin: 0; }
.lead { color: var(--mute); max-width: 68ch; }
.hint { color: var(--mute); font-size: .88rem; font-weight: 400; }
.empty { color: var(--mute); }
.foot { color: var(--mute); font-size: .82rem; padding-bottom: 32px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.narrow { max-width: 420px; width: 100%; margin: 24px auto 0; }
.client.is-off { opacity: .7; }
.client-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .74rem; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.off { background: var(--bad-soft); color: var(--bad); }
.badge.pilot { background: #f4e7da; color: #8a4a12; letter-spacing: .08em; } /* AZ PILOT P13b: the PILOT tag, the pilot files' amber */
@media (prefers-color-scheme: dark) { .badge.pilot { background: #2e2218; color: #e8a868; } }

.grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: .95rem; }
.grid dt { color: var(--mute); }
.grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts, .links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.links li { display: flex; flex-direction: column; }
.links span { color: var(--mute); font-size: .92rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

code { font: .9em var(--f-mono); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline .grow { flex: 1 1 280px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
input[type='text'], input[type='email'], input[type='password'], input[type='url'] {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0;
}
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
fieldset.choice { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.choice legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; padding: 0; }
.option { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.option input { margin-top: 5px; accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; font: 600 .92rem var(--f-body); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: .84rem; }
button.link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.flash { padding: 10px 14px; border-radius: 8px; font-size: .95rem; }
.flash.is-ok { background: var(--ok-soft); color: var(--ok); }
.flash.is-error { background: var(--bad-soft); color: var(--bad); }

.secret { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.secret-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .92rem; }
.secret-value { display: block; font-size: 1rem; padding: 8px 10px; user-select: all; }

select { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
.filter { max-width: 520px; }
.hooks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hook { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.hook-main { min-width: 0; flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; }
.hook-what { overflow-wrap: anywhere; }
.hook-meta { color: var(--mute); font-size: .86rem; overflow-wrap: anywhere; }
.hook-side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.result { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.result.ok { background: var(--ok-soft); color: var(--ok); }
.result.bad { background: var(--bad-soft); color: var(--bad); }
.result.wait { background: var(--accent-soft); color: var(--accent); }

/* Stand-in */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; }
.subnav a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--mute); text-decoration: none; font-size: .92rem; background: var(--paper); }
.subnav a[aria-current='page'] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card.project { text-decoration: none; color: var(--ink); gap: 4px; }
.card.project:hover { border-color: var(--accent); }
.card.project b { font-size: 1.15rem; }
.muted { color: var(--mute); }
.small { font-size: .86rem; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
h3 { margin-top: 4px; }
textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; resize: vertical; }
input[type='file'] { font: inherit; font-weight: 400; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: .92rem; font-weight: 400; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table.docs { border-collapse: collapse; width: 100%; font-size: .94rem; }
table.docs th, table.docs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.docs th { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
table.docs tr:last-child td { border-bottom: 0; }
.actions-cell { min-width: 260px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0 6px 6px 0; flex-wrap: wrap; }
.inline-form select { width: auto; padding: 5px 8px; }
.brief-edit { margin-top: 6px; }
.brief-edit summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.brief-edit form { margin-top: 10px; }
.badge.st-processing { background: var(--accent-soft); color: var(--accent); }
.badge.st-failed { background: var(--bad-soft); color: var(--bad); }
.badge.st-ready, .badge.st-returned, .badge.st-done { background: var(--ok-soft); color: var(--ok); }
.badge.st-cancelled { background: var(--line); color: var(--mute); }
.docs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.card.doc { gap: 6px; }
.doc-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 1.05rem; }
.upload input[type='file'] { max-width: 260px; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .grid dt { margin-top: 6px; }
  h1 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Usage */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.stat-v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--mute); font-size: .86rem; }
ul.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bad-text { color: var(--bad); }

/* Documents */
.card.problem { border-color: var(--bad); border-left: 4px solid var(--bad); }
pre.answer { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font: .86rem/1.6 var(--f-mono); max-height: 75vh; overflow: auto; }
td code, .problem code, .card code { overflow-wrap: anywhere; }

/* The Test bench (TO-BUILD 7b): a band across every bench page, so it is never taken for real work */
.testband { background: #b45309; color: #fff; font-weight: 700; letter-spacing: .03em; text-align: center; padding: 8px 16px; font-size: .9rem; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label, .inline-form label { display: inline-flex; flex-direction: row; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[name=label] { width: 16em; }
.stack { align-items: flex-start; }

/* Errors, Times, Backups (TO-BUILD 9) */
table.errors tr.unseen td:first-child { border-left: 3px solid var(--bad); }
table.errors details { margin-top: 6px; }
table.errors pre.answer { max-height: 320px; font-size: .8rem; }
#plain-line { font-size: 1.02rem; line-height: 1.6; }
ol.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* AZ PILOT: Claude's draft organization of the pilot's categories */
pre.draft { white-space: pre-wrap; font-family: inherit; font-size: .92rem; line-height: 1.55; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; max-height: 70vh; overflow: auto; }

/* AZ PILOT P6: Pilot lessons */
.lesson { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.lesson:first-of-type { border-top: 0; }
.lesson.dropped .lesson-text, .lesson.dropped .lesson-ex { color: var(--mute); text-decoration: line-through; }
.lesson-text { font-size: 1rem; margin: 0; }
.lesson-ex { margin: 0; font-family: 'Frank Ruhl Libre', 'David', serif; font-size: 1.04rem; background: var(--bg); border-radius: 6px; padding: 4px 10px; }
/* AZ PILOT P12: an example in a wrap-up — the author → Claude → the editor */
.wrap-ex { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 6px; padding: 6px 10px; font-family: 'Frank Ruhl Libre', 'David', serif; font-size: 1.02rem; }
.wrap-ex .muted { font-family: inherit; display: inline-block; min-width: 9em; }
.lesson-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.lesson-acts details { flex-basis: 100%; }
.lesson-acts details[open] summary { margin-bottom: 8px; }
.lesson-edit textarea, .lesson-edit input[type=text] { width: min(640px, 100%); }
.lesson-edit label { flex-direction: column; align-items: flex-start; }
.settle { background: var(--bad-soft); border-radius: 6px; padding: 8px 12px; }
details.record { border-top: 1px solid var(--line); padding: 8px 0; }

/* AZ PILOT P9: Pilot help */
.help-turn { border-top: 1px solid var(--line); padding: 10px 0; }
.help-turn:first-of-type { border-top: 0; }
.help-turn p { margin: 4px 0; }
.help-a { white-space: pre-wrap; color: var(--ink); }
/* AZ PILOT P11d, m: Hebrew or English speaker; his link to copy again */
.speaker { display: inline-flex; gap: 12px; flex-wrap: wrap; align-items: center; }
label.radio { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
label.radio input { width: auto; margin: 0; }
label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; } /* P13c */
label.check input { width: auto; margin: 0; }
form.new-link { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 6px; }
code.link-code { display: block; max-width: 24em; overflow-wrap: anywhere; margin-top: 4px; }

/* AZ PILOT P14b: Admin · Usage — the cost record. One colour per site, fixed order (categorical slots 1–5, validated
   for both themes against the card surface); a table view under the chart carries the same numbers. */
:root { --site-1: #2a78d6; --site-2: #eb6834; --site-3: #1baf7a; --site-4: #eda100; --site-5: #e87ba4; }
@media (prefers-color-scheme: dark) { :root { --site-1: #3987e5; --site-2: #d95926; --site-3: #199e70; --site-4: #c98500; --site-5: #d55181; } }
.usage-nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.usage-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 8px; }
.usage-filter input[type="text"] { min-width: 12em; }
.day-chart { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.day-chart svg { width: 100%; height: auto; display: block; }
.day-chart .axis { font: 11px var(--f-body); fill: var(--mute); }
.day-chart .grid { stroke: var(--line); stroke-width: 1; }
.day-chart .base { stroke: var(--mute); stroke-width: 1; }
.day-chart .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--ink); margin-bottom: 6px; }
.day-chart .key { display: inline-flex; align-items: center; gap: 6px; }
.day-chart .key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.day-chart rect.s-1, .day-chart .key i.s-1 { fill: var(--site-1); background: var(--site-1); }
.day-chart rect.s-2, .day-chart .key i.s-2 { fill: var(--site-2); background: var(--site-2); }
.day-chart rect.s-3, .day-chart .key i.s-3 { fill: var(--site-3); background: var(--site-3); }
.day-chart rect.s-4, .day-chart .key i.s-4 { fill: var(--site-4); background: var(--site-4); }
.day-chart rect.s-5, .day-chart .key i.s-5 { fill: var(--site-5); background: var(--site-5); }
.day-chart rect.s-none { fill: var(--mute); }
.day-chart rect.hit { fill: transparent; }

/* TO-BUILD 14: the test site's loop (runs, Send to AI, files) */
tr.loop td { background: #faf8f5; padding-top: 4px; }
tr.loop details > summary { cursor: pointer; font-size: 13px; color: #57534e; }
ol.runs { margin: 6px 0 8px 18px; padding: 0; }
ol.runs li { margin: 2px 0; }
.loop-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.loop-forms h3 { font-size: 13px; margin: 0 0 6px; }
.small-form { gap: 6px; font-size: 13px; }
.small-form .inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.small-form textarea, .small-form input[type="text"] { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: #5d4037; text-decoration: underline; cursor: pointer; font: inherit; }
/* AZ PILOT P20: Admin · Pilot → Feedback (her pictures full size, her words as she wrote them) */
.pre { white-space: pre-wrap; }
.fb-pic { margin: 10px 0; }
.fb-pic img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; display: block; }

/* TO-BUILD 15: the small orange mark on every page of the DEV site (src/lib/site.js) */
.site-mark { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 2000; background: #d9660a; color: #fff; font: 700 11px/1 system-ui, sans-serif; letter-spacing: .08em; padding: 3px 10px 4px; border-radius: 0 0 6px 6px; pointer-events: none; }
/* the tabs inside Costs, Pilot and Settings */
.subnav.section-tabs { margin: 0 0 18px; }
.needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.needs .small { display: block; }
