/* The app's frame and forms. Job pages' own styles are in jobs.css; every value comes from tokens.css. */
:root { --radius: 8px; --rail: 188px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink-2); font: var(--text-size)/var(--text-lead) var(--font); }
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; border: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, iframe { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--select-bg); color: var(--select-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink); }
.label { color: var(--ink-3); font-size: var(--small-size); line-height: var(--small-lead); }
.muted { color: var(--ink-3); font-size: var(--small-size); line-height: var(--small-lead); }
.title { color: var(--ink); font-size: calc(var(--h2-size) * 1.3); line-height: 1.2; font-weight: var(--title-weight); letter-spacing: var(--title-track); }
.title + .muted { margin-top: var(--s1); }

/* ---- the frame */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: var(--s3) var(--s2); border-right: 1px solid var(--rule); }
.rail__brand { display: block; padding: 0 var(--s1) var(--s3); color: var(--ink); font-size: var(--lede-size); text-decoration: none; }
.rail__links a { display: block; padding: 6px var(--s1); border-radius: var(--radius); color: var(--ink-2); text-decoration: none; }
.rail__links a:hover { color: var(--ink); background: var(--surface); }
.rail__links a[aria-current] { color: var(--ink); background: var(--surface-2); }
.page { min-width: 0; padding: var(--s2) var(--s5) var(--s8); max-width: 1320px; }
.topbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--s2); min-height: 24px; margin-bottom: var(--s2); color: var(--ink-3); font-size: var(--small-size); }
.topbar__who, .topbar__switch { white-space: nowrap; }
.topbar__switch { color: var(--ink-2); }
.theme { display: inline-flex; flex: none; margin-right: auto; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.theme button { padding: 4px 10px; border: 0; background: none; color: var(--ink-3); font: inherit; cursor: pointer; }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.theme button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.solo { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s2); }
.card { padding: var(--s4); background: var(--surface); border-radius: var(--radius); }
.card--narrow { width: 100%; max-width: 380px; margin: 0 auto; }
.brand { color: var(--ink); font-size: var(--h2-size); line-height: var(--h2-lead); font-weight: var(--heading-weight); }
.card .stack { margin-top: var(--s3); }
.card .flash { margin-top: var(--s2); }

.limit { margin-bottom: var(--s1); padding: var(--s1) var(--s2); border-left: 2px solid var(--hair); background: var(--surface); font-size: var(--small-size); line-height: var(--small-lead); border-radius: var(--radius); }
.flash { margin-bottom: var(--s2); padding: var(--s1) var(--s2); background: var(--surface-2); color: var(--ink); font-size: var(--small-size); line-height: var(--small-lead); border-radius: var(--radius); overflow-wrap: anywhere; }
.flash--error { border-left: 2px solid var(--accent); }
.secret { margin-top: var(--s1); font: var(--text-size)/var(--text-lead) var(--font-mono); overflow-wrap: anywhere; user-select: all; }

/* ---- forms */
.panel { margin-top: var(--s3); padding: var(--s3); background: var(--surface); border-radius: var(--radius); scroll-margin-top: var(--s2); }
.panel__title { color: var(--ink); font-size: var(--lede-size); line-height: var(--lede-lead); font-weight: var(--heading-weight); }
.panel__title + .muted { margin-top: 2px; }
.panel > .muted + .muted { margin-top: var(--s1); }
.stack { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: var(--s2); }
.grid--tight { grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: var(--small-size); line-height: var(--small-lead); }
.field > span, .field > legend { color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; line-height: 16px; }
.field--wide { grid-column: 1 / -1; }
.field--choices { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--hair); border-radius: var(--radius); font-size: 16px; line-height: 24px;
}
.field textarea { resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); padding-top: 2px; }
.choice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1); color: var(--ink-2); font-size: var(--small-size); }
.choice--card { display: flex; padding: var(--s2); background: var(--surface); border-radius: var(--radius); }
.choice input { width: 18px; height: 18px; accent-color: var(--ink-2); }
.row { margin-bottom: var(--s2); padding: var(--s2); border: 1px solid var(--rule); border-radius: var(--radius); min-width: 0; }
.row legend { padding: 0 var(--s1); color: var(--ink-3); font-size: 12px; }
.row__remove { display: inline-flex; gap: var(--s1); margin-top: var(--s2); color: var(--ink-3); font-size: var(--small-size); }
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin-top: var(--s2); font-size: var(--small-size); }
.upload__name { min-width: 170px; }
.upload input[type=file] { max-width: 100%; }
.toc { display: flex; gap: var(--s2); margin-top: var(--s2); overflow-x: auto; font-size: var(--small-size); white-space: nowrap; padding-bottom: 4px; }
.toc a { color: var(--ink-3); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.setup-tag { margin-left: var(--s1); color: var(--ink-3); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }

[data-add-row] { align-self: flex-start; }
[data-row-group] { display: flex; flex-direction: column; }

/* ---- Get started */
.wizard { max-width: 720px; margin: 0 auto; }
.wizard__count { color: var(--ink-3); font-size: var(--small-size); }
.wizard__bar { display: block; width: 100%; height: 6px; margin: var(--s1) 0 var(--s3); appearance: none; border: 0; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.wizard__bar::-webkit-progress-bar { background: var(--surface-2); }
.wizard__bar::-webkit-progress-value { background: var(--accent); }
.wizard__bar::-moz-progress-bar { background: var(--accent); }
.wizard__buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s1); margin-top: var(--s2); }
.wizard__buttons > .jbtn:first-child { margin-right: auto; }
.wizard .panel__title { margin-top: var(--s2); }
.story { color: var(--ink); font-size: var(--text-size); line-height: var(--text-lead); }
.busy { display: flex; align-items: center; gap: var(--s1); margin-top: var(--s2); color: var(--ink); }
.draft { display: flex; flex-direction: column; gap: 6px; font-size: var(--small-size); }
.draft strong { color: var(--ink); font-weight: var(--strong-weight); }
.checklist { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s1); }
.panel + p { margin-top: var(--s3); }
.checklist li { display: flex; gap: var(--s1); color: var(--ink-2); }
.checklist__mark { width: 16px; flex: none; color: var(--ink-3); }
.checklist .on .checklist__mark { color: var(--accent); }

/* ---- pickers and admin */
.picker { display: flex; flex-direction: column; gap: var(--s1); max-width: 480px; margin-top: var(--s3); }
.picker__item { display: flex; flex-direction: column; width: 100%; padding: var(--s2); background: var(--surface); border: 1px solid transparent; border-radius: var(--radius); text-align: left; cursor: pointer; }
.picker__item:hover { border-color: var(--hair); }
.picker__name { color: var(--ink); }
.accounts { margin-top: var(--s1); }
.account__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); }
.account__move, .account__actions { display: flex; flex-wrap: wrap; gap: var(--s1); }
.account__actions { margin-top: var(--s2); }
.account .stack .account__actions { margin-top: 0; }

/* ---- the job pages' styles made calmer: sentence case, softer corners */
.jbtn { letter-spacing: 0; text-transform: none; font-size: var(--small-size); line-height: var(--small-lead); border-radius: var(--radius); text-decoration: none; }
.jbtn-form { display: inline; }
.jalert { border-radius: var(--radius); }
.jalert__tag, .jalert__label, .jalert__more summary { letter-spacing: 0; text-transform: none; }
.jhead { margin-top: 0; }
.jhead__title { font-size: calc(var(--h2-size) * 1.3); }
.jclaims li + li { margin-top: var(--s1); }
.jclaims__from { margin-top: 2px; color: var(--ink-3); font-size: var(--small-size); line-height: var(--small-lead); overflow-wrap: anywhere; }

/* ---- phones: tabs along the bottom */
@media (max-width: 760px) {
  .shell { display: block; }
  .rail { position: fixed; z-index: 10; inset: auto 0 0 0; height: auto; padding: 0 0 env(safe-area-inset-bottom); background: var(--bg); border: 0; border-top: 1px solid var(--rule); }
  .rail__brand { display: none; }
  .rail__links { display: flex; }
  .rail__links li { flex: 1 1 0; min-width: 0; }
  .rail__links a { padding: 12px 2px; border-radius: 0; font-size: 12px; line-height: 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page { padding: var(--s2) var(--s2) calc(var(--s12) + env(safe-area-inset-bottom)); }
  .panel { padding: var(--s2); }
  .wizard__buttons { position: static; }
}
.jlist, .jmain, .jside { min-width: 0; }
@media (max-width: 760px) {
  .jside { max-width: 100%; margin: 0; padding: 0 0 2px; overflow-x: auto; }
}
