/* VRS Comms. Near-black, sharp 2px geometry, one emerald accent (vrseclabs.in tokens). */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-latin-v5.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-mono-latin-v6.woff2) format('woff2'); }

:root {
  --bg: #08090B; --surface: #0E1014; --surface-2: #14171C; --surface-3: #1B1F26;
  --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.18);
  --text: #F4F5F7; --text-2: #A3AAB6; --text-3: #808897;
  --accent: #1FBF75; --accent-dim: rgba(31,191,117,.12); --accent-line: rgba(31,191,117,.45);
  --warn: #E8A23A; --danger: #F06262; --danger-dim: rgba(240,98,98,.12);
  --r: 2px;
  --font: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.16,1,.3,1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; }
h2 { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 16px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.warn { color: var(--warn); }
.mb { margin-bottom: 18px; }
[hidden] { display: none !important; }

/* ── Shell ── */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: 56px; padding: 0 28px; background: rgba(8,9,11,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 18px; width: auto; }
.brand span { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding-left: 10px; border-left: 1px solid var(--line-strong); }
.nav { display: flex; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px; color: var(--text-2); font-weight: 500; border-radius: var(--r); }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav svg { width: 15px; height: 15px; opacity: .8; }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.who a:hover { color: var(--text); }
.banner { padding: 9px 28px; font-size: 12.5px; color: var(--warn); background: rgba(232,162,58,.07); border-bottom: 1px solid rgba(232,162,58,.2); }
.main { max-width: 1440px; margin: 0 auto; padding: 32px 28px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 70ch; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.back svg { width: 15px; height: 15px; }

/* ── Controls ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; font: 500 13px/1 var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-3); border-color: rgba(255,255,255,.28); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #04130B; font-weight: 600; }
.btn--accent:hover { background: #2AD083; border-color: #2AD083; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.btn--danger { color: var(--danger); }
.btn--sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn--icon { width: 30px; height: 30px; padding: 0; }
.btn--block { width: 100%; height: 38px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label { display: block; }
.lbl { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea { width: 100%; min-width: 0; font: 400 13.5px/1.45 var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 10px; transition: border-color .15s, box-shadow .15s; }
input.mono { font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
input[type="date"] { color-scheme: dark; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: var(--accent); margin: 0; }
input[type="search"] { padding-left: 32px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23808897' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E") no-repeat 11px 50%; }
.form { display: grid; gap: 14px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.error { color: var(--danger); font-size: 13px; }
.error:empty { display: none; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; line-height: 1.4; }
.check input { margin-top: 1px; }
.check--pad { align-self: end; padding-bottom: 9px; }
.code { font: 500 12px/1 var(--mono); color: var(--accent); letter-spacing: .02em; }
.code--lg { display: block; font-size: 13px; margin-bottom: 8px; }
.linkish { all: unset; cursor: pointer; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: var(--accent); }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; border-radius: var(--r); border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; }
.badge--sent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.badge--failed { color: var(--danger); border-color: rgba(240,98,98,.45); background: var(--danger-dim); }
.badge--logged, .badge--sending { color: var(--warn); border-color: rgba(232,162,58,.4); }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="search"] { width: 280px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card + .card { margin-top: 16px; }
.card--narrow { max-width: 440px; }
.empty { padding: 64px 20px; text-align: center; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: var(--r); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table--static tbody tr { cursor: default; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num { font: 12px var(--mono); color: var(--text-2); white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn + .btn { margin-left: 6px; }
.table select { width: auto; padding: 5px 8px; }

/* ── Timeline board ── */
.tl { --info: minmax(260px, 320px); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tl-head { display: grid; grid-template-columns: var(--info) 1fr; align-items: end; position: sticky; top: 56px; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.tl-head > span { padding: 14px 18px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.track-head { display: grid; grid-template-columns: repeat(var(--n), 1fr); padding: 0 12px; }
.track-head span { padding: 12px 0; text-align: center; font: 500 12px/1 var(--font); color: var(--text-2); }
.track-head i { display: block; font: 500 10px/1 var(--mono); font-style: normal; color: var(--text-3); margin-bottom: 6px; letter-spacing: .06em; }
.tl-row { display: grid; grid-template-columns: var(--info) 1fr; align-items: center; border-bottom: 1px solid var(--line); transition: background .15s; }
.tl-row:last-child { border-bottom: 0; }
.tl-row:hover { background: rgba(255,255,255,.015); }
.tl-info { display: grid; gap: 3px; padding: 15px 18px; border-right: 1px solid var(--line); min-width: 0; }
.tl-info b { font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-info:hover b { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.tl-info .client { color: var(--text-2); font-size: 13px; }
.tl-info .code { margin-bottom: 2px; }
.sched { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.sched-bar { width: 44px; height: 3px; background: var(--surface-3); flex: none; }
.sched-bar i { display: block; height: 100%; background: var(--text-3); }
.sched-t { color: var(--text-2); }
.sched--late { color: var(--warn); }
.sched-bar.sched--late i { background: var(--warn); }
.sched-bar.sched--done i { background: var(--accent); }
.mstate { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.mstate i { width: 6px; height: 6px; background: var(--text-3); }
.mstate--sent i { background: var(--accent); }
.mstate--logged i { background: var(--warn); }
.mstate--failed { color: var(--danger); }
.mstate--failed i { background: var(--danger); }
.empty-row { padding: 36px; text-align: center; color: var(--text-2); }

/* The track: rail, six slots, and the draggable marker. */
.track { position: relative; height: 72px; margin: 0 12px; touch-action: pan-y; }
.track-rail { position: absolute; left: calc(50% / var(--n)); right: calc(50% / var(--n)); top: 50%; height: 1px; background: var(--line-strong); }
.track-fill { height: 1px; background: var(--accent); width: calc(var(--cur) / (var(--n) - 1) * 100%); box-shadow: 0 0 10px rgba(31,191,117,.5); }
.track-slots { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.slot { all: unset; position: relative; display: grid; place-items: center; cursor: pointer; }
.slot:disabled { cursor: default; }
.slot::before { content: ''; position: absolute; inset: 10px 4px; border: 1px dashed transparent; border-radius: var(--r); transition: border-color .12s, background .12s; }
.slot:not(:disabled):hover::before, .slot:focus-visible::before { border-color: var(--line-strong); }
.slot:focus-visible { outline: none; }
.slot:focus-visible::before { border-color: var(--accent); }
.slot.is-hover::before, .slot.is-target::before { border-color: var(--accent-line); background: var(--accent-dim); }
.slot-dot { position: relative; width: 9px; height: 9px; border: 1px solid var(--line-strong); background: var(--surface); transform: rotate(45deg); transition: background .15s, border-color .15s; }
.slot[data-state="done"] .slot-dot { background: var(--accent); border-color: var(--accent); }
.track:not(.track--large) .slot:disabled[data-state="todo"] .slot-dot { opacity: .5; }
.puck { position: absolute; top: 50%; z-index: 2; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 11px 0 5px; transform: translate(-50%, -50%); font: 600 12.5px/1 var(--font); color: var(--text); background: #0F2219; border: 1px solid var(--accent); border-radius: var(--r); box-shadow: 0 0 0 4px var(--bg), 0 6px 20px rgba(0,0,0,.45); cursor: grab; touch-action: none; user-select: none; white-space: nowrap; transition: left .32s var(--ease), box-shadow .15s, background .15s; }
.puck svg { width: 14px; height: 14px; color: var(--accent); opacity: .9; }
.puck:hover { background: #12291E; }
.puck:disabled { cursor: default; padding-left: 11px; }
.puck--closed { border-color: var(--line-strong); background: var(--surface-3); }
.puck--closed svg { color: var(--text-3); }
.tl-row:hover .puck { box-shadow: 0 0 0 4px #0B0D10, 0 6px 20px rgba(0,0,0,.45); }
.track.is-dragging .puck { cursor: grabbing; transition: none; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent-line), 0 14px 34px rgba(0,0,0,.6); }
.track.is-pending .puck { animation: pend 1.1s ease-in-out infinite; }
@keyframes pend { 50% { border-color: var(--accent-line); } }

/* Large track on the project page: labels and the site's stage descriptions under each slot. */
.card--track { padding: 22px 12px 8px; }
.track--large { height: auto; min-height: 150px; margin: 0; }
.track--large .track-rail { top: 22px; }
.track--large .slot { align-content: start; justify-items: center; padding-top: 18px; }
.track--large .slot::before { inset: 0 4px; }
.track--large .slot-label { display: grid; gap: 6px; margin-top: 26px; padding: 0 12px 14px; text-align: center; }
.track--large .slot-label b { font-weight: 600; font-size: 13px; }
.track--large .slot-label small { font-size: 12px; line-height: 1.45; color: var(--text-3); }
.track--large .slot[data-state="current"] .slot-label small { color: var(--text-2); }
.track--large .slot[data-state="todo"] .slot-label b { color: var(--text-2); }
.track--large .puck { top: 22px; }

/* ── Project page ── */
.split { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.split .card + .card { margin-top: 0; }
.facts { margin: 0; display: grid; gap: 14px; }
.fact { display: grid; grid-template-columns: 120px 1fr; gap: 12px; font-size: 13px; }
.fact dt { color: var(--text-3); }
.fact dd { margin: 0; word-break: break-word; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { position: relative; padding: 0 0 18px 22px; }
.feed-item::before { content: ''; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; transform: rotate(45deg); background: var(--surface-3); border: 1px solid var(--line-strong); }
.feed-item::after { content: ''; position: absolute; left: 6.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.feed-item:last-child::after { display: none; }
.feed--stage::before, .feed--created::before { background: var(--accent); border-color: var(--accent); }
.feed--update::before { border-color: var(--accent); }
.feed-title { font-weight: 500; }
.feed-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.feed blockquote { margin: 8px 0 0; padding: 8px 12px; border-left: 2px solid var(--accent-line); background: var(--surface-2); color: var(--text-2); white-space: pre-wrap; font-size: 13px; }
.feed-mail { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; flex-wrap: wrap; }

/* ── Move / update dialogs ── */
.move { display: grid; grid-template-columns: 300px 1fr; gap: 20px; min-height: 440px; }
.move-side { display: grid; gap: 16px; align-content: start; }
.move-path { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r); font-size: 14px; }
.move-path .code { margin-right: 4px; }
.move-path .arrow { color: var(--accent); }
.note-warn { font-size: 13px; color: var(--warn); }
.pv { display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: opacity .2s; }
.pv.is-off { opacity: .35; }
.pv-head .lbl { margin-bottom: 4px; }
.pv-subject { font-weight: 550; }
.email-frame { width: 100%; flex: 1; min-height: 380px; border: 1px solid var(--line); border-radius: var(--r); background: #F4F5F7; }
.rcpt { display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; margin: 0; font-size: 12.5px; }
.rcpt dt { color: var(--text-3); }
.rcpt dd { margin: 0; word-break: break-word; }
.msg { display: grid; gap: 16px; }
.msg .email-frame { min-height: 520px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ── Settings ── */
.mailmode { font-size: 13px; color: var(--text-2); padding: 10px 12px; border: 1px solid var(--line); background: var(--bg); margin-bottom: 18px; border-radius: var(--r); }
.mailmode b { color: var(--text); font-weight: 550; }
.tpl-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tpl-tab { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tpl-tab:hover { color: var(--text); }
.tpl-tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tpl-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tpl-tab i { width: 5px; height: 5px; background: var(--warn); }
.tpl-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr); gap: 20px; }
.tpl textarea { font: 13px/1.6 var(--mono); }
.ph { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-chip { all: unset; cursor: pointer; padding: 4px 7px; font: 11.5px/1 var(--mono); color: var(--text-2); border: 1px solid var(--line); border-radius: var(--r); }
.ph-chip:hover, .ph-chip:focus-visible { color: var(--accent); border-color: var(--accent-line); }
.invite { display: grid; grid-template-columns: 1fr 1.3fr 130px auto; gap: 8px; }

/* ── Dialogs & toasts ── */
dialog { padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog.wide { width: min(1040px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(4,5,7,.72); backdrop-filter: blur(2px); }
dialog[open] { display: flex; flex-direction: column; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-body { padding: 20px; overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 12px 40px rgba(0,0,0,.5); font-size: 13px; animation: pop .2s var(--ease); }
.toast--error { border-color: rgba(240,98,98,.5); }
.toast button { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; }

/* ── Auth ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 50% -10%, rgba(31,191,117,.07), transparent 70%); }
.auth-box { width: min(380px, 100%); }
.auth-box img { height: 24px; width: auto; margin-bottom: 28px; }
.auth-box h1 { font-size: 22px; margin-bottom: 6px; }
.auth-box > p { color: var(--text-2); margin-bottom: 22px; }

/* ── Smaller screens ── */
@media (max-width: 1100px) {
  .tl { --info: 220px; }
  .move, .tpl-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .track--large .slot-label small { display: none; }
  .track--large { min-height: 100px; }
}
@media (max-width: 760px) {
  .top { gap: 14px; padding: 0 14px; overflow-x: auto; }
  .who a { display: none; }
  .nav a { padding: 0 8px; }
  .nav svg { display: none; }
  .main { padding: 22px 14px 80px; }
  .tl-head { display: none; }
  .tl-row { grid-template-columns: 1fr; }
  .tl-info { border-right: 0; border-bottom: 1px dashed var(--line); }
  .track { margin: 6px 4px; }
  .puck { font-size: 11.5px; padding: 0 8px 0 3px; }
  .puck[data-edge="start"] { transform: translate(-14px, -50%); }
  .puck[data-edge="end"] { transform: translate(calc(-100% + 14px), -50%); }
  .form-2, .invite { grid-template-columns: 1fr; }
  .toolbar input[type="search"] { width: 100%; }
  .fact { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
