/* PayCaptain Activation Wizard */
:root {
  --ink: #282828;
  --ink-soft: #55605f;
  --ink-faint: #8a9695;
  --teal: #37c4c0;
  --teal-deep: #16706d;
  --teal-wash: #e6f6f5;
  --mist: #f1f6f6;
  --paper: #ffffff;
  --line: #dbe5e4;
  --amber: #b26a00;
  --amber-wash: #fff4dc;
  --red: #c0392b;
  --red-wash: #fdecea;
  --display: 'Urbanist', 'Avenir Next', 'Segoe UI', sans-serif;
  --body: 'DM Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --r-s: 8px; --r-m: 14px; --r-l: 22px;
  --shadow: 0 1px 2px rgba(22, 60, 58, .06), 0 8px 24px rgba(22, 60, 58, .07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--body); color: var(--ink); background: var(--mist); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--teal-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-soft); } .faint { color: var(--ink-faint); } .small { font-size: .875rem; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.94); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.3rem; border-radius: 999px; border: 1.5px solid transparent; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #000; } .btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.teal { background: var(--teal); color: #0d3b39; } .btn.teal:hover { background: #2fb3af; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { background: var(--mist); border-color: #c5d3d2; }
.btn.quiet { background: transparent; color: var(--teal-deep); padding: .35rem .6rem; } .btn.quiet:hover { background: var(--teal-wash); }
.btn.danger { background: transparent; color: var(--red); border-color: #efc4bf; } .btn.danger:hover { background: var(--red-wash); }
.btn.sm { padding: .4rem .9rem; font-size: .875rem; }
.btn.block { width: 100%; }
.spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* Forms */
.field { display: block; margin-bottom: 1.1rem; }
.field-label { display: flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .925rem; margin-bottom: .35rem; }
.field-label .opt { font-weight: 400; color: var(--ink-faint); }
.input, select.input, textarea.input { width: 100%; padding: .68rem .85rem; border: 1.5px solid var(--line); border-radius: var(--r-s); background: #fff; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #bccccb; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(55, 196, 192, .22); }
.input[disabled], .input[readonly] { background: var(--mist); color: var(--ink-soft); }
.input.bad { border-color: var(--red); }
textarea.input { min-height: 5.5rem; resize: vertical; }
.help { display: block; margin-top: .3rem; font-size: .84rem; color: var(--ink-soft); }
.err { display: block; margin-top: .3rem; font-size: .84rem; color: var(--red); }
.row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row.three { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.check { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-s); background: #fff; margin-bottom: .6rem; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--teal-deep); flex: none; }
.check.on { border-color: var(--teal); background: var(--teal-wash); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.seg button { border: 0; background: transparent; padding: .35rem 1.05rem; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button[disabled] { cursor: default; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .t-label { font-weight: 600; } .toggle-row .help { margin-top: .1rem; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; background: #c9d5d4; border: 0; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--teal-deep); } .switch.on::after { transform: translateX(22px); }
.tip { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1.5px solid var(--ink-faint); color: var(--ink-soft); font-size: .72rem; font-weight: 700; background: none; cursor: help; padding: 0; position: relative; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%); width: min(280px, 70vw); padding: .7rem .85rem; background: var(--ink); color: #fff; font: 400 .84rem/1.45 var(--body); border-radius: var(--r-s); z-index: 20; text-align: left; }

/* Surfaces */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 1.5rem; }
.card + .card { margin-top: 1rem; }
.card h3 { margin-bottom: .35rem; }
.card > .lede { color: var(--ink-soft); margin-bottom: 1.1rem; }
.note { padding: .85rem 1rem; border-radius: var(--r-s); background: var(--teal-wash); color: #0f4f4d; font-size: .925rem; }
.note.warn { background: var(--amber-wash); color: #6b4200; } .note.bad { background: var(--red-wash); color: #7d241b; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--mist); color: var(--ink-soft); white-space: nowrap; }
.chip.done { background: var(--teal-wash); color: var(--teal-deep); } .chip.warn { background: var(--amber-wash); color: var(--amber); } .chip.bad { background: var(--red-wash); color: var(--red); } .chip.dark { background: var(--ink); color: #fff; }
.code-chip { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .18em; font-weight: 700; background: var(--teal-wash); color: var(--teal-deep); padding: .2rem .6rem .2rem .75rem; border-radius: 6px; }
.divider { height: 1px; background: var(--line); margin: 1.25rem 0; border: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stack > * + * { margin-top: .75rem; }
.inline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
table.grid { width: 100%; border-collapse: collapse; font-size: .925rem; }
table.grid th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: .55rem .75rem; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.grid td { white-space: nowrap; padding: .65rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid td.wrap, table.grid td:first-child:last-child { white-space: normal; }
table.grid tr.click { cursor: pointer; } table.grid tr.click:hover td { background: var(--mist); }
.scroll-x { overflow-x: auto; }

/* Welcome and sign-in pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { background: var(--ink); color: #fff; padding: clamp(1.5rem, 4vw, 3.5rem); display: flex; flex-direction: column; gap: 2rem; position: relative; overflow: hidden; }
.auth-side .logo { width: 190px; }
.auth-side h1 { max-width: 14ch; }
.auth-side p.sub { color: #c4cfce; font-size: 1.1rem; max-width: 34ch; margin: 0; }
.voyage { list-style: none; margin: auto 0 0; padding: 0; position: relative; }
.voyage::before { content: ''; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: repeating-linear-gradient(to bottom, #4d5958 0 6px, transparent 6px 11px); }
.voyage li { position: relative; display: flex; gap: .9rem; align-items: center; padding: .34rem 0; color: #c4cfce; font-size: .95rem; }
.voyage .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); border: 2px solid #4d5958; display: grid; place-items: center; font: 700 .78rem var(--display); color: #9aa7a6; flex: none; z-index: 1; }
.voyage li.here { color: #fff; font-weight: 600; } .voyage li.here .dot { border-color: var(--teal); background: var(--teal); color: #0d3b39; }
.auth-main { padding: clamp(1.5rem, 5vw, 4rem); display: flex; align-items: center; justify-content: center; background: var(--paper); }
.auth-form { width: 100%; max-width: 520px; }
.auth-form h2 { font-size: 1.9rem; margin-bottom: .4rem; }
.auth-form .lede { color: var(--ink-soft); margin-bottom: 1.6rem; }
.overview { display: grid; gap: .9rem; margin: 0; padding: 0; list-style: none; }
.overview li { display: grid; grid-template-columns: 10px 1fr; gap: .9rem; color: #dfe7e6; }
.overview li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); margin-top: .5rem; }
.overview strong { display: block; color: #fff; font-family: var(--display); font-size: 1.05rem; }
.big-code { font: 800 2.6rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3em; color: var(--teal-deep); background: var(--teal-wash); padding: 1.1rem 1rem 1.1rem 1.6rem; border-radius: var(--r-m); text-align: center; margin: 1rem 0 1.4rem; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side .voyage { display: none; } .auth-side { gap: 1.2rem; } }

/* Company lookup */
.lookup { position: relative; }
.lookup-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.lookup-list button { display: block; width: 100%; text-align: left; padding: .65rem .85rem; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.lookup-list button:hover, .lookup-list button:focus { background: var(--teal-wash); }
.lookup-list small { display: block; color: var(--ink-soft); }
.matched { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r-s); background: var(--teal-wash); color: #0f4f4d; font-size: .9rem; margin: -.4rem 0 1.1rem; }

/* App shell */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 3vw, 2rem); background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .logo { height: 30px; width: auto; display: block; }
.topbar .where { display: flex; align-items: center; gap: .6rem; min-width: 0; font-weight: 600; }
.topbar .where span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .grow { flex: 1; }
.staffbar { background: var(--ink); color: #fff; padding: .5rem clamp(1rem, 3vw, 2rem); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.staffbar select { background: #3a3a3a; color: #fff; border: 1px solid #555; border-radius: 6px; padding: .25rem .5rem; }
.staffbar a { color: var(--teal); }
.shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 2rem; max-width: 1240px; margin: 0 auto; padding: 1.75rem clamp(1rem, 3vw, 2rem) 6rem; align-items: start; }
.rail { position: sticky; top: 76px; }
.rail-head { margin-bottom: 1rem; }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: .5rem; }
.meter i { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.route { list-style: none; margin: 0; padding: 0; position: relative; }
.route::before { content: ''; position: absolute; left: 15px; top: 20px; bottom: 20px; width: 2px; background: var(--line); }
.route a { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: .8rem; align-items: center; padding: .5rem .6rem .5rem 0; border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.route a:hover { background: rgba(255,255,255,.7); }
.route .stop { width: 32px; height: 32px; border-radius: 50%; background: var(--mist); border: 2px solid #c5d3d2; display: grid; place-items: center; font: 700 .85rem var(--display); color: var(--ink-soft); z-index: 1; }
.route .t { font-weight: 600; font-size: .94rem; line-height: 1.25; display: block; }
.route .s { font-size: .8rem; color: var(--ink-faint); display: block; }
.route li.completed .stop { background: var(--teal); border-color: var(--teal); color: #0d3b39; }
.route li.in_progress .stop { border-color: var(--teal-deep); color: var(--teal-deep); background: #fff; }
.route li.locked a { color: var(--ink-faint); } .route li.locked .stop { border-style: dashed; }
.route li.current a { background: #fff; box-shadow: var(--shadow); } .route li.current .stop { box-shadow: 0 0 0 4px rgba(55,196,192,.25); }
.main { min-width: 0; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; gap: 1rem; }
  .rail { position: static; }
  .route { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; } .route::before { display: none; }
  .route a { grid-template-columns: 32px; padding: .2rem; } .route .t, .route .s { display: none; }
}

/* Stage */
.stage-head { margin-bottom: 1.25rem; }
.stage-head .kicker { color: var(--teal-deep); font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.stage-head p { color: var(--ink-soft); margin: .4rem 0 0; max-width: 60ch; }
.stage-meta { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .8rem; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .4rem 1rem; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.actionbar { position: sticky; bottom: 0; margin-top: 1.25rem; padding: .9rem 1.1rem; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; z-index: 20; }
.actionbar .status { flex: 1; min-width: 180px; font-size: .9rem; color: var(--ink-soft); }
.todo-left { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .9rem; color: var(--ink-soft); }
.steps { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.steps button { border: 0; background: transparent; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-soft); display: inline-flex; gap: .4rem; align-items: center; }
.steps button.on { background: var(--ink); color: #fff; }
.steps button .tick { color: var(--teal); }
.locked-panel { text-align: center; padding: 3rem 1.5rem; }
.locked-panel .lock { width: 64px; height: 64px; border-radius: 50%; background: var(--mist); display: grid; place-items: center; margin: 0 auto 1rem; font-size: 1.6rem; }

/* Overview */
.hero-card { background: var(--ink); color: #fff; border-radius: var(--r-l); padding: clamp(1.4rem, 3vw, 2.2rem); display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.hero-card p { color: #c4cfce; margin: .5rem 0 1.1rem; max-width: 52ch; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--p) * 1%), #454545 0); display: grid; place-items: center; }
.ring > div { width: 94px; height: 94px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; text-align: center; font: 800 1.7rem/1 var(--display); }
.ring small { display: block; font: 500 .72rem var(--body); color: #c4cfce; margin-top: .2rem; }
@media (max-width: 600px) { .hero-card { grid-template-columns: 1fr; } .ring { display: none; } }
.stage-list { display: grid; gap: .6rem; margin-top: 1rem; }
.stage-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 1rem; align-items: center; padding: .9rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: inherit; }
.stage-item:hover { border-color: var(--teal); }
.stage-item .num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 1rem var(--display); background: var(--mist); color: var(--ink-soft); }
.stage-item.completed .num { background: var(--teal); color: #0d3b39; }
.stage-item.locked { opacity: .62; }
.stage-item .t { font-weight: 600; } .stage-item .b { font-size: .875rem; color: var(--ink-soft); }
.stage-item .side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 18px 1fr; gap: .7rem; padding: .5rem 0; font-size: .9rem; border-bottom: 1px solid var(--line); }
.feed li:last-child { border: 0; }
.feed .tick { color: var(--teal-deep); font-weight: 700; }
.feed time { display: block; font-size: .78rem; color: var(--ink-faint); }
.person { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.person:last-child { border: 0; }
.person .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-wash); color: var(--teal-deep); display: grid; place-items: center; font: 700 .8rem var(--display); flex: none; }

/* Pricing */
.price-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.quote { position: sticky; top: 76px; background: var(--ink); color: #fff; border-radius: var(--r-l); padding: 1.4rem; }
.quote h3 { color: #fff; }
.quote .total { font: 800 2.5rem/1 var(--display); margin: .6rem 0 .1rem; transition: opacity .15s; }
.quote .per { color: #c4cfce; font-size: .9rem; }
.quote dl { margin: 1rem 0 0; display: grid; gap: .45rem; font-size: .9rem; }
.quote dl div { display: flex; justify-content: space-between; gap: 1rem; } .quote dt { color: #c4cfce; } .quote dd { margin: 0; font-weight: 600; white-space: nowrap; }
.quote hr { border: 0; border-top: 1px solid #454545; margin: .9rem 0; }
.quote .free { background: var(--teal); color: #0d3b39; border-radius: var(--r-s); padding: .55rem .8rem; font-weight: 600; font-size: .9rem; margin-top: 1rem; }
.quote .codebox { display: flex; gap: .4rem; margin-top: 1rem; } .quote .codebox .input { background: #3a3a3a; border-color: #555; color: #fff; }
@media (max-width: 1100px) { .price-layout { grid-template-columns: 1fr; } .quote { position: static; order: -1; } }
.group-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: end; margin-bottom: .2rem; }
.group-row .field { margin-bottom: .6rem; }
.sigpad { border: 1.5px dashed #b9c9c8; border-radius: var(--r-m); background: #fff; position: relative; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: 170px; border-radius: var(--r-m); cursor: crosshair; }
.sigpad .hint { position: absolute; inset: auto 0 12px 0; text-align: center; color: var(--ink-faint); font-size: .85rem; pointer-events: none; }
.sigpad .base { position: absolute; left: 8%; right: 8%; bottom: 44px; border-bottom: 1.5px solid var(--line); pointer-events: none; }
.terms-list { margin: 0 0 1rem; padding-left: 1.15rem; } .terms-list li { margin-bottom: .25rem; }

/* Files */
.drop { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 1.5px dashed #b9c9c8; border-radius: var(--r-m); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--teal); background: var(--teal-wash); }
.drop.has { border-style: solid; border-color: var(--teal); }
.drop .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--mist); display: grid; place-items: center; flex: none; font-weight: 700; color: var(--teal-deep); }
.drop .grow { flex: 1; min-width: 0; } .drop .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop input { display: none; }

/* Choice cards */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
.choice { text-align: left; padding: 1rem; border: 1.5px solid var(--line); border-radius: var(--r-m); background: #fff; cursor: pointer; }
.choice:hover { border-color: #bccccb; } .choice.on { border-color: var(--teal-deep); background: var(--teal-wash); box-shadow: 0 0 0 1px var(--teal-deep); }
.choice strong { display: block; font-family: var(--display); font-size: 1.02rem; } .choice span { font-size: .85rem; color: var(--ink-soft); }
.policy { border-bottom: 1px solid var(--line); padding: .9rem 0; } .policy:last-child { border: 0; }
.policy p { margin: .3rem 0 .4rem; color: var(--ink-soft); font-size: .93rem; }

/* Overlays */
.overlay { position: fixed; inset: 0; background: rgba(20, 30, 30, .55); display: grid; place-items: center; padding: 1rem; z-index: 100; }
.modal { background: #fff; border-radius: var(--r-l); width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 1.75rem; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal.wide { width: min(860px, 100%); }
.modal h3 { font-size: 1.35rem; margin-bottom: .4rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; flex-wrap: wrap; }
.ticker { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.ticker li { display: grid; grid-template-columns: 26px 1fr; gap: .8rem; align-items: center; padding: .5rem 0; color: var(--ink-faint); transition: color .2s; }
.ticker li.done, .ticker li.doing { color: var(--ink); }
.ticker .mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.ticker li.doing .mark { border-color: var(--teal); border-right-color: transparent; animation: spin .7s linear infinite; }
.ticker li.done .mark { background: var(--teal); border-color: var(--teal); color: #0d3b39; }
.toasts { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 200; display: grid; gap: .5rem; width: min(440px, calc(100vw - 2rem)); }
.toast { background: var(--ink); color: #fff; padding: .8rem 1.1rem; border-radius: var(--r-m); box-shadow: var(--shadow); font-size: .93rem; }
.toast.bad { background: var(--red); }
.captain-fab.raised { bottom: 6.6rem; }
.captain-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; box-shadow: 0 10px 30px rgba(22,112,109,.35); }
.captain { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 70; width: min(400px, calc(100vw - 2rem)); height: min(580px, calc(100vh - 6rem)); background: #fff; border-radius: var(--r-l); box-shadow: 0 30px 80px rgba(0,0,0,.28); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.captain header { background: var(--ink); color: #fff; padding: .9rem 1.1rem; display: flex; align-items: center; gap: .7rem; }
.captain header img { width: 30px; height: 30px; background: #fff; border-radius: 8px; padding: 3px; }
.captain header button { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; }
.captain .msgs { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--mist); }
.msg { max-width: 88%; padding: .65rem .9rem; border-radius: 14px; font-size: .93rem; white-space: pre-wrap; }
.msg.a { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.u { background: var(--teal-deep); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.captain .ask { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.captain .foot { padding: 0 .7rem .7rem; }
.suggest { display: flex; gap: .4rem; flex-wrap: wrap; }
.suggest button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; cursor: pointer; color: var(--teal-deep); }

/* Employee review */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; margin: 1rem 0; }
.health div { background: var(--mist); border-radius: var(--r-s); padding: .8rem 1rem; }
.health b { display: block; font: 800 1.6rem/1.1 var(--display); }
.health span { font-size: .84rem; color: var(--ink-soft); }
.cell-bad { color: var(--red); font-weight: 600; } .cell-warn { color: var(--amber); font-weight: 600; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 110; box-shadow: -20px 0 60px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.drawer header { padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); }
.drawer .body { flex: 1; overflow: auto; padding: 1.2rem 1.4rem; }
.drawer footer { padding: .9rem 1.4rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .6rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 26px 1fr; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border: 0; }
.checklist input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--teal-deep); }
.checklist .when { font-size: .82rem; color: var(--teal-deep); font-weight: 600; }

/* Admin */
.admin-wrap { max-width: 1240px; margin: 0 auto; padding: 1.75rem clamp(1rem, 3vw, 2rem) 4rem; }
.admin-nav { display: flex; gap: .3rem; }
.admin-nav a { padding: .4rem .9rem; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .93rem; }
.admin-nav a.on { background: var(--ink); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin: 1.25rem 0; }
.stats .card { padding: 1.1rem 1.25rem; } .stats b { display: block; font: 800 1.9rem/1.1 var(--display); } .stats span { color: var(--ink-soft); font-size: .88rem; }
.bar { width: 110px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: .5rem; }
.bar i { display: block; height: 100%; background: var(--teal); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media print { .topbar, .rail, .actionbar, .captain-fab, .staffbar { display: none !important; } .shell { display: block; padding: 0; } body { background: #fff; } }

/* Small screens */
.topbar .logo, .topbar a { flex: none; }
.admin-wrap .feed { max-height: 640px; overflow: auto; }
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .topbar { gap: .6rem; } .topbar > .small { display: none; } .topbar .logo { height: 24px; }
  .admin-nav { overflow-x: auto; }
  .actionbar { padding: .7rem; gap: .5rem; } .actionbar .status { flex-basis: 100%; min-width: 0; } .todo-left { display: none; }
  .actionbar .btn { flex: 1; padding: .6rem .8rem; font-size: .9rem; }
  .captain-fab.raised { bottom: 8.4rem; } .captain-fab { padding: .55rem 1rem; font-size: .9rem; }
  .group-row { grid-template-columns: 1fr 1fr; }
  .card { padding: 1.1rem; }
  .stage-item { grid-template-columns: 40px 1fr; } .stage-item .side { grid-column: 2; justify-content: flex-start; }
  .big-code { font-size: 1.9rem; }
}
