:root {
  --ink: #152033;
  --ink-soft: #5a6b80;
  --paper: #eef3f8;
  --card: #f8fbfe;
  --line: #d5e0ea;
  --accent: #1d6fbf;
  --accent-deep: #14528f;
  --sidebar: #16324f;
  --sidebar-text: #eef5fb;
  --sidebar-muted: #a9c0d4;
  --ok: #1f6b45;
  --ok-bg: #e5f4eb;
  --wait: #8a5a12;
  --wait-bg: #f8efd8;
  --no: #9f1239;
  --no-bg: #fde8ee;
  --shadow: 0 16px 40px rgba(22, 50, 79, 0.06);
  --radius: 18px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, p { margin-top: 0; }
h1, .brand strong, .total-num, .days-block strong {
  font-family: Fraunces, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  font-weight: 560;
  letter-spacing: -0.03em;
}
h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.12; margin-bottom: 0; }
h2 { font-size: 1.2rem; margin-bottom: 0.7rem; font-weight: 600; }
button, input, select, textarea { font: inherit; }
button { color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: #d4e6f7; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sidebar :focus-visible { outline-color: #b9d7f2; }

.loading { color: var(--ink-soft); padding: 2rem 1rem; }
.hint { color: var(--ink-soft); font-size: 0.88rem; font-weight: 400; }
.hint.warn, .warn { color: var(--no); }
.muted { color: var(--ink-soft); }
.empty { color: var(--ink-soft); margin: 0.2rem 0; }
abbr { text-decoration: none; color: var(--accent); margin-left: 0.15rem; }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-deep); }
.button-ghost { background: white; color: var(--ink); border-color: #c5d4e2; }
.button-danger { background: white; color: var(--no); border-color: #f0c2ce; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
#timesheet-form .actions { margin-top: 1.35rem; margin-bottom: 1.5rem; gap: 1rem; }

.banner { padding: 0.8rem 0.95rem; border-radius: 14px; margin: 0 0 1rem; }
.banner p { margin: 0.3rem 0; }
.banner p:first-child { margin-top: 0; }
.banner p:last-child { margin-bottom: 0; }
.banner a { color: inherit; }
.banner-error { background: var(--no-bg); color: #6f0d2a; }
.banner-ok { background: var(--ok-bg); color: #145233; }
.banner-warn { background: var(--wait-bg); color: #6a4208; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill-Pending { background: var(--wait-bg); color: var(--wait); }
.pill-Approved { background: var(--ok-bg); color: var(--ok); }
.pill-Rejected { background: var(--no-bg); color: var(--no); }
.pill-Cancelled, .pill-Voided, .pill-Archived { background: #e6eef5; color: #4d6274; }
.pill-ready, .pill-added, .pill-updated { background: var(--ok-bg); color: var(--ok); }
.pill-skip { background: var(--wait-bg); color: var(--wait); }
.pill-error { background: var(--no-bg); color: var(--no); }
.import-table td { white-space: normal; vertical-align: top; }

.login-screen { display: grid; grid-template-columns: 1.15fr 0.85fr; min-height: 100vh; }
.login-brand {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}
.login-brand .eyebrow { color: #8ec4ef; }
.login-brand h1 { color: white; max-width: 11ch; font-size: clamp(2.6rem, 5vw, 4.4rem); }
.login-brand .intro { max-width: 34ch; color: var(--sidebar-muted); font-size: 1.05rem; }
.login-panel { display: grid; align-content: center; padding: 2rem 1.25rem; }
.login-form { width: min(100%, 26rem); margin: 0 auto; display: grid; gap: 0.9rem; }
.login-form h1 { font-size: 2.2rem; }

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.later { color: var(--sidebar-muted); font-size: 0.92rem; }
.later div, .module { display: flex; justify-content: space-between; gap: 1rem; padding: 0.28rem 0; }
.later em, .module em { font-style: normal; }

.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; align-items: start; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1.15rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.brand { color: inherit; text-decoration: none; padding: 0.25rem 0.7rem 0.4rem; }
.brand strong { display: block; font-size: 1.35rem; line-height: 1.15; }
.brand span { color: var(--sidebar-muted); font-size: 0.85rem; }
.nav { display: grid; gap: 0.15rem; }
.nav a {
  color: inherit;
  text-decoration: none;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, 0.1); }
.badge {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  min-width: 1.35rem;
  text-align: center;
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
}
.sidebar .later { margin-top: auto; padding: 0.4rem 0.7rem 0; }
.who { padding: 0.2rem 0.7rem 0.2rem; }
.who strong, .who span { display: block; }
.who span { color: var(--sidebar-muted); font-size: 0.85rem; }
.signout {
  width: 100%;
  margin-top: 0.7rem;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--sidebar-text);
}
.workspace { min-width: 0; }
.mobile-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(238, 243, 248, 0.94);
  border-bottom: 1px solid var(--line);
}
main { padding: 1.4rem clamp(1rem, 2vw, 2rem) 3rem; max-width: 1080px; }
main:has(#timesheet-form),
main:has(.ts-review) { max-width: none; }
.scrim { position: fixed; inset: 0; background: rgba(18, 36, 56, 0.46); z-index: 20; }

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.lede { margin: 0.4rem 0 0; color: var(--ink-soft); }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}
.panel form, form.panel, .login-form { display: grid; gap: 0.85rem; }
.summary-wrap { overflow-x: auto; }
.summary { width: 100%; border-collapse: collapse; }
.summary th, .summary td { text-align: left; padding: 0.55rem 0.35rem; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.summary th.num, .summary td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary tfoot th, .summary tfoot td { font-weight: 650; border-bottom: 0; }
.stack { display: grid; gap: 0.75rem; }
.section-head, .card-top, .card-foot, .hero {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}
.section-head { align-items: center; }
.section-head h2 { margin: 0; }
.section-head a, a.back { color: var(--accent-deep); text-decoration: none; font-weight: 600; }
a.back { display: inline-block; margin-bottom: 0.75rem; font-weight: 500; }
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.8fr); gap: 0.9rem; align-items: start; }
.side { display: grid; gap: 0.75rem; align-content: start; position: sticky; top: 1rem; }
.fields { display: grid; gap: 0.85rem; }
.fields.two { grid-template-columns: 1fr 1fr; align-items: start; }
label.field, .field { display: grid; gap: 0.35rem; align-content: start; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  width: 100%;
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  background: white;
  border: 1px solid #c5d4e2;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}
input.is-locked { background: #f3f7fb; }
textarea { min-height: 7rem; resize: vertical; }
.password-row { display: flex; gap: 0.5rem; }
.password-row input { flex: 1; }
.password-row button {
  border: 1px solid #c5d4e2;
  border-radius: 12px;
  background: white;
  padding: 0 0.9rem;
  min-width: 4.5rem;
}
.segment { display: flex; gap: 0.4rem; }
.segment label { position: relative; flex: 1; font-weight: 500; }
.segment input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
}
.segment span {
  display: block;
  text-align: center;
  border: 1px solid #c5d4e2;
  border-radius: 999px;
  padding: 0.55rem 0.3rem;
  background: white;
}
.segment input:checked + span { background: var(--ink); color: white; border-color: var(--ink); }
.segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.readonly {
  background: #eef4f9;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}
.readonly strong { display: block; font-size: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.chip {
  text-decoration: none;
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.chip.active { background: var(--ink); color: white; border-color: var(--ink); }

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}
a.card:hover { border-color: #b7c9da; }
.card h2, .card p { margin: 0; }
.card h2 { font-size: 1.05rem; }
.card .muted { margin-top: 0.25rem; }
.card-foot { margin-top: 0.45rem; font-size: 0.92rem; }
.list { display: grid; gap: 0.6rem; }

.directory { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 0.2rem 0.85rem; }
a.person, .person {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 0.85rem 0.2rem;
  border-bottom: 1px solid var(--line);
}
.person > div:first-child { min-width: 0; }
.person-side { flex: none; text-align: right; }
.person-id { white-space: nowrap; }
.directory a.person:last-child, .directory .person:last-child { border-bottom: 0; }
a.person:hover { background: #f3f8fc; }
.person strong, .person .muted { display: block; }
.person-id { font-variant-numeric: tabular-nums; font-weight: 600; }

.total-num { font-size: 3rem; line-height: 0.95; margin: 0.15rem 0 0.35rem; }
.path, .timeline { list-style: none; margin: 0; padding: 0; }
.path li { padding: 0.5rem 0; border-top: 1px solid var(--line); }
.path small, .step-copy small, .facts dt { display: block; color: var(--ink-soft); font-size: 0.82rem; }
.step-copy { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.55rem; row-gap: 0.15rem; }
.step-copy small, .step-copy blockquote { flex-basis: 100%; }
.timeline { display: grid; gap: 0.85rem; }
.timeline li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0.75rem; }
.dot { width: 12px; height: 12px; border-radius: 99px; margin-top: 0.3rem; background: #c5d4e2; }
.dot-approved { background: var(--ok); }
.dot-rejected { background: var(--no); }
.dot-current { background: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; margin: 0.2rem 0 0; }
.facts dd, .modal dd { margin: 0; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; }
blockquote { margin: 0.35rem 0 0; padding-left: 0.7rem; border-left: 2px solid var(--line); color: var(--ink-soft); }
.days-block { display: grid; justify-items: end; gap: 0.15rem; }
.days-block strong { font-size: 2.5rem; line-height: 0.95; }
main > .panel,
main > .banner,
main > .directory,
main > .split,
main > .field { margin-bottom: 0.9rem; }
.audit { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.audit:last-child { border-bottom: 0; padding-bottom: 0; }
.audit strong { font-weight: 600; }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(18, 36, 56, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal { width: min(32rem, 100%); background: white; border-radius: 20px; padding: 1.25rem; }
.modal dl { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.45rem 0.75rem; align-items: baseline; }
.modal dt { color: var(--ink-soft); }
.secret {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}
body.modal-open { overflow: hidden; }

.picker-control { position: relative; }
.picker-menu {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 0.3rem);
  max-height: 16rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: white;
  border: 1px solid #c5d4e2;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(18, 36, 56, 0.14);
  padding: 0.3rem;
}
.picker-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0.55rem 0.7rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
}
.picker-option:hover,
.picker-option.is-active { background: #e7f1fa; }
.picker-option:disabled { color: var(--ink-soft); cursor: not-allowed; }
.picker-option[hidden] { display: none; }
.picker-none { margin: 0.35rem 0.7rem; color: var(--ink-soft); font-weight: 400; }

.checks { display: grid; gap: 0.45rem; margin: 0.35rem 0 0.85rem; }
.check { display: flex; align-items: center; gap: 0.55rem; font-weight: 500; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.check.is-disabled { color: var(--ink-soft); }

.cal-toolbar { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.cal-toolbar h2 { margin: 0 0 0 0.35rem; font-family: Fraunces, Georgia, serif; font-size: 1.45rem; font-weight: 560; }
.cal-nav { min-width: 2.25rem; padding-inline: 0.5rem; font-size: 1.15rem; line-height: 1; }
.cal-wrap { overflow: auto; }
.cal { min-width: 52rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.cal-dow, .cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { padding: 0.5rem 0.45rem 0.35rem; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.cal-week { display: grid; border-top: 1px solid var(--line); }
.cal-cells, .cal-bars { grid-area: 1 / 1; }
.cal-cells { align-self: stretch; }
.cal-cell { min-height: 100%; padding: 0.35rem 0.4rem 0; }
.cal-cell.is-holiday {
  background-image: repeating-linear-gradient(-45deg, transparent 0 7px, rgba(216, 120, 120, 0.55) 7px 8px);
}
.cal-cell.is-out .cal-num { color: #a8b8c8; }
.cal-num { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; font-size: 0.82rem; font-weight: 600; }
.cal-num.is-today { background: #1a73e8; color: white; border-radius: 999px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0.15rem 0 0.75rem; color: var(--ink-soft); font-size: 0.88rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.cal-swatch { width: 0.95rem; height: 0.95rem; border-radius: 3px; }
.cal-hatch {
  background-color: #fff;
  background-image: repeating-linear-gradient(-45deg, transparent 0 3px, rgba(216, 120, 120, 0.8) 3px 4px);
}
.cal-filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: end; margin-bottom: 0.9rem; }
.cal-filters .field { min-width: 14rem; flex: 1 1 14rem; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; margin: 0.85rem 0; }
.cal-bars {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  height: calc(var(--lanes) * 1.55rem);
  margin-bottom: 0.4rem;
}
.cal-bar {
  position: absolute;
  top: calc(var(--lane) * 1.55rem);
  left: calc(var(--col) * 100% / 7 + 3px);
  width: calc(var(--span) * 100% / 7 - 6px);
  height: 1.35rem;
  padding: 0 0.45rem;
  border-radius: 4px;
  background: var(--bar, #e6eef5);
  color: var(--bar-ink, #3d5166);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.cal-bar:hover { filter: brightness(0.94); }

@media (min-width: 881px) {
  .scrim { display: none !important; }
}

@media (max-width: 880px) {
  .login-screen, .shell, .split, .fields.two, .facts { grid-template-columns: 1fr; }
  .login-brand, .login-panel { min-height: auto; }
  .login-brand { padding: 1.6rem 1.2rem 1.2rem; }
  .login-panel { padding: 1.3rem 1.2rem 2.5rem; }
  .mobile-bar { display: flex; }
  .sidebar {
    position: fixed;
    z-index: 30;
    width: min(18rem, 86vw);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 12px 0 40px rgba(0, 0, 0, 0.2); }
  .side { position: static; }
  main { padding-top: 1rem; }
}

@media (max-width: 640px) {
  .actions .button, .actions button { flex: 1; }
  .hero, .card-top, .card-foot { flex-wrap: wrap; }
  .days-block { justify-items: start; }
}

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

.file-picks, .file-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.file-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; padding: 0.65rem 0; border-top: 1px solid var(--line); }
.file-list li div { display: grid; gap: 0.15rem; min-width: 0; }
.file-list strong, .file-picks li { overflow-wrap: anywhere; }
.file-preview { max-width: 100%; max-height: 12rem; margin-top: 0.4rem; border-radius: 8px; object-fit: contain; background: var(--paper); cursor: zoom-in; }

main:has(.sheet-page) { max-width: none; }
.sheet-tools { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.sheet-tools p { margin: 0; color: var(--ink-soft); }
.sheet-scroll { overflow: auto; max-height: calc(100vh - 12rem); border: 1px solid var(--line); border-radius: 12px; background: white; }
.sheet-table { border-collapse: separate; border-spacing: 0; min-width: max-content; }
.sheet-table th, .sheet-table td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.sheet-table th { position: sticky; top: 0; z-index: 2; background: #f7fbfe; font-weight: 650; }
.sheet-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-table td.sheet-wrap { white-space: normal; min-width: 14rem; max-width: 22rem; }
.sheet-table tbody tr { cursor: pointer; }
.sheet-table tbody tr.sheet-static,
.sheet-table tbody tr.sheet-static:hover td { cursor: default; background: transparent; }
.sheet-table tbody tr:hover td { background: #f2f7fb; }
.sheet-empty { color: var(--ink-soft); }
.sheet-head { display: flex; align-items: center; gap: 0.35rem; }
.sheet-filter { border: 1px solid var(--line); background: white; color: var(--ink-soft); border-radius: 999px; padding: 0.1rem 0.45rem; font: inherit; font-size: 0.75rem; cursor: pointer; }
.sheet-filter.is-on, .sheet-filter[aria-expanded="true"] { background: var(--accent); color: white; border-color: var(--accent); }
.sheet-menu {
  position: fixed;
  z-index: 35;
  width: max-content;
  min-width: 14rem;
  max-width: min(22rem, calc(100vw - 1rem));
  background: white;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 0.45rem 0.4rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sheet-menu[hidden] { display: none; }
.sheet-menu input[type="search"] {
  width: 100%;
  margin: 0;
  padding: 0.28rem 0.45rem;
  border: 1px solid #b0b0b0;
  border-radius: 2px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.3;
}
.sheet-options { display: block; max-height: 16rem; overflow: auto; }
.sheet-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.18rem 0.4rem;
  min-height: 1.65rem;
  font-weight: 450;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}
.sheet-option:hover { background: #f3f3f3; }
.sheet-option input {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: var(--accent);
}
.sheet-option span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-all { border-bottom: 1px solid #e1e1e1; margin-bottom: 0.15rem; padding-bottom: 0.28rem; }

body.viewer-open { overflow: hidden; }
#viewer-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.viewer-back { position: absolute; inset: 0; background: rgba(18, 36, 56, 0.62); }
.viewer {
  position: relative;
  z-index: 1;
  width: min(72rem, 100%);
  height: min(46rem, calc(100vh - 2rem));
  background: white;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(18, 36, 56, 0.28);
}
.viewer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.viewer-bar strong { min-width: 0; overflow-wrap: anywhere; }
.viewer-tools { display: flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.viewer-tools .button { min-height: 36px; padding: 0.4rem 0.8rem; }
#viewer-zoom { min-width: 3.2rem; text-align: center; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.viewer-stage { flex: 1; min-height: 0; overflow: auto; background: #16324a; padding: 0.75rem; }
.viewer-stage img { display: block; width: 100%; max-width: none; height: auto; margin: 0 auto; background: white; }
.viewer-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: white; }

.all-tools {
  display: inline-block;
  margin: 0.15rem 0.85rem 0.85rem;
  color: #d7ebff;
  font-weight: 600;
  text-decoration: none;
}
.all-tools:hover { color: white; }
.login-brand a { color: #d7ebff; }
.login-brand h1 { max-width: 10ch; }

.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--sidebar);
  color: var(--sidebar-text);
}
.portal-brand { color: inherit; text-decoration: none; display: grid; }
.portal-brand span, .portal-user span { color: var(--sidebar-muted); font-size: 0.85rem; }
.portal-user { display: flex; align-items: center; gap: 0.9rem; }
.portal-identity { display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; }
.portal-user .signout { width: auto; margin: 0; padding: 0.4rem 0.9rem; }
.portal-main { width: min(68rem, 100%); margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.4rem) 1.1rem 3rem; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.portal-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 10.5rem;
  padding: 1.2rem 1.25rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.portal-card strong { font-size: 1.35rem; }
.portal-card.is-soon { background: #f3f7fb; color: var(--ink-soft); box-shadow: none; }
.portal-card.is-soon .eyebrow { color: var(--ink-soft); }

.camera-preview {
  width: 100%;
  max-height: 360px;
  background: #152033;
  border-radius: 12px;
  object-fit: contain;
}
.signature-pad {
  width: 100%;
  height: 160px;
  background: white;
  border: 1px dashed #9db0c3;
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
}
.signature-view {
  display: block;
  width: min(100%, 28rem);
  height: auto;
  margin-top: 0.35rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.peripherals {
  margin: 0;
  padding: 0.8rem 0.9rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 0.55rem;
}
.peripherals legend { padding: 0 0.3rem; }
.turnover { padding: 0.85rem 0; border-top: 1px solid var(--line); }
.turnover p { margin: 0.2rem 0; }
.turnover:first-of-type { border-top: 0; padding-top: 0; }
.sheet-check { width: 2.4rem; }
.sheet-check input { width: auto; }
.ts-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 76rem; }
.ts-table th, .ts-table td { text-align: left; vertical-align: top; padding: 0.85rem 0.7rem; border-bottom: 1px solid var(--line); overflow-wrap: break-word; word-break: normal; }
.ts-table th { background: #f7fbfe; font-weight: 650; line-height: 1.3; }
.ts-table tfoot th { background: white; }
.ts-table .ts-times { display: grid; gap: 0.45rem; }
.ts-table .ts-date { width: 11%; }
.ts-table .ts-clock { width: 10%; }
.ts-table .ts-country { width: 13%; }
.ts-table .ts-project { width: 18%; }
.ts-table .ts-task { width: 26%; }
.ts-table .ts-status { width: 10%; }
.ts-table .ts-count { width: 7%; }
.ts-table .ts-action { width: 5%; }
.ts-table td.ts-task-cell { height: 1px; }
.ts-table textarea {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 7.5rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  line-height: 1.45;
  resize: vertical;
}
.pick { min-width: 0; max-width: 100%; }
.pick-toggle {
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid #c5d4e2;
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  font-weight: 400;
  white-space: normal;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  min-height: 2.6rem;
  height: auto;
}
.pick-line { display: block; line-height: 1.35; overflow-wrap: break-word; }
.pick-placeholder { color: var(--ink-soft); }
.pick-toggle[aria-expanded="true"] { border-color: var(--accent); }
.pick-menu {
  position: fixed;
  z-index: 40;
  width: 18rem;
  max-width: min(22rem, calc(100vw - 1rem));
  background: white;
  border: 1px solid #c5d4e2;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(18, 36, 56, 0.16);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pick-menu[hidden] { display: none; }
.pick-search { margin: 0; padding: 0.4rem 0.55rem; }
.pick-scroll { max-height: 14rem; overflow: auto; overscroll-behavior: contain; }
.pick-option { display: flex; gap: 0.45rem; align-items: flex-start; padding: 0.35rem 0.4rem; font-weight: 500; cursor: pointer; border-radius: 8px; }
.pick-option:hover { background: #f2f7fb; }
.pick-option[hidden] { display: none; }
.pick-option input { width: auto; margin-top: 0.15rem; }
.pick-option span { overflow-wrap: anywhere; }
.pick-empty { margin: 0.35rem 0.45rem; color: var(--ink-soft); font-weight: 400; }
.ts-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.7rem 1rem; margin: 0 0 1rem; }
.ts-facts div { margin: 0; }
.ts-facts dt { color: var(--ink-soft); font-size: 0.82rem; }
.ts-facts dd { margin: 0.12rem 0 0; font-weight: 600; }
.ts-facts .ts-span { grid-column: 1 / -1; }
.ts-review { width: 100%; border-collapse: collapse; min-width: 52rem; }
.ts-review th, .ts-review td { border: 1px solid var(--line); padding: 0.5rem 0.65rem; vertical-align: top; text-align: left; background: white; }
.ts-review thead th { background: #f7fbfe; position: sticky; top: 0; z-index: 1; }
.ts-review tfoot th, .ts-review tfoot td { background: #f7fbfe; font-weight: 650; }
.ts-review .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ts-review .ts-task, .ts-notes { white-space: pre-wrap; }
.ts-review .ts-task { min-width: 14rem; }
.ts-notes { margin: 0; }
.ts-hours, .ts-total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ts-legend { display: flex; flex-wrap: wrap; gap: 0.75rem 1.4rem; list-style: none; margin: 0 0 0.85rem; padding: 0; color: var(--ink-soft); }
.ts-legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.ts-swatch { width: 1rem; height: 1rem; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.ts-table tr.is-overtime td,
.ts-review tr.is-overtime td,
.ts-swatch.is-overtime { background: #fff6d6; }
.ts-table tr.is-off td,
.ts-review tr.is-off td,
.ts-swatch.is-off { background: #fde8e8; }
table.ts-review tbody tr.is-overtime > td,
table.ts-table tbody tr.is-overtime > td { background: #fff6d6; }
table.ts-review tbody tr.is-off > td,
table.ts-table tbody tr.is-off > td { background: #fde8e8; }
.ts-table tr.is-overtime input,
.ts-table tr.is-overtime textarea,
.ts-table tr.is-overtime select,
.ts-table tr.is-overtime .pick-toggle { background: #fff6d6; }
.ts-table tr.is-off input,
.ts-table tr.is-off textarea,
.ts-table tr.is-off select,
.ts-table tr.is-off .pick-toggle { background: #fde8e8; }
.ts-remove { border: 0; background: transparent; color: var(--accent-deep); font-weight: 600; padding: 0.35rem 0; cursor: pointer; }

@media (max-width: 800px) {
  .portal-bar, .portal-user { flex-wrap: wrap; }
  .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .viewer-bar { flex-wrap: wrap; }
  .viewer-tools { width: 100%; }
}
