/* WorkTracker web — single stylesheet.
   Theme: an office time clock. Paper-grey card stock, ink-navy text, brass for the one accent,
   and stamped monospace numerals for every clock time and duration. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/BricolageGrotesque-400-800.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;
  --paper: #eef1ec;        /* time-card stock */
  --surface: #ffffff;
  --surface-2: #f6f8f5;
  --ink: #17212c;          /* main text */
  --ink-soft: #55616d;     /* secondary text */
  --ink-faint: #8a949e;
  --line: #d8ddd6;
  --brass: #a8701c;        /* the single accent: clock stamps, active nav, primary buttons */
  --brass-soft: #f3e6cf;
  --on-brass: #ffffff;
  --productive: #3fa64e;     /* DeskTime-style green */
  --neutral: #8a949e;
  --unproductive: #c2414b;
  --idle: #cfd5d0;
  --offline: #4f78a8;
  --break: #e0952b;
  --warn: #a8701c;
  --danger: #b4323c;
  --focus: #2f6fb5;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 0 rgba(23, 33, 44, 0.04), 0 1px 3px rgba(23, 33, 44, 0.06);
  --sidebar-w: 236px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #10151b;
    --surface: #171e26;
    --surface-2: #1c242e;
    --ink: #e6ebee;
    --ink-soft: #a3adb7;
    --ink-faint: #75808b;
    --line: #2a3440;
    --brass: #e0a43a;
    --brass-soft: #3a2e17;
    --on-brass: #1a1305;
    --productive: #5cc46a;
    --neutral: #7d8893;
    --unproductive: #e46670;
    --idle: #36404b;
  --offline: #7ea6d6;
  --break: #f0b35a;
  --warn: #e0a43a;
    --danger: #f07178;
    --focus: #7fb0ea;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #10151b;
  --surface: #171e26;
  --surface-2: #1c242e;
  --ink: #e6ebee;
  --ink-soft: #a3adb7;
  --ink-faint: #75808b;
  --line: #2a3440;
  --brass: #e0a43a;
  --brass-soft: #3a2e17;
  --on-brass: #1a1305;
  --productive: #5cc46a;
  --neutral: #7d8893;
  --unproductive: #e46670;
  --idle: #36404b;
  --offline: #7ea6d6;
  --break: #f0b35a;
  --warn: #e0a43a;
  --danger: #f07178;
  --focus: #7fb0ea;
  --shadow: none;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

p { margin: 0 0 0.75em; }
a { color: var(--brass); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.mono, time, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- app shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 8px 10px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand-company {
  font-size: 12.5px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The brand mark: a 24-hour ribbon, like a strip of a punched time card. */
.ribbon-mark {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 1.5px;
  height: 8px;
  width: 100%;
}
.ribbon-mark span { border-radius: 1px; background: var(--idle); }
.ribbon-mark .p { background: var(--productive); }
.ribbon-mark .n { background: var(--neutral); }
.ribbon-mark .u { background: var(--unproductive); }

nav { display: flex; flex-direction: column; gap: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 10px 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link[aria-current="page"] {
  background: var(--brass-soft);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--brass);
}
.nav-link svg { width: 17px; height: 17px; flex: none; color: var(--ink-soft); }
.nav-link[aria-current="page"] svg { color: var(--brass); }

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.whoami { padding: 0 8px; min-width: 0; }
.whoami-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-role { font-size: 12.5px; color: var(--ink-soft); }
.foot-actions { display: flex; gap: 6px; padding: 0 4px; }

.main {
  min-width: 0;
  padding: 26px 32px 64px;
}
.main-inner { max-width: 1180px; margin: 0 auto; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head .eyebrow {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.page-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Mobile top bar replaces the sidebar header. */
.topbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 280px);
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 0 100vmax transparent;
  }
  .shell[data-nav-open] .sidebar {
    transform: none;
    box-shadow: 0 0 0 100vmax rgba(10, 14, 18, 0.45);
  }
  .main { padding: 18px 16px 56px; }
  h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ---------- components ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/1 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.btn-primary:hover { background: var(--brass); filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--ink-soft); font-weight: 400; }

.input, select.input, textarea.input {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 14px/1.4 var(--font-body);
  width: 100%;
}
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type="date"].input, input[type="time"].input { font-family: var(--font-mono); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Stamped clock values: arrival time, totals. */
.stamp {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12.5px; color: var(--ink-soft); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Pagination under long lists */
.pager {
  display: flex;
  flex-direction: row; /* the sidebar's global nav rule stacks items */
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pager-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pager-info { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pager-size { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.pager-size .input-sm { min-width: 64px; }
.pager-buttons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-buttons .btn { min-width: 34px; font-variant-numeric: tabular-nums; }
.pager-gap { padding: 0 4px; color: var(--ink-faint); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--neutral); }
.dot.p { background: var(--productive); }
.dot.u { background: var(--unproductive); }
.dot.i { background: var(--idle); }

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
}
.empty h2 { color: var(--ink); margin-bottom: 6px; }

.error-text { color: var(--danger); font-size: 13.5px; min-height: 1.3em; margin: 0; }

/* Toast messages (bottom right). */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}
.toast {
  max-width: 360px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.toast.error { background: var(--danger); color: #fff; }

/* Full-page centred layout for login / signup. */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card { width: min(420px, 100%); }

.loading {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-faint);
}

/* ---------- forms & small utilities ---------- */

.small { font-size: 13px; }
.section-gap { margin-top: 16px; }
.grow { flex: 1 1 220px; min-width: 0; }

.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack h3 { margin-top: 8px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 140px; }
.form-row-end { align-items: flex-end; }
/* Popup dialogs (native <dialog>) */
.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.modal::backdrop { background: rgba(15, 15, 15, 0.45); }
.modal-body { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
.modal-body h2 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal.modal-wide { width: min(560px, calc(100vw - 32px)); }

/* Project notes and files (inside an opened project) */
.project-extras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 14px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
@media (max-width: 860px) { .project-extras { grid-template-columns: 1fr; } }
.extras-col h3 { margin: 0 0 8px; }
.extras-col textarea.input { resize: vertical; min-height: 60px; }
.note-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note-list li { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--surface-2); }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.file-list li { align-items: center; }
.file-main { display: flex; flex-direction: column; min-width: 0; }
.file-main .file-name { justify-content: flex-start; padding: 0; min-height: 0; text-align: left; overflow-wrap: anywhere; white-space: normal; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .error-text { flex-basis: 100%; min-height: 0; }
.inline-form .error-text:empty { display: none; }
.field-inline { flex-direction: row; align-items: center; }
.input.input-sm { min-height: 30px; padding: 4px 8px; font-size: 13px; width: auto; }

.btn-block { width: 100%; }
.btn.armed { color: #fff; background: var(--danger); border-color: var(--danger); }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--brass); margin: 0; }

fieldset.days { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
fieldset.days legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-dim { color: var(--ink-faint); }
.row-dim a { color: var(--ink-soft); }

.notice {
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--brass-soft);
  border: 1px solid var(--line);
}
.notice-error { background: transparent; border-color: var(--danger); color: var(--danger); }

.badge-warn { color: var(--warn); border-color: currentColor; background: transparent; }
.badge-p { color: var(--productive); border-color: currentColor; background: transparent; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.plain-list li:last-child { border-bottom: none; }
.plain-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.plain-list li > .inline-form { flex: 1; }

/* Tabs (settings). */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 8px 14px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brass); }

/* Segmented buttons (filters, productivity choice). */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.segmented button {
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font: 500 13px/1 var(--font-body);
  padding: 8px 12px;
  cursor: pointer;
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--surface-2); color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--brass-soft); color: var(--ink); font-weight: 600; }
.segmented-sm button { padding: 6px 9px; font-size: 12.5px; }
.segmented .seg-p[aria-pressed="true"] { background: var(--productive); color: #fff; }
.segmented .seg-u[aria-pressed="true"] { background: var(--unproductive); color: #fff; }
.segmented .seg-n[aria-pressed="true"] { background: var(--neutral); color: #fff; }

/* ---------- auth pages ---------- */

.auth-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.auth-head .ribbon-mark { width: 120px; }
.auth-head h1 { font-size: 24px; margin-top: 6px; }
.auth-head p { margin: 0; }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.auth-foot p { margin: 0 0 6px; }

/* ---------- page tools ---------- */

.date-nav { display: inline-flex; align-items: center; gap: 6px; }
.date-nav .input { width: auto; }
.date-nav .btn-icon { font-size: 20px; line-height: 1; }
.month-label { font-family: var(--font-display); font-weight: 650; min-width: 9.5em; text-align: center; }

.range-controls { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range-controls select.input { width: auto; }
.range-dates { display: inline-flex; gap: 6px; align-items: center; }
.range-dates .input { width: auto; }
.range-dates.readonly .input { color: var(--ink-soft); background: var(--surface-2); }

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 0;
}
.stat .stamp { font-size: 24px; }
.stat-sub { font-size: 12px; color: var(--ink-faint); }
.stamp-p { color: var(--productive); }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .stats, .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .stamp { font-size: 21px; }
}

.breakdown { margin-bottom: 16px; }
.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.stack-bar .seg { flex: 0 0 0; min-width: 3px; background: var(--neutral); }
.seg.p, .tl-block.p, .usage-bar .p { background: var(--productive); }
.seg.n, .tl-block.n, .usage-bar .n { background: var(--neutral); }
.seg.u, .tl-block.u, .usage-bar .u { background: var(--unproductive); }
.seg.i, .tl-block.i { background: var(--idle); }
.dot.o, .tl-block.o {
  background: repeating-linear-gradient(135deg, var(--offline) 0 3px, transparent 3px 6px);
  box-shadow: inset 0 0 0 1px var(--offline);
}
.breakdown-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 20px;
  margin: 14px 0 0;
}
.breakdown-list > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.breakdown-list dt { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.breakdown-list dd { margin: 0; white-space: nowrap; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-soft); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- day timeline ---------- */

.timeline {
  position: relative;
  height: 44px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.tl-work { position: absolute; top: 0; bottom: 0; background: var(--brass-soft); opacity: 0.6; }
.tl-block { position: absolute; top: 6px; bottom: 6px; border-radius: 2px; }
.tl-block.i { top: 16px; bottom: 16px; }
.tl-axis { position: relative; height: 20px; margin-top: 4px; font: 11px/1 var(--font-mono); color: var(--ink-faint); }
.tl-axis span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.tl-axis span:first-child { transform: none; }
.tl-axis span:last-child { transform: translateX(-100%); }
@media (max-width: 560px) { .tl-axis span:nth-child(even) { display: none; } }

/* ---------- apps / sites usage ---------- */

.usage { list-style: none; margin: 0 0 8px; padding: 0; }
.usage li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1.4fr) minmax(40px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}
.usage-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: 999px; }

.offline-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 10px; }
.offline-form .btn { align-self: flex-start; }

/* ---------- screenshots ---------- */

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-bottom: 10px; }
.shot { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.shot-open {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
}
.shot-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-open img:not([src]) { visibility: hidden; }
.shot figcaption { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-del { align-self: flex-start; }
.shot-missing .shot-open { cursor: default; display: grid; place-items: center; }
.shot-missing .shot-open img { display: none; }
.shot-missing .shot-open::after { content: "Image missing"; font-size: 12px; color: var(--ink-faint); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(8, 11, 14, 0.82);
}
.lightbox figure { margin: 0; max-width: min(1400px, 100%); display: flex; flex-direction: column; gap: 8px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: var(--radius); }
.lightbox figcaption { color: #e6ebee; font-size: 14px; }
.lightbox-close { position: fixed; top: 14px; right: 14px; }

/* ---------- team ---------- */

.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--ink-faint); flex: none; }
.status .status-dot { margin-right: 0; }
.status-dot.st-online { background: var(--productive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--productive) 22%, transparent); }
.status-dot.st-idle { background: var(--warn); }
.status-dot.st-private { background: var(--offline); }
.status.st-offline { color: var(--ink-faint); }

/* ---------- reports ---------- */

.report-table td, .report-table th { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.report-table tfoot th { border-top: 2px solid var(--line); border-bottom: none; color: var(--ink); font-size: 14px; padding-top: 10px; }
.report-table tfoot th.num { font-family: var(--font-mono); }

/* ---------- projects ---------- */

.project-list { display: flex; flex-direction: column; }
.project { border-bottom: 1px solid var(--line); }
.project:last-child { border-bottom: none; }
.project summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  cursor: pointer;
  list-style: none;
}
.project summary::-webkit-details-marker { display: none; }
.project summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.7px solid var(--ink-soft);
  border-bottom: 1.7px solid var(--ink-soft);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex: none;
}
.project[open] summary::before { transform: rotate(45deg); }
.project-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.project-time { margin-left: auto; }
.project.archived .project-name { color: var(--ink-soft); }
.project-body { padding: 0 4px 16px 21px; display: flex; flex-direction: column; gap: 12px; }
.project-body h3 { font-size: 13px; color: var(--ink-soft); margin-bottom: 2px; }
.task-side { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.task-side .num { min-width: 60px; text-align: right; }

/* ---------- time off calendar ---------- */

.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 12px; font-weight: 600; color: var(--ink-soft); padding: 2px 6px 6px; }
.cal-day {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  background: var(--surface);
}
.cal-day.outside { background: var(--surface-2); }
.cal-day.outside .cal-num { color: var(--ink-faint); }
.cal-day.today { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.cal-num {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 13px/1 var(--font-mono);
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.cal-num:hover { background: var(--brass-soft); }
.cal-chip {
  font-size: 11.5px;
  line-height: 1.3;
  padding: 1px 6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface-2);
  border-left: 3px solid var(--neutral);
}
.cal-chip.t-vacation { border-left-color: var(--productive); }
.cal-chip.t-sick { border-left-color: var(--unproductive); }
.cal-chip.t-personal { border-left-color: var(--offline); }
.cal-chip.t-holiday { border-left-color: var(--brass); }
@media (max-width: 560px) {
  .calendar-card { padding: 10px; }
  .calendar { gap: 2px; }
  .cal-head { padding: 2px 2px 4px; font-size: 11px; }
  .cal-day { min-height: 54px; padding: 2px; }
  .cal-num { padding: 3px 4px; font-size: 12px; }
  .cal-chip { font-size: 10px; padding: 0 3px; border-left-width: 2px; }
}

/* ---------- settings ---------- */

.company-form { max-width: 760px; }
.invite-result { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--brass-soft); }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; min-width: 0; font-size: 13px; }

@media (max-width: 860px) {
  .page-tools { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .project summary::before { transition: none; }
}

/* Cards inside a grid line up; headings directly in a card get room before their content. */
.grid > .card { margin-top: 0; }
.card > h2:not(:last-child) { margin-bottom: 12px; }
.table .dot { margin-right: 4px; vertical-align: 1px; }
.table th.num { font-family: var(--font-body); }

/* ---------- settings: people ---------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: end; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-grid .error-text:empty { display: none; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.credentials {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--line);
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.people-table td { vertical-align: top; }
.people-table .input-sm { max-width: 160px; }
.row-buttons { white-space: nowrap; text-align: right; }
.row-buttons .btn + .btn { margin-left: 6px; }
.panel-row td { background: var(--surface-2); padding: 14px 16px; }
.link-btn {
  padding: 0 4px;
  min-height: 0;
  height: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.badge-team { font-size: 11px; padding: 0 6px; margin-right: 2px; }

.looks-after { margin-top: 4px; }
.looks-after .link-btn { font-family: var(--font-body); }

/* ---------- desktop app download ---------- */
.app-link { justify-content: flex-start; margin: 0 4px; color: var(--brass); }
.steps { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }


/* ===================== batch 3: breaks, tracking switch, sticky notes, files, members ===================== */

/* breaks on the timeline */
.dot.b, .tl-block.b {
  background: repeating-linear-gradient(135deg, var(--break) 0 3px, transparent 3px 6px);
  box-shadow: inset 0 0 0 1px var(--break);
}
.badge-break { color: var(--break); border-color: currentColor; background: transparent; }
.timeline.can-add { cursor: copy; }
.timeline.can-add .tl-block.i:hover { background: var(--break); opacity: 0.6; }
.tl-hint { font-size: 12px; color: var(--ink-faint); margin: 6px 0 0; }
.kind-choice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kind-choice label {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; text-align: center;
}
.kind-choice input { position: absolute; opacity: 0; pointer-events: none; }
.kind-choice label:has(input:checked) { border-color: var(--brass); background: var(--brass-soft); font-weight: 600; }
.kind-choice label:has(input:focus-visible) { outline: 2px solid var(--focus); }
.kind-choice .kind-icon { font-size: 18px; line-height: 1; }
@media (max-width: 480px) { .kind-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the app's own "W" mark (download link in the sidebar) */
.app-mark { width: 18px; height: 18px; flex: none; }

/* tracking on/off switch (Settings -> People) and status */
.switch {
  position: relative; width: 38px; height: 22px; border-radius: 999px; border: none; padding: 0; cursor: pointer;
  background: var(--idle); transition: background 0.15s; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: var(--productive); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tracking-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; }
.status-dot.st-paused, .status.st-paused .status-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-faint); }
.status.st-paused { color: var(--ink-faint); }

/* project sections */
.project-extras { display: flex; flex-direction: column; gap: 20px; margin: 16px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.px-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.px-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.px-count { font: 500 12px var(--font-body); color: var(--ink-faint); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

/* members */
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.member-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 3px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font: 600 11px var(--font-body); color: #fff; background: var(--brass);
}
.avatar.a1 { background: #3fa64e; } .avatar.a2 { background: #4f78a8; } .avatar.a3 { background: #c2414b; }
.avatar.a4 { background: #8b5cf6; } .avatar.a5 { background: #e0952b; } .avatar.a6 { background: #0f9d9a; }
.member-pick { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.member-pick label { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: var(--radius); cursor: pointer; }
.member-pick label:hover { background: var(--surface-2); }
.member-pick .who { display: flex; flex-direction: column; min-width: 0; }
.member-pick .who small { color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }

/* sticky notes */
.notes-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.sticky {
  --note: #fff2a8;
  position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 14px 14px 10px;
  background: var(--note); color: #2a2a20; border-radius: 3px 3px 14px 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 8px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sticky[draggable="true"] { cursor: grab; }
.sticky:hover { transform: translateY(-2px) rotate(-0.4deg); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16), 0 12px 22px rgba(0, 0, 0, 0.12); }
.sticky.c-yellow { --note: #fff2a8; } .sticky.c-green { --note: #d3f3c8; } .sticky.c-blue { --note: #cfe7ff; }
.sticky.c-pink { --note: #ffd5e3; } .sticky.c-purple { --note: #e6dcff; } .sticky.c-orange { --note: #ffdfc0; }
.color-dot.c-yellow { --note: #ffe46b; } .color-dot.c-green { --note: #9fe28a; } .color-dot.c-blue { --note: #8fc6ff; }
.color-dot.c-pink { --note: #ff9fc0; } .color-dot.c-purple { --note: #c3adff; } .color-dot.c-orange { --note: #ffb877; }
.sticky-colors { margin-top: 8px; padding: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.55); display: inline-flex; }
.sticky.dragging { opacity: 0.35; transform: none; }
.sticky.drop-before::before, .sticky.drop-after::after {
  content: ""; position: absolute; top: 4px; bottom: 4px; width: 4px; border-radius: 2px; background: var(--brass);
}
.sticky.drop-before::before { left: -10px; } .sticky.drop-after::after { right: -10px; }
.sticky-body { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; margin: 0; }
.sticky-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; font-size: 11.5px; color: rgba(0, 0, 0, 0.55); }
.sticky-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.sticky:hover .sticky-tools, .sticky:focus-within .sticky-tools { opacity: 1; }
@media (hover: none) { .sticky-tools { opacity: 1; } }
.sticky-tools button {
  width: 26px; height: 26px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1;
  background: rgba(255, 255, 255, 0.65); color: #333; display: inline-flex; align-items: center; justify-content: center;
}
.sticky-tools button:hover { background: #fff; }
.sticky-tools button.armed { background: var(--danger); color: #fff; width: auto; padding: 0 8px; }
.sticky textarea {
  flex: 1; min-height: 90px; resize: vertical; border: none; outline: none; padding: 0; background: transparent;
  color: inherit; font: 14px/1.45 var(--font-body);
}
.sticky .sticky-edit-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.color-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.color-dot {
  width: 18px; height: 18px; border-radius: 50%; padding: 0; cursor: pointer; background: var(--note);
  border: 2px solid rgba(0, 0, 0, 0.18);
}
.color-dot[aria-pressed="true"] { border-color: #2a2a20; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8) inset; }
.sticky .error-text { color: #9b1c25; font-size: 12px; margin: 4px 0 0; }
.notes-empty { border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: 22px; text-align: center; color: var(--ink-soft); }

/* files */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface-2); color: var(--ink-soft);
  transition: border-color 0.12s, background 0.12s;
}
.dropzone.over { border-color: var(--brass); background: var(--brass-soft); color: var(--ink); }
.dropzone strong { color: var(--ink); }
.upload-progress { font-size: 13px; color: var(--brass); font-weight: 600; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.file-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.file-thumb {
  height: 104px; width: 100%; border: none; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-ext { padding: 7px 12px; border-radius: 8px; font: 600 13px var(--font-mono); letter-spacing: 0.04em; color: #fff; background: var(--ink-faint); }
.file-ext.e-pdf { background: #c2414b; } .file-ext.e-doc { background: #2f6fb5; } .file-ext.e-xls { background: #3fa64e; }
.file-ext.e-ppt { background: #e0952b; } .file-ext.e-zip { background: #6b7280; } .file-ext.e-txt { background: #0f9d9a; }
.file-info { padding: 8px 10px 4px; min-width: 0; }
.file-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; gap: 2px; padding: 4px 6px 8px; flex-wrap: wrap; }
.file-actions .btn { padding: 0 7px; }
.file-actions { flex-wrap: nowrap; }
.restricted-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); }

[hidden] { display: none !important; }
