/* millenniumworkflows.com: modern and clean, with 90s accents
   (chunky Unbounded headlines, bold outlines with hard offset shadows,
   slim gradient title bars on the main panels, a thin ticker). */
@font-face { font-family: "Unbounded"; font-weight: 500 800; font-display: swap; src: url("../fonts/unbounded-normal-500-800.edd24a2b43a9.woff2") format("woff2"); }

:root {
  --bg: #f6f4ef;
  --dot: #e4e0d6;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #15151a;
  --muted: #5d5a55;
  --line: #15151a;
  --soft-line: #d9d5cc;
  --navy: #1b1f6b;
  --blue: #2f6bff;
  --teal: #0f8b8d;
  --yellow: #ffd23f;
  --error: #c4231a;
  --ok: #1e7a3c;
  --warn-bg: #fff6d6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Unbounded", "Arial Black", var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --hard: 4px 4px 0 var(--line);
  --hard-sm: 3px 3px 0 var(--line);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 400 16px/1.6 var(--font); color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-font-smoothing: antialiased;
}
main { width: 100%; max-width: 820px; margin: 0 auto; padding: 32px 16px 56px; flex: 1; }
a { color: var(--blue); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, .pill input:focus-visible + span, .check input:focus-visible {
  outline: 3px solid var(--blue); outline-offset: 2px;
}

/* ---------- Header ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 820px; width: 100%; margin: 0 auto; padding: 18px 16px;
}
.brand { font: 700 18px/1 var(--display); letter-spacing: -.01em; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 9px; }
.brand em { font: inherit; color: var(--blue); }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--navy); color: var(--yellow); font-size: 14px; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--line); }
.topbar nav { display: flex; gap: 8px; align-items: center; }

/* ---------- Ticker (thin accent strip) ---------- */
.ticker { max-width: 100vw; contain: paint; background: var(--navy); color: #fff; font: 600 12px/1 var(--mono); letter-spacing: .04em; overflow: hidden; white-space: nowrap; padding: 8px 0; }
.ticker-track { display: inline-flex; animation: ticker 40s linear infinite; }
.ticker-track span { padding-right: 24px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Panels ---------- */
.window, .card {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--hard); margin: 0 0 28px; overflow: hidden;
}
.titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: linear-gradient(90deg, var(--navy), var(--blue));
  color: #fff; font: 600 12px/1 var(--mono); letter-spacing: .03em; padding: 8px 10px 8px 14px;
  border-bottom: 2px solid var(--line);
}
.titlebar .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctrls { display: flex; gap: 4px; flex: none; }
.ctrls i { display: inline-grid; place-items: center; width: 18px; height: 16px; border-radius: 3px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45); color: #fff; font: 700 10px/1 var(--mono); font-style: normal; }
.window > .body { padding: 26px 26px 28px; }
.card { padding: 24px 24px 6px; }
.card > h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 20px; }

/* ---------- Type ---------- */
h1, h2 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.12; color: var(--text); }
h1 { font-size: clamp(30px, 6.4vw, 50px); font-weight: 800; margin: 8px 0 16px; }
.hl { background: linear-gradient(transparent 60%, var(--yellow) 60%, var(--yellow) 92%, transparent 92%); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .08em; }
.eyebrow { font: 600 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--teal); margin: 0; }
.lede { font-size: 18px; color: var(--muted); max-width: 60ch; margin: 0 0 22px; }
.small, .help { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.prose h1 { font-size: clamp(26px, 5vw, 36px); }
.prose h2 { font-size: 18px; margin: 28px 0 6px; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 0 0 6px; }
.prose h2 { scroll-margin-top: 16px; }
.toc { background: var(--surface-2); border: 2px solid var(--line); border-radius: 8px; padding: 14px 18px 6px; margin: 18px 0 8px; font-size: 15px; }
.toc p { margin: 0 0 6px; }
.toc ol { columns: 2 220px; column-gap: 24px; }
.toc a { color: var(--text); }

/* ---------- Home ---------- */
.hero > .body { padding: 34px 30px 34px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 6px; }
.steps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--hard-sm); padding: 22px; }
.step h2 { font-size: 17px; margin: 14px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--yellow); color: var(--text); font: 800 15px/1 var(--display); border: 2px solid var(--line); flex: none; }
.card > h2 .num { width: 30px; height: 30px; font-size: 13px; }
.dialog { max-width: 580px; margin: 48px auto; }
.ok { color: var(--ok); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: 8px;
  box-shadow: var(--hard-sm); padding: 11px 20px; font: 700 15px/1 var(--font); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.small { padding: 8px 14px; font-size: 14px; box-shadow: 2px 2px 0 var(--line); }
.btn.ghost-link { border: 0; box-shadow: none; background: none; padding: 8px 6px; font-weight: 600; color: var(--text); }
.btn.ghost-link:hover { transform: none; text-decoration: underline; }

/* ---------- Notices ---------- */
.notice, .alert { background: var(--warn-bg); border: 2px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.alert { margin: 0 0 22px; box-shadow: var(--hard-sm); }
.icon { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--line); font: 900 12px/1 var(--font); }

/* ---------- Forms ---------- */
.field { margin: 0 0 22px; }
.field > label, legend { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
em { font: 400 12px/1 var(--font); font-style: normal; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input[type=text], input[type=password], select, input[type=email], input[type=url], input[type=tel], textarea {
  width: 100%; font: 16px/1.4 var(--font); color: var(--text); background: var(--surface-2);
  border: 2px solid var(--soft-line); border-radius: 8px; padding: 11px 13px; transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--line); background: var(--surface); }
textarea { resize: vertical; min-height: 100px; }
::placeholder { color: #8a867e; }
input[type=file] { font: 14px var(--font); width: 100%; padding: 12px; background: var(--surface-2); border: 2px dashed var(--soft-line); border-radius: 8px; }
input[type=file]::file-selector-button { font: 700 14px var(--font); background: var(--surface); border: 2px solid var(--line); border-radius: 6px; box-shadow: 2px 2px 0 var(--line); padding: 6px 12px; margin-right: 12px; cursor: pointer; }
.grid2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-block; padding: 8px 15px; border-radius: 999px; background: var(--surface); border: 2px solid var(--soft-line); font-size: 15px; transition: all .12s ease; }
.pill:hover span { border-color: var(--line); }
.pill input:checked + span { background: var(--navy); border-color: var(--line); color: #fff; box-shadow: 2px 2px 0 var(--line); font-weight: 600; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--navy); flex: none; cursor: pointer; }

.has-error input, .has-error textarea { border-color: var(--error); }
.has-error .pill span { border-color: var(--error); }
.error { color: var(--error); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.submit { padding-bottom: 24px; }
.submit .btn { margin-top: 14px; width: 100%; padding: 15px; font-size: 16px; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; align-items: center; padding: 26px 16px 40px; font-size: 14px; color: var(--muted); border-top: 2px solid var(--line); background: var(--surface); }
.foot a { color: var(--text); text-decoration: none; font-weight: 600; }
.foot a:hover { text-decoration: underline; }
.foot .mark { font: 600 12px/1 var(--mono); letter-spacing: .04em; }

@media (max-width: 560px) {
  .window > .body, .hero > .body { padding: 22px 18px 24px; }
  .card { padding: 20px 18px 4px; }
  .lede { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}

.field-warning { margin: 4px 0 12px; }

/* Owner dashboard */
form.inline { display: inline; margin: 0; }
.login-form { max-width: 380px; margin-top: 18px; }
.copy-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 6px; }
.link-box { flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 13px; }
.new-invite { border-color: var(--ok); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface-2); vertical-align: middle; }
.tag-sent { background: #dbe6ff; }
.tag-submitted { background: #d5f5dc; }
.tag-expired { background: var(--surface-2); color: var(--muted); }
.tag-revoked { background: #ffdfe3; }
.invite-list { list-style: none; padding: 0; margin: 0 0 16px; }
.invite { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; padding: 14px 0; border-top: 1.5px solid var(--soft-line); }
.invite-main { flex: 1 1 260px; min-width: 0; }
.invite-main strong { margin-right: 6px; }
.invite-main .small { margin-top: 4px; overflow-wrap: anywhere; }
.invite-main .notes { font-style: italic; }
.invite-actions { display: flex; gap: 6px; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
