/* Troy: the look of the working pages (staff dashboard, "under the hood" panel, privacy page).
   Same language as the landing page, without its paintings or motion: Space Grotesk headlines, Inter body,
   the palette in tokens.css, big soft corners, pill buttons, thin line borders, one Greek key rule under the
   page header and a small laurel sprig above the title. Load after tokens.css and nav.css. */

:root {
  /* The two classical details, the same drawings the landing page uses (page.css), as masks. */
  --key-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 12'%3E%3Cpath d='M0 10.5H15M1.5 10.5V1.5H13.5V7.5H4.5V4.5H10.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='square'/%3E%3C/svg%3E");
  --sprigs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 24'%3E%3Cdefs%3E%3Cpath id='l' d='M0 0Q3.6 -2.7 7.4 0Q3.6 2.7 0 0Z'/%3E%3Cg id='s'%3E%3Cpath d='M29 20Q14 20 5 6' fill='none' stroke='%23000' stroke-width='1.1' stroke-linecap='round'/%3E%3Cuse href='%23l' transform='translate(23.2 19.4) rotate(-134)'/%3E%3Cuse href='%23l' transform='translate(23.2 19.4) rotate(157)'/%3E%3Cuse href='%23l' transform='translate(18 17.8) rotate(-121)'/%3E%3Cuse href='%23l' transform='translate(18 17.8) rotate(169)'/%3E%3Cuse href='%23l' transform='translate(13.2 15) rotate(-109)'/%3E%3Cuse href='%23l' transform='translate(13.2 15) rotate(-179)'/%3E%3Cuse href='%23l' transform='translate(8.8 11) rotate(-97)'/%3E%3Cuse href='%23l' transform='translate(8.8 11) rotate(-167)'/%3E%3Cuse href='%23l' transform='translate(5.4 6.6) rotate(-123)'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23s'/%3E%3Cuse href='%23s' transform='translate(64 0) scale(-1 1)'/%3E%3C/svg%3E");
  /* Soft tints for pills and states, mixed from the palette. */
  --laurel-soft: color-mix(in srgb, var(--laurel) 13%, var(--white));
  --amber-soft: color-mix(in srgb, var(--amber) 14%, var(--white));
  --cardinal-soft: color-mix(in srgb, var(--cardinal) 9%, var(--white));
  --stone-soft: color-mix(in srgb, var(--stone) 11%, var(--white));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px 88px; }

/* ---------- Example data banner (added by demo.js when there is no server) ---------- */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}
.demo-banner i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }

/* ---------- Page title: sprig, headline, one line, then the key rule ---------- */
.page-head { padding: 34px 0 0; }
.page-head::before {
  content: "";
  display: block;
  width: 58px;
  height: 22px;
  margin: 0 0 14px -4px;
  background: var(--laurel);
  -webkit-mask: var(--sprigs) 50% 50% / contain no-repeat;
  mask: var(--sprigs) 50% 50% / contain no-repeat;
}
.page-head-row { display: flex; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.page-head-row > .grow { flex: 1; min-width: 240px; }
h1, h2, .display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; margin: 0; text-wrap: balance; }
.page-head .sub { color: var(--stone); font-size: 15px; margin: 10px 0 0; max-width: 60ch; }
/* The Greek key, once per page. It fades out to the right. */
.key-rule {
  height: 12px;
  margin: 26px 0 22px;
  border: 0;
  background: var(--line);
  -webkit-mask: var(--key-up) 0 50% / 15px 12px repeat-x, linear-gradient(to right, #000 0, #000 55%, transparent);
  -webkit-mask-composite: source-in;
  mask: var(--key-up) 0 50% / 15px 12px repeat-x, linear-gradient(to right, #000 0, #000 55%, transparent);
  mask-composite: intersect;
  /* Darker than a plain border so the thin strokes read on paper. */
  filter: brightness(0.82);
}

h2 { font-size: 1.75rem; line-height: 1.1; margin: 28px 0 6px; }
h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--stone); margin: 28px 0 10px; }
.lead { color: var(--stone); margin: 0 0 18px; max-width: 66ch; }

/* ---------- Pills and tags ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--stone-soft);
  color: var(--stone);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.done { background: var(--laurel-soft); color: var(--laurel); }
.pill.stop, .pill.fail { background: var(--cardinal-soft); color: var(--cardinal); }
.tag {
  display: inline-block;
  border: 1px dashed var(--stone);
  color: var(--stone);
  border-radius: var(--r-pill);
  padding: 1px 9px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  vertical-align: middle;
}

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; margin-bottom: 12px; }
.row { display: flex; gap: 16px; align-items: flex-start; }
.row .body { flex: 1; min-width: 0; }
.title { font-weight: 600; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.meta { color: var(--stone); font-size: 13px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.empty { border: 1px dashed var(--line); border-radius: var(--r-card); padding: 34px 20px; text-align: center; color: var(--stone); }
.empty .dot { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); margin: 0 auto 10px; }
.note { font-size: 13px; color: var(--stone); margin-top: 8px; }
.warn { font-size: 13px; color: var(--cardinal); margin-top: 8px; font-weight: 500; }
.mono { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- Buttons and fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--r-pill);
  padding: 0 22px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--stone); }
.btn.primary { background: var(--cardinal); border-color: var(--cardinal); color: var(--white); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.field { flex: 1; min-width: 0; min-height: var(--tap); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 20px; background: var(--paper); }
select.field { appearance: none; -webkit-appearance: none; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }

.list { list-style: none; margin: 14px 0 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list li .grow { flex: 1; min-width: 0; }

/* ---------- Photos (blurred until a staff member taps) ---------- */
.photo { width: 84px; height: 84px; border-radius: 22px; overflow: hidden; background: var(--stone-soft); flex: none; position: relative; border: 1px solid var(--line); padding: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.blurred img { filter: blur(22px); transform: scale(1.4); }
.photo.blurred::after, .photo.locked::after { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; font-weight: 600; padding: 6px; }
.photo.blurred::after { content: "blurred, tap to reveal"; color: var(--white); background: rgba(var(--ink-rgb), 0.45); }
.photo.locked::after { content: "photo hidden"; color: var(--stone); }
.photo.none { display: flex; align-items: center; justify-content: center; }
.photo.none::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  border-radius: 22px;
  padding: 12px 20px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  text-align: center;
  z-index: 5;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

.page-foot { color: var(--stone); font-size: 13px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: space-between; }
.page-foot a { text-underline-offset: 3px; }

@media (max-width: 620px) {
  .wrap { padding: 0 16px 72px; }
  .page-head { padding-top: 22px; }
  .card { padding: 16px; border-radius: 22px; }
  .photo { width: 64px; height: 64px; border-radius: 18px; }
  .demo-banner { font-size: 13px; padding: 9px 14px; }
}
