/* Harbour Hotel operations portal prototype. Desktop-first staff app.
   > 900px: left rail + content. <= 900px: a top bar with a compact menu.
   html.bare: no demo chrome, so no room is kept for the back link and chip. */

:root {
  --rail-w: 252px;
  --card: #FFFFFF;
  --line: rgba(10, 42, 94, .09);
  --line-2: rgba(10, 42, 94, .16);
  --ink-2: #2A3550;
  --ink-3: #46526A;
  --good: #0B7F92;
  --good-soft: rgba(30, 200, 224, .13);
  --bad: #A12A40;
  --bad-soft: #FDEEF1;
  --bad-line: #E7A0AE;
  --warn: #8A6400;
  --warn-soft: #FFF3D1;
  --warn-line: #E9C46A;
  --radius: 16px;
  --arabic: 'Geist', system-ui, 'Segoe UI', 'Noto Naskh Arabic', 'Geeza Pro', sans-serif;
  --chrome-top: 68px;    /* room for the fixed back link */
  --chrome-bottom: 68px; /* room for the fixed demo chip */
}
html.bare { --chrome-top: 0px; --chrome-bottom: 0px; }

html { scroll-padding-top: 24px; }
body { font-size: 14px; line-height: 1.45; min-height: 100vh; }
.noscript { position: fixed; inset: auto 16px 50% 16px; margin: 0 auto; max-width: 420px; padding: 16px; border-radius: 14px; background: var(--card); color: var(--heading); text-align: center; font-weight: 500; z-index: 5; box-shadow: 0 0 0 1px var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.faint { color: #8892A6; }
.r { text-align: right; }
h1, h2, h3, h4 { margin: 0; }

:where(a, button, select, [tabindex]):focus-visible { outline: 2.5px solid var(--accent-ink); outline-offset: 2px; }
:where(h1, .req-card)[tabindex="-1"]:focus { outline: none; }
.req-card[tabindex="-1"]:focus-visible { outline: 2.5px solid var(--accent-ink); outline-offset: 2px; }

.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: calc(14px + var(--chrome-top)) 14px calc(14px + var(--chrome-bottom));
  background: var(--card); border-right: 1px solid var(--line);
}
.rail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; text-decoration: none; border-radius: 12px; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; color: var(--heading); }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.menu-btn { display: none; }

.rail-nav { display: grid; gap: 3px; }
.rail-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: 11px; color: var(--ink-3); font-weight: 500; font-size: 14.5px; text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.rail-nav a svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail-nav a[aria-current="page"] { background: var(--surface-2); color: var(--heading); font-weight: 600; }
.rail-nav a[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan); }
.rail-nav a[aria-current="page"] svg { color: var(--accent-ink); }
@media (hover: hover) { .rail-nav a:not([aria-current="page"]):hover { background: #F5F7FA; color: var(--heading); } }
.nav-count { margin-left: auto; min-width: 24px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.rail-nav a[aria-current="page"] .nav-count { background: var(--navy); color: #fff; }
.nav-count:empty { display: none; }

.rail-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--bg); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; background: var(--surface-2); color: var(--heading); }
.who { display: grid; line-height: 1.25; font-size: 12px; color: var(--muted); }
.who b { color: var(--heading); font-size: 13px; font-weight: 600; }

.main { min-width: 0; padding: 26px 32px 56px; }
html:not(.bare) .main { padding-bottom: 88px; }
.view { max-width: 1440px; margin: 0 auto; display: grid; gap: 18px; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 4px; }
.page-head h1 { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; color: var(--heading); }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.ph-side { display: flex; align-items: center; gap: 10px; flex: none; }
.date-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--heading); font-weight: 500; font-size: 13px; white-space: nowrap; }
.date-pill .ic { color: var(--accent-ink); }
.tag { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--warn); background: var(--warn-soft); white-space: nowrap; }

/* ---------- panels, stats, chips, buttons ---------- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(6, 28, 64, .03); padding: 18px 20px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-h h2 { font-family: var(--font-body); font-weight: 600; font-size: 15.5px; letter-spacing: -.005em; color: var(--heading); }
.panel-h span, .panel-h > div > span { font-size: 12.5px; color: var(--muted); }
.panel-h > div:not(.seg) { display: grid; gap: 2px; }
.panel-h { min-height: 40px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: grid; gap: 6px; align-content: start; padding: 16px 18px; text-decoration: none; color: inherit; transition: box-shadow .2s var(--ease), transform .16s var(--ease); }
.stat-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-l .ic { color: var(--accent-ink); opacity: .7; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.stat-v { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat-v small { margin-left: 6px; font-family: var(--font-body); font-weight: 500; font-size: 13.5px; color: var(--muted); letter-spacing: 0; }
.stat-n { font-size: 12.5px; color: var(--muted); }
.stat-n.good { color: var(--good); } .stat-n.bad { color: var(--bad); } .stat-n.warn { color: var(--warn); }
@media (hover: hover) {
  .stat.is-link:hover { box-shadow: 0 0 0 1px var(--line-2), 0 14px 28px -20px rgba(6, 28, 64, .35); }
  .stat.is-link:hover .stat-l .ic { transform: translateX(2px); opacity: 1; }
}
.stat.is-link:active { transform: scale(.99); }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--cyan); transition: width .5s var(--ease); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--ink-3); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.navy { background: var(--navy); color: #fff; }
.chip.navy-soft { background: rgba(10, 42, 94, .08); color: var(--heading); }
.chip.cyan { background: var(--good-soft); color: var(--good); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), transform .16s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn.solid { background: var(--btn-bg); color: #fff; }
.btn.solid.cyan { background: var(--cyan); color: var(--deep); }
.btn.ghost { background: var(--card); color: var(--heading); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.wide { grid-column: 1 / -1; }
@media (hover: hover) {
  .btn.solid:hover { background: var(--btn-bg-hover); }
  .btn.solid.cyan:hover { background: #3ED3E8; }
  .btn.ghost:hover { box-shadow: inset 0 0 0 1px rgba(10, 42, 94, .34); }
}
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px; color: var(--accent-ink); font-weight: 500; font-size: 13px; text-decoration: none; border-radius: 8px; }
.text-link .ic { width: 14px; height: 14px; transition: transform .2s var(--ease); }
@media (hover: hover) { .text-link:hover .ic { transform: translateX(2px); } }

.select { position: relative; }
.select::after { content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.select select {
  appearance: none; width: 100%; min-height: 40px; padding: 0 34px 0 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: inherit; font-size: 13.5px;
}

.select.is-invalid select { box-shadow: inset 0 0 0 1.5px var(--warn-line); background: #FFFBEF; }
.field-label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
.flag { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: #5E4500; font-size: 13px; }
.flag .ic { margin-top: 1px; color: var(--warn); }
.empty { margin: 0; padding: 18px; border-radius: 12px; background: var(--bg); color: var(--muted); text-align: center; font-size: 13px; list-style: none; }
.foot-note { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.room-badge { display: inline-grid; place-items: center; min-width: 46px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.warn-text { color: var(--warn); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0 12px; height: 46px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table thead th { height: 34px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.table tbody th { font-weight: 600; color: var(--heading); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table td.note { white-space: normal; color: var(--ink-3); font-size: 13px; }
.table td.num { color: var(--heading); font-weight: 500; }
.room-link { display: inline-grid; place-items: center; min-width: 46px; height: 28px; padding: 0 8px; border-radius: 8px; background: var(--surface-2); color: var(--heading); font-weight: 600; font-size: 12.5px; text-decoration: none; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .room-link:hover { background: rgba(30, 200, 224, .18); } }

/* ---------- Today ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.mini-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.mini-req { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mini-req:first-child { border-top: 0; padding-top: 0; }
.mr-text { display: grid; line-height: 1.3; min-width: 0; }
.mr-text b { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-text > span { font-size: 12px; color: var(--muted); }
.room-bar { display: flex; height: 12px; gap: 3px; border-radius: 6px; overflow: hidden; }
.room-bar i { display: block; height: 100%; transition: width .5s var(--ease); }
.room-bar i:first-child { border-radius: 6px 0 0 6px; } .room-bar i:last-child { border-radius: 0 6px 6px 0; }
.rb-inspected, .sw-inspected { background: var(--cyan); }
.rb-clean, .sw-clean { background: var(--warn-line); }
.rb-dirty, .sw-dirty { background: var(--bad-line); }
.room-legend { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-3); }
.room-legend li { display: flex; align-items: center; gap: 10px; }
.room-legend b { margin-left: auto; color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.duty { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.duty li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--ink-3); }
.duty b { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--heading); }

/* ---------- Guest requests ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { display: grid; gap: 12px; padding: 14px; border-radius: 18px; background: rgba(10, 42, 94, .035); box-shadow: inset 0 0 0 1px var(--line); }
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.col-h h2 { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 600; color: var(--heading); }
.col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--navy); }
.col-in-progress .col-dot { background: var(--cyan); }
.col-done .col-dot { background: #9AA6BC; }
.count { min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-align: center; font-size: 12.5px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.col-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.req-card { padding: 14px 16px 16px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 6px 16px -12px rgba(6, 28, 64, .25); }
.req-card.is-moved, .tile.is-moved { animation: card-in .35s var(--ease); }
.req-card.status-in-progress { box-shadow: 0 0 0 1px var(--line), inset 3px 0 0 var(--cyan), 0 6px 16px -12px rgba(6, 28, 64, .25); }
.req-card.status-done { background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px var(--line); }
.req-card.status-done h3 { color: var(--ink-3); }
.rc-top { display: flex; align-items: center; gap: 10px; }
.rc-top .chip { margin-left: auto; }
.rc-floor { font-size: 12px; color: var(--muted); }
.req-card h3 { margin: 10px 0 14px; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--heading); }
.rc-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.done-by { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; color: var(--good); font-weight: 500; }
@keyframes card-in { from { opacity: .4; transform: translateY(4px); } }

/* ---------- Housekeeping ---------- */
.hk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-3); }
.legend-inline li { display: inline-flex; align-items: center; gap: 7px; }
.legend-inline b { color: var(--heading); font-weight: 600; }
.floors { display: grid; gap: 12px; }
.floor { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.floor-l { display: grid; place-content: center; text-align: center; border-radius: 12px; background: var(--bg); font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--heading); line-height: 1; }
.floor-l small { display: block; margin-top: 4px; font-family: var(--font-body); font-weight: 500; font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tile {
  position: relative; display: grid; align-content: start; gap: 4px; min-height: 96px; padding: 11px 12px; text-align: left;
  border: 0; border-radius: 13px; cursor: pointer; font: inherit; color: var(--ink);
  transition: box-shadow .2s var(--ease), transform .16s var(--ease), background-color .3s var(--ease);
}
.tile:active { transform: scale(.97); }
.tile.st-dirty { background: var(--bad-soft); box-shadow: inset 0 0 0 1px rgba(161, 42, 64, .14); }
.tile.st-clean { background: var(--warn-soft); box-shadow: inset 0 0 0 1px rgba(138, 100, 0, .14); }
.tile.st-inspected { background: #E3F7FA; box-shadow: inset 0 0 0 1px rgba(11, 127, 146, .16); }
.tile.is-selected { box-shadow: inset 0 0 0 2px var(--navy), 0 10px 22px -14px rgba(6, 28, 64, .5); }
@media (hover: hover) { .tile:not(.is-selected):hover { box-shadow: inset 0 0 0 1.5px rgba(10, 42, 94, .4); } }
.t-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.t-num { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--heading); font-variant-numeric: tabular-nums; }
.t-att { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--heading); font-size: 10px; font-weight: 600; box-shadow: 0 0 0 1px var(--line-2); }
.t-state { font-size: 12px; font-weight: 600; }
.st-dirty .t-state { color: var(--bad); } .st-clean .t-state { color: var(--warn); } .st-inspected .t-state { color: var(--good); }
.t-arr { margin-top: auto; font-size: 11.5px; color: var(--ink-3); }

.room-panel { position: sticky; top: 24px; display: grid; gap: 16px; padding: 20px; }
.rp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0 0 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.rp-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; color: var(--heading); }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; }
.stepper li { position: relative; display: grid; justify-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); text-align: center; }
.stepper li::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--surface-2); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.past::before, .stepper li.now::before { background: var(--cyan); }
.sdot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: inset 0 0 0 2px var(--surface-2); }
.sdot .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.stepper li.past .sdot { background: var(--cyan); color: var(--deep); box-shadow: none; }
.stepper li.now { color: var(--heading); font-weight: 600; }
.stepper li.now .sdot { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 0 4px var(--good-soft); }
.stepper li.now .sdot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.facts { display: grid; gap: 0; margin: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--heading); font-weight: 500; text-align: right; }
.rp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-assign .hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.room-panel .flag { margin: 0; }

/* ---------- Guest feedback ---------- */
.split { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--bg); }
.split i { display: block; height: 100%; }
.split .en { background: var(--navy); } .split .arb { background: var(--cyan); }
.fb-row { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.cs-table { width: 100%; border-collapse: separate; border-spacing: 0 5px; margin-top: -5px; }
.cs-table thead th { padding: 0 3px 2px; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.cs-table thead th:nth-child(2) { text-align: left; }
.cs-table td { padding: 0 3px; }
.cs-table td.rk { width: 18px; padding: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cs-table tbody th { padding: 0 10px 0 0; text-align: left; white-space: nowrap; font-weight: 500; color: var(--ink-2); }
.cs-table tr.us th { color: var(--heading); font-weight: 600; }
.you { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 500; vertical-align: 1px; }
.cell { display: grid; place-items: center; min-width: 50px; height: 38px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell.ov { font-weight: 700; }
.cs-table tr.us .cell { box-shadow: inset 0 0 0 1.5px var(--navy); }
.scale-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.scale { display: flex; gap: 3px; }
.scale i { width: 18px; height: 10px; border-radius: 3px; display: block; }
.push { margin-left: auto; }

.acts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.act { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 13px; background: var(--bg); }
.act-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.act h3 { margin-bottom: 4px; color: var(--heading); font-weight: 600; font-size: 14px; line-height: 1.35; }
.act p { margin: 0 0 10px; color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.act-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.owner { margin-left: auto; font-size: 12px; color: var(--muted); }

.themes-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.themes-table th, .themes-table td { padding: 0 9px; height: 46px; border-bottom: 1px solid var(--line); text-align: left; }
.themes-table thead th { height: 30px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.themes-table tbody tr:last-child > * { border-bottom: 0; }
.themes-table th:first-child, .themes-table td:first-child { padding-left: 0; }
.themes-table th:last-child, .themes-table td:last-child { padding-right: 0; }
.themes-table tbody th { font-weight: 600; color: var(--heading); white-space: nowrap; }
.themes-table .r { text-align: right; }
.lang { display: grid; grid-template-columns: minmax(80px, 1fr) auto; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); }
.lang .split { height: 7px; }
.sent { display: grid; grid-template-columns: 1fr 1fr; align-items: center; height: 10px; min-width: 120px; position: relative; }
.sent::after { content: ''; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: rgba(10, 42, 94, .35); }
.sent i { display: block; height: 10px; }
.neg-side { display: flex; justify-content: flex-end; } .neg-side i { background: var(--bad-line); border-radius: 3px 0 0 3px; }
.pos-side i { background: var(--cyan); border-radius: 0 3px 3px 0; }
.delta { text-align: right; font-weight: 500; padding-left: 20px !important; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.quote { font-size: 13px; color: var(--ink-3); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar { font-family: var(--arabic); unicode-bidi: isolate; }
.quote .ar { display: block; font-size: 14.5px; text-align: right; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: #E9EEF5; }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--heading); box-shadow: 0 1px 2px rgba(6, 28, 64, .1); }
@media (hover: hover) { .seg button[aria-pressed="false"]:hover { color: var(--heading); } }

.reviews { padding-bottom: 20px; }
.rv-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.rv-list { margin: 0; padding: 0; list-style: none; border-radius: 13px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.rv-list li + li { border-top: 1px solid var(--line); }
.rv { display: grid; gap: 7px; width: 100%; min-height: 64px; padding: 12px 16px; border: 0; background: var(--card); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background-color .2s var(--ease); }
.rv.on { background: #EEF6FA; box-shadow: inset 3px 0 0 var(--cyan); }
@media (hover: hover) { .rv:not(.on):hover { background: #F7F9FB; } }
.rv:focus-visible { outline-offset: -3px; }
.rv-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.rv-score { font-weight: 600; color: var(--heading); font-size: 12.5px; }
.rv-top .chip { margin-left: auto; height: 22px; }
.rv-text { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-text.ar { font-size: 15px; text-align: right; }

.rv-detail { display: grid; gap: 16px; min-width: 0; }
.rd-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.score-badge { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.score-badge.warn { background: var(--warn-soft); color: var(--warn); }
.score-badge.bad { background: var(--bad-soft); color: var(--bad); }
.score-badge.good { background: var(--good-soft); color: var(--good); }
.rd-head h3 { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--heading); letter-spacing: -.01em; }
.rd-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.rd-chips { margin-left: auto; display: flex; gap: 6px; }
.orig { padding: 18px 22px; border-radius: 13px; background: var(--bg); }
.orig-l { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.ar-big { margin: 0; font-size: 21px; line-height: 2; color: var(--ink); text-align: right; }
.hl { padding: 1px 2px; border-radius: 5px; }
.hl-pos { background: rgba(30, 200, 224, .2); box-shadow: inset 0 -2px 0 var(--cyan); }
.hl-neg { background: #FBDDE3; box-shadow: inset 0 -2px 0 #D7697F; }
.en-orig p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.meaning h4, .gloss h4 { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--heading); }
.meaning p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); max-width: 70ch; }
.rd-bottom { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gloss dl { margin: 0; display: grid; }
.gloss dl > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.gloss dt { font-size: 18px; color: var(--heading); text-align: right; }
.gloss dd { margin: 0; font-size: 13px; color: var(--ink-2); }
.gloss small { display: block; font-size: 11.5px; color: var(--muted); }
.gloss small .ar { font-size: 13.5px; color: var(--ink-3); }
.linked { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 13px; background: var(--bg); }
.linked b { display: block; color: var(--heading); font-weight: 600; font-size: 13px; }
.linked span:not(.act-no) { font-size: 12.5px; color: var(--muted); }
.rd-bottom > .linked:only-child { grid-column: 1 / -1; }

.illustrative { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.illustrative .ic { color: var(--accent-ink); }

/* ---------- Staff ---------- */
.rota { width: 100%; min-width: 880px; border-collapse: collapse; }
.rota th, .rota td { padding: 6px 5px; border-bottom: 1px solid var(--line); text-align: center; }
.rota thead th { padding: 0 5px 10px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.rota thead th .dnum { color: var(--heading); font-weight: 600; margin-left: 2px; }
.rota thead th.today { color: var(--accent-ink); }
.rota thead th.today .dnum { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; margin-left: 4px; }
.rota td.today { background: rgba(30, 200, 224, .06); }
.rota .who-col { text-align: left; padding-left: 0; white-space: nowrap; }
.rota tbody th.who-col { height: 48px; font-weight: 500; color: var(--heading); }
.who-cell { display: flex; align-items: center; gap: 10px; }
.rota .r { text-align: right; padding-right: 0; }
.rota td.num { color: var(--heading); font-weight: 600; }
.team-row th { padding: 18px 0 8px; text-align: left; font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--heading); border-bottom: 1px solid var(--line-2); }
.rota tbody:first-of-type .team-row th { padding-top: 4px; }
.team-row th span { margin-left: 8px; font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--muted); }
.shift { display: inline-flex; align-items: center; justify-content: center; min-width: 98px; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; font-weight: 500; }
.k-early { background: #DDF6FA; color: #075E6C; }
.k-mid { background: #E7ECF7; color: #24406F; }
.k-late { background: #C9D6EA; color: #0A2A5E; }
.k-night { background: var(--navy); color: #fff; }
.off { font-size: 12px; color: #A0A9BA; }
.rota-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.kinds { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; }
.kinds li { display: inline-flex; align-items: center; gap: 7px; }
.shift.swatch { min-width: 0; width: 18px; height: 12px; padding: 0; border-radius: 4px; }

/* ---------- toast ---------- */
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 900; display: grid; justify-items: end; width: min(420px, calc(100vw - 48px)); pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 14px;
  background: var(--deep); color: #fff; font-size: 13.5px; line-height: 1.45; box-shadow: 0 18px 40px -16px rgba(6, 28, 64, .6);
  opacity: 0; transform: translateY(8px); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-dot { flex: none; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #3DDC97; }
.toast.tone-info .toast-dot { background: var(--cyan); }
.toast.tone-warn .toast-dot { background: #FFC94D; }

/* ---------- wide and narrower desktops ---------- */
@media (max-width: 1280px) {
  .fb-row { grid-template-columns: minmax(0, 1fr); }
  .rv-grid { grid-template-columns: 320px minmax(0, 1fr); }
  .hk-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rc-controls { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-bottom { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- tablet: rail becomes a top bar ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  html:not(.bare) .shell { padding-top: 64px; } /* the back link sits above the bar */
  html:not(.bare) .rail { position: relative; } /* sticking would slide the bar under the fixed back link */
  .rail {
    position: sticky; top: 0; z-index: 50; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0;
    padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px -22px rgba(6, 28, 64, .5);
  }
  .rail-top { width: 100%; }
  .brand { padding: 4px 6px 4px 0; }
  .brand-mark { width: 34px; height: 34px; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--surface-2); color: var(--heading); font: inherit; font-weight: 500; font-size: 14px;
  }
  .menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .menu-btn[aria-expanded="true"] { background: var(--navy); color: #fff; }
  .rail-nav { display: none; width: 100%; padding: 10px 0 6px; grid-template-columns: minmax(0, 1fr); }
  .menu-open .rail-nav { display: grid; }
  .rail-nav a[aria-current="page"]::before { display: none; }
  .rail-foot { display: none; }
  .main { padding: 22px 24px 48px; }
  html:not(.bare) .main { padding-bottom: 84px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .hk-grid { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .room-panel { position: static; }
  .rv-grid { grid-template-columns: minmax(0, 1fr); }
  .rv-list { max-height: 360px; overflow-y: auto; }
  .toast-region { right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); }
  html:not(.bare) .toast-region { bottom: 64px; }
}
@media (max-width: 760px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats, .stats.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rd-chips { margin-left: 0; }
}
@media (max-width: 480px) {
  .main { padding: 18px 16px 40px; }
  .stats, .stats.three { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 24px; }
  .floor { grid-template-columns: minmax(0, 1fr); }
  .floor-l { display: none; }
  .brand-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .toast { transform: none; }
}
