:root {
  --green: #252525;
  --panel-radius: 8px;
  --panel-padding: clamp(14px, 2.1vw, 22px);
  --section-gap: 20px;
  --ink: #202020;
  --muted: #737373;
  --border: #dedede;
  --surface: #f7f7f7;
  --page: #fafafa;
  --card: #ffffff;
  --secondary: #626262;
  --hover: #ededed;
  --selected: #e8e8e8;
  --active: #242424;
  --active-text: #ffffff;
  --error: #a32929;
  --warning-text: #854d0e;
  --warning-bg: #fef3c7;
  --logged: #2563eb;
  --locked: #b86a08;
  --recorded: #15803d;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --green: #e5e5e5;
  --ink: #ededed;
  --muted: #a3a3a3;
  --border: #383838;
  --surface: #1b1b1b;
  --page: #141414;
  --card: #1e1e1e;
  --secondary: #b8b8b8;
  --hover: #2b2b2b;
  --selected: #343434;
  --active: #e5e5e5;
  --active-text: #181818;
  --error: #ff9494;
  --warning-text: #fcd34d;
  --warning-bg: #392a12;
  --logged: #82adff;
  --locked: #efb35f;
  --recorded: #74d99b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 20px; scrollbar-gutter: stable; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, .table-wrap:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.brand { display: block; color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.055em; text-decoration: none; }
.brand::first-letter { color: var(--logged); font-size: 1.4em; font-weight: 900; font-style: italic; margin-inline-end: .04em; }
.app-header { display: flex; align-items: center; gap: 8px; min-height: 64px; border-bottom: 1px solid var(--border); }
.app-header .brand { margin-inline-end: clamp(10px, 3vw, 44px); }
.header-actions { display: flex; gap: 6px; }
#theme { display: grid; place-items: center; width: 36px; min-height: 36px; padding: 0; }
[data-theme="light"] .theme-light, [data-theme="dark"] .theme-dark { display: none; }
.page-nav { display: flex; gap: 4px; }
.page-nav a { padding: 8px 12px; border-radius: 4px; color: var(--secondary); font-size: 13px; font-weight: 600; text-decoration: none; }
.page-nav a:hover { background: var(--hover); }
.page-nav a[aria-current] { background: var(--active); color: var(--active-text); }
.page-nav a[href="#clusters"] { white-space: nowrap; }
.page-nav-badge {
  display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 2px;
  padding: 2px 6px; border-radius: 999px; background: var(--warning-bg); color: var(--warning-text);
  font-size: 10px; font-weight: 700; line-height: 1.2;
}
.page-nav-badge > span { font-size: 12px; line-height: 1; }
:root:not([data-theme="dark"]) .page-nav-badge {
  background: linear-gradient(115deg, #c43a21, #a92e19);
  color: #fff;
  box-shadow: 0 1px 3px #a92e1940;
}
:root:not([data-theme="dark"]) .page-nav-badge > span { color: #ffe19b; }
:root[data-theme="dark"] .page-nav-badge {
  background: linear-gradient(115deg, #ffe480, #ffac40);
  color: #3b2009;
  box-shadow: 0 0 8px #ffac4066;
}
@media (prefers-reduced-motion: no-preference) {
  .page-nav-badge { animation: new-badge-bounce 950ms ease-in-out 3; }
  @keyframes new-badge-bounce {
    0%, 65%, 100% { transform: translateY(0) rotate(0); }
    30% { transform: translateY(-4px) rotate(-7deg); }
    48% { transform: translateY(1px) rotate(4deg); }
  }
}
.repo-support {
  display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto;
  min-height: 36px; padding-inline: 10px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--locked) 45%, var(--border));
  background: color-mix(in srgb, var(--locked) 10%, var(--card)); color: var(--ink);
  font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.repo-support svg { color: var(--locked); }
.repo-support:hover { border-color: var(--locked); background: color-mix(in srgb, var(--locked) 18%, var(--card)); }
main {
  max-width: 1296px;
  margin-inline: auto;
  padding: 0 clamp(16px, 4vw, 48px) 32px;
}
@media (min-width: 1440px) {
  #dashboard {
    --dashboard-scale: 1.1;
    zoom: var(--dashboard-scale);
  }
}
h1 { margin: 0; font-size: 27px; line-height: 1.3; font-weight: 650; letter-spacing: -.7px; }
.button { padding: 8px 13px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--ink); font-size: 12px; white-space: nowrap; }
.button:hover { background: var(--hover); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 24px 0 18px; }
.day-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; width: 100%; gap: 10px; }
.toolbar-actions { display: grid; justify-items: end; gap: 3px; }
.toolbar-actions:has(#day-tabs:not([hidden])) { flex: 1 1 100%; }
#last-refresh { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#last-refresh:empty { display: none; }
#refresh { min-width: 102px; }
.tabs { display: flex; border: 1px solid var(--border); border-radius: 4px; background: var(--card); }
.tabs button { padding: 8px 13px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.tabs button + button { border-left: 1px solid var(--border); }
.tabs button[aria-pressed="true"] { background: var(--selected); color: var(--ink); font-weight: 600; }
.tabs button:focus-visible, .attendance-period summary:focus-visible, .table-wrap:focus-visible { outline-offset: -3px; }
#status { color: var(--secondary); min-width: 0; overflow-wrap: anywhere; }
#status.error { color: var(--error); }
.card { min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--panel-radius); }
#daily-session { display: contents; }
.session-details {
  display: grid;
  flex-basis: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding-block: clamp(16px, 2vw, 28px);
}
.session-details > div { padding-inline: clamp(14px, 2.5vw, 32px); }
.session-details > div + div { border-inline-start: 1px solid var(--border); }
.session-details dt { color: var(--secondary); font-size: 13px; }
.session-details dd { margin: 4px 0 0; font: 600 clamp(17px, 1.7vw, 23px)/1.3 ui-monospace, monospace; overflow-wrap: anywhere; }
#goal-panel { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--border); }
.period-slot { display: grid; min-width: 0; }
#period-progress-title a { text-decoration: none; }
#period-progress-title a:is(:hover, :focus-visible) { text-decoration: underline; text-underline-offset: 3px; }
.detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-readings { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
#recorded.unposted { color: var(--secondary); font-family: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0; }
.time-chart { padding: var(--panel-padding); }
.daily-chart-heading, #time-chart-legend, .daily-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; }
.daily-chart-heading { justify-content: space-between; }
#time-chart-legend { margin-top: 16px; align-items: center; }
.chart-totals { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.chart-totals dd { display: grid; gap: 2px; margin: 2px 0 0; }
.chart-totals strong { color: var(--ink); font: 600 clamp(17px, 2vw, 22px)/1.25 ui-monospace, monospace; }
.chart-totals small { font-size: 11px; color: var(--muted); }
.chart-totals small:empty { display: none; }
#day-upcoming { margin-inline-start: auto; }
.time-chart h2 { font-size: 17px; }
#time-chart-period { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
#time-chart-legend, .daily-readout { color: var(--secondary); font-size: 12px; }
.legend-total::before, .legend-locked::before { content: ''; display: inline-block; width: .72em; height: .72em; margin-right: 6px; border-radius: 2px; }
.legend-total::before { background: var(--logged); }
.legend-locked::before { background: var(--locked); }
.daily-readout { padding-top: 12px; border-top: 1px solid var(--border); }
.daily-readout strong, .daily-readout b { color: var(--ink); font-weight: 600; }
.daily-readout b { margin-left: 3px; font-variant-numeric: tabular-nums; }
.metric-value {
  margin-top: 12px;
  overflow-wrap: anywhere;
  font: 550 clamp(26px, 3.5vw, 42px)/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}
.goal-line, .goal-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 10px; color: var(--muted); font-size: 11px; }
.goal-line { flex-wrap: wrap; }
.goal-line h3 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.goal-line strong { color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.goal-actions, .goal-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.goal-link { border: 0; background: none; padding: 4px 0; color: var(--secondary); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.goal-link:hover { color: var(--ink); }
#goal-editor { display: grid; justify-items: start; gap: 10px; margin-top: 12px; }
.goal-fields label { display: grid; gap: 3px; color: var(--secondary); font-size: 12px; }
.goal-fields input { width: 7ch; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--ink); font-size: 14px; }
#goal-editor .button { background: var(--active); color: var(--active-text); border-color: var(--active); }
#goal-error { margin: 0; color: var(--error); font-size: 12px; }
.progress { height: 4px; margin: 8px 0; border-radius: 999px; overflow: hidden; background: var(--selected); }
.progress div { height: 100%; background: var(--logged); width: 0; }
.history, .attendance { margin-top: var(--section-gap); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: var(--panel-padding); }
h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.table-wrap { overflow: auto; max-height: 330px; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; padding: 10px var(--panel-padding); background: var(--surface); border-block: 1px solid var(--selected); color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .4px; }
td { padding: 11px var(--panel-padding); border-bottom: 1px solid var(--border); color: var(--secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.empty { white-space: normal; text-align: center; padding: 35px 20px; color: var(--muted); }
.tag { color: var(--secondary); font-size: 11px; }
.overview-summary, .daily-report, .detail-summary, .detail-readings { display: grid; gap: 12px; }
.overview-summary { grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); }
.summary-column { display: flex; flex-direction: column; padding: var(--panel-padding); }
.summary-column h2 { color: var(--ink); font-size: 13px; }
.summary-column > p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.pill { padding: 1px 6px; border-radius: 999px; background: var(--surface); color: var(--secondary); font-size: 10px; }
.summary-column .metric-value { font-size: clamp(24px, 3vw, 37px); }
.hourly-locks { grid-column: 1 / -1; padding: var(--panel-padding); }
.hourly-heading, .hourly-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.hourly-heading h2 { font-size: 16px; }
.hourly-heading p, #hourly-empty { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.hourly-heading a { color: var(--secondary); font-size: 12px; text-decoration: none; }
.hourly-heading a:hover { text-decoration: underline; }
#hourly-empty { margin-top: 16px; }
.duration-plot { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px; margin: 22px 0 28px; height: clamp(88px, calc(13vh / var(--dashboard-scale, 1)), 136px); font: 11px/1 ui-monospace, monospace; color: var(--muted); }
.duration-axis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; margin-block: -.5em; }
.duration-bars { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; background: linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat; border-block: 1px solid var(--border); }
.duration-slot { position: relative; min-width: 0; }
.hour-slot[data-tick]::after { content: attr(data-tick); position: absolute; left: 0; top: calc(100% + 7px); }
.duration-slot input { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; cursor: pointer; }
.duration-slot input:enabled:hover, .duration-slot input:checked { background: color-mix(in srgb, var(--slot-accent, var(--locked)) 10%, transparent); }
.duration-slot input:focus-visible { outline-offset: -2px; }
.hour-slot input:enabled::after { content: ''; position: absolute; inset-inline: 13%; bottom: 0; height: var(--bar-height, 0); border-radius: 2px 2px 0 0; background: var(--locked); }
.duration-slot input:disabled, .hour-upcoming::before { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--border) 4px 5px); }
.duration-slot input:disabled { opacity: .52; cursor: default; }
.daily-plot { --plot-height: clamp(132px, 19vh, 200px); --label-space: 1.7em; --slot-accent: var(--logged); height: auto; margin: 8px 0 12px; }
.daily-plot .duration-axis { height: calc(var(--plot-height) + 1em); margin-top: calc(var(--label-space) - .5em); }
.daily-scroll { overflow-x: auto; padding-block: var(--label-space) 35px; scrollbar-width: thin; }
#time-chart-days { width: max-content; min-width: 100%; height: var(--plot-height); grid-auto-columns: minmax(16ch, 1fr); }
.day-slot time { position: absolute; top: calc(100% + 6px); width: 100%; text-align: center; line-height: 1.2; cursor: pointer; }
.day-slot time::before { content: attr(data-weekday); display: block; }
.day-slot input:checked + time { color: var(--ink); font-weight: 700; }
.day-slot input:disabled + time { cursor: default; }
.day-bar { --offset: clamp(3.6ch, 21%, 4.5ch); position: absolute; bottom: 0; width: min(28%, 30px); height: 0; transform: translateX(-50%); border-radius: 3px 3px 0 0; background: var(--bar-color); pointer-events: none; }
.bar-total { --bar-color: var(--logged); left: calc(50% - var(--offset)); }
.bar-locked { --bar-color: var(--locked); left: calc(50% + var(--offset)); }
.day-bar > span { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); color: color-mix(in srgb, var(--bar-color) 75%, var(--ink)); font-weight: 600; white-space: nowrap; }
.day-bar.missing { --bar-color: var(--muted); border-top: 2px dotted var(--muted); }
.hourly-footer { padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--secondary); }
#hour-value { font-variant-numeric: tabular-nums; }
#hour-value::before, .hour-upcoming::before { content: ''; display: inline-block; width: .72em; height: .72em; border-radius: 2px; margin-right: 6px; }
#hour-value::before { background: var(--locked); }
.hour-upcoming::before { border: 1px solid var(--border); }
.period-badges { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; }
.period-badge { padding: 4px 11px; border-radius: 999px; background: var(--surface); color: var(--logged); font-size: 12px; font-weight: 600; }
.period-badge.target-reached { color: var(--recorded); }
.period-count { color: var(--muted); font-size: 12px; }
.period-gauge {
  position: relative;
  isolation: isolate;
  display: grid;
  place-content: center;
  width: 160px;
  max-width: 100%;
  align-self: center;
  margin-block: 8px;
  aspect-ratio: 1;
  color: var(--ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.period-gauge::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 225deg, var(--logged) 0deg var(--period-sweep, 0deg), var(--border) var(--period-sweep, 0deg) 270deg, transparent 270deg);
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
}
.period-gauge strong { font-size: 22px; line-height: 1.15; }
.period-gauge span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.attendance-periods { display: grid; gap: 12px; margin: 0 var(--panel-padding); color: var(--muted); font-size: 12px; }
.attendance-period { border: 1px solid var(--border); border-radius: 5px; min-width: 0; }
.attendance-period summary { display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; color: var(--ink); list-style: none; }
.attendance-period summary::-webkit-details-marker { display: none; }
.attendance-period summary::after { content: ''; border: solid var(--secondary); border-width: 0 1px 1px 0; width: 6px; height: 6px; flex-shrink: 0; transform: rotate(45deg); }
.attendance-period[open] > summary::after, .attendance-day[open] > summary::after { transform: rotate(225deg); }
.attendance-period summary small { display: block; margin-top: 5px; color: var(--muted); }
.period-totals { margin-left: auto; text-align: right; }
.attendance-days { margin: 0 16px 12px; }
.attendance-days:empty { display: none; }
.attendance-day + .attendance-day { border-top: 1px solid var(--border); }
.attendance-day > summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7ch, 9ch) minmax(9ch, 18%) 6px; gap: clamp(6px, 2vw, 18px); min-height: 54px; padding: 10px 8px; }
.attendance-day > summary:hover, .attendance-day > summary[aria-current] { background: var(--selected); }
.attendance-day > summary strong { font: 600 13px ui-monospace, monospace; }
.day-count-status { color: var(--muted); font-size: 11px; }
.day-count-status.counted { color: var(--recorded); }
.attendance-day-content { display: grid; justify-items: start; gap: 10px; padding: 10px 12px 12px; }
.inline-day-report { width: 100%; min-width: 0; overflow-wrap: anywhere; }
.inline-day-totals { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 6px 0 14px; }
.inline-day-totals dd { margin: 4px 0 0; color: var(--ink); font-weight: 600; }
.inline-day-report .table-wrap { max-height: none; }
.inline-day-report caption { text-align: left; padding-bottom: 8px; color: var(--ink); }
.inline-day-report th, .inline-day-report td { padding: 8px 10px; }
.attendance-help { margin: 12px var(--panel-padding) var(--panel-padding); color: var(--muted); font-size: 11px; }
footer { margin-top: 12px; color: var(--muted); font-size: 13px; }
.session-screen { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.session-card { width: min(100%, 460px); padding: clamp(20px, 5vw, 36px); }
.session-card .brand { margin-bottom: 22px; }
.session-card h1 { margin: 0; }
.session-card p { margin: 8px 0 0; color: var(--secondary); overflow-wrap: anywhere; }
.session-card .browser-note { padding: 10px 12px; border-radius: 6px; color: var(--warning-text); background: var(--warning-bg); }
.session-services { list-style: none; padding: 0; margin: 24px 0; border-top: 1px solid var(--border); }
.session-services li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.session-services strong { font-size: 16px; font-weight: 600; }
.session-state { display: flex; align-items: center; gap: 7px; margin-top: 2px; color: var(--secondary); font-size: 13px; }
.session-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.session-state[data-state="signed-in"] { color: var(--recorded); }
.session-state[data-state="signed-out"] { color: var(--warning-text); }
.session-link { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font-size: 13px; text-decoration: none; }
.session-link span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.session-link:hover { color: var(--secondary); }
.session-card #session-status:not(:empty) { margin: 0 0 16px; }
.session-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.session-actions .button { min-height: 44px; font-size: 13px; }
#retry-session { min-width: clamp(108px, 15vw, 152px); background: var(--active); color: var(--active-text); border-color: var(--active); }
#retry-session:hover:enabled { opacity: .85; }
.cluster-warning { display: grid; gap: 3px; width: fit-content; margin: 18px 0; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--warning-text) 28%, transparent); border-radius: 999px; background: var(--warning-bg); color: var(--warning-text); }
.cluster-warning strong { font-size: 15px; }
.install-command { margin: 16px 0; padding: 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink); font: 13px/1.65 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.install-help { margin-top: 18px; color: var(--secondary); font-size: 13px; }
.install-help summary { width: fit-content; cursor: pointer; }
.install-help p { margin-top: 8px; }
.install-help code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.install-help a { display: inline-block; margin-top: 6px; }
.session-card .server-status { color: var(--muted); font-size: 13px; }
.primary-button { background: var(--active); color: var(--active-text); border-color: var(--active); }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
[hidden] { display: none !important; }
@media (max-width: 680px) {
  .app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 6px; padding-block: 8px; }
  .app-header .page-nav { grid-column: 1 / -1; grid-row: 2; }
  .app-header .repo-support { grid-column: 2; grid-row: 1; }
  .header-actions { grid-column: 3; grid-row: 1; justify-self: end; }
  .toolbar { align-items: flex-end; }
  .overview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #logged-card { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  :root { --section-gap: 16px; }
  .overview-summary, .detail-summary { grid-template-columns: minmax(0, 1fr); }
  .detail-readings { row-gap: 0; }
  .detail-readings .summary-column {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    padding-inline: clamp(6px, 2vw, 14px);
  }
  .daily-report .reading-source { overflow-wrap: anywhere; }
  .hour-slot[data-tick]::after { font-size: 10px; }
  .app-header { min-height: 58px; gap: 6px; }
  .app-header .brand { font-size: 20px; }
  .page-nav { gap: 4px; }
  .page-nav a { padding-inline: 6px; }
  .repo-support { padding-inline: 6px; }
  .app-header .button { padding-inline: 8px; }
  .session-actions .button { flex: 1 1 auto; }
  .toolbar { align-items: start; }
  .day-controls { gap: 6px; }
  .day-controls .button, .tabs button { padding-inline: 8px; }
  #refresh { min-width: 85px; }
  h1 { font-size: 24px; }
  .attendance-period > summary { gap: 9px; padding: 12px; }
  .attendance-days { margin-inline: 8px; }
  .attendance-day > summary { gap: 7px; }
}
@media (max-width: 360px) {
  .repo-support { justify-content: center; width: 36px; font-size: 0; gap: 0; }
  .page-nav { gap: 2px; }
  .page-nav a { padding-inline: 4px; }
}
#logged, #daily-net { color: var(--logged); }
#locked, #overview-locked { color: var(--locked); }

.history .section-heading { align-items: baseline; padding: var(--panel-padding) var(--panel-padding) 0; }
.history .section-heading p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
#history-graph { padding: 0 var(--panel-padding) 16px; }
#history-graph .duration-plot { height: clamp(110px, calc(16vh / var(--dashboard-scale, 1)), 180px); }
#history-graph .hour-slot input:disabled { opacity: .34; }
#lock-periods { border-top: 1px solid var(--border); }
#lock-periods > summary { padding: 12px var(--panel-padding); cursor: pointer; font-weight: 600; }
.history h2 { font-size: 17px; }
.history .count { font-size: 12px; }
.history th { font-size: 11px; letter-spacing: 0; }
.history td:not(.empty) { color: var(--ink); font-size: 13px; }
.history th:last-child, .history td:last-child:not(.empty) { text-align: right; }
.history-help { padding: 10px var(--panel-padding); border-top: 1px solid var(--border); color: var(--secondary); font-size: 12px; }
.history-help summary { width: fit-content; cursor: pointer; }
#warnings:empty { display: none; }
.history-help p { margin: 6px 0 0; max-width: 75ch; }
@media (max-width: 480px) {
  .history th, .history td { padding-inline: 8px; }
}

.settings-dialog {
  width: min(400px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 22px;
  color: var(--ink);
}
.settings-dialog::backdrop { background: rgb(0 0 0 / .45); }
.settings-dialog h2 { margin-bottom: 18px; font-size: 18px; }
.settings-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.settings-field select { min-width: clamp(108px, 15vw, 152px); font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 5px 7px; }
.settings-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--logged); }
.settings-description, .settings-error { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.settings-error { color: var(--error); }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
select:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }

#recorded { color: var(--recorded); }

#dashboard:has(#clusters-page:not([hidden]) #cluster-map:not([hidden])) {
  display: flex; flex-direction: column;
  max-height: calc(100dvh / var(--dashboard-scale, 1)); padding-bottom: 12px;
}
.clusters { --map-pad: clamp(8px, 2vw, 24px); display: flex; flex-direction: column; min-height: 0; margin-top: 12px; }
.cluster-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 16px var(--map-pad) 0; }
#cluster-switcher { display: flex; flex-wrap: wrap; max-width: 100%; }
#cluster-switcher:empty { display: none; }
.clusters { --cluster-accent: #007f85; }
[data-theme="dark"] .clusters { --cluster-accent: #6bd5d5; }
#cluster-switcher button {
  flex: none; padding: 5px 10px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--cluster-accent); font-weight: 500;
}
#cluster-switcher small { display: block; color: var(--secondary); font-size: 11px; font-weight: 400; line-height: 1.4; font-variant-numeric: tabular-nums; }
#cluster-switcher button[aria-pressed="true"] { border-color: var(--cluster-accent); }
#cluster-switcher button:hover { background: var(--surface); }
#cluster-switcher button:focus-visible { outline-offset: -3px; }
.cluster-heading { padding: 20px var(--map-pad); }
.cluster-heading h2 { font-size: 20px; }
#cluster-summary { margin: 2px 0 0; color: var(--secondary); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.cluster-search { display: flex; align-items: center; gap: 8px; padding: 7px 10px; color: var(--secondary); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; }
.cluster-search:focus-within { outline: 2px solid var(--logged); outline-offset: 2px; }
.cluster-search input { min-width: 0; width: 26ch; padding: 0; background: transparent; color: var(--ink); font-size: 13px; border: 0; outline: 0; }
#cluster-map {
  align-self: center; container-type: size; min-height: 0; margin-block: 12px;
  width: min(calc(100% - 2 * var(--map-pad)), calc(var(--plan-width) * 1px)); aspect-ratio: var(--plan-ratio);
}
.floor-plan {
  position: relative; container-type: inline-size; margin-inline: auto;
  width: min(100%, calc(100cqh * var(--plan-ratio))); aspect-ratio: var(--plan-ratio);
}
.floor-label { position: absolute; transform: translateY(-82%); color: var(--secondary); font: 700 calc(1600cqw / var(--plan-width))/1 Helvetica, Arial, sans-serif; white-space: nowrap; }
.floor-seat { position: absolute; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 4px; }
.floor-seat[data-host] { isolation: isolate; border: 0; border-radius: 0; background: var(--selected); color: var(--ink); font: 600 min(12px, calc(1200cqw / var(--plan-width)))/1 ui-monospace, monospace; text-decoration: none; cursor: pointer; }
.floor-seat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.floor-seat[data-host]:is(:hover, :focus-visible, [aria-current]) { outline: 2px solid var(--cluster-accent); outline-offset: 2px; z-index: 1; }
#cluster-profile {
  --profile-bg: #06767b;
  position: fixed; z-index: 5; display: flex; align-items: flex-start; gap: 10px;
  width: max-content; max-width: min(292px, calc(100% - 12px)); padding: 10px 14px 10px 10px;
  border-radius: 5px; background: var(--profile-bg); color: white; box-shadow: 0 3px 12px #0002;
  font-size: 13px; line-height: 1.4;
}
#cluster-profile::after {
  content: ''; position: absolute; left: var(--arrow-left); top: 100%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--profile-bg); border-bottom: 0;
}
#cluster-profile.below-seat::after { top: auto; bottom: 100%; border-top: 0; border-bottom: 6px solid var(--profile-bg); }
.cluster-profile-avatar {
  position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px;
  overflow: hidden; border-radius: 50%; background: #dcf1f1; color: #17575a; font-weight: 650;
}
.cluster-profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cluster-profile-info { min-width: 0; max-height: var(--profile-space, calc(100dvh - 40px)); overflow: auto; overflow-wrap: anywhere; }
#cluster-profile-name { font-size: 14px; }
#cluster-profile-projects { margin-top: 4px; }
#cluster-profile-projects ul { margin: 0; padding-inline-start: 16px; }
#cluster-inspector { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 13px var(--map-pad); min-height: 46px; border-top: 1px solid var(--border); background: var(--surface); color: var(--secondary); }
#cluster-inspector:empty { display: none; }
#cluster-inspector strong, #cluster-results strong { font-family: ui-monospace, monospace; color: var(--ink); }
#cluster-inspector:has(strong) { position: sticky; bottom: 0; z-index: 2; }
#cluster-inspector time { margin-inline-start: auto; font-size: 12px; }
#cluster-sign-in { display: inline-flex; margin: 0 var(--map-pad) 18px; }
#cluster-results { margin: 0; padding: 0 var(--map-pad) 14px; list-style: none; }
#cluster-results:empty { display: none; }
#cluster-results button {
  display: grid; align-items: baseline; grid-template-columns: minmax(6em, .5fr) 1fr auto; gap: 10px;
  width: 100%; padding: 10px 3px; text-align: left; border: 0; border-top: 1px solid var(--border);
  background: var(--card); color: var(--secondary); overflow-wrap: anywhere;
}
#cluster-results button:is(:hover, :focus-visible, [aria-pressed="true"]) { background: var(--surface); }
@media (max-width: 480px) {
  .cluster-search { width: 100%; }
  .cluster-search input { width: 100%; }
  #cluster-inspector time { flex-basis: 100%; }
}
