/* Entirely Project Room. Tokens in tokens/ are copied from the estate's shared
   design tokens and never edited here; this file only composes them. The look
   follows the design prototype: black hero, neon accent, pill controls. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body);
       color: var(--text-primary); background: var(--surface-page); }
body.drawer-open { overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.muted { color: var(--text-secondary); }
.small { font-size: 12.5px; }
.strong { font-weight: var(--weight-medium); }
.flag { color: #b42318; }
.overdue { color: #c4211c; font-weight: var(--weight-medium); }
.spacer { flex: 1; }
.empty { padding: 18px 0; color: var(--text-secondary); font-size: 14px; }
.note { font-size: 13px; color: var(--text-secondary); max-width: 80ch; }

/* ------------------------------------------------------------------ gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6);
        background: var(--color-black); color: var(--text-on-dark); }
.gate-card { max-width: 480px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.gate-eyebrow { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.6); }
.gate-title { margin: 0; font-family: var(--font-display); font-weight: var(--weight-light); font-size: 38px;
              line-height: var(--lh-display); color: var(--color-neon); }
.gate-message { margin: 0; font-size: 14.5px; color: rgba(255,255,255,.78); text-wrap: pretty; }

/* -------------------------------------------------------------- controls */
.btn { font-size: 13px; font-weight: var(--weight-medium); padding: 8px 16px; border-radius: 999px;
       border: 1px solid var(--border-default); background: transparent; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--color-white); }
.btn.primary { background: var(--color-black); color: var(--color-white); text-transform: uppercase; letter-spacing: .04em; font-weight: var(--weight-semibold); }
.btn.primary:hover { background: #2e2e2e; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 14px; padding: 6px 8px; border-radius: 6px; color: var(--text-secondary); }
.icon-btn:hover { background: rgba(0,0,0,.06); color: #000; }
.linkish { border: none; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.linkish.danger { color: #b42318; }
.input, .select { font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--color-white); }
.select:disabled { opacity: 1; color: inherit; background: transparent; border-color: transparent; appearance: none; padding-left: 0; }
.seg { display: inline-flex; border: 1px solid var(--border-default); border-radius: 999px; overflow: hidden; }
.seg-btn, .tab { border: none; background: transparent; padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: var(--weight-medium); }
.seg-btn.on, .tab.on { background: var(--color-black); color: var(--color-white); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-default); background: var(--color-white);
        border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.tag { margin-left: 8px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--color-neon); font-weight: var(--weight-medium); }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.eyebrow-dark { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); font-weight: var(--weight-medium); margin: 0; }

/* Status colours, as in the prototype. */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-on-track, .pill-on-track { background: #c7f100; color: #000; }
.dot-at-risk, .pill-at-risk { background: #ffa382; color: #000; }
.dot-off-track, .pill-off-track { background: #f44040; color: #000; }
.dot-done { background: #42dd41; }
.pill-done { background: #003e26; color: #fff; }
.dot-not-reported { border: 1px solid #9b9b9a; }
.dot-overdue { background: #c4211c; }
.pill-not-reported { background: transparent; color: #2e2e2e; border: 1px solid #9b9b9a; }
.pill { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }

/* ---------------------------------------------------------------- topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
          padding: 16px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--border-subtle); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lockup { font-family: var(--font-display); font-weight: var(--weight-medium); font-size: 22px; letter-spacing: -.01em; }
.divider { width: 1px; height: 24px; background: rgba(0,0,0,.2); }
.app-name { font-size: 15px; font-weight: var(--weight-medium); }
.who { font-size: 13px; color: var(--text-secondary); margin-right: 4px; }

/* ------------------------------------------------------------------ hero */
.hero { background: var(--surface-inverse); color: var(--text-on-dark); padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 48px) 36px; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-neon); font-weight: var(--weight-medium); }
.hero-title { font-family: var(--font-display); font-weight: var(--weight-light); font-size: clamp(40px, 6vw, 72px);
              line-height: 1.02; letter-spacing: -.02em; margin: 14px 0 0; max-width: 14ch; text-wrap: balance; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; margin-top: 40px;
         background: var(--border-on-dark); border: 1px solid var(--border-on-dark); }
.stat { text-align: left; background: var(--color-black); color: var(--color-white); border: none; padding: 18px 18px 16px;
        display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.stat:hover, .stat.active { background: #2e2e2e; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { font-family: var(--font-display); font-weight: var(--weight-light); font-size: 48px; line-height: 1; }
.timeline { margin-top: 36px; padding-top: 8px; }
.tl-line { height: 2px; background: rgba(255,255,255,.3); position: relative; }
.tl-fill { position: absolute; left: 0; top: 0; height: 2px; background: var(--color-neon); }
.tl-dot { position: absolute; top: -6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--color-neon); }
.tl-labels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; font-size: 13px; color: rgba(255,255,255,.75); }
.tl-labels .c { text-align: center; }
.tl-labels .r { text-align: right; }
.tl-strong { color: #fff; font-weight: var(--weight-medium); }

/* --------------------------------------------------------------- toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 22px clamp(16px, 4vw, 48px) 10px; }
.search { flex: 1 1 220px; max-width: 360px; }
#chips { display: inline-flex; gap: 6px; }
.action-opts { display: inline-flex; gap: 14px; font-size: 13px; }
.action-opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.main { padding: 10px clamp(16px, 4vw, 48px) 80px; }

/* --------------------------------------------------------------- projects */
.group-head { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border-default); }
.group-title { margin: 0; font-family: var(--font-display); font-weight: var(--weight-regular); font-size: 26px; letter-spacing: -.01em; }
.area { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); margin: 18px 0 6px; font-weight: var(--weight-medium); }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 16px; background: var(--color-white);
        border: 1px solid var(--border-subtle); border-radius: 14px; margin-bottom: 8px; cursor: pointer; }
.prow:hover { border-color: #000; }
.prow-main { display: flex; gap: 14px; min-width: 0; }
.code { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); min-width: 3ch; white-space: nowrap; }
.prow-name { font-weight: var(--weight-medium); }
.prow-meta, .prow-owners { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.prow-owners.flag { color: #b42318; }
.prow-side { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.prio { font-size: 12px; color: var(--text-secondary); min-width: 64px; }
.meter { width: 108px; }
.meter-label { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 4px; white-space: nowrap; }
.bar { height: 4px; background: rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: #000; }
.next { min-width: 84px; font-size: 13px; }

/* ---------------------------------------------------------------- actions */
.actions .count { margin: 12px 0; font-size: 13px; }
.arow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 16px;
        background: var(--color-white); border: 1px solid var(--border-subtle); border-radius: 12px; margin-bottom: 6px; }
.arow input { margin-top: 4px; width: 16px; height: 16px; accent-color: #000; }
.arow.done .arow-title { text-decoration: line-through; color: #9b9b9a; }
.arow-title { font-weight: var(--weight-medium); }
.arow-main .linkish { color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; text-align: left; }
.arow-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; text-align: right; max-width: 260px; }

/* --------------------------------------------------------------- calendar */
.cal-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.ms-key { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid #9b9b9a; }
.gate-key { border: 2px solid #000; background: transparent; }
.today-key { background: #f1f5c2; border-color: #f1f5c2; }
.cal-scroll { overflow-x: auto; border: 1px solid var(--border-default); border-radius: 14px; background: var(--color-white); }
.cal-row { display: grid; border-bottom: 1px solid rgba(0,0,0,.08); }
.cal-head { background: #000; color: #fff; position: sticky; top: 0; z-index: 1; }
.cal-head .cal-name { color: #fff; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 12px 14px; }
.cal-hcell { padding: 10px 8px; font-size: 12.5px; font-weight: var(--weight-medium); border-left: 1px solid rgba(255,255,255,.22); }
.cal-hcell.gatecol { border-left: 2px solid var(--color-neon); }
.cal-hcell.today { background: var(--color-neon); color: #000; }
.cal-gate { font-size: 10.5px; color: var(--color-neon); font-weight: var(--weight-regular); min-height: 14px; }
.cal-hcell.today .cal-gate { color: #000; }
.cal-name { padding: 10px 14px; position: sticky; left: 0; background: var(--color-white); z-index: 0; border-right: 1px solid rgba(0,0,0,.08); }
.cal-head .cal-name { background: #000; }
.cal-track .cal-name, .cal-track { background: #f6f5ef; }
.cal-w { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.cal-area { font-weight: var(--weight-semibold); font-size: 14px; }
.cal-title { display: flex; gap: 8px; font-size: 13.5px; font-weight: var(--weight-medium); line-height: 1.3; }
.cal-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cal-actions .linkish { font-size: 12px; color: var(--text-secondary); }
.cal-cell { border-left: 1px solid rgba(0,0,0,.08); padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.cal-cell.gatecol { border-left: 2px solid #000; }
.cal-cell.today { background: #f1f5c2; }
.cal-total { font-size: 12px; color: var(--text-secondary); align-items: center; }
.ms { border: 1px solid #9b9b9a; background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; text-align: left; line-height: 1.25; }
.ms.dot { width: 12px; height: 12px; padding: 0; }
.ms-planned { background: #fff; border-color: #9b9b9a; }
.ms-in-progress { background: #78ede3; border-color: #78ede3; }
.ms-at-risk { background: #ffa382; border-color: #ffa382; }
.ms-done { background: #003e26; border-color: #003e26; color: #fff; }

/* ----------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 100vw); background: var(--surface-page); z-index: 21;
          display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.18); }
.drawer-loading { padding: 40px; color: var(--text-secondary); }
.drawer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--border-subtle); background: var(--color-white); }
.drawer-head .source { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved { font-size: 12.5px; color: #1a7f37; min-width: 40px; }
.drawer-body { overflow-y: auto; padding: 20px clamp(16px, 3vw, 32px) 80px; flex: 1; }
.banner { padding: 12px 14px; border-radius: 10px; background: #000; color: #fff; font-size: 13.5px; margin-bottom: 14px; }
.banner.subtle { background: rgba(0,0,0,.06); color: #2e2e2e; }
.banner.warn { background: #fff4ef; color: #000; border: 1px solid #ffa382; }
.banner.warn textarea { margin: 8px 0; background: #fff; }

.field { width: 100%; font: inherit; font-size: 14px; line-height: 1.5; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px;
         background: transparent; resize: none; overflow: hidden; color: inherit; }
.field:not([readonly]):hover { border-color: rgba(0,0,0,.15); }
.field:not([readonly]):focus { border-color: #000; background: #fff; outline: none; }
.field[readonly] { cursor: default; }
.field::placeholder { color: #9b9b9a; }

.bhead { margin-bottom: 16px; }
.bhead-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bhead-row .select { font-size: 13px; padding: 6px 12px; }
.w-code { width: 90px; font-weight: var(--weight-semibold); }
.w-area { width: 260px; }
.bname { font-family: var(--font-display); font-weight: var(--weight-light); font-size: 32px; line-height: 1.15; letter-spacing: -.01em; margin-top: 6px; }
.owners, .links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.person { display: inline-flex; align-items: center; gap: 6px; background: var(--color-white); border: 1px solid var(--border-subtle); border-radius: 999px; padding: 3px 10px 3px 3px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: #000; color: var(--color-neon); display: inline-grid; place-items: center; font-size: 10.5px; font-weight: var(--weight-semibold); flex: none; }

.status-block { background: var(--color-white); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 16px; margin-bottom: 22px; }
.status-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.status-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sopt { border: 1px solid #9b9b9a; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; opacity: .55; }
.sopt.on { opacity: 1; outline: 2px solid #000; outline-offset: 1px; }
.sopt:disabled { cursor: default; }
.status-note { border-color: rgba(0,0,0,.15); background: var(--surface-page); }
.facts { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.facts strong { color: #000; }

.brief-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.brief-title { font-family: var(--font-display); font-size: 22px; }
.sec { background: var(--color-white); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.sec-n { width: 22px; height: 22px; border-radius: 50%; background: #000; color: var(--color-neon); display: inline-grid; place-items: center; font-size: 12px; font-weight: var(--weight-semibold); }
.sec-title { font-weight: var(--weight-semibold); font-size: 15px; }
.sec-sub { font-size: 12.5px; color: var(--text-secondary); }
.frow { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 10px; align-items: start; padding: 4px 0; border-top: 1px solid rgba(0,0,0,.05); }
.flabel { font-size: 12.5px; color: var(--text-secondary); padding-top: 8px; display: flex; gap: 8px; align-items: baseline; }
.fdot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid #9b9b9a; flex: none; }
.fdot.filled { background: #000; border-color: #000; }
.bnote { font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; padding: 8px; background: var(--surface-page); border-radius: 8px; }

.itable { font-size: 14px; }
.ihead, .irow { display: grid; gap: 8px; align-items: start; }
.ms-table .ihead, .ms-table .irow { grid-template-columns: minmax(0, 1fr) 200px 130px 32px; }
.act-table .ihead, .act-table .irow { grid-template-columns: 22px minmax(0, 1fr) 170px 180px 32px; }
.ihead { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); padding: 4px 0 6px; border-bottom: 1px solid rgba(0,0,0,.1); }
.irow { padding: 4px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.irow input[type=checkbox] { margin-top: 10px; width: 16px; height: 16px; accent-color: #000; }
.irow.done .field { text-decoration: line-through; color: #9b9b9a; }
.read { font-size: 11.5px; color: var(--text-secondary); padding: 0 8px 4px; }
.read.flag { color: #b54708; }
.ms-sel { font-size: 12.5px; padding: 5px 10px; margin-top: 4px; }
.ms-sel.ms-planned { background: #fff; }
.pill-sel { font-size: 12px; padding: 4px 10px; }
.add { border: 1px dashed rgba(0,0,0,.3); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; margin-top: 10px; }
.add:hover { border-color: #000; }

.init { border: 1px solid var(--border-subtle); border-radius: 12px; margin-top: 8px; }
.init-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 20px; gap: 12px; align-items: center; padding: 10px 12px; cursor: pointer; }
.init-body { padding: 0 12px 12px; }
.chev { color: var(--text-secondary); }

.activity .comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(0,0,0,.06); font-size: 14px; }
.ctext { white-space: pre-wrap; margin-top: 2px; }
.activity > .sec > .field { border-color: rgba(0,0,0,.15); background: var(--surface-page); }
.hrow { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid rgba(0,0,0,.05); font-size: 13.5px; }
.hwhen { font-size: 12.5px; }

/* ----------------------------------------------------------------- dialog */
.dialog-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; z-index: 40; padding: 16px; }
.dialog { background: var(--surface-page); border-radius: 16px; padding: 20px; width: min(520px, 100%); display: flex; flex-direction: column; gap: 10px; max-height: 90vh; overflow: auto; }
.dialog .input, .dialog .select { width: 100%; border-radius: 10px; }
.dlg-results { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }
.dlg-result { text-align: left; border: 1px solid var(--border-subtle); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 13.5px; }
.dlg-result:hover { border-color: #000; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #000; color: #fff; padding: 10px 18px;
         border-radius: 999px; font-size: 13.5px; z-index: 50; max-width: calc(100vw - 32px); }

/* ----------------------------------------------------------------- narrow */
@media (max-width: 760px) {
  .prow { grid-template-columns: 1fr; }
  .prow-side { justify-content: flex-start; }
  .frow { grid-template-columns: 1fr; gap: 0; }
  .ms-table .ihead, .act-table .ihead { display: none; }
  .ms-table .irow { grid-template-columns: minmax(0, 1fr) 32px; }
  .act-table .irow { grid-template-columns: 22px minmax(0, 1fr) 32px; }
  .tl-labels { font-size: 11.5px; }
}

/* ------------------------------------------------------------------ print */
#print { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; font-size: 10.5pt; color: #000; }
  .p-brief { break-after: page; }
  .p-brief:last-child { break-after: auto; }
  .p-eyebrow { font-size: 8.5pt; letter-spacing: .1em; text-transform: uppercase; color: #555; }
  .p-brief h2 { font-family: var(--font-display); font-weight: var(--weight-light); font-size: 22pt; margin: 4pt 0; }
  .p-meta { font-size: 9pt; color: #333; margin-bottom: 6pt; }
  .p-status { border-left: 3pt solid #c7f100; padding-left: 6pt; margin: 6pt 0 10pt; }
  .p-sec { break-inside: avoid; margin-top: 10pt; }
  .p-sec h3 { font-size: 11pt; margin: 0 0 4pt; border-bottom: 1px solid #000; padding-bottom: 2pt; }
  .p-field { display: grid; grid-template-columns: 45mm 1fr; gap: 4mm; padding: 2pt 0; }
  .p-label { color: #555; font-size: 9pt; }
  .p-val { white-space: pre-wrap; }
  .p-sec table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .p-sec th, .p-sec td { text-align: left; border-bottom: 1px solid #ddd; padding: 3pt 4pt; vertical-align: top; }
}
