/* A fictional corporate work laptop. Ordinary light apps; NARC keeps its own
   dark monospace identity inside its window and its notifications. */

:root {
  --wall-a: #2d686a;
  --wall-b: #355a78;
  --wall-warm: #a85f43;
  --wall-plum: #6c496d;
  --bar: rgba(21, 34, 45, .94);
  --bar-text: #f2efe8;
  --bar-muted: #b8c3c7;
  --app-bg: #f5f7f9;
  --app-panel: #ffffff;
  --app-line: #dbe1e7;
  --app-text: #1b2530;
  --app-muted: #66727f;
  --app-accent: #2a6db5;
  --app-accent-bg: #e6f0fa;
  --unread: #2a6db5;

  --n-bg: #0c0d0c;
  --n-panel: #121512;
  --n-panel2: #171b17;
  --n-line: #2d342e;
  --n-text: #e8ece7;
  --n-muted: #9ca69e;
  --n-accent: #c9db7a;
  --n-danger: #e0a38e;
  --n-good: #9bd0a3;
  --n-info: #9abfe8;
  --n-warn: #efc46c;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #315f69; }
body { font: 15px/1.5 var(--sans); color: var(--app-text); overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }

.desk {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(238,190,105,.28) 0 9%, transparent 9.5%),
    radial-gradient(ellipse at 82% 22%, rgba(122,76,119,.34) 0 15%, transparent 15.5%),
    radial-gradient(ellipse at 68% 80%, rgba(201,103,67,.28) 0 18%, transparent 18.5%),
    linear-gradient(142deg, var(--wall-a) 0%, #2f6764 35%, var(--wall-b) 72%, #403f68 100%);
  background-attachment: fixed;
}
.desk::after {
  content: "";
  position: fixed; inset: 38px 0 72px; pointer-events: none;
  background:
    linear-gradient(28deg, transparent 0 47%, rgba(255,255,255,.035) 47.5% 49%, transparent 49.5%),
    linear-gradient(154deg, transparent 0 61%, rgba(248,201,122,.055) 61.5% 63%, transparent 63.5%);
  opacity: .8;
}

/* ------------------------------------------------------------ menu bar */
.menubar {
  flex: none; height: 38px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bar); color: var(--bar-text); font-size: 13px;
  padding-top: env(safe-area-inset-top);
}
.menubar .left, .menubar .right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.menubar .company { font-weight: 700; letter-spacing: .14em; font-size: 12px; white-space: nowrap; }
.menubar .who { color: var(--bar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menubar .clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tray {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid #33413a; border-radius: 4px;
  padding: 2px 8px; font: 700 11px/1.6 var(--mono); letter-spacing: .08em; color: var(--n-accent);
  white-space: nowrap;
}
.tray:hover { border-color: var(--n-accent); }
.tray .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tray.action { color: var(--n-warn); border-color: var(--n-warn); background: rgba(239, 196, 108, .1); }
.tray.action .dot { animation: pulse 1.2s ease-in-out infinite; }
.logoff { border: 1px solid #33413a; background: transparent; color: var(--bar-muted); border-radius: 4px; padding: 2px 10px; font-size: 12px; }
.logoff:hover:not(:disabled) { color: var(--bar-text); border-color: var(--bar-muted); }
.logoff:disabled { opacity: .4; cursor: default; }
.tray.enhanced { color: var(--n-warn); }
@keyframes pulse { 50% { opacity: .25; } }

/* ------------------------------------------------------------- stage / dock */
.stage { flex: 1; min-height: 0; display: flex; }
.dock {
  flex: none; width: 76px; padding: 12px 8px;
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  background: rgba(8, 14, 19, .38);
}
.dock button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 6px; border: 0; border-radius: 10px; background: transparent;
  color: #d7e2ea; font-size: 11px;
}
.dock button:hover { background: rgba(255, 255, 255, .1); }
.dock button[aria-current="true"] { background: rgba(255, 255, 255, .18); }
.dock button.is-open::after {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.72);
  position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
}
.dock button[aria-current="true"].is-open::after { background: #f4c676; }
.dock button.narc { color: var(--n-accent); margin-top: auto; }
.dock svg { width: 26px; height: 26px; }
.badge {
  position: absolute; top: 2px; right: 10px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #d64545; color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}

.workarea { flex: 1; min-width: 0; padding: 16px; display: flex; }
.window-stack { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.window {
  min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--app-bg); border-radius: 11px; box-shadow: 0 20px 54px rgba(4, 16, 24, .42);
  border: 1px solid rgba(255,255,255,.18);
}
.window.active-window { box-shadow: 0 24px 64px rgba(4, 13, 22, .52), 0 0 0 1px rgba(255,255,255,.18); }
.titlebar {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: #e9edf1; border-bottom: 1px solid var(--app-line); font-weight: 600; font-size: 13px;
  user-select: none; touch-action: none;
}
.titlebar .lights { display: flex; gap: 6px; }
.titlebar .lights i { width: 9px; height: 9px; border-radius: 50%; background: #c5ccd3; display: block; }
.titlebar .back { display: none; border: 0; background: none; color: var(--app-accent); padding: 0 6px 0 0; }
.window-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-close {
  margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: #6d7680;
  font-size: 18px; line-height: 1;
}
.win-close:hover { background: rgba(0,0,0,.08); color: #28323b; }
.body { flex: 1; min-height: 0; display: flex; }

.list { flex: none; width: 300px; overflow-y: auto; border-right: 1px solid var(--app-line); background: var(--app-panel); }
.detail { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 22px; }
.empty { color: var(--app-muted); padding: 24px; }
.pane { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 22px; }

.row {
  display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--app-line);
  background: transparent; padding: 10px 14px;
}
.row:hover { background: #f0f4f8; }
.row[aria-current="true"] { background: var(--app-accent-bg); }
.row .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row .name { font-weight: 500; }
.row.unread .name, .row.unread .sub-b { font-weight: 700; }
.row .sub { color: var(--app-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--unread); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.dotpres { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3aa76d; margin-right: 6px; }
.dotpres.off { background: #b3bcc4; }

/* ---------------------------------------------------------------- email */
.mail h2 { margin: 0 0 4px; font-size: 20px; }
.mail .from { color: var(--app-muted); font-size: 13px; margin-bottom: 14px; }
.mail p { margin: 0 0 12px; max-width: 62ch; }
.form { margin-top: 16px; padding: 14px; border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-panel); }
.form label { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.form .note { color: var(--app-muted); font-size: 13px; margin: 8px 0 0; }

.btn {
  border: 1px solid #b8c3ce; background: #fff; border-radius: 6px; padding: 7px 14px; font-weight: 600; color: var(--app-text);
}
.btn:hover:not(:disabled) { border-color: var(--app-accent); color: var(--app-accent); }
.btn.primary { background: var(--app-accent); border-color: var(--app-accent); color: #fff; }
.btn.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.1); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------- messages */
.detail.flush { display: flex; flex-direction: column; padding: 0; }
.thread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread .scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.thread header { padding: 10px 22px; border-bottom: 1px solid var(--app-line); background: var(--app-panel); }
.thread header b { display: block; }
.thread header span { color: var(--app-muted); font-size: 13px; }
.bubble { max-width: min(80%, 460px); padding: 8px 12px; border-radius: 14px; background: #e4e9ee; align-self: flex-start; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--app-accent); color: #fff; }
.bubble.system { align-self: center; background: transparent; color: var(--app-muted); font-size: 13px; text-align: center; }
.attach { display: block; margin-top: 4px; font-size: 13px; opacity: .9; }
/* An attachment someone else sent that actually does something when clicked
   (currently: Marcus's keepalive share, which points at Utilities). */
button.attach.clickable {
  all: unset; display: block; margin-top: 4px; font-size: 13px; opacity: .9;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
button.attach.clickable:hover, button.attach.clickable:focus-visible { opacity: 1; }
button.attach.clickable:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; border-radius: 2px; }
.attach::before { content: "📎 "; }
.compose { border-top: 1px solid var(--app-line); background: var(--app-panel); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--app-accent); background: var(--app-accent-bg); color: var(--app-accent); border-radius: 16px; padding: 6px 12px; text-align: left; }
.chip:hover { background: var(--app-accent); color: #fff; }
.compose input { border: 1px solid var(--app-line); border-radius: 18px; padding: 8px 14px; background: #f3f5f7; width: 100%; }
.compose-state { color: var(--app-muted); font-size: 13px; padding: 2px 4px; }

/* ------------------------------------------------------------- calendar */
.cal-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 1px solid var(--app-line); background: #fff; border-radius: 6px; padding: 5px 12px; font-size: 13px; }
.tab[aria-pressed="true"] { background: var(--app-accent); border-color: var(--app-accent); color: #fff; }
.tab.today { font-weight: 700; }
.event { display: grid; grid-template-columns: 6.6rem 1fr; gap: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; border: 1px solid var(--app-line); border-left: 4px solid var(--app-accent); border-radius: 6px; }
.event.team { border-left-color: #8a6bbf; }
.event .time { color: var(--app-muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.event .where { color: var(--app-muted); font-size: 13px; }
.slot { border: 1px dashed #aab5c0; border-radius: 6px; padding: 12px; margin-bottom: 8px; background: #fbfcfd; }
.slot input[type="text"] { width: 100%; border: 1px solid var(--app-line); border-radius: 6px; padding: 7px 10px; margin: 8px 0; background: #fff; }
.who-h { font-weight: 700; margin: 16px 0 6px; }

/* ---------------------------------------------------- files & utilities */
.file-body p { margin: 0 0 10px; max-width: 62ch; }
.file-body h2 { margin: 0 0 2px; font-size: 18px; }
.file-body .meta { color: var(--app-muted); font-size: 13px; margin-bottom: 14px; }
.cards { display: grid; gap: 14px; padding: 18px 22px; align-content: start; overflow-y: auto; flex: 1; }
.card { background: #fff; border: 1px solid var(--app-line); border-radius: 10px; padding: 14px 16px; }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.card p { margin: 0 0 10px; color: var(--app-muted); }
.card.sketchy { border-style: dashed; border-color: #c38a4d; background: #fffaf3; }
.utility-kicker { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: #9b5b17; margin-bottom: 5px; }
.card .line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--app-line); }
.card .line:first-of-type { border-top: 0; }
.switch { position: relative; width: 46px; height: 26px; border: 0; border-radius: 13px; background: #b6c0ca; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: #3aa76d; }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.status-on { color: #2c8558; font-weight: 600; }
.status-off { color: #b23b3b; font-weight: 600; }
.feed .line span:first-child { color: var(--app-muted); font-variant-numeric: tabular-nums; }
.card .line + .note { margin-top: -6px; margin-bottom: 8px; }

/* ----------------------------------------------------------------- NARC */
.window.narc { background: var(--n-bg); color: var(--n-text); font-family: var(--mono); }
.window.narc .titlebar { background: #131713; border-color: var(--n-line); color: var(--n-text); }
.window.narc .titlebar .lights i { background: #2d342e; }
.window.narc .titlebar .back { color: var(--n-accent); }
.window.narc .body { flex-direction: column; }
.narc-top { flex: none; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; padding: 10px 16px; border-bottom: 1px solid var(--n-line); font-size: 13px; color: var(--n-muted); }
.narc-top b { color: var(--n-text); }
.narc-top .flag b { color: var(--n-danger); }
.narc-top .brand { color: var(--n-text); font-weight: 800; letter-spacing: .14em; }
.narc-main { flex: 1; min-height: 0; display: flex; }
.narc-main .list { background: var(--n-panel); border-color: var(--n-line); width: 300px; }
.narc-main .row { border-color: var(--n-line); color: var(--n-text); }
.narc-main .row:hover { background: #171b17; }
.narc-main .row[aria-current="true"] { background: #1d231c; }
.narc-main .row .sub { color: var(--n-muted); }
.narc-main .row.closed .name { color: var(--n-muted); }
.narc-main .row .pill { background: var(--n-accent); color: #10140a; }
.narc-main .detail { padding: 18px 22px; }
.narc-main .empty { color: var(--n-muted); }
.case h2 { margin: 0 0 2px; font-size: 18px; }
.case .subject { color: var(--n-muted); font-size: 13px; margin-bottom: 12px; }
.sect { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 16px 0 6px; }
.sect.observed { color: var(--n-good); }
.sect.model { color: var(--n-warn); }
.case ul { margin: 0; padding-left: 18px; max-width: 68ch; }
.case li { margin: 4px 0; }
.model-box { border: 1px solid #4c4930; background: #171710; padding: 12px 14px; max-width: 620px; }
.model-box .assessment { font-size: 16px; font-weight: 700; }
.model-box .conf { color: var(--n-muted); font-size: 12px; margin-top: 3px; }
.context-facts { margin-top: 10px; display: grid; gap: 6px; max-width: 620px; }
.context-facts > div { display: flex; justify-content: space-between; gap: 18px; padding: 7px 9px; border: 1px solid var(--n-line); background: #111411; }
.context-facts span { color: var(--n-muted); }
.context-facts b { color: var(--n-text); text-align: right; }
.company-action { margin-top: 10px; max-width: 620px; padding: 10px 12px; border-left: 3px solid var(--n-warn); background: #171710; display: flex; justify-content: space-between; gap: 18px; }
.company-action span { color: var(--n-muted); }
.company-action b { color: var(--n-text); text-align: right; }
.history-tag { color: var(--n-muted); font-size: 10px; letter-spacing: .12em; margin: 8px 0 4px; }
.notice-copy { max-width: 68ch; line-height: 1.5; }
.prompt { margin: 16px 0 8px; color: var(--n-info); }
.ctl { display: grid; gap: 8px; margin-top: 12px; }
.nbtn { text-align: left; min-height: 42px; color: var(--n-text); background: var(--n-panel2); border: 1px solid #39413a; border-radius: 4px; padding: 9px 12px; }
.nbtn:hover:not(:disabled) { border-color: var(--n-accent); }
.nbtn.dismiss { color: var(--n-muted); }
.nbtn:disabled { opacity: .5; cursor: not-allowed; }
.narc-main textarea, .narc-main .radio label { color: var(--n-text); }
.narc-main textarea { width: 100%; min-height: 70px; background: #101210; border: 1px solid #39413a; border-radius: 4px; padding: 8px 10px; resize: vertical; }
.ctl .radio { display: grid; gap: 4px; }
.ctl .radio label { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.closed-line { margin-top: 16px; color: var(--n-muted); font-size: 13px; }
.team { margin: 16px 16px 0; padding: 10px 0 0; border-top: 1px dashed var(--n-line); font-size: 13px; }
.team .sect { margin-top: 0; color: var(--n-muted); }
.team .t-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.team .s { color: var(--n-accent); font-size: 12px; letter-spacing: .06em; }
.team .s.fired { color: var(--n-danger); }
.team .s.rewarded, .team .s.promoted { color: var(--n-warn); }
.about { padding: 24px 22px; color: var(--n-muted); max-width: 60ch; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; top: 46px; right: 12px; width: min(340px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; z-index: 30; pointer-events: none; }
/* The rail sits over the open window. Below about 1400px a full-width rail
   covers the top of the NARC case, which is where the assessment now is, so it
   narrows to leave that readable. Phones get their own full-width rule below. */
@media (min-width: 761px) and (max-width: 1399px) {
  .toasts { width: 240px; }
  /* The company response is right-aligned, which puts it under the rail at
     these widths. Stacked and left-aligned, it stays readable. */
  .company-action { flex-direction: column; align-items: flex-start; gap: 4px; }
  .company-action b { text-align: left; }
}
/* Reserve the rail's width in the case column so every line in it -- title
   included -- wraps before the notifications rather than under them. */
@media (min-width: 901px) and (max-width: 1399px) {
  .narc-main .detail { padding-right: 252px; }
}
/* Too narrow to reserve a rail without squeezing the case to nothing, so the
   rail itself gets out of the way as much as it can. */
@media (min-width: 761px) and (max-width: 900px) {
  .toasts { width: 200px; }
}
.toast {
  pointer-events: auto; display: block; text-align: left; width: 100%; position: relative;
  padding: 10px 34px 10px 12px; border-radius: 10px; border: 1px solid #cfd7de; background: #fff; color: var(--app-text);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
}
.toast.enter { animation: slidein .25s ease-out; }
.toast.leaving { opacity: 0; transform: translateX(16px); transition: .3s; }
.toast .app { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--app-muted); }
.toast b { display: block; }
.toast span.text { display: block; font-size: 13px; color: var(--app-muted); overflow-wrap: anywhere; }
.toast.narc { background: var(--n-bg); border-color: #4a5a3c; color: var(--n-text); font-family: var(--mono); }
.toast.narc .app { color: var(--n-accent); }
.toast.narc span.text { color: var(--n-muted); }
.toast .open { all: unset; display: block; cursor: pointer; width: 100%; }
.toast .open:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 4px; border-radius: 4px; }
.toast.narc .open:focus-visible { outline-color: var(--n-accent); }
.toast .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 12px; background: transparent; color: inherit; opacity: .6; font-size: 16px; line-height: 1; }
.toast .x:hover { opacity: 1; background: rgba(128, 128, 128, .2); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }

/* --------------------------------------------------- end-of-week report */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px 16px; background: rgba(4, 8, 11, .72); overflow-y: auto; }
.report { width: min(680px, 100%); background: var(--n-bg); color: var(--n-text); border: 1px solid var(--n-line); font-family: var(--mono); padding: 20px 20px 24px; margin-bottom: 24px; }
.report h1 { margin: 0 0 2px; font-size: 24px; }
.report .eyebrow { color: var(--n-muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.report .sect { color: var(--n-muted); margin-top: 20px; }
.person { border: 1px solid var(--n-line); padding: 12px; background: #101210; margin-bottom: 8px; }
.person .head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.person h3 { margin: 0; font-size: 16px; }
.person .small { color: var(--n-muted); font-size: 13px; }
.person .status { font-size: 12px; letter-spacing: .1em; color: var(--n-accent); }
.person .status.fired { color: var(--n-danger); }
.person .status.rewarded, .person .status.promoted { color: var(--n-warn); }
.person p { margin: 6px 0 0; }
.sig { display: grid; grid-template-columns: 5rem 1fr; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #252a25; }
.sig .tag { color: var(--n-danger); font-size: 12px; letter-spacing: .08em; padding-top: 2px; }
.ach { display: grid; gap: 8px; }
.ach-item { border: 1px solid var(--n-line); padding: 10px 12px; background: #101210; }
.ach-item.earned { border-color: var(--n-accent); }
.ach-item .name { font-weight: 700; }
.ach-item.locked .name { color: var(--n-muted); }
.ach-item .desc { color: var(--n-muted); font-size: 13px; }
.report .actions { margin-top: 20px; }

/* ------------------------------------------- desktop shell refinement */
@media (min-width: 761px) {
  .stage { flex-direction: column-reverse; }

  .dock {
    width: auto;
    height: 72px;
    min-height: 72px;
    padding: 7px 12px 10px;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    background: rgba(8, 14, 19, .5);
    border-top: 1px solid rgba(255, 255, 255, .08);
  }

  .dock button {
    width: 64px;
    min-height: 52px;
    padding: 5px 4px 4px;
  }

  .dock button.narc {
    margin-top: 0;
    margin-left: 12px;
  }

  .dock button.narc::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(255, 255, 255, .18);
  }

  .dock .mark { top: 2px; right: 9px; }

  .workarea {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    padding: 18px 24px 14px;
  }

  .window {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px)));
    width: min(88%, 1080px);
    height: min(760px, 88%);
    max-height: 100%;
  }

  .window.app-intranet { width: min(90%, 1120px); }
  .window.app-email { width: min(86%, 1040px); height: min(720px, 84%); }
  .window.app-messages { width: min(78%, 920px); height: min(680px, 82%); }
  .window.app-calendar { width: min(74%, 820px); height: min(650px, 80%); }
  .window.app-files { width: min(82%, 960px); height: min(700px, 82%); }
  .window.app-utilities { width: min(80%, 900px); height: min(680px, 80%); }
  .window.app-browser { width: min(82%, 960px); height: min(700px, 82%); }
  .window.app-narc { width: min(82%, 980px); height: min(690px, 82%); }
}

/* --------------------------------------------------------------- narrow */
@media (max-width: 760px) {
  .stage { flex-direction: column-reverse; }
  .dock { width: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; gap: 0; }
  .dock button { flex: 1; padding: 6px 0 4px; font-size: 10px; }
  .dock button.narc { margin-top: 0; }
  .dock svg { width: 22px; height: 22px; }
  .badge { right: 50%; margin-right: -22px; top: 0; }
  .workarea { padding: 0; }
  .window-stack { width: 100%; height: 100%; }
  .window { position: relative; inset: auto; transform: none !important; width: 100%; height: 100%; border-radius: 0; box-shadow: none; border: 0; }
  .menubar .who, .menubar .co-rest { display: none; }
  .body .list, .narc-main .list { width: 100%; flex: 1; border-right: 0; }
  .body .detail { display: none; padding: 16px; }
  .window.show-detail .body .list, .window.show-detail .narc-main .list { display: none; }
  .window.show-detail .body .detail { display: block; flex: 1; }
  .window.show-detail .body .detail.flush { display: flex; }
  .window.show-detail .titlebar .back { display: inline-block; }
  .thread .scroll { padding: 14px; }
  .thread header { padding: 8px 14px; }
  .cards, .pane { padding: 14px; }
  .toasts { top: 42px; right: 12px; left: 12px; width: auto; }
  .event { grid-template-columns: 1fr; gap: 2px; }
  .sig { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .tray.action .dot, .toast.enter { animation: none; }
}

/* ---------------------------------------- attention, marks, persistent toasts */
.badge.action { background: var(--n-warn); color: #1a1405; }
.dock .mark { position: absolute; top: 6px; right: 18px; width: 10px; height: 10px; border-radius: 50%; background: #4aa3ff; border: 2px solid #12202b; }
.tabdot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #4aa3ff; vertical-align: middle; }
.acked { color: #2c8558; font-weight: 600; }

.narc-main .sect-h { padding: 8px 14px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--n-muted); background: #0e110e; border-bottom: 1px solid var(--n-line); }
.narc-main .sect-h.need { color: var(--n-warn); }
.narc-main .none { padding: 10px 14px; color: var(--n-muted); font-size: 13px; border-bottom: 1px solid var(--n-line); }
.narc-main .row { font-weight: 400; }
.narc-main .row.active { border-left: 3px solid var(--n-warn); background: #16150c; }
.narc-main .row.active .name { font-weight: 700; }
.narc-main .row .pill { background: var(--n-warn); }
.narc-main .row.closed, .narc-main .row:not(.active) { opacity: .85; }
.narc-main .row:not(.active) .name { color: var(--n-muted); }

.toasts .more { pointer-events: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 8px; background: rgba(12, 18, 24, .92); color: var(--bar-text); font-size: 12px; }
.toasts .more .clear { border: 0; background: none; color: #8fc4ff; text-decoration: underline; padding: 0; }
.toast .cta { display: block; margin-top: 4px; font-size: 12px; color: var(--n-accent); }
.toast.narc.enhanced { border-color: #8a6f2a; }
.toast.narc.enhanced .app { color: var(--n-warn); }

.dialog { width: min(420px, 100%); margin-top: 20vh; background: #fff; color: var(--app-text); border-radius: 12px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.dialog h2 { margin: 0 0 8px; font-size: 18px; }
.dialog p { margin: 0 0 8px; }
.dialog .ctl { grid-template-columns: 1fr 1fr; }
.dialog .nbtn { color: var(--app-text); background: #fff; border-color: #b8c3ce; text-align: center; }
.dialog .nbtn:hover { border-color: var(--app-accent); }
.dialog .nbtn.dismiss { color: #a33a3a; }

.row .top .pill { flex: none; }
.row .top .name { min-width: 0; overflow-wrap: anywhere; }

#trayText .short { display: none; }
@media (max-width: 760px) {
  #trayText .full { display: none; }
  #trayText .short { display: inline; }
  .menubar { padding: 0 8px; gap: 6px; }
  .menubar .right { gap: 8px; }
  .menubar .company { font-size: 11px; letter-spacing: .1em; }
  .menubar .clock { font-size: 12px; }
  .logoff { padding: 2px 8px; font-size: 11px; }
  .tray { padding: 2px 6px; font-size: 10px; letter-spacing: .04em; }
}

/* ------------------------------------------ team alerts, focus time, files */
.tray.teamalert { color: var(--n-info); border-color: #4a6a8a; background: rgba(154, 191, 232, .08); }
.tray.teamalert .dot { animation: pulse 2.4s ease-in-out infinite; }
.badge.team { background: #4a82c2; color: #fff; }
.narc-main .row.teamrow { border-left: 3px solid #4a6a8a; background: #0f141a; }
.narc-main .row.teamrow .name { color: var(--n-text); font-weight: 600; }
.narc-main .row .pill.team { background: #4a82c2; color: #fff; }
.viewonly { margin-top: 16px; padding: 10px 12px; border: 1px dashed #4a6a8a; color: var(--n-info); font-size: 13px; }
.showrow { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.showas { padding: 1px 8px; border-radius: 10px; background: #e4e9ee; color: var(--app-muted); }
.showas.is-focus { background: #dff2e7; color: #2c8558; font-weight: 600; }
.showbtn { border: 1px solid #b8c3ce; background: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12px; }
.showbtn:hover { border-color: var(--app-accent); color: var(--app-accent); }
.event.focus { border-left-color: #3aa76d; }
.file-body .btn { margin-top: 12px; }

/* ------------------------------------- NARC changes its mind, where you see it */
.narcnote { margin-top: 8px; display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; background: #0c0d0c; color: var(--n-text); border-left: 3px solid var(--n-accent); font: 12px/1.5 var(--mono); border-radius: 2px; animation: noteIn .35s ease-out; }
.narcnote .tag { color: var(--n-accent); font-weight: 700; letter-spacing: .08em; }
.narcnote.good { border-left-color: var(--n-good); }
.narcnote.bad { border-left-color: var(--n-danger); }
.narcnote.flat { border-left-color: var(--n-muted); color: var(--n-muted); }
.bubble.narc { align-self: stretch; max-width: none; background: #0c0d0c; color: var(--n-text); font: 12px/1.5 var(--mono); border-left: 3px solid var(--n-accent); border-radius: 2px; animation: noteIn .35s ease-out; }
.bubble.narc .tag { color: var(--n-accent); font-weight: 700; letter-spacing: .08em; margin-right: 8px; }
.model-box.updated { border-color: var(--n-accent); animation: noteIn .35s ease-out; }
.updated-tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--n-accent); margin-bottom: 4px; }
.model-box .was { color: var(--n-muted); font-size: 12px; text-decoration: line-through; }
.reaction-line { margin-top: 8px; font-size: 13px; color: var(--n-muted); }
.context-facts .val { display: inline-flex; gap: 8px; align-items: baseline; }
.context-facts .was { color: var(--n-muted); font-weight: 400; text-decoration: line-through; }
.num.up { color: var(--n-good); }
.num.down { color: var(--n-danger); }
.num { transition: color 1.6s ease-out; }
@keyframes noteIn { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .narcnote, .bubble.narc, .model-box.updated { animation: none; } }

/* The one moment in the game where NARC catches something the player did and
   revises a prior belief. Same update grammar as everywhere else, sized up:
   reuses --n-warn (already the "something needs attention" color) rather
   than introducing a new one. */
.big-reveal {
  font: 700 12px/1.4 var(--mono); letter-spacing: .14em; color: var(--n-warn);
  margin-bottom: 8px;
}
.model-box.big {
  border-color: var(--n-warn);
  padding: 18px 20px;
  animation: bigReveal .5s ease-out;
}
.model-box.big .assessment { font-size: 22px; }
.model-box.big .updated-tag { color: var(--n-warn); font-size: 12px; }
@keyframes bigReveal { from { opacity: 0; transform: scale(.97); } }

.toast.big { border-color: var(--n-warn); box-shadow: 0 0 0 1px rgba(239, 196, 108, .3); }
.toast.big .bigflag { display: block; font: 700 10px/1.4 var(--mono); letter-spacing: .12em; color: var(--n-warn); margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) { .model-box.big { animation: none; } }

/* The post-report debrief: what this run demonstrated, named for a reviewer
   rather than left to be inferred. Same card language as achievements. */
.debrief { display: grid; gap: 8px; }
.debrief-item { border: 1px solid var(--n-line); border-left: 3px solid var(--n-accent); padding: 10px 12px; background: #101210; }
.debrief-item .name { font-weight: 700; margin-bottom: 3px; }
.debrief-item p { margin: 0; color: var(--n-muted); font-size: 13px; line-height: 1.5; }

/* A short reason a dock dot appeared, shown once when the app is opened. */
.hint-banner {
  margin: 0 0 8px; padding: 8px 12px; background: var(--app-accent-bg); color: var(--app-accent);
  font-size: 13px; border-radius: 6px; border-left: 3px solid var(--app-accent);
}

/* The Loop: a small, static company feed to sit in between incidents. */
.intranet-list { padding: 18px 22px; overflow-y: auto; display: grid; gap: 10px; max-width: 62ch; }
.intranet-post { border: 1px solid var(--app-line); border-radius: 8px; padding: 10px 14px; background: var(--app-panel); }
.intranet-from { font-size: 12px; font-weight: 700; color: var(--app-muted); letter-spacing: .02em; margin-bottom: 4px; }
.intranet-post p { margin: 0; font-size: 14px; line-height: 1.5; }


/* #51 final company-laptop pass */
.desk::before {
  content: "MERIDIAN";
  position: fixed; right: 34px; bottom: 92px; z-index: 0;
  font-weight: 800; font-size: clamp(48px, 8vw, 110px); letter-spacing: .16em;
  color: rgba(248,236,215,.07); pointer-events: none;
}
.workarea, .dock, .menubar { position: relative; z-index: 1; }

.app-intranet { --app-accent: #3f675d; --app-accent-bg: #e8f0ed; }
.app-intranet .titlebar { background: #f0eee7; border-color: #d8d3c8; }
.loop-home { background: #f5f3ed; }
.intranet-list { flex: 1; max-width: none; padding: 20px 24px; }
.loop-welcome { padding: 18px 20px; border-radius: 8px; background: #244b43; color: #f5f3ed; margin-bottom: 6px; }
.loop-welcome h2 { margin: 2px 0 4px; font-size: 26px; }
.loop-welcome p { margin: 0; opacity: .84; }
.loop-kicker { font-size: 10px; font-weight: 800; letter-spacing: .16em; opacity: .7; }
.loop-side { width: 34%; min-width: 250px; max-width: 360px; padding: 20px 20px 20px 0; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.loop-card { background: #fff; border: 1px solid #d8d3c8; border-radius: 8px; padding: 12px; }
.loop-card-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: #667068; margin-bottom: 8px; }
.loop-event { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid #ece8df; font-size: 13px; }
.loop-event:first-of-type { border-top: 0; }
.loop-event b { font-variant-numeric: tabular-nums; }
.loop-muted { color: #6e756f; font-size: 12px; margin: 4px 0; }
.employee-line { display: flex; gap: 10px; align-items: center; }
.employee-line p { margin: 2px 0 0; }
.employee-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #dfe9e5; color: #244b43; font-weight: 800; }
.loop-link { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid #ece8df; background: transparent; padding: 7px 2px; color: #315f55; }
.loop-link:first-of-type { border-top: 0; }
.loop-link:hover { text-decoration: underline; }
.loop-card.nonsense { background: #fff8dc; border-color: #ddd09d; }

.app-email .list { background: #f7f8fa; }
.app-email .titlebar { background: #eef2f5; }
.app-messages .titlebar { background: #eaf3ef; }
.app-messages .list { background: #f2f7f5; width: 270px; }
.app-messages .detail { background: #fbfdfc; }
.app-calendar .titlebar { background: #f3eef8; }
.app-calendar .pane { background-image: linear-gradient(to bottom, transparent 47px, #ece7f1 48px); background-size: 100% 48px; }
.app-files .titlebar { background: #f6f1e7; }
.app-files .list { background: #faf7f0; width: 260px; }
.app-files .row .name::before { content: "▱ "; color: #9a7d4d; }
.app-utilities .titlebar { background: #edf0f1; }
.app-utilities .cards { background: #eef1f2; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.app-utilities .card { border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.015); }
.app-browser { --app-accent: #7b4b72; --app-accent-bg: #f2e9f0; }
.app-browser .titlebar { background: #f0e7ef; }
.app-browser .list { width: 310px; background: #fbf8fb; }
.browser-list .row { padding: 12px 14px; }
.browser-source { color: #8a5b80; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 3px; }
.browser-dek { white-space: normal !important; line-height: 1.35; margin-top: 3px; }
.browser-page { background: #fffdf9; }
.browser-page h2 { max-width: 24ch; font-size: 27px; line-height: 1.12; margin: 6px 0 10px; font-family: Georgia, "Times New Roman", serif; }
.browser-page p { max-width: 62ch; }
.browser-lede { color: var(--app-muted); font-size: 17px; line-height: 1.45; margin-bottom: 20px; }
.browser-home-kicker { color: #7b4b72; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.browser-home-copy { color: var(--app-muted); max-width: 54ch; }
.browser-feature { margin-top: 24px; padding: 18px; border: 1px solid #e0d4dc; border-radius: 10px; background: #fff; max-width: 640px; }
.browser-feature h3 { margin: 4px 0 8px; font: 700 23px/1.2 Georgia, "Times New Roman", serif; }

.narc-body { flex-direction: column; background: var(--n-bg); color: var(--n-text); font-family: var(--mono); }
.narc-top { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 8px; border-bottom: 1px solid var(--n-line); }
.narc-top .brand { display: inline-flex; gap: 9px; align-items: center; font-weight: 800; letter-spacing: .08em; }
.narc-top .ai-label { color: var(--n-accent); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.narc-eyes { display: inline-flex; align-items: center; gap: 2px; }
.narc-eyes i { position: relative; width: 12px; height: 15px; border-radius: 50%; background: #f0f2e7; border: 1px solid #65705f; }
.narc-eyes i::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #101310; left: 4px; top: 6px; }
.narc-primary-tabs { flex: none; display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--n-line); background: #0f110f; }
.narc-tab { border: 1px solid var(--n-line); background: #111411; color: var(--n-muted); border-radius: 999px; padding: 6px 12px; font: 700 11px/1.3 var(--mono); }
.narc-tab[aria-pressed="true"] { color: #10140a; border-color: var(--n-accent); background: var(--n-accent); }
.narc-main { flex: 1; min-height: 0; display: flex; }
.narc-main .list { width: 250px; background: var(--n-panel); border-color: var(--n-line); }
.narc-list-heading { padding: 10px 14px 7px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--n-muted); border-bottom: 1px solid var(--n-line); }
.person-row { width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; border: 0; border-bottom: 1px solid var(--n-line); background: transparent; color: var(--n-text); padding: 14px; }
.person-row:hover, .person-row.selected { background: #191d19; }
.person-name { font-size: 16px; font-weight: 800; }
.person-status { color: var(--n-muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.person-status.fired { color: var(--n-danger); }
.person-status.promoted, .person-status.rewarded { color: var(--n-warn); }
.narc-main .detail { padding: 20px 24px; }
.narc-main .case { max-width: 680px; }
.case-person { font-size: 21px; line-height: 1.2; font-weight: 800; color: var(--n-text); margin-bottom: 3px; }
.case-title { color: var(--n-muted); font-size: 13px !important; font-weight: 500; margin-bottom: 14px !important; }
.my-narc { border-bottom: 1px solid var(--n-line); padding-bottom: 18px; margin-bottom: 18px; max-width: 680px; }
.my-status { display: inline-block; margin-top: 7px; padding: 5px 9px; border: 1px solid #4d574d; background: #171b17; color: var(--n-accent); font-size: 12px; }
.my-facts { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.my-facts > div { border: 1px solid var(--n-line); background: #111411; padding: 8px 10px; }
.my-facts span { display: block; color: var(--n-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.my-facts b { display: block; margin-top: 2px; font-size: 18px; color: var(--n-text); }
.narc-compact-note { color: var(--n-muted); font-size: 12px; }
.narc-main .sect { margin-top: 14px; }
.narc-change { margin-top: 10px; padding: 8px 10px; border-left: 2px solid var(--n-accent); background: #111411; color: var(--n-muted); font-size: 12px; line-height: 1.45; }
.model-box .was.compact { margin-top: 5px; text-decoration: none; }
.company-action { margin-top: 14px; }

@media (max-width: 760px) {
  .loop-home { display: block; overflow-y: auto; }
  .loop-side { width: auto; max-width: none; padding: 0 20px 20px; }
  .intranet-list { overflow: visible; }
  .my-facts { grid-template-columns: 1fr; }
  .narc-primary-tabs { overflow-x: auto; }
  .browser-page h2 { font-size: 23px; }
}


/* ============================================================
   Sept 24 final feedback pass
   A designed Meridian desktop, distinct work apps, and a much
   simpler NARC. These rules intentionally supersede earlier
   shell experiments above.
   ============================================================ */

/* -- authored wallpaper ------------------------------------------------ */
.desk {
  background:
    radial-gradient(circle at 18% 20%, rgba(243, 190, 108, .12) 0 9%, transparent 9.5%),
    radial-gradient(circle at 78% 74%, rgba(190, 92, 105, .14) 0 14%, transparent 14.5%),
    linear-gradient(132deg, #153b48 0%, #1d5360 35%, #294d68 68%, #473f68 100%);
}
.desk::before,
.desk::after { content: none; }

.wallpaper-art {
  position: fixed;
  inset: 38px 0 72px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.wallpaper-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.2px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,.7), transparent 68%);
  opacity: .28;
}
.wall-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  transform: rotate(-12deg);
}
.ring-a {
  width: min(48vw, 620px);
  aspect-ratio: 1;
  right: -7vw;
  top: -12vh;
  border-width: clamp(54px, 7vw, 100px);
  border-color: rgba(235, 157, 91, .22);
  box-shadow: 0 0 0 2px rgba(255,255,255,.05) inset;
}
.ring-b {
  width: min(36vw, 460px);
  aspect-ratio: 1;
  right: 18vw;
  bottom: -22vh;
  border-width: clamp(38px, 5vw, 72px);
  border-color: rgba(122, 82, 128, .30);
}
.wall-ribbon {
  position: absolute;
  display: block;
  width: 62vw;
  height: 15vh;
  border-radius: 999px;
  transform-origin: center;
  filter: saturate(.9);
}
.ribbon-a {
  left: -20vw;
  top: 54%;
  transform: rotate(-18deg);
  background: linear-gradient(90deg, rgba(72,157,151,.04), rgba(91,169,159,.22), rgba(242,179,99,.12));
}
.ribbon-b {
  left: 9vw;
  top: 70%;
  transform: rotate(13deg);
  background: linear-gradient(90deg, rgba(182,82,93,.03), rgba(182,82,93,.19), rgba(113,74,133,.18));
}
.wall-brand {
  position: absolute;
  left: 34px;
  bottom: 26px;
  color: rgba(248, 242, 229, .22);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
}
.workarea, .dock, .menubar { position: relative; z-index: 2; }

/* -- never let a desktop window lose its title bar -------------------- */
@media (min-width: 761px) {
  .window {
    max-height: calc(100% - 20px) !important;
    max-width: calc(100% - 20px);
  }
  .window.app-intranet {
    width: min(90%, 1120px);
    height: min(700px, 82%);
  }
  .window.app-utilities {
    width: min(80%, 900px);
    height: min(630px, 76%);
  }
}

/* -- distinct app identities ------------------------------------------ */
.app-intranet { --app-accent: #2e6d63; --app-accent-bg: #e5f1ed; }
.app-messages { --app-accent: #2768b2; --app-accent-bg: #e7f1fc; }
.app-email { --app-accent: #a84f45; --app-accent-bg: #faece9; }
.app-calendar { --app-accent: #7652a5; --app-accent-bg: #f0eafa; }
.app-files { --app-accent: #a36d24; --app-accent-bg: #f8f0df; }
.app-utilities { --app-accent: #3f6871; --app-accent-bg: #e8f0f1; }
.app-browser { --app-accent: #87517e; --app-accent-bg: #f3e8f0; }

.app-intranet .titlebar { background: #dcebe5; border-color: #bdd4cb; }
.app-messages .titlebar { background: #dbeafb; border-color: #bfd2e9; }
.app-email .titlebar { background: #f5dfdb; border-color: #e4c3bd; }
.app-calendar .titlebar { background: #e9e0f5; border-color: #d2c3e6; }
.app-files .titlebar { background: #f2e6cf; border-color: #deceb1; }
.app-utilities .titlebar { background: #dfe9eb; border-color: #c4d4d7; }
.app-browser .titlebar { background: #ecdfeb; border-color: #d7c2d2; }

.title-icon,
.dock-icon {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
}
.title-icon {
  width: 24px;
  height: 24px;
  color: #fff;
}
.title-icon svg { width: 15px; height: 15px; }

.title-icon-intranet, .dock-app-intranet .dock-icon { background: #347669; }
.title-icon-messages, .dock-app-messages .dock-icon { background: #377cc8; }
.title-icon-email, .dock-app-email .dock-icon { background: #bb5f52; }
.title-icon-calendar, .dock-app-calendar .dock-icon { background: #805eb0; }
.title-icon-files, .dock-app-files .dock-icon { background: #b47a2b; }
.title-icon-utilities, .dock-app-utilities .dock-icon { background: #527982; }
.title-icon-browser, .dock-app-browser .dock-icon { background: #925c88; }
.title-icon-narc, .dock-app-narc .dock-icon { background: #222b20; color: var(--n-accent); }

.dock-app .dock-icon {
  width: 36px;
  height: 36px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 2px 8px rgba(0,0,0,.18);
}
.dock-app .dock-icon svg { width: 22px; height: 22px; }
.dock-app { position: relative; }

/* Messages reads like chat, not another inbox */
.message-row {
  display: grid;
  grid-template-columns: 36px minmax(0,1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
}
.message-row-copy { min-width: 0; }
.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #55758f;
}
.avatar-dana { background: #5d6ca8; }
.avatar-luis { background: #3c7c78; }
.avatar-marcus { background: #a36b45; }
.avatar-priya { background: #8a5d8c; }
.app-messages .list { background: #f2f7fc; }
.app-messages .detail { background: #fbfdff; }
.app-messages .bubble.me { background: #2f73bd; color: #fff; }
.app-messages .bubble:not(.me):not(.system):not(.narc) { background: #e7edf4; color: #202a35; }

/* Email reads like an inbox */
.mail-row {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 8px;
  align-items: start;
}
.mail-row-copy { min-width: 0; }
.mail-row-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #f2d8d3;
  color: #9c473e;
  font-size: 13px;
}

/* Files reads like a file manager */
.file-row {
  display: grid;
  grid-template-columns: 40px minmax(0,1fr);
  gap: 10px;
  align-items: center;
}
.file-row-copy { min-width: 0; }
.file-type {
  width: 36px;
  height: 42px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d8c8a9;
  color: #9b6a27;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
}
.file-type-txt { color: #50728b; border-color: #b8cbd7; }
.file-type-xlsx { color: #3d7b55; border-color: #bdd5c4; }
.app-files .row .name::before { content: none; }

/* Utilities should look diagnostic rather than like a cut-off dashboard */
.app-utilities .cards {
  align-content: start;
  overflow-y: auto;
  padding-top: 18px;
}
.app-utilities .card {
  border-top: 4px solid #718f96;
  border-radius: 8px;
}
.app-utilities .card.sketchy { border-top-color: #ba754f; }
.app-utilities .card.feed { border-top-color: #6687ac; }

/* -- simpler NARC ----------------------------------------------------- */
.narc-primary-tabs {
  padding: 8px 12px;
  gap: 5px;
}
.narc-tab {
  border-radius: 5px;
  padding: 6px 10px;
}
.narc-main .list { width: 220px; }
.narc-main .detail { padding: 22px 26px; }
.person-row { padding: 13px 14px; gap: 2px; }
.person-name { font-size: 17px; }
.person-status {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: none;
  line-height: 1.3;
}
.narc-empty-person { max-width: 560px; }
.narc-empty-status {
  display: inline-block;
  margin-top: 7px;
  padding: 5px 8px;
  border: 1px solid var(--n-line);
  color: var(--n-accent);
  background: #131713;
  font-size: 12px;
}
.narc-empty-person p { color: var(--n-muted); max-width: 52ch; }
.narc-main .case { max-width: 620px; }
.narc-main .case-title {
  margin-bottom: 10px !important;
  opacity: .72;
}
.narc-main .model-box {
  padding: 12px 14px;
  border-radius: 4px;
}
.narc-main .assessment { font-size: 17px; }
.narc-main .conf { font-size: 12px; margin-top: 3px; }
.narc-main .sect { margin-top: 12px; }
.narc-main ul { margin-top: 6px; padding-left: 18px; }
.narc-main li { margin-bottom: 4px; }
.narc-change { font-size: 11px; padding: 7px 9px; }
.my-narc, .my-facts, .my-status { display: none !important; }

/* -- readable notification history ----------------------------------- */
.toasts .more {
  align-items: center;
}
.toasts .more .show-earlier,
.toasts .more .clear {
  border: 0;
  background: none;
  padding: 2px 0;
  font-size: 12px;
}
.toasts .more .show-earlier {
  color: #f0f4f7;
  font-weight: 700;
  text-align: left;
}
.toasts .more .show-earlier:hover,
.toasts .more .clear:hover { text-decoration: underline; }
.toasts .more .clear { color: #9ecbff; }

/* -- tutorial marks should look deliberate on the dock --------------- */
.dock .mark {
  background: #ffd179;
  box-shadow: 0 0 0 2px #182733;
}

/* -- narrow layouts keep the personality without the overlap ---------- */
@media (max-width: 760px) {
  .wallpaper-art { display: none; }
  .title-icon { width: 22px; height: 22px; }
  .dock-app .dock-icon { width: 28px; height: 28px; border-radius: 7px; }
  .dock-app .dock-icon svg { width: 18px; height: 18px; }
  .narc-main .list { width: 100%; }
}

.loop-pulse { background: #f4f8f6; border-color: #c9d8d1; }
.loop-pulse-line {
  padding: 6px 0;
  border-top: 1px solid #dde7e2;
  font-size: 12px;
  line-height: 1.35;
}
.loop-pulse-line:first-of-type { border-top: 0; }


/* ============================================================
   Sept 24 QA follow-up: clearer calendar state, cleaner windows,
   and a browser that reads like an actual browser.
   ============================================================ */

.titlebar .lights { display: none !important; }

.browser-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f4f0f4;
}
.browser-toolbar {
  flex: none;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-bottom: 1px solid #d7cbd4;
  background: #ede6ec;
}
.browser-nav {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #cabcc6;
  border-radius: 7px;
  background: #faf7fa;
  color: #5e4c59;
  font-size: 16px;
  line-height: 1;
}
.browser-nav:hover { background: #fff; border-color: #a88c9f; }
.browser-address {
  flex: 1;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #cfc2ca;
  border-radius: 8px;
  background: #fff;
  color: #62535e;
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.browser-lock { color: #6d8b72; font-size: 10px; }
.browser-body { flex: 1; min-height: 0; }
.browser-list {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.browser-page { overflow-y: auto; }

@media (max-width: 760px) {
  .browser-toolbar { padding: 5px 8px; }
  .browser-address { font-size: 11px; }
}
