/* Job Machine. Light and dark from the device (or Settings -> Theme), orange
   from the resume letterhead, Geist served from /fonts. No third-party anything.
   Motion is short and eased, and switches off for "reduce motion". */

@font-face { font-family: "Geist"; font-weight: 400; font-display: swap; src: url("/fonts/Geist-Regular.ttf") format("truetype"); }
@font-face { font-family: "Geist"; font-weight: 500; font-display: swap; src: url("/fonts/Geist-Medium.ttf") format("truetype"); }
@font-face { font-family: "Geist"; font-weight: 600; font-display: swap; src: url("/fonts/Geist-SemiBold.ttf") format("truetype"); }

:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --panel-2: #f1efeb;
  --panel-3: #e9e6e1;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e7e4df;
  --line-2: #d9d5ce;
  --accent: #d4501f;
  --accent-hover: #bf4517;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee6;
  --good: #16794a;
  --good-soft: #e3f4ea;
  --warn: #8a5d00;
  --warn-soft: #fbf2d8;
  --bad: #b3261e;
  --bad-soft: #fbe8e6;
  --shadow-sm: 0 1px 2px rgb(24 24 27 / 0.05);
  --shadow: 0 1px 2px rgb(24 24 27 / 0.04), 0 4px 16px rgb(24 24 27 / 0.05);
  --shadow-lg: 0 10px 40px rgb(24 24 27 / 0.16), 0 2px 8px rgb(24 24 27 / 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --nav-w: 232px;
  --detail-w: 540px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e11; --panel: #18171b; --panel-2: #212025; --panel-3: #2a2830; --ink: #f4f4f5; --ink-2: #d4d4d8; --muted: #a1a1aa;
    --line: #2a2830; --line-2: #3a3740; --accent: #ff7a45; --accent-hover: #ff8c5c; --accent-ink: #1a0d06; --accent-soft: #3a2117;
    --good: #5fd39a; --good-soft: #15291d; --warn: #f0c062; --warn-soft: #32270f; --bad: #ff8a80; --bad-soft: #36191a;
    --shadow-sm: none; --shadow: 0 0 0 1px rgb(255 255 255 / 0.02); --shadow-lg: 0 16px 48px rgb(0 0 0 / 0.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e11; --panel: #18171b; --panel-2: #212025; --panel-3: #2a2830; --ink: #f4f4f5; --ink-2: #d4d4d8; --muted: #a1a1aa;
  --line: #2a2830; --line-2: #3a3740; --accent: #ff7a45; --accent-hover: #ff8c5c; --accent-ink: #1a0d06; --accent-soft: #3a2117;
  --good: #5fd39a; --good-soft: #15291d; --warn: #f0c062; --warn-soft: #32270f; --bad: #ff8a80; --bad-soft: #36191a;
  --shadow-sm: none; --shadow: 0 0 0 1px rgb(255 255 255 / 0.02); --shadow-lg: 0 16px 48px rgb(0 0 0 / 0.5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body.viewer-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: 0.9em; background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h2 { font-size: 16px; margin-bottom: 10px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* ---------------------------------------------------------------- shell */
.shell { min-height: 100dvh; }
.nav {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.brand { display: none; }
.logo { width: 28px; height: 28px; border-radius: 8px; flex: none; background: var(--accent) url("/icons/icon-192.png") center/cover; box-shadow: var(--shadow-sm); }
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; padding: 5px 4px; cursor: pointer;
  border-radius: 10px; transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s var(--ease); }
.nav-btn:active svg { transform: scale(0.9); }
.nav-btn[aria-current="page"] { color: var(--accent); }
.main { padding: 0 max(16px, env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 980px; margin: 0 auto; transition: margin 0.35s var(--ease); }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 26px; flex: 1; letter-spacing: -0.025em; }
.scan-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; min-width: 0;
}
.scan-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.scan-pill.running .dot { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.scan-pill.ok .dot { background: var(--good); }
#scan-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.8); } }
.banner { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin: 0 0 14px; animation: rise 0.3s var(--ease); }

@media (min-width: 860px) {
  .nav {
    inset: 0 auto 0 0; width: var(--nav-w); flex-direction: column; justify-content: flex-start; gap: 2px;
    border-top: 0; border-right: 1px solid var(--line); padding: calc(22px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom)); background: var(--panel); backdrop-filter: none;
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; padding: 2px 10px 22px; letter-spacing: -0.01em; }
  .nav-btn { flex: none; flex-direction: row; gap: 11px; font-size: 14.5px; padding: 9px 12px; }
  .nav-btn:hover { background: var(--panel-2); color: var(--ink); }
  .nav-btn[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .main { margin-left: calc(var(--nav-w) + max(0px, (100vw - var(--nav-w) - 980px) / 2)); margin-right: auto; padding: 0 36px 56px; }
  .topbar { padding-top: calc(26px + env(safe-area-inset-top)); }
  .topbar h1 { font-size: 30px; }
  #scan-text { max-width: 320px; }
}

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { min-height: 34px; padding: 6px 13px; font-size: 14px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: none; border: 0; font-size: 17px; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }

.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.12s var(--ease);
}
.seg button:hover { border-color: var(--line-2); }
.seg button:active { transform: scale(0.96); }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filters { display: grid; gap: 10px; margin-bottom: 6px; }
.filter-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type="search"] { flex: 1 1 240px; width: auto; padding-left: 36px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 11px center / 17px no-repeat; }
input[type="checkbox"] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
input[type="range"] { width: 130px; accent-color: var(--accent); padding: 0; border: 0; background: none; box-shadow: none; }
.score-filter { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 6px; margin: 12px 0; font-size: 14px; }
.field > span { color: var(--muted); font-weight: 500; }
.row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }

/* ---------------------------------------------------------------- tabs and cards */
.tab:not([hidden]) { animation: fade 0.25s var(--ease); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.count { font-size: 13px; margin: 6px 2px 10px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.job {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 14px 16px; box-shadow: var(--shadow); cursor: pointer;
  animation: rise 0.35s var(--ease) both; animation-delay: calc(min(var(--i, 0), 12) * 28ms);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.job:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.job:active { transform: translateY(0) scale(0.995); }
.job.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow); }
.job h3 { font-size: 16px; line-height: 1.3; }
.job h3, .job .company, .job .meta, .lane li b, .d-top h2, .d-company, .desc-text, .prompt, .note .c, .why li span { overflow-wrap: anywhere; }
.job .company { font-weight: 500; color: var(--ink-2); margin-top: 1px; }
.job .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.job .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.job.closed { opacity: 0.6; }
.quick { display: flex; flex-direction: column; gap: 6px; }
.quick button {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 16px;
  transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s;
}
.quick button:hover { border-color: var(--line-2); background: var(--panel-2); }
.quick button:active { transform: scale(0.88); }
.quick button.on { background: var(--accent-soft); border-color: var(--accent); animation: pop 0.35s var(--ease); }
.tag { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

.score {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  background: var(--panel-2); color: var(--muted);
}
.score.hi { background: var(--good-soft); color: var(--good); }
.score.mid { background: var(--accent-soft); color: var(--accent); }
.score.big { width: 60px; height: 60px; font-size: 23px; border-radius: 16px; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; animation: fade 0.3s var(--ease); }

/* loading placeholders */
.skeleton { height: 92px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 40%, var(--panel) 80%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------------------------------------------------------------- pipeline */
.board { display: grid; gap: 16px; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(3, 1fr); } }
.lane { background: var(--panel-2); border-radius: var(--radius); padding: 12px; }
.lane h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 2px 4px 10px; display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: 0.05em; }
.lane ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-height: 24px; }
.lane li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow-sm);
  animation: rise 0.3s var(--ease) both; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.lane li:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.lane li b { display: block; font-weight: 500; font-size: 14px; }
.lane li span { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- detail sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgb(15 14 17 / 0.4); z-index: 30; opacity: 0; transition: opacity 0.25s var(--ease); }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 31; inset: auto 0 0 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform 0.35s var(--ease);
}
.sheet.open { transform: none; }
@media (min-width: 860px) {
  .sheet { inset: 0 0 0 auto; width: min(var(--detail-w), 92vw); max-height: none; border-radius: 0; border-left: 1px solid var(--line); transform: translateX(100%); }
}
/* Wide screens: the detail docks beside the list instead of covering it. */
@media (min-width: 1360px) {
  .sheet-backdrop { display: none; }
  .sheet { box-shadow: none; }
  body.detail-open .main { margin-left: calc(var(--nav-w) + max(0px, (100vw - var(--nav-w) - var(--detail-w) - 980px) / 2)); }
}
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: flex-end; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 10px 12px 4px; }
.sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line-2); }
@media (min-width: 860px) { .sheet-head::before { display: none; } .sheet-head { padding-top: calc(10px + env(safe-area-inset-top)); } }
.sheet-body { padding: 0 22px 32px; }
.d-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 4px; }
.d-top > div { min-width: 0; }
.d-top h2 { font-size: 21px; line-height: 1.25; margin: 0; letter-spacing: -0.02em; }
.d-company { font-weight: 500; margin: 3px 0 0; color: var(--ink-2); }
.d-top .muted { margin: 3px 0 0; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.chips button:active { transform: scale(0.95); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.reasons { background: var(--panel-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; animation: rise 0.25s var(--ease); }
.reasons p { margin: 0 0 8px; font-size: 13px; }
.docs { display: grid; gap: 8px; margin: 16px 0; }
.docs a {
  display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 11px; text-decoration: none; color: var(--ink); font-weight: 500; transition: border-color 0.15s, transform 0.12s var(--ease);
}
.docs a:hover { border-color: var(--line-2); }
.docs a:active { transform: scale(0.99); }
.docs a span { color: var(--muted); font-size: 13px; font-weight: 400; }
.docs .btn { justify-self: start; }
.docs a.pdf { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; justify-content: stretch; padding: 10px 14px; }
.pdf-icon { display: grid; place-items: center; width: 36px; height: 42px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; }
.pdf-name { display: grid; min-width: 0; }
.pdf-name small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-dl { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); color: var(--ink-2); transition: background 0.15s, transform 0.15s var(--ease); }
.docs a.pdf:hover .pdf-dl { background: var(--accent-soft); color: var(--accent); transform: translateY(1px); }
.apply-kit { margin-top: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); animation: rise 0.3s var(--ease); }
.apply-kit h3 { font-size: 15px; margin-bottom: 6px; }
.apply-kit ol { margin: 0 0 12px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.apply-kit ol li { margin: 2px 0; }
.apply-kit details { margin-top: 10px; }
.prompt { white-space: pre-wrap; font-size: 12px; background: var(--panel-2); padding: 12px; border-radius: 10px; max-height: 320px; overflow: auto; margin: 10px 0 0; }
.docs .hint { font-size: 13px; color: var(--muted); background: var(--panel-2); padding: 11px 14px; border-radius: 11px; margin: 0; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "›"; display: inline-block; color: var(--muted); font-size: 18px; line-height: 1; transition: transform 0.2s var(--ease); }
details[open] > summary::before { transform: rotate(90deg); }
details[open] > :not(summary) { animation: fade 0.25s var(--ease); }
.why ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.why li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.why li b { font-variant-numeric: tabular-nums; }
.why li b.neg { color: var(--bad); }
.desc-text { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); margin-top: 10px; line-height: 1.6; }

/* ---------------------------------------------------------------- review viewer */
.viewer { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; animation: viewer-in 0.3s var(--ease); }
@keyframes viewer-in { from { opacity: 0; transform: scale(0.985); } }
.viewer-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.viewer-titles { flex: 1 1 220px; min-width: 0; }
.zoom { display: flex; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; padding: 1px; background: var(--panel); }
.zoom .icon-btn { width: 32px; height: 32px; font-size: 18px; }
.viewer-titles h2 { margin: 0; font-size: 16px; }
.viewer-titles p { margin: 1px 0 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-body { flex: 1; display: flex; min-height: 0; }
.viewer-doc { flex: 1; min-width: 0; position: relative; background: var(--panel-3); }
.viewer-doc iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; opacity: 0; transition: opacity 0.3s var(--ease); }
.viewer-doc iframe.loaded { opacity: 1; }
.viewer-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; margin: 0; }
.viewer-notes { width: 360px; flex: none; overflow-y: auto; border-left: 1px solid var(--line); padding: 16px; background: var(--bg); }
.viewer-notes .hint { font-size: 13px; color: var(--muted); background: var(--panel-2); padding: 11px 13px; border-radius: 11px; margin: 0 0 14px; line-height: 1.5; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notes-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 0; }
.note {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; font-size: 14px; box-shadow: var(--shadow-sm);
  animation: rise 0.3s var(--ease) both; animation-delay: calc(min(var(--i, 0), 10) * 30ms);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.note.focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.note .q { color: var(--muted); font-style: italic; font-size: 13px; border-left: 3px solid #f2c94c; padding-left: 9px; margin-bottom: 7px; overflow-wrap: anywhere; cursor: pointer; }
.note.done .q { border-left-color: var(--good); }
.note.declined .q { border-left-color: var(--line-2); }
.note .c { white-space: pre-wrap; color: var(--ink); }
.note .r { margin-top: 9px; font-size: 13px; background: var(--good-soft); padding: 9px 11px; border-radius: 9px; white-space: pre-wrap; animation: fade 0.3s var(--ease); }
.note .r b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--good); margin-bottom: 2px; }
.note.declined .r { background: var(--panel-2); }
.note.declined .r b { color: var(--muted); }
.note .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 12px; color: var(--muted); gap: 8px; }
.note .meta button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.note .meta button:hover { background: var(--accent-soft); }
.pill { font-weight: 500; padding: 1px 8px; border-radius: 999px; background: #fff3c4; color: #7a5a00; }
.pill.done { background: var(--good-soft); color: var(--good); }
.pill.declined { background: var(--panel-2); color: var(--muted); }
.note-bar {
  border-top: 1px solid var(--line); background: var(--panel); padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgb(0 0 0 / 0.08); animation: slide-up 0.28s var(--ease);
}
.note-bar textarea { min-height: 64px; resize: vertical; }
.note-bar .btn-row { margin: 10px 0 0; }
.note-quote { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-style: italic; max-height: 3.2em; overflow: hidden; border-left: 3px solid #f2c94c; padding-left: 9px; }
@media (max-width: 860px) {
  .viewer-head { position: relative; gap: 8px; padding-right: 56px; }
  .viewer-titles { flex-basis: 100%; }
  #v-close { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 8px; }
  .viewer-head .seg { flex: 1 0 auto; }
  #v-pdf { min-height: 34px; padding: 6px 10px; }
  .viewer-notes .hint { display: none; }
  .viewer-body { flex-direction: column; }
  .viewer-notes { width: auto; border-left: 0; border-top: 1px solid var(--line); max-height: 36dvh; }
}

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
@media (min-width: 860px) { .toasts { bottom: 28px; left: auto; right: 28px; transform: none; } }
.toast {
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s var(--ease); transition: opacity 0.3s, transform 0.3s var(--ease);
}
.toast.error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* ---------------------------------------------------------------- profile, settings */
.prose { padding: 24px 26px; }
.prose h1 { font-size: 23px; margin: 4px 0 12px; }
.prose h2 { font-size: 18px; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose ul { padding-left: 20px; margin: 6px 0; }
.prose li { margin: 3px 0; }
.prose p { margin: 8px 0; }
.prose strong { font-weight: 600; }
.runs { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.runs li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.runs li:last-child { border-bottom: 0; }
.runs details { border: 0; padding: 4px 0 0; }
.runs summary { font-weight: 400; color: var(--muted); font-size: 13px; }
.log { font-size: 11px; max-height: 360px; overflow: auto; background: var(--panel-2); padding: 12px; border-radius: 11px; white-space: pre-wrap; }
@media (min-width: 1100px) {
  #tab-settings:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
}

/* ---------------------------------------------------------------- login */
/* A soft accent glow behind one centered card, like the finance dashboard's. */
.login-page { background: radial-gradient(900px 480px at 15% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.login-card { width: min(360px, 100%); padding: 28px 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 30px rgb(24 24 27 / 0.06); animation: rise 0.4s var(--ease); }
.login-card h1 { font-size: 17px; margin: 0; }
.login-sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.login-field { display: block; font-size: 12px; font-weight: 600; margin: 0 0 6px; }
.login-card input + .login-field { margin-top: 12px; }
.login-card input { width: 100%; }
.login-card .err { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; }
.login-card .btn { margin-top: 6px; }
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wide { width: 100%; }
.err { color: var(--bad); font-size: 14px; }

/* ---------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { 40% { transform: scale(1.18); } }
@keyframes slide-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

.find-it { margin-top: 8px; font-size: 13px; }
.find-it a { color: var(--accent); }

/* ---------------------------------------------------------------- touch screens (iPhone, iPad)
   Fields at 16px+ so iOS doesn't zoom the page when one is tapped; tap targets
   at Apple's 44px; hover effects off so a tapped card doesn't stay lifted. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  .icon-btn, .quick button { width: 44px; height: 44px; }
  .btn, .btn.small { min-height: 44px; }
  .seg button, .chips button { min-height: 40px; }
  summary { min-height: 44px; }
  .note .meta button { min-height: 36px; padding: 6px 10px; }
}
@media (hover: none) {
  .job:hover, .lane li:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
  .job.active:hover { border-color: var(--accent); }
  .btn:hover { border-color: var(--line-2); }
  .btn.primary:hover { background: var(--accent); border-color: var(--accent); }
  .quick button:hover { border-color: var(--line); background: var(--panel); }
  .quick button.on:hover { background: var(--accent-soft); border-color: var(--accent); }
}

