/* DineDesk owner dashboard.
   Navy #032156 and gold #C68C26, the brand's own colours. Gold measures 2.58:1 on the page
   wash, so it appears only on navy grounds, as small markers, and as chart fill - never as
   text you have to read on white.

   Semantic colour means one thing only: green good, amber attention, red wrong. It is never
   decoration, so that when something turns red the eye is right to go to it. */

:root {
  --navy: #032156;
  --navy-deep: #02163B;
  --navy-soft: #E7EDF8;
  --gold: #C68C26;

  --ink: #0E1B33;
  --muted: #5A6480;
  --faint: #8A93A8;
  --line: #DDE3EE;
  --line-soft: #EAEFF6;
  --panel: #FFFFFF;
  --canvas: #F4F6FA;

  --good: #067647;
  --warn: #B54708;
  --warn-soft: #FDF3E7;
  --bad: #B42318;
  --bad-soft: #FDECEA;

  /* One hue for data, stepped. Four values is enough for any breakdown worth reading, and a
     fifth is "everything else" rather than another colour competing for attention. */
  --d1: #032156;
  --d2: #24467F;
  --d3: #5877AD;
  --d4: #9CB1D4;
  --d5: #C9D5E8;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(3, 33, 86, .05), 0 6px 18px rgba(3, 33, 86, .05);
}

/* Switching a view off has to actually switch it off.
   The views are hidden with the hidden attribute, but some also carry a class that sets
   display - and a class beats the browser's own [hidden] rule, so hiding them did nothing at
   all. Signing in left the sign-in card sitting above the dashboard with "Choose your
   password" stranded a screenful below it. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.eyebrow {
  margin: 0 0 1px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--gold);
}

.help { margin: 4px 0 14px; font-size: 12.5px; color: var(--muted); }
.panel-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.footnote { margin: 0; font-size: 11.5px; color: var(--faint); }

.error, .banner {
  margin: 0 0 12px;
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--bad-soft);
  border: 1px solid #F3B9B3;
  color: var(--bad);
  font-size: 13px;
}
/* A refresh that failed while figures are already on screen is a note, not a catastrophe. */
.banner.soft { background: var(--warn-soft); border-color: #F0D5B4; color: var(--warn); }

/* ---------- buttons ---------- */
button { font: inherit; cursor: pointer; border-radius: 8px; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

button.primary {
  width: 100%;
  padding: 11px 16px;
  font-weight: 650;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
}
button.primary:hover { background: var(--navy-deep); }
button.primary:disabled { opacity: .6; cursor: default; }
button.primary.small { width: auto; padding: 8px 14px; font-size: 13px; }

button.ghost {
  padding: 8px 14px;
  color: var(--navy);
  background: transparent;
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}
button.ghost:hover { border-color: var(--navy); }
button.ghost.small { padding: 6px 11px; font-size: 12.5px; }

/* ---------- sign in ---------- */
.centred { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.sign-in { width: 100%; max-width: 380px; }
.sign-in h1 { margin-bottom: 2px; font-size: 21px; }

label { display: block; margin: 0 0 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
label input:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
label small { display: block; margin-top: 4px; font-weight: 400; font-size: 11.5px; }

.password-field { position: relative; display: block; }
.password-field input { padding-right: 64px; }
.reveal {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 6px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
}
.reveal:hover { color: var(--navy); }

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

.rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px;
  background: var(--navy-deep);
  color: #E8EDF7;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 12px;
  font-weight: 800;
}
.rail-brand-text { font-weight: 650; letter-spacing: -.01em; }

.rail-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.rail-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: #B6C4DE;
  background: transparent;
  border: 1px solid transparent;
}
.rail-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.rail-link.active { color: #fff; background: rgba(255,255,255,.11); font-weight: 650; }

.count {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 9px; padding: 0 6px; }
.rail-who { margin: 0; font-size: 12px; color: #9FAECB; overflow-wrap: anywhere; }
.rail .ghost { color: #E8EDF7; border-color: rgba(255,255,255,.25); }
.rail .ghost:hover { border-color: var(--gold); }

.main { display: flex; flex-direction: column; min-width: 0; }

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-identity h1 { font-size: 19px; }
.topbar-controls { display: flex; align-items: center; gap: 10px; }

.outlet-picker select {
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Not decoration. "No sales yet" and "the till has not spoken to us since eleven" look
   identical on a dashboard, and only one of them is a problem. */
.sync {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  font-size: 12px;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.sync.warn { color: var(--warn); background: var(--warn-soft); border-color: #F0D5B4; }
.sync.warn .dot { background: var(--warn); }
.sync.bad { color: var(--bad); background: var(--bad-soft); border-color: #F3B9B3; }
.sync.bad .dot { background: var(--bad); }

/* ---------- period ---------- */
.periodbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 24px 0;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--navy-soft);
  border-radius: 9px;
}
.segmented button {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: none;
  border-radius: 7px;
  white-space: nowrap;
}
.segmented button:hover { background: rgba(255,255,255,.6); }
.segmented button.active { background: #fff; box-shadow: 0 1px 2px rgba(3,33,86,.14); }
.segmented.tiny { padding: 2px; }
.segmented.tiny button { padding: 4px 10px; font-size: 12px; }

.period-label { margin: 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.custom-range {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 24px 0;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.custom-range label { margin: 0; }
.range-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button.active { background: var(--navy-soft); border-color: var(--navy); color: var(--navy); }

/* ---------- refunds, voids and discounts ---------- */
.exceptions { display: flex; flex-direction: column; gap: 4px; }
.exception {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.exception:last-child { border-bottom: 0; }
.exception-name { font-weight: 600; }
.exception strong { font-variant-numeric: tabular-nums; }
.exception-foot {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.exception-detail { grid-column: 1; grid-row: 2; color: var(--faint); font-size: 12px; }

#dashboardError { margin: 14px 24px 0; }

/* ---------- content ---------- */
.content { padding: 16px 24px 40px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- alerts ---------- */
.alerts, .alerts-full { display: flex; flex-direction: column; gap: 8px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
}
.alert.critical { border-left-color: var(--bad); }
.alert-body { min-width: 0; }
.alert strong { display: block; font-size: 13.5px; }
.alert p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.alert .pill {
  flex: none;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--warn-soft);
  color: var(--warn);
}
.alert.critical .pill { background: var(--bad-soft); color: var(--bad); }

/* ---------- KPIs ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 0;
}
.kpi-key { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.kpi strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi small { display: block; font-size: 11.5px; color: var(--muted); }
.kpi strong.good { color: var(--good); }
.kpi strong.bad { color: var(--bad); }

/* A movement, with its direction said in words as well as colour. */
.delta { font-weight: 600; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
/* Where more is not better - discounts, money out - the arrow still points up but the colour
   stays neutral, because a rise there is not automatically good news. */
.delta.neutral { color: var(--muted); }

/* ---------- grid ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ---------- charts ---------- */
.chart { position: relative; min-height: 208px; }
.chart svg { display: block; width: 100%; height: 208px; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10px; }
.chart .bar-rect { fill: var(--d3); }
.chart .bar-rect.peak { fill: var(--gold); }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .bar-hit:hover ~ .bar-rect, .chart .bar-hit:focus-visible ~ .bar-rect { fill: var(--navy); }

.tip {
  position: absolute;
  z-index: 5;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--navy-deep);
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(3,33,86,.24);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tip b { display: block; font-size: 11px; color: #A8BADB; font-weight: 600; }

.donut-wrap { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.donut { width: 148px; height: 148px; flex: none; }
.donut-total { fill: var(--ink); font-size: 15px; font-weight: 650; text-anchor: middle; }
.donut-total-key { fill: var(--faint); font-size: 9px; text-anchor: middle; letter-spacing: .08em; }
.legend { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.legend-row { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 9px; align-items: center; font-size: 12.5px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.legend-share { color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ---------- horizontal bars & ranked lists ---------- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.bar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar-value small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 3px; background: var(--d3); }
.bar-row:first-child .bar-fill { background: var(--navy); }

.ranked { display: flex; flex-direction: column; }
.rank-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.rank-row:last-child { border-bottom: none; }
.rank-n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.rank-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name small { display: block; font-size: 11px; color: var(--muted); }
.rank-value { text-align: right; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-value small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }

/* ---------- reports ---------- */
.reports { display: flex; flex-direction: column; gap: 22px; }
.report-block h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 650; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { background: var(--canvas); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
td.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }

.account { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* ---------- states ---------- */
.empty { padding: 22px 0; font-size: 13px; color: var(--muted); text-align: center; }
.empty strong { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 3px; }

/* Skeletons keep the layout still while figures arrive, so nothing jumps under the thumb. */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--line-soft);
  border-radius: 6px;
  color: transparent;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: sweep 1.3s infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }
.sk-number { height: 24px; width: 70%; margin: 5px 0 3px; }
.sk-line { height: 11px; width: 55%; margin: 4px 0; }
.sk-chart { height: 208px; width: 100%; }

/* ---------- phone navigation ---------- */
.tabbar { display: none; }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-4, .span-6, .span-8 { grid-column: span 12; }
}

@media (max-width: 760px) {
  /* The rail becomes a bar along the bottom, where a thumb reaches. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 52px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-top: 2px solid transparent;
    border-radius: 0;
  }
  .tab.active { color: var(--navy); border-top-color: var(--gold); }

  .topbar { padding: 11px 14px; gap: 8px 12px; }
  .topbar .eyebrow { display: none; }
  .topbar-identity h1 { font-size: 17px; }
  .topbar-controls { width: 100%; justify-content: space-between; }

  .periodbar { padding: 12px 14px 0; }
  .segmented { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { flex: 1 0 auto; min-height: 36px; padding: 8px 12px; }
  /* Everything tappable is at least a fingertip. "Show all 12" came out at 33px, which is
     small enough to miss and annoying enough to notice. */
  button.ghost, button.ghost.small, .reveal { min-height: 36px; }

  .content { padding: 14px 14px 28px; gap: 12px; }
  .custom-range, #dashboardError { margin-left: 14px; margin-right: 14px; }
  .grid { gap: 12px; }
  .panel { padding: 13px 14px; }

  /* Two to a row: six figures in three thumb-widths rather than six. */
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi strong { font-size: 20px; }
  .kpi-key, .kpi small { font-size: 10.5px; }

  .chart, .chart svg, .sk-chart { height: 176px; min-height: 176px; }
  .donut { width: 132px; height: 132px; }
}

@media (max-width: 380px) {
  .kpi strong { font-size: 18px; }
  .topbar-identity h1 { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* A dish being sent back is a warning, and should not read like a category label. */
.rank-name small.returned { color: var(--warn); font-weight: 600; }

/* Sits under the bar, spanning the row, so it reads as a note about the person. */
.bar-note { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- the week, hour by hour ---------- */
.heatmap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; }
.heat th { font-weight: 600; font-size: 11px; color: var(--muted); padding: 0; }
.heat-corner { width: 34px; }
.heat-hour { text-align: center; white-space: nowrap; padding-bottom: 4px !important; }
.heat-day { text-align: right; padding-right: 6px !important; white-space: nowrap; }
.heat-cell {
  height: 26px;
  min-width: 22px;
  border-radius: 3px;
  background: var(--sunk, var(--canvas));
  cursor: default;
}
.heat-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* Five steps, because a person can tell five shades apart and cannot tell fifty. A closed
   hour is left as the page's own ground rather than the lightest step, so "shut" and
   "open but empty" do not look like the same thing. */
.heat-0 { background: var(--line-soft); }
.heat-1 { background: var(--d5); }
.heat-2 { background: var(--d4); }
.heat-3 { background: var(--d3); }
.heat-4 { background: var(--d2); }
.heat-5 { background: var(--d1); }

/* ---------- the detail drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none !important; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(3, 33, 86, .32); }
.drawer-panel {
  position: relative;
  width: min(460px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: var(--panel);
}
.drawer-head h2 { margin: 2px 0 0; font-size: 20px; }
.drawer-body { padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.drawer-figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.drawer-figure { background: var(--canvas); border-radius: var(--radius); padding: 10px 12px; }
.drawer-figure span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.drawer-figure strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.drawer-figure small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }

/* A row is something you can open, and should look like it. */
.rank-row, #staff .bar-row { cursor: pointer; border-radius: 6px; }
.rank-row:hover, #staff .bar-row:hover { background: var(--canvas); }
.rank-row:focus-visible, #staff .bar-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* On a phone it comes up from the bottom, which is where a thumb is. */
@media (max-width: 720px) {
  .drawer { align-items: flex-end; }
  .drawer-panel {
    width: 100%;
    max-height: 86vh;
    border-left: 0;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Placeholders while a row's detail is being fetched. */
/* Uses the page's own skeleton treatment, which already stops moving for anyone who has
   asked for less motion. */
.skeleton-box { min-height: 62px; }
.detail-chart { height: 150px; }

/* Somebody with less than full access should know that, rather than wonder where a panel went. */
.rail-role { color: var(--d4); font-size: 11px; margin: 2px 0 8px; }

/* ---------- things needing attention ---------- */
.bell-wrap { position: relative; }
.bell {
  position: relative;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}
.bell:hover { background: var(--canvas); }
.bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}
.bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 60vh;
  overflow-y: auto;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.bell-panel[hidden] { display: none !important; }
.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: var(--panel);
}
.bell-list { display: flex; flex-direction: column; }
.bell-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  cursor: pointer;
}
.bell-item:hover { background: var(--canvas); }
.bell-item:last-child { border-bottom: 0; }
/* Unread carries a mark of its own rather than only a weight, so it survives a screenshot,
   a colourblind reader and a bright kitchen. */
.bell-item.unread { border-left: 3px solid var(--bad); }
.bell-item.unread strong { font-weight: 700; }
.bell-item strong { display: block; font-size: 13px; }
.bell-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.bell-item .when { color: var(--faint); font-size: 11px; margin-top: 4px; display: block; }
