/* Span — Kindling Studio time sheet.
   Cream paper, deep teal ink, a compact timer over the week's lines. */

:root {
  --brand: #0E4A46;
  --brand-accent: #F3EEE4;
  --brand-ink: #173330;
  --cream: var(--brand-accent);
  --paper: #fbf7f0;
  --ink: var(--brand-ink);
  --muted: #4e6562;
  --teal: var(--brand);
  --teal-deep: #0a3330;
  --mist: #e3eeea;
  --line: #d9d0c1;
  --line-soft: #e7e0d2;
  --danger: #8e2e2a;
  --stop: #b23b32;
  --font-display: "Literata", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --font-body: "Nunito Sans", "Avenir Next", "Segoe UI", sans-serif;
  --pad: clamp(16px, 3.4vw, 36px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f3efe6;
  color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
::selection { background: var(--teal); color: var(--cream); }
h1, h2, h3, p, ul, dl { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--teal);
  color: var(--cream);
  padding: 10px 16px;
  font-weight: 700;
}
.skip:focus { left: 0; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1.5px solid var(--teal);
  border-radius: 8px;
  background: var(--paper);
  color: var(--teal);
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--mist); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-teal { background: var(--teal); color: var(--cream); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2); }
.btn-teal:hover { background: var(--teal-deep); }
.btn-cream { background: var(--cream); color: var(--teal); border-color: var(--cream); }
.btn-cream:hover { background: #fff; }
.btn-line { background: transparent; }
.btn-wide { width: 100%; }
.linklike {
  border: 0;
  background: none;
  padding: 0;
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(440px, calc(100vw - 32px));
  background: var(--teal);
  color: var(--cream);
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
}
.toast--err { background: var(--paper); color: var(--danger); border: 1.5px solid var(--danger); }

/* ── mast: signed-out top bar, signed-in dark sidebar ── */
.mast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  min-height: 56px;
  padding: 12px var(--pad);
  background: #fffdf8;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2.4; }
.brand-word { font: 700 1.35rem/1 var(--font-display); letter-spacing: -0.03em; }
.mast-studio { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.nav { display: flex; gap: 6px; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 6px 12px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}
.nav a[aria-current="page"] { background: var(--teal); color: var(--cream); }
.running-chip {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--cream);
  background: var(--teal);
  text-decoration: none;
  padding: 6px 12px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who-name { font-weight: 700; font-size: 0.92rem; }
.btn-out {
  min-height: 40px;
  border: 1.5px solid var(--teal);
  border-radius: 8px;
  background: transparent;
  color: var(--teal);
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}
.btn-out:hover { background: var(--mist); }

main { flex: 1; }

.boot-line { padding: 48px var(--pad); font: 600 22px/1.3 var(--font-display); }

.banner {
  margin: 18px var(--pad) 0;
  padding: 14px 16px;
  border: 1.5px solid var(--danger);
  border-radius: 10px;
  background: var(--paper);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

/* ── sign-in gate ── */
body:has(#view-signin:not([hidden])) .mast { display: none; }
#view-signin[hidden] { display: none !important; }
#view-signin.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background: var(--teal);
}
.auth-clock {
  width: min(440px, 100%);
  background: #fffdf8;
  color: #1c2422;
  padding: 28px 24px 22px;
  border-radius: 28px 28px 18px 18px;
}
.gate-lockup { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--teal); }
.gate-company { color: var(--muted); font-weight: 600; }
.auth-clock h1 { font: 600 2rem/1.15 var(--font-display); letter-spacing: -0.02em; margin: 8px 0; }
.lede { margin-top: 12px; max-width: 38em; font-size: 16px; }
.auth-clock .lede { color: #3d524e; }
.lede-second { color: var(--muted); font-size: 14.5px; }
.demo-slot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.demo-slot > p:first-child { font-weight: 700; margin-bottom: 8px; }
.demo-rows { margin: 8px 0 14px; }
.demo-rows div { display: flex; gap: 12px; padding: 3px 0; }
.demo-rows dt { width: 6.5rem; color: var(--muted); }
.demo-rows dd { margin: 0; font-weight: 700; }
.card-alt { margin-top: 20px; }
.field-hint { color: var(--muted); font-size: 14px; margin-top: 6px; }
.field-note { color: var(--muted); font-size: 14px; margin-top: 12px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 700; }
.field-check { align-content: end; }
.field-check label { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 700; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal); }
input, select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #c9c0ae;
  border-radius: 8px;
}
.form-err { color: var(--danger); font-weight: 700; }
#signinForm .field + .field,
#signupForm .field + .field,
#clientForm .field + .field,
#projectForm .field + .field,
#signinForm .form-err,
#signupForm .form-err,
#clientForm .form-err,
#projectForm .form-err,
#signinForm .btn,
#signupForm .btn,
#clientForm .btn,
#projectForm .btn { margin-top: 12px; }

/* ── signed-in shell: dark teal sidebar ── */
body:has(#appNav:not([hidden])) { background: #f5f1e8; }
body:has(#appNav:not([hidden])) .mast {
  position: fixed;
  left: 0;
  top: 0;
  width: 224px;
  height: 100vh;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 20px 14px;
  background: var(--teal);
  border-bottom: 0;
  color: var(--cream);
}
body:has(#appNav:not([hidden])) main { min-width: 0; margin-left: 224px; }
body:has(#appNav:not([hidden])) .foot { margin-left: 224px; }
body:has(#appNav:not([hidden])) .brand { color: var(--cream); padding: 2px 6px; }
body:has(#appNav:not([hidden])) .mast-studio { color: #bcd4cf; padding: 0 6px; font-size: 0.8rem; margin-top: -10px; }
body:has(#appNav:not([hidden])) .nav { display: flex; flex-direction: column; gap: 2px; }
body:has(#appNav:not([hidden])) .nav a { color: #d7ebe6; border-radius: 8px; padding: 8px 12px; min-height: 38px; font-size: 0.94rem; }
body:has(#appNav:not([hidden])) .nav a:hover { background: rgba(243, 238, 228, 0.12); }
body:has(#appNav:not([hidden])) .nav a[aria-current="page"] { background: var(--cream); color: var(--teal); }
body:has(#appNav:not([hidden])) .running-chip {
  margin-top: 4px;
  justify-content: center;
  background: var(--teal-deep);
  border: 1px solid #2c6b64;
  border-radius: 8px;
  font-size: 0.9rem;
}
body:has(#appNav:not([hidden])) .who {
  margin: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #2c6b64;
}
body:has(#appNav:not([hidden])) .who-name { color: var(--cream); padding: 0 6px; }
body:has(#appNav:not([hidden])) .btn-out { border-color: #4d857d; color: var(--cream); }
body:has(#appNav:not([hidden])) .btn-out:hover { background: var(--teal-deep); }

/* ── pages ── */
.sheet-page { padding: 22px var(--pad) 56px; max-width: 1080px; }
.sheet-page > h1 { font: 600 clamp(1.7rem, 2.6vw, 2.15rem)/1.1 var(--font-display); letter-spacing: -0.03em; }
.panel { margin-top: 24px; background: #fffdf8; border-radius: 12px; border: 1px solid var(--line); padding: 16px 16px 18px; }
.panel h2, .lines-h { font: 600 1.6rem/1.2 var(--font-display); }
.panel-lead { color: var(--muted); margin: 6px 0 14px; max-width: 46em; font-size: 0.92rem; }

/* ── timer bar (Toggl-style) ── */
.track { max-width: 880px; }
.timer-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 230px) 34px auto auto;
  align-items: center;
  gap: 10px 12px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px 8px 14px;
  box-shadow: 0 2px 10px rgba(23, 51, 48, 0.07);
}
.timer-bar .field { gap: 0; }
.tb-note input {
  border: 0;
  background: transparent;
  min-height: 42px;
  padding: 6px 4px;
  font-size: 1rem;
}
.tb-note input:focus-visible { outline-offset: 0; }
.tb-project select {
  min-height: 42px;
  border-color: transparent;
  background: #f4f0e6;
  font-weight: 600;
  font-size: 0.9rem;
}
.tb-bill { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; cursor: pointer; }
.tb-bill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tb-bill-ic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #c9c0ae;
  color: #a39a86;
  font-weight: 800;
  font-size: 0.9rem;
}
.tb-bill input:checked + .tb-bill-ic { background: var(--teal); border-color: var(--teal); color: var(--cream); }
.tb-bill input:focus-visible + .tb-bill-ic { outline: 3px solid var(--teal); outline-offset: 2px; }
.tb-face {
  font: 600 1.55rem/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  padding: 0 2px;
  white-space: nowrap;
}
.tb-btn {
  min-width: 86px;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: var(--teal);
  color: var(--cream);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.tb-btn:hover { background: var(--teal-deep); }
.tb-btn.is-running { background: var(--stop); }
.tb-btn.is-running:hover { background: #962f28; }
.tb-btn:disabled { opacity: 0.6; cursor: progress; }
.tb-caption { color: var(--muted); font-size: 0.86rem; margin: 8px 4px 0; }
#clockErr { margin: 10px 4px 0; }

/* ── week glance + grouped lines ── */
.track-glance {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 18px 0 0;
  padding: 12px 16px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.glance-item { display: flex; align-items: baseline; gap: 10px; }
.glance-item span { color: var(--muted); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.glance-item strong { font: 600 1.3rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.track-list { margin-top: 20px; }
.track-h { font: 600 1.35rem/1.2 var(--font-display); letter-spacing: -0.01em; margin-bottom: 6px; }
.tday { margin-bottom: 14px; }
.tday-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6d7a72;
  border-bottom: 2px solid var(--line);
}
.tday-sum { font-variant-numeric: tabular-nums; color: var(--ink); }
.trow {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto auto 26px;
  align-items: center;
  gap: 8px 16px;
  min-height: 42px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}
.trow:hover { background: #fffdf8; }
.trow-desc { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-proj { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 0.88rem; }
.pdot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--pd, 160) 45% 36%); }
.trow-proj-name { font-weight: 700; color: hsl(var(--pd, 160) 45% 32%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-client { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-client::before { content: "· "; }
.trow-when { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.86rem; white-space: nowrap; }
.trow-dur { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow-bill { font-weight: 800; color: #c3baa6; text-align: center; }
.trow-bill.is-billable { color: #3d7a4c; }

/* ── manual line ── */
.manual-wrap { margin-top: 22px; background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; }
.manual-wrap summary { cursor: pointer; font-weight: 800; color: var(--teal); }
.manual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
}
.manual-grid .form-err { margin: 0; }
.line-project, .line-span, #manualForm .form-err { grid-column: 1 / -1; }
.line-span {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto auto;
  gap: 10px 12px;
  margin: 0;
  padding: 10px 12px 12px;
  border: 0;
  border-radius: 8px;
  background: #f3eee4;
}
.line-span legend { font: 600 1.05rem/1.2 var(--font-display); padding: 0 6px 0 0; }
.line-span input { font-variant-numeric: tabular-nums; }
.line-note { grid-column: 1; min-width: 0; }
#manualForm #manualBtn { grid-column: 3; justify-self: end; }

/* ── week sheet ── */
.week-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: end; }
.week-head h1 { text-align: center; font: 600 clamp(1.6rem, 3vw, 2.1rem)/1.1 var(--font-display); letter-spacing: -0.03em; }
.text-nav { color: var(--teal); font-weight: 700; min-height: 40px; display: inline-flex; align-items: center; }
.week-anchor-row { min-height: 1.5em; margin: 8px 0 12px; text-align: center; }
.week-anchor-row a { color: var(--teal); font-weight: 700; }
.week-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.week-tools .field { max-width: 240px; }
.sheet-scroll { overflow-x: auto; max-width: 100%; }
.sheet {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.sheet th, .sheet td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.sheet th:first-child, .sheet td:first-child { text-align: left; }
.sheet thead th { background: var(--teal); color: var(--cream); font-weight: 700; font-size: 13.5px; }
.sheet .proj-name { font-weight: 700; }
.sheet .proj-client { display: block; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.sheet .zero { color: var(--muted); font-weight: 600; }
.sheet tr.total td { font-weight: 800; border-bottom: 0; }
.sheet td.today, .sheet th.today { box-shadow: inset 0 -3px 0 var(--teal); }
.sheet thead th.today { box-shadow: inset 0 -3px 0 var(--cream); }
.sheet tbody tr:hover td { background: #f6fbf9; }
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.totals p { background: #fffdf8; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.totals strong { font: 600 1.7rem/1 var(--font-display); font-variant-numeric: tabular-nums; }

/* ── week lines ── */
.line-list { display: grid; gap: 0; }
.line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.line-title { font-family: var(--font-display); font-size: 1.1rem; margin: 0; }
.line-hours { font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.line-meta { color: var(--muted); }
.line-acts { display: flex; gap: 12px; justify-content: flex-end; }
.act {
  border: 0;
  background: none;
  padding: 8px 0;
  min-height: 40px;
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.line-confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.edit-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 8px;
}
.edit-form .field-span, .edit-form .form-err, .edit-form .edit-acts { grid-column: 1 / -1; }
.edit-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { font-weight: 700; font-size: 14px; }
.tag-off { color: var(--muted); }

/* ── projects page ── */
.find-field { max-width: 420px; margin: 16px 0; }
.client-block { margin: 8px 0 22px; }
.client-block h2 { font: 600 1.6rem/1.2 var(--font-display); }
.client-contact { color: var(--muted); margin-bottom: 6px; }
.proj-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.proj-code { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--teal); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 12px; }
.form-grid .panel { margin-top: 0; }
.seat-roster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; margin: 20px 0 28px; }
.seat-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fffdf8; padding: 16px; }
.seat-card h4 { margin: 0 0 6px; font-size: 1rem; }
.seat-card p { overflow-wrap: anywhere; }
#teammateForm { max-width: 560px; }

.empty {
  margin-top: 14px;
  padding: 20px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.empty h2 { font: 600 1.5rem/1.2 var(--font-display); }
.empty p { margin-top: 6px; max-width: 42em; color: var(--muted); }
.empty .btn { margin-top: 14px; }

.foot { padding: 18px var(--pad) 30px; border-top: 1px solid var(--line); }
.foot-note { color: var(--muted); margin: 6px 0 12px; max-width: 46em; font-size: 0.9rem; }

@media (max-width: 900px) {
  .timer-bar { grid-template-columns: minmax(0, 1fr) 34px auto auto; }
  .tb-project { grid-column: 1 / -1; grid-row: 2; }
  .trow { grid-template-columns: minmax(0, 1fr) auto auto 26px; }
  .trow-proj { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 840px) {
  .clock-controls, .manual-grid, .edit-form { grid-template-columns: 1fr 1fr; }
  .manual-grid .btn { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .week-head { grid-template-columns: 1fr; }
  .week-head h1 { text-align: left; }
  .who { margin-left: 0; }
}
@media (max-width: 760px) {
  body:has(#appNav:not([hidden])) .mast { position: sticky; width: auto; height: auto; z-index: 4; }
  body:has(#appNav:not([hidden])) main,
  body:has(#appNav:not([hidden])) .foot { margin-left: 0; }
  body:has(#appNav:not([hidden])) .nav { flex-direction: row; flex-wrap: wrap; }
  body:has(#appNav:not([hidden])) .nav a { flex: 1 1 auto; min-height: 44px; }
  body:has(#appNav:not([hidden])) .who { margin-top: 0; flex-direction: row; align-items: center; border-top: 0; }
}
@media (max-width: 560px) {
  .timer-bar { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .tb-note { grid-column: 1 / -1; grid-row: 1; }
  .tb-project { grid-row: 2; }
  .tb-bill { grid-row: 3; width: 44px; height: 44px; }
  .tb-face { grid-row: 3; justify-self: start; }
  .tb-btn { grid-row: 3; min-height: 44px; }
  .clock-controls, .manual-grid, .edit-form, .totals { grid-template-columns: 1fr; }
  .line { grid-template-columns: 1fr auto; }
  .line-acts, .line-confirm { grid-column: 1 / -1; }
  .nav { width: 100%; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; }
  .trow-when, .trow-bill { display: none; }
}

/* ── motion ──
   One ease, one tempo. Surfaces enter with a short settle; controls answer
   hover and press without lag. Everything collapses under reduced motion. */
:root {
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 160ms;
  --t-base: 200ms;
}
@keyframes span-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes span-enter-left {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: none; }
}
@keyframes span-enter-right {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes span-toast {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.is-entering { animation: span-enter var(--t-base) var(--ease-out) both; }
.is-entering-left { animation: span-enter-left var(--t-base) var(--ease-out) both; }
.is-entering-right { animation: span-enter-right var(--t-base) var(--ease-out) both; }
.toast:not([hidden]) { animation: span-toast var(--t-base) var(--ease-out) both; }
.banner:not([hidden]), .empty, .line-confirm, .edit-form, .manual-wrap[open] > :not(summary) {
  animation: span-enter var(--t-base) var(--ease-out) both;
}

.btn, .btn-out, .tb-btn, .act, .linklike, .text-nav, .nav a, .running-chip,
.trow, .sheet tbody tr td, .tb-bill-ic, .proj-row, .manual-wrap summary {
  transition:
    background-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    opacity var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
}
input, select { transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.btn:active:not(:disabled), .tb-btn:active:not(:disabled), .btn-out:active { transform: translateY(1px); }
.tb-btn { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(14, 74, 70, 0); }
.tb-btn.is-running { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(178, 59, 50, 0.14); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
