:root {
  /* Brand palette — sampled from whitefit.co */
  --purple:       #5E2EA8;
  --purple-deep:  #3F1C7A;
  --purple-soft:  #F2EBFB;
  --green:        #5BC23C;
  --green-deep:   #3E9128;
  --green-soft:   #EAF7E4;

  --ink:          #1A1432;
  --paper:        #FAFAFC;
  --paper-2:      #F8F6FC;
  --line:         #ECE5F5;
  --line-soft:    #EFEAF8;
  --dim:          #7A718E;
  --bad:          #C5331F;
  --bad-soft:     #FBE3DD;
  --warn:         #B67A00;
  --amber:        #FFB800;

  --display: 'Alexandria', ui-sans-serif, system-ui, -apple-system, sans-serif;
  /* Serif + mono retired site-wide: both now resolve to the Alexandria text
     font. Number/time columns keep their alignment via font-variant-numeric:
     tabular-nums (already set on those cells), so nothing misaligns. */
  --serif:   'Alexandria', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:    'Alexandria', ui-sans-serif, system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 0 rgba(94,46,168,.03), 0 6px 18px rgba(94,46,168,.04);
  --shadow-xs: 0 1px 2px rgba(26,20,50,.04);
  --shadow-md: 0 8px 24px rgba(26,20,50,.08);
  --shadow-lg: 0 20px 48px rgba(26,20,50,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }
a { color: var(--purple); }
a:hover { color: var(--purple-deep); }

/* ======= TOP BAR ======= */
.topbar {
  background: var(--purple);
  color: #fff;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 24px;
  position: sticky; top: 0; z-index: 50;
  flex-wrap: wrap;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.05);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 800;
  letter-spacing: -0.03em; font-size: 22px;
  color: #fff; text-decoration: none;
}
.brand .w { color: #fff; }
.brand .f { color: var(--green); }
.brand small {
  font-family: var(--mono); font-weight: 400; font-size: 11px;
  color: rgba(255,255,255,.65);
  text-transform: uppercase; letter-spacing: 0.2em; margin-left: 4px;
  align-self: center;
}
.brand-logo {
  height: 38px;
  width: auto;
  display: block;
  background: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 0 0 1px rgba(255,255,255,0.10);
}
nav.tabs {
  display: flex; gap: 2px;
  margin-left: 8px;
  overflow-x: auto; flex-wrap: nowrap;
  scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  text-decoration: none;
  color: rgba(255,255,255,.85);
  padding: 6px 14px;
  font-weight: 500; font-size: 14px;
  border-radius: 999px;
  background: transparent;
  transition: all .2s ease;
  white-space: nowrap;
}
nav.tabs a:hover { background: rgba(255,255,255,.10); color: #fff; }
nav.tabs a.active {
  background: #fff; color: var(--purple-deep); font-weight: 600;
}
.topbar .right {
  margin-left: auto;
  display: flex; align-items: center; gap: 18px;
  font-family: var(--mono); font-size: 12px;
  color: rgba(255,255,255,.78);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.topbar .user {
  font-family: var(--display); color: #fff;
  text-transform: none; letter-spacing: 0; font-size: 14px;
}
.topbar .logout {
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-family: var(--display);
  text-transform: none; letter-spacing: 0; font-size: 13px;
}
.topbar .logout:hover { color: #fff; }

.sync-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(91,194,60,.7);
}
.sync-dot.fresh { background: var(--green); box-shadow: 0 0 0 0 rgba(91,194,60,.7); animation: pulse-fresh 2.4s ease-out infinite; }
.sync-dot.warn  { background: var(--amber); box-shadow: 0 0 0 2px rgba(255,184,0,.18); animation: none; }
.sync-dot.stale { background: #ff5a3c; animation: blink-stale 1s steps(2, start) infinite; }
.sync-dot.bad   { background: #ff5a3c; animation: blink-stale 1s steps(2, start) infinite; }
.sync-dot.off   { background: rgba(255,255,255,.4); animation: none; }
@keyframes pulse-fresh {
  0%   { box-shadow: 0 0 0 0 rgba(91,194,60,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(91,194,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(91,194,60,0); }
}
@keyframes blink-stale {
  0%, 49%   { opacity: 1; box-shadow: 0 0 0 0 rgba(255,90,60,.55); }
  50%, 100% { opacity: .25; box-shadow: 0 0 0 0 rgba(255,90,60,0); }
}

/* ======= PAGE HEAD (compact, professional) ======= */
.page-head {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 22px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.page-head-left { display: flex; flex-direction: column; gap: 4px; }
.page-title {
  font-family: var(--display);
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1.1;
}
.page-meta {
  font-family: var(--display); font-size: 13px;
  color: var(--dim);
}
.page-meta strong { color: var(--ink); font-weight: 600; }
.page-meta .meta-link { color: var(--purple); text-decoration: none; }
.page-meta .meta-link:hover { text-decoration: underline; }
.page-head-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* legacy header-strip kept as a thin alias for pages I haven't rebuilt yet */
.header-strip {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 22px 32px;
}
.eyebrow,
.label {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--dim); font-weight: 500;
}
.eyebrow {
  margin-bottom: 6px;
  display: flex; gap: 10px; align-items: center;
}
.eyebrow .accent-line { display: none; }
h1.huge {
  font-family: var(--display); font-weight: 700;
  font-size: 72px;
  line-height: 1.05; letter-spacing: -0.04em;
  color: var(--ink);
}
h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 28px; letter-spacing: -0.02em;
  color: var(--ink);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
h1.huge em {
  font-style: normal; font-weight: 700;
  color: var(--ink); font-family: var(--display);
}
.header-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 6px;
  font-family: var(--display); font-size: 13px;
  color: var(--dim);
  text-transform: none; letter-spacing: 0;
}
.header-meta strong { color: var(--ink); font-weight: 600; margin-left: 4px; }
.header-meta strong.acc  { color: var(--purple); }
.header-meta strong.good { color: var(--green-deep); }
.header-meta strong.bad  { color: var(--bad); }

/* ======= KPI STRIP ======= */
.kpi-strip {
  margin: 0 32px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  overflow: hidden;
}
.kpi {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}
.kpi:last-child { border-right: 0; }
.kpi-k {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--dim); margin-bottom: 6px;
}
.kpi-v {
  font-family: var(--display); font-weight: 600;
  font-size: 30px; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -0.025em;
  font-feature-settings: 'tnum' 1, 'ss01' 1, 'cv11' 1;
}
.kpi-v .kpi-of { font-size: 14px; color: var(--dim); font-weight: 500; margin-left: 4px; }
.kpi-v.is-red   { color: var(--bad); }
.kpi-v.is-amber { color: var(--warn); }
.kpi-v.is-good  { color: var(--green-deep); }
.kpi-v.is-dim   { color: var(--dim); }

/* ======= PANEL (a serious card) ======= */
.panel {
  margin: 0 32px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.panel-title {
  font-family: var(--display); font-weight: 600;
  font-size: 15px; letter-spacing: -0.01em; color: var(--ink);
}
.panel-sub {
  font-family: var(--mono); font-size: 11px;
  color: var(--dim); text-transform: uppercase; letter-spacing: 0.14em;
}

/* ======= PAGE BODY ======= */
.page { padding: 22px 0 8px; background: var(--paper-2); min-height: 60vh; }

/* Most page-children (kpi-strip, panel) handle their own gutters; legacy pages still using .card etc get a margin */
.page > .card, .page > .alert, .page > .log-stack, .page > div.alert { margin-left: 32px; margin-right: 32px; }
.page > .floor { margin: 0 32px 22px; }

/* ======= STAFF TABLE (dashboard) ======= */
.tbl-staff td { padding: 14px 16px; vertical-align: middle; }
.tbl-staff thead th { padding: 12px 16px; }

/* Card-row hybrid: hairline dividers + subtle purple-tinted hover */
.tbl-staff tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}
.tbl-staff tbody tr:last-child { border-bottom: 0; }
.tbl-staff tbody tr:hover {
  background: color-mix(in srgb, var(--purple-soft) 70%, transparent);
  box-shadow: inset 3px 0 0 var(--purple);
  cursor: pointer;
}
.tbl-staff tbody tr:hover td { cursor: pointer; }

.emp-cell { display: flex; align-items: center; gap: 12px; }
.ini {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper-2); color: var(--purple);
  border: 2px solid color-mix(in srgb, var(--purple) 70%, #fff 30%);
  box-shadow: 0 0 0 1px var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.ini-in    { background: var(--green-soft);  color: var(--green-deep); border-color: color-mix(in srgb, var(--green-deep) 70%, #fff 30%); }
.ini-break { background: #FFF1C2; color: #6B4900; border-color: color-mix(in srgb, #6B4900 70%, #fff 30%); }
.ini-done  { background: var(--purple-soft); color: var(--purple-deep); border-color: color-mix(in srgb, var(--purple-deep) 70%, #fff 30%); }
.ini-off   { background: var(--paper-2); color: var(--dim); border-color: color-mix(in srgb, var(--dim) 70%, #fff 30%); }
.ini-absent{ background: #FBE3DD; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 70%, #fff 30%); }

.emp-name {
  font-family: var(--display); font-weight: 700;
  font-size: 14px; color: var(--ink); line-height: 1.2;
}
.emp-sub {
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.14em; margin-top: 2px;
}

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--display); font-weight: 600; font-size: 12px;
  padding: 5px 12px; border-radius: 24px;
  background: var(--paper-2); color: var(--dim);
  box-shadow: 0 1px 2px rgba(63, 28, 122, 0.08), 0 2px 6px rgba(63, 28, 122, 0.06);
}
.status::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status.st-in     { background: var(--green-soft);  color: var(--green-deep); }
.status.st-break  { background: #FFF1C2; color: var(--warn); }
.status.st-done   { background: var(--purple-soft); color: var(--purple-deep); }
.status.st-off    { background: var(--paper-2); color: var(--dim); }
.status.st-absent { background: #FBE3DD; color: var(--bad); }

/* small inline dots row for "Activity" column */
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--purple);
  border: 1.5px solid var(--purple);
  cursor: help;
}
.dots .d-in  { background: var(--purple); border-color: var(--purple); }
.dots .d-bo  { background: var(--amber);  border-color: var(--amber); }
.dots .d-bi  { background: var(--paper);  border-color: var(--amber); }
.dots .d-out { background: var(--green);  border-color: var(--green); }

.val-bad  { color: var(--bad); }
.val-warn { color: var(--warn); }
.val-dim  { color: var(--dim); }
.muted    { color: var(--dim); }
.row-link {
  font-family: var(--display); font-size: 12px; font-weight: 600;
  color: var(--purple); text-decoration: none;
  padding: 4px 8px; border-radius: 6px;
}
.row-link:hover { background: var(--purple-soft); }

/* Floor (dashboard) grid */
.floor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 22px;
}

/* ======= EMPLOYEE CARDS ======= */
.emp-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 1px 0 rgba(94,46,168,.04), 0 8px 24px rgba(94,46,168,.06);
}
.emp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(94,46,168,.06), 0 14px 36px rgba(94,46,168,.10);
}
.emp-card .head {
  padding: 22px 26px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--purple); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700;
  font-size: 20px; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.emp-card.is-off .avatar { background: var(--paper-2); color: var(--purple); border: 2px solid var(--line); }
.emp-card.is-in  .avatar { background: var(--green);   color: #0c2906; }
.emp-card .name { flex: 1; min-width: 0; }
.emp-card .name h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 22px; letter-spacing: -0.025em;
  line-height: 1.1; color: var(--ink);
}
.emp-card .name .sub {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--dim); margin-top: 4px; display: block;
}
.pill {
  padding: 5px 12px; border-radius: 999px;
  font-family: var(--display); font-weight: 600;
  font-size: 12px; letter-spacing: .02em;
  text-transform: uppercase;
  background: var(--paper-2); color: var(--dim);
  border: 1px solid var(--line);
  flex-shrink: 0; white-space: nowrap;
}
.pill.in      { background: var(--green);  color: #0c2906; border-color: transparent; }
.pill.break   { background: #FFE9A8; color: #5B3F00; border-color: transparent; }
.pill.done    { background: var(--purple); color: #fff; border-color: transparent; }
.pill.off     { background: var(--paper-2); color: var(--purple); border-color: var(--line); }
.pill.absent  { background: #FBE3DD; color: var(--bad); border-color: transparent; }

.emp-card .stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.emp-card .stat {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}
.emp-card .stat:last-child { border-right: 0; }
.emp-card .stat .k {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--dim); margin-bottom: 8px;
}
.emp-card .stat .v {
  font-family: var(--display); font-weight: 400;
  font-size: 32px; letter-spacing: -0.035em;
  line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.emp-card .stat .v small {
  font-size: 12px; color: var(--dim);
  font-weight: 500; margin-left: 3px;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-family: var(--mono);
}
.emp-card .stat.is-late .v { color: var(--bad); }
.emp-card .stat.is-ot .v   { color: var(--warn); }
.emp-card .stat.is-good .v { color: var(--green-deep); }
.emp-card .stat .v.is-dim  { color: var(--dim); }

/* ======= PUNCH TIMELINE ======= */
.timeline { padding: 22px 26px 24px; }
.timeline-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.timeline-head .label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--dim);
}
.timeline-head .shift {
  font-family: var(--mono); font-size: 12px;
  color: var(--purple); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.punches {
  list-style: none;
  border-left: 2px solid var(--line);
  margin-left: 6px;
}
.punches li {
  position: relative;
  padding: 12px 0 12px 22px;
  border-bottom: 1px dashed var(--line);
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px; align-items: baseline;
}
.punches li:last-child { border-bottom: 0; padding-bottom: 2px; }
.punches li::before {
  content: ""; position: absolute;
  left: -7px; top: 17px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--purple);
}
.punches li.evt-in::before      { background: var(--purple); }
.punches li.evt-bo::before      { background: var(--amber); border-color: var(--amber); }
.punches li.evt-bi::before      { background: var(--paper); border-color: var(--amber); }
.punches li.evt-out::before     { background: var(--green); border-color: var(--green); }
.punches li.evt-pending::before { background: var(--paper); border-color: var(--line); }

.punches .time {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.punches .label-txt {
  font-family: var(--display); font-size: 14px;
  color: var(--ink); letter-spacing: -0.005em;
}
.punches .delta {
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.12em;
}

.emp-card.is-empty .timeline { text-align: center; padding: 56px 26px; }
.emp-card.is-empty .timeline .empty-h {
  font-family: var(--serif); font-style: normal;
  font-size: 32px; color: var(--purple); margin-bottom: 8px; line-height: 1;
}
.emp-card.is-empty .timeline .empty-sub {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--dim);
}

/* ======= GENERAL CARDS / SECTIONS ======= */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font: 600 16px var(--display);
  letter-spacing: -0.01em;
}
.card h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 18px; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 16px;
}
.card .help {
  font-family: var(--display); font-size: 13px;
  color: var(--dim); margin-top: -8px; margin-bottom: 16px;
}

/* ======= FORMS ======= */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: end; margin-bottom: 20px;
}
.toolbar label {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--dim); font-weight: 500;
}
.input, select, input[type=date], input[type=month], input[type=time], input[type=number], input[type=text], input[type=password] {
  font-family: var(--display); font-size: 14px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, select:focus, input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}
.btn {
  font-family: var(--display); font-weight: 600;
  font-size: 14px; padding: 9px 18px;
  background: var(--purple); color: #fff;
  border: 0; border-radius: 10px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--purple-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--purple);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--purple-soft); color: var(--purple-deep); }
.btn.green {
  background: var(--green); color: #0c2906;
}
.btn.green:hover { background: var(--green-deep); color: #fff; }

.alert {
  padding: 12px 16px; border-radius: 10px;
  margin-bottom: 18px;
  font-family: var(--display); font-size: 14px;
}
.alert.ok  { background: var(--green-soft); color: var(--green-deep); border: 1px solid #C7E9BC; }
.alert.bad { background: #FBE3DD; color: var(--bad); border: 1px solid #F2C5BB; }
.alert.warn { background: #FFF5DC; color: var(--warn); border: 1px solid #F2DFA0; }

/* ======= TABLES (modernized 2026-05-26) ======= */
.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--paper);
  padding: 0;
}
table.tbl, table.data-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--display); font-size: 14px;
}
table.tbl thead th, table.data-table thead th {
  text-align: left;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--dim); font-weight: 500;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 2px solid var(--purple-soft);
}
table.tbl tbody td, table.data-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
table.tbl td.num, table.tbl th.num,
table.data-table td.num, table.data-table th.num { font-weight: 600; }
table.tbl tbody tr:last-child td,
table.data-table tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr, table.data-table tbody tr {
  transition: background-color 150ms ease;
}
table.tbl tbody tr:hover, table.data-table tbody tr:hover {
  background: rgba(94, 46, 168, 0.04);
}
table.tbl td.num, table.tbl th.num,
table.data-table td.num, table.data-table th.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
table.tbl td.flag, table.data-table td.flag {
  font-family: var(--mono); font-size: 11px;
  color: var(--bad); text-transform: uppercase; letter-spacing: 0.08em;
}
table.tbl td.code, table.tbl td.time,
table.data-table td.code, table.data-table td.time {
  font-family: var(--mono); color: var(--dim);
}
table.tbl tr.off-row td, table.data-table tr.off-row td {
  background: var(--paper-2); color: var(--dim);
}

/* schedule editor — compact grid */
.sched-grid {
  display: grid;
  grid-template-columns: 70px repeat(3, 1fr);
  gap: 10px; align-items: center;
  margin-bottom: 8px;
}
.sched-grid .dow {
  font-family: var(--mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--dim);
}

/* ======= LOG / TIMELINE LIST (daily log page) ======= */
.log-stack { display: flex; flex-direction: column; gap: 18px; }

/* ======= FOOTER ======= */
.footnote {
  padding: 22px 32px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px;
  color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.16em;
  flex-wrap: wrap; gap: 12px;
}
.footnote .footer-brand {
  display: flex; align-items: center; gap: 10px;
  text-transform: none; letter-spacing: 0.04em;
}
.footnote .footer-logo {
  height: 22px; width: auto; display: block;
  opacity: .85;
}
.footnote .legend { display: flex; gap: 18px; flex-wrap: wrap; }
.footnote .legend span { display: flex; align-items: center; gap: 7px; }
.footnote .legend i {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--purple);
}
.footnote .legend i.lg-bo  { background: var(--amber); }
.footnote .legend i.lg-bi  { background: var(--paper); border: 2px solid var(--amber); }
.footnote .legend i.lg-out { background: var(--green); }

/* ======= LOGIN PAGE ======= */
.login-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
}
.login-wrap .hero {
  background: var(--purple); color: #fff;
  padding: 60px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-wrap .hero::after {
  content: ""; position: absolute;
  bottom: -180px; right: -120px;
  width: 460px; height: 460px;
  border-radius: 50%; background: var(--green); opacity: .14;
}
.login-wrap .hero .top {
  font-family: var(--display); font-weight: 800;
  font-size: 28px; letter-spacing: -0.03em;
}
.login-wrap .hero .top .f { color: var(--green); }
.login-wrap .hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: 64px; line-height: 1; letter-spacing: -0.04em;
  position: relative; z-index: 1;
}
.login-wrap .hero h1 em {
  font-family: var(--serif); font-style: normal; color: var(--green);
}
.login-wrap .hero .blurb {
  font-family: var(--mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: rgba(255,255,255,.7);
  max-width: 380px;
}
.login-wrap .form-side {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 40px;
  background: var(--paper-2);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 14px 40px rgba(94,46,168,.08);
}
.login-card h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 22px; letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.login-card .sub {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--dim); margin-bottom: 24px;
}
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; }

@media (max-width: 1100px) {
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 880px) {
  .topbar { padding: 12px 18px; gap: 12px; }
  .topbar .right { width: 100%; justify-content: space-between; font-size: 11px; }
  .page { padding: 16px 0; }
  .page-head { padding: 16px 18px; }
  .page > .card, .page > .alert, .page > .log-stack, .page > div.alert,
  .page > .floor, .kpi-strip, .panel { margin-left: 16px; margin-right: 16px; }
  .header-strip { padding: 18px; }
  .floor { grid-template-columns: 1fr; gap: 16px; }
  .emp-card .head { padding: 16px; gap: 12px; }
  .emp-card .stat { padding: 14px 12px; }
  .emp-card .stat .v { font-size: 22px; }
  .emp-card .name h2 { font-size: 17px; }
  h1.huge { font-size: 48px; letter-spacing: -0.04em; }
  .page-title { font-size: 20px; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi:nth-child(odd) { border-right: 1px solid var(--line); }
  .kpi:nth-child(even) { border-right: 0; }
  .tbl-staff th:nth-child(4), .tbl-staff td:nth-child(4),
  .tbl-staff th:nth-child(7), .tbl-staff td:nth-child(7),
  .tbl-staff th:nth-child(10), .tbl-staff td:nth-child(10) { display: none; }
  .footnote { flex-direction: column; align-items: flex-start; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-wrap .hero { padding: 36px 28px; min-height: 38vh; }
  .login-wrap .hero h1 { font-size: 44px; }
  .login-wrap .form-side { padding: 32px 20px; }
}

/* ======= MOBILE RESPONSIVE ADDITIONS (additive, do not edit above) ======= */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
  /* Topbar: smaller logo + scrollable nav */
  .brand-logo { height: 32px; padding: 4px 8px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand small { display: none; }
  .topbar { padding: 10px 12px; gap: 10px; }
  nav.tabs { margin-left: 0; flex-wrap: nowrap; overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
  nav.tabs a { white-space: nowrap; padding: 6px 10px; font-size: 13px; }
  .topbar .right { gap: 12px; font-size: 10px; }

  /* Tables: ensure wrapper scrolls; covers existing .table-wrap and any future .table-scroll */
  .table-scroll, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 0; }

  /* Reduce padding ~30% across common containers */
  .page { padding: 11px 0; }
  .page-head { padding: 15px 12px; }
  .header-strip { padding: 13px; }
  .page > .card, .page > .alert, .page > .log-stack, .page > div.alert,
  .page > .floor, .kpi-strip, .panel { margin-left: 11px; margin-right: 11px; }
  .emp-card .head { padding: 11px; gap: 9px; }
  .emp-card .stat { padding: 10px 9px; }
  .login-wrap .hero { padding: 25px 20px; }
  .login-wrap .form-side { padding: 22px 14px; }
}

@media (max-width: 480px) {
  .brand-logo { height: 28px; padding: 3px 6px; }
  .brand { font-size: 16px; }
  .topbar { padding: 8px 10px; }
  nav.tabs a { padding: 5px 9px; font-size: 12px; }
  .page-title { font-size: 18px; }
}

@media print {
  .topbar, .footnote, .no-print { display: none !important; }
  body { background: #fff; }
  main.page { padding: 0; }
  table { border-collapse: collapse; }
  th, td { border: 1px solid #999; padding: 4px 8px; font-size: 11px; }
  a { color: #000; text-decoration: none; }
}

/* Per-employee colored circular avatars (list view) */
.emp-avatar { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; color:#fff; font-weight:700; font-size:13px; }
.emp-avatar.c1 { background:#5E2EA8; } .emp-avatar.c2 { background:#5BC23C; }
.emp-avatar.c3 { background:#3F1C7A; } .emp-avatar.c4 { background:#3E9128; }
.emp-avatar.c5 { background:#1A1432; } .emp-avatar.c6 { background:#7A718E; }

/* ======= DARK MODE (additive — light is default) =======
   Activated when <html data-theme="dark">. Overrides only the
   colour custom properties; everything else cascades. */
html[data-theme="dark"] {
  --purple:       #9C7BE0;
  --purple-deep:  #B79CEF;
  --purple-soft:  #2A1F44;
  --green:        #5BC23C;
  --green-deep:   #8FE070;
  --green-soft:   #1E3318;

  --ink:          #ECE6FA;
  --paper:        #14101F;
  --paper-2:      #1C172C;
  --line:         #2E2747;
  --line-soft:    #251F3B;
  --dim:          #9990B0;
  --bad:          #FF7A66;
  --bad-soft:     #3A1A14;
  --warn:         #E0A33A;
  --amber:        #FFC74A;
}

/* Dark-mode tweaks for elements that hardcoded near-white/near-black */
html[data-theme="dark"] .brand-logo {
  background: #ECE6FA;
  box-shadow: 0 1px 0 rgba(0,0,0,.3);
}
html[data-theme="dark"] .footnote .footer-logo { filter: invert(1) hue-rotate(180deg); opacity: .85; }
html[data-theme="dark"] .pill.in       { color: #0c2906; }
html[data-theme="dark"] .pill.break    { background: #5B3F00; color: #FFE9A8; }
html[data-theme="dark"] .pill.absent   { background: #4A1E16; color: #FF9F8C; }
html[data-theme="dark"] .ini-break     { background: #4A3500; color: #FFE9A8; border-color: #6B4900; }
html[data-theme="dark"] .ini-absent    { background: #4A1E16; color: #FF9F8C; border-color: #6B2A1E; }
html[data-theme="dark"] .status.st-break  { background: #4A3500; color: #FFD56B; }
html[data-theme="dark"] .status.st-absent { background: #4A1E16; color: #FF9F8C; }
html[data-theme="dark"] .alert.bad     { background: #4A1E16; color: #FF9F8C; border-color: #6B2A1E; }
html[data-theme="dark"] .alert.warn    { background: #3D2E0A; color: #FFD56B; border-color: #6B5500; }
html[data-theme="dark"] .ini-in        { border-color: #2A5018; }
html[data-theme="dark"] .alert.ok      { border-color: #2A5018; }
html[data-theme="dark"] .emp-card      { box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4); }
html[data-theme="dark"] .emp-card:hover { box-shadow: 0 1px 0 rgba(0,0,0,.35), 0 14px 36px rgba(0,0,0,.5); }
html[data-theme="dark"] .card          { box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.35); }
html[data-theme="dark"] .login-card    { box-shadow: 0 14px 40px rgba(0,0,0,.5); }
html[data-theme="dark"] .punches li::before    { background: var(--paper); }
html[data-theme="dark"] .punches li.evt-bi::before,
html[data-theme="dark"] .punches li.evt-pending::before { background: var(--paper); }
html[data-theme="dark"] .dots .d-bi { background: var(--paper); }

/* Theme toggle button */
.theme-toggle {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  font-size: 15px; line-height: 1;
  transition: background .15s ease, transform .1s ease;
  font-family: var(--display);
}
.theme-toggle:hover  { background: rgba(255,255,255,.20); }
.theme-toggle:active { transform: translateY(1px); }

/* ======= PAGE HEAD — soft gradient backdrop + serif accent + animated rule ======= */
.page-head { position: relative; overflow: hidden; }
.page-head::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(
    520px 220px at 0% 0%,
    rgba(94, 46, 168, 0.10) 0%,
    rgba(94, 46, 168, 0.04) 35%,
    rgba(94, 46, 168, 0) 70%
  );
  pointer-events: none;
  z-index: 0;
}
.page-head > * { position: relative; z-index: 1; }


/* Dark-mode: soften gradient to read against the deep paper */
html[data-theme="dark"] .page-head::before {
  background: radial-gradient(
    520px 220px at 0% 0%,
    rgba(156, 123, 224, 0.14) 0%,
    rgba(156, 123, 224, 0.06) 35%,
    rgba(156, 123, 224, 0) 70%
  );
}


/* ===== Mobile-only "card per employee" override for Today's staff table =====
   Activates <768px. CSS-only (no HTML change). Standard responsive-table
   technique: collapse <table>/<tr>/<td> to block-level cards, then use a
   grid for the metrics. Existing thead is hidden; ::before injects labels. */
@media (max-width: 767px) {
  .tbl-staff { display: block; width: 100%; background: transparent; box-shadow: none; }
  .tbl-staff thead { display: none; }
  .tbl-staff tbody { display: grid; gap: 12px; }
  .tbl-staff tbody tr,
  .tbl-staff tbody tr.off-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    background: var(--paper, #fff);
    border: 1px solid var(--line, #E5E5EA);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
  }
  .tbl-staff tbody tr:hover { background: var(--paper, #fff); }
  .tbl-staff tbody tr:hover td { cursor: default; }
  .tbl-staff td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    vertical-align: top;
  }
  .tbl-staff td.num { text-align: left; }

  /* Top row: avatar + name (col 1) + status pill (col 3). Shift (col 2) tucked under name. */
  .tbl-staff td:nth-child(1) {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line, #E5E5EA);
  }
  .tbl-staff td:nth-child(2) {
    order: 99;
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--dim, #777);
    padding-top: 6px;
    border-top: 1px dashed var(--line, #E5E5EA);
  }
  .tbl-staff td:nth-child(2)::before { content: "Shift: "; font-weight: 600; }
  .tbl-staff td:nth-child(3) {
    position: absolute;
    margin-top: 4px;
    right: 12px;
  }

  /* Wrap card so absolute status pill positions correctly */
  .tbl-staff tbody tr { position: relative; }

  /* 2-column grid container holding the 6 metric cells (4..9) */
  .tbl-staff td:nth-child(4) { grid-column: 1 / 2; }
  .tbl-staff td:nth-child(5) { grid-column: 2 / 3; }
  .tbl-staff td:nth-child(6) { grid-column: 1 / 2; }
  .tbl-staff td:nth-child(7) { grid-column: 2 / 3; }
  .tbl-staff td:nth-child(8) { grid-column: 1 / 2; }
  .tbl-staff td:nth-child(9) { grid-column: 2 / 3; }
  .tbl-staff tbody tr { grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 12px; }

  /* Label each metric with ::before pulled from the original thead semantics */
  .tbl-staff td:nth-child(4),
  .tbl-staff td:nth-child(5),
  .tbl-staff td:nth-child(6),
  .tbl-staff td:nth-child(7),
  .tbl-staff td:nth-child(8),
  .tbl-staff td:nth-child(9) {
    font-size: 14px;
    line-height: 1.3;
  }
  .tbl-staff td:nth-child(4)::before { content: "First in"; }
  .tbl-staff td:nth-child(5)::before { content: "Last punch"; }
  .tbl-staff td:nth-child(6)::before { content: "Worked"; }
  .tbl-staff td:nth-child(7)::before { content: "Break"; }
  .tbl-staff td:nth-child(8)::before { content: "Late"; }
  .tbl-staff td:nth-child(9)::before { content: "OT"; }
  .tbl-staff td:nth-child(4)::before,
  .tbl-staff td:nth-child(5)::before,
  .tbl-staff td:nth-child(6)::before,
  .tbl-staff td:nth-child(7)::before,
  .tbl-staff td:nth-child(8)::before,
  .tbl-staff td:nth-child(9)::before {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--dim, #777);
    font-weight: 600;
    margin-bottom: 2px;
  }

  /* Activity dots row spans full width */
  .tbl-staff td:nth-child(10) {
    grid-column: 1 / -1;
    padding-top: 6px;
    border-top: 1px dashed var(--line, #E5E5EA);
  }
  .tbl-staff td:nth-child(10)::before {
    content: "Activity";
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--dim, #777);
    font-weight: 600;
    margin-bottom: 4px;
  }

  /* Action link as full-width tap target */
  .tbl-staff td:nth-child(11) {
    grid-column: 1 / -1;
    text-align: center;
  }
  .tbl-staff td:nth-child(11) .row-link {
    display: block;
    padding: 8px;
    border: 1px solid var(--line, #E5E5EA);
    border-radius: 8px;
    text-decoration: none;
  }

  /* Don't let the wrap force horizontal scroll on the card layout */
  .table-wrap { overflow-x: visible; }
}

/* ============================================================
   Monthly heatmap (calendar matrix)  ·  namespaced .monthly-*
   ============================================================ */
.monthly-card { padding: 16px; }

.monthly-legend {
  display: flex; flex-wrap: wrap; gap: 14px 18px;
  align-items: center; font-size: 12px; color: var(--dim);
  margin: 2px 4px 14px;
}
.monthly-legend span { display: inline-flex; align-items: center; gap: 6px; }
.monthly-swatch {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; border: 1px solid rgba(0,0,0,.08);
}

.monthly-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.monthly-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 12px;
}

.monthly-grid thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper-2, var(--paper));
  border-bottom: 1px solid var(--line);
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
}

.monthly-emp-head,
.monthly-emp-cell {
  position: sticky; left: 0; z-index: 3;
  background: var(--paper);
  text-align: left;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  min-width: 200px;
}
.monthly-grid thead .monthly-emp-head { z-index: 4; background: var(--paper-2, var(--paper)); }

.monthly-day-head {
  min-width: 28px; width: 28px;
  line-height: 1.05;
}
.monthly-day-head .monthly-day-n {
  display: block; font-size: 12px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.monthly-day-head .monthly-day-w {
  display: block; font-size: 10px; color: var(--dim); text-transform: uppercase;
  letter-spacing: .04em; margin-top: 1px;
}
.monthly-day-head.is-weekend .monthly-day-n,
.monthly-day-head.is-weekend .monthly-day-w { color: var(--purple, #5e2ea8); }

.monthly-total-head {
  min-width: 70px; text-align: right !important;
  padding-right: 14px !important;
}

.monthly-row + .monthly-row .monthly-emp-cell,
.monthly-row + .monthly-row .monthly-cell-td,
.monthly-row + .monthly-row .monthly-total {
  border-top: 1px solid var(--line);
}

.monthly-emp {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.monthly-emp .emp-avatar {
  width: 30px; height: 30px; font-size: 12px;
  flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.monthly-emp-name { display: inline-flex; flex-direction: column; line-height: 1.15; }
.monthly-emp-fn   { font-weight: 600; color: var(--text); font-size: 13px; }
.monthly-emp-code { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }

.monthly-cell-td {
  padding: 4px 2px;
  text-align: center;
  vertical-align: middle;
  background: var(--paper);
}
.monthly-cell-td.is-weekend { background: rgba(94, 46, 168, 0.035); }

.monthly-cell {
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.06);
  position: relative;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  outline: none;
}
.monthly-cell:hover,
.monthly-cell:focus-visible {
  transform: scale(1.35);
  z-index: 5;
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
}

.monthly-cell--worked { background: #2ea043; }   /* green */
.monthly-cell--late   { background: #f59e0b; }   /* amber */
.monthly-cell--absent { background: #dc2626; }   /* red */
.monthly-cell--off    { background: #d6d6dc; }   /* grey */

/* Tooltip */
.monthly-cell[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.95);
  background: #1f1d2b;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  z-index: 50;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.monthly-cell[data-tip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f1d2b;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 50;
}
.monthly-cell:hover::after,
.monthly-cell:focus-visible::after { opacity: 1; transform: translateX(-50%) scale(1); }
.monthly-cell:hover::before,
.monthly-cell:focus-visible::before { opacity: 1; }

.monthly-total {
  text-align: right;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  border-left: 1px solid var(--line);
  background: var(--paper);
  white-space: nowrap;
}

.monthly-empty {
  text-align: center; padding: 28px; color: var(--dim);
}

@media print {
  .monthly-cell { transform: none !important; box-shadow: none !important; }
  .monthly-cell[data-tip]::after,
  .monthly-cell[data-tip]::before { display: none; }
  .monthly-wrap { overflow: visible; }
}

/* Page title weekday accent — clean Serif italic, gentle size */
.page-weekday-accent {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 400;
  font-size: 0.55em;
  color: var(--dim);
  margin-left: 10px;
  vertical-align: middle;
  letter-spacing: 0;
}
html[data-theme='dark'] .page-weekday-accent { color: var(--dim); }

/* Powered-by attribution in footer */
.foot-powered {
  display: block;
  margin-top: 6px;
  font: 500 10px var(--mono);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--dim);
}
.foot-powered a {
  color: var(--purple);
  text-decoration: none;
  border-bottom: 1px dotted var(--purple-soft);
}
.foot-powered a:hover { color: var(--purple-deep); border-bottom-style: solid; }

/* ===== PWA standalone display mode ===== */
@media (display-mode: standalone) {
  /* hide install button + browser-related elements when launched from home screen */
  .install-app-btn { display: none !important; }
  .install-btn     { display: none !important; }
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .topbar { padding-top: env(safe-area-inset-top); }
}

/* iOS notch / Android cutout support */
:root { --safe-top: env(safe-area-inset-top, 0px); }

/* Install (PWA) button — ghost style, slots between user + theme-toggle */
.install-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 999px;
  font-family: var(--display, inherit);
  font-size: 12px; font-weight: 500; letter-spacing: .01em;
  cursor: pointer; line-height: 1;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.install-btn:hover  { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.35); }
.install-btn:active { transform: translateY(1px); }
.install-btn[hidden] { display: none !important; }
.install-btn svg { display: block; }
@media (max-width: 640px) {
  .install-btn span { display: none; }
  .install-btn { padding: 0 8px; }
}
