:root {
  --ink: #1c1c21;
  --muted: #6b6b76;
  --faint: #9a9aa6;
  --line: #e4e4ea;
  --page: #f6f6f8;
  --card: #ffffff;
  --user-bubble: #edebfd;
  --user-ink: #2c2166;
  --app-bubble: #f1f1f4;
  --accent: #4f46b8;
  --accent-ink: #ffffff;
  --success-bg: #e2f4ec;
  --success-ink: #0d6b4f;
  --warn-bg: #fdf0d9;
  --warn-ink: #7c4d08;
  --info-bg: #e7f0fb;
  --info-ink: #1a5c9e;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { max-width: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
  padding: clamp(12px, 4vw, 24px);
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
main {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
img { max-width: 100%; }

/* ---- App header / branding — measurements match the approved header component
   (Ideas/timesheet-ai-header-mockup.html): idrow height 56, logo 30x30 transparent
   (no container box), title 17/600 -0.3, subtitle 12/400 muted, avatar 32x32 right-pinned.
   The old plumbing line ("Talk to the assistant... → Zoho People Timetracker") is gone —
   Zoho proof lives on the receipt now, not the header. ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  height: 56px;
  margin-bottom: 10px;
}
.app-header .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.app-header .brand img.logo { width: 38px; height: 38px; object-fit: contain; display: block; flex-shrink: 0; }
.app-header .brand .app-name { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.15; }
.app-header .brand .app-name small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.profile-btn.av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--user-bubble); color: var(--user-ink);
  border: none; font-weight: 700; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: auto;
}

h1 { margin: 0 0 2px; font-size: 1.4em; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 0.9em; }

/* ---- Status row (date + status chip + site chip) — the daterow from the header
   component, grid so the site chip is always right-pinned regardless of chip width. ---- */
.statusrow { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 0; min-height: 46px; margin-bottom: 8px; position: relative; }
.statusrow[hidden] { display: none; }
.statusrow .time { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.pill { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 500; justify-self: end; }
.pill.ok { background: var(--success-bg); color: var(--success-ink); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill[hidden] { display: none; }

/* Day status chip — Draft (grey) / Submitted (accent tint) / Approved (success tint).
   Always present once a date is loaded; per the header spec, the chip is the anchor,
   not the date text. */
.chip { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 9px; margin: 0 0 0 8px; display: inline-flex; align-items: center; align-self: center; height: 20px; line-height: 1; }
.chip.draft { background: var(--app-bubble); color: var(--muted); }
.chip.sub { background: var(--user-bubble); color: var(--user-ink); }
.chip.appr { background: var(--success-bg); color: var(--success-ink); }
.chip[hidden] { display: none; }

/* Trust popover — the Worker Data Charter performed in UI, not just written down.
   Appears under the daterow when the site chip is tapped. */
.site-trust-pop {
  margin: 4px 0 14px; max-width: 270px; margin-left: auto;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 11px 13px;
  font-size: 12.5px; line-height: 1.5;
}
.site-trust-pop[hidden] { display: none; }
.site-trust-pop b { color: #cbc7f2; }
.site-trust-pop .pop-off { display: inline-block; margin-top: 7px; font-size: 12px; font-weight: 600; color: #cbc7f2; text-decoration: underline; cursor: pointer; }

/* A plain muted button standing in for the raw date input — tapping it opens the
   real (visually hidden but functional) native picker via showPicker(). */
.date-display {
  font: inherit;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.date-display::after { content: '▾'; font-size: 8px; opacity: 0.7; line-height: 1; }
.date-input-native {
  position: absolute;
  left: 0; top: 0;
  width: 1px; height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  pointer-events: none;
}

/* ---- Today / This week tabs — H 42 · radius 12 · inner padding 3, per the header spec ---- */
.view-tabs {
  display: flex;
  gap: 0;
  background: var(--app-bubble);
  border-radius: 12px;
  padding: 3px;
  height: 42px;
  margin-bottom: 14px;
}
.view-tab {
  flex: 1;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.view-tab.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(28,28,33,0.08); }

/* ---- Week summary: datacard/ledger, matching the mockup's payroll ledger card ---- */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.week-nav button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 1.1em;
  cursor: pointer;
  color: var(--ink);
}
#week-range-label { font-weight: 600; font-size: 0.95em; }

.datacard { background: #fafafc; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 10px; }
.datacard .dh { font-size: 11px; color: var(--faint); margin-bottom: 6px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; }
.kv .v.strong { font-weight: 600; }
.kv.total { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 7px; }

.ledger .row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ledger .row:last-child { border-bottom: none; }
.ledger .row:hover { background: var(--app-bubble); }
.ledger .l1 { font-size: 13.5px; }
.ledger .l2 { font-size: 11.5px; color: var(--muted); }
.ledger .row.empty .l2 { color: var(--faint); }
.ledger .hrs { font-size: 13.5px; white-space: nowrap; }
.ledger .hrs .tick { color: var(--success-ink); }
.ledger .row.total { border-top: 1.5px solid var(--ink); cursor: default; }
.ledger .row.total:hover { background: none; }
/* Sick-leave day — accounted for, but not worked time. Muted, with a small chip in place
   of the hours so it reads differently from both a worked day and an empty one. */
.ledger .row.leave .l2 { color: var(--warn-ink); }
.ledger .leave-chip { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--warn-bg); color: var(--warn-ink); }
/* Draft / pre-filled day — real hours on screen but nothing submitted to Zoho yet. */
.ledger .row.draft .l2 { color: #1f4e8c; }
.ledger .hrs .draft-dot { color: #3d7bd9; font-weight: 700; }
#week-hint { text-align: left; }

.week-voice-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px; padding: 11px 0;
  background: var(--ink); color: #fff; border: none; border-radius: 12px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.week-voice-btn svg { width: 16px; height: 16px; fill: #fff; }
.week-voice-btn:active { opacity: 0.9; }
.week-voice-btn.listening { background: #c0392b; animation: pulse 1.2s infinite; }

/* The entries form just wraps the line items (.dlist) now that they live inside the
   dcard (component 1A: agent, then dlist, then confirm — one card) — no top margin of
   its own, the dlist's own margin-top does the spacing under the chat log. */
#timesheet-form { margin-top: 0; }
label { display: block; margin-bottom: 16px; font-weight: 600; font-size: 0.92em; }
input, select, textarea {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; line-height: 1.35; }
input, select, textarea { width: 100%; }

/* ---- Line items — component library's .dlist/.drow: NOT a separate bordered box.
   Lives inside the dcard (component 1A: agent, then dlist, then confirm — one card),
   so it only needs a top rule to separate it from whatever's above, and rows go flush
   to the card's own 18px padding rather than adding their own. ---- */
.dlist { margin-top: 12px; border-top: 1px solid var(--line); }

.entry-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: 0 6px;
  border-bottom: 1px solid var(--line);
}

/* Empty-day placeholder — component library's elist empty state, swapped in by
   syncEntriesEmptyState() instead of an auto-added blank "No task selected" row. */
.entries-empty {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-size: 12.5px;
  color: var(--muted);
}
.entry-row:last-child { border-bottom: none; }
.entry-row:hover { background: var(--app-bubble); }
.entry-row .entry-index { display: none; }

.entry-view {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}
.entry-view-text { min-width: 0; flex: 1; cursor: pointer; }
.entry-view-main {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-view-sub {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-view-sub:empty { display: none; }

.entry-view-hours {
  flex-shrink: 0;
  margin-left: auto;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}

/* Edit/Delete sit below the row, not squeezed into it — full-width on hover (desktop)
   or tap (touch, via .show-actions), so the row itself stays clean and hours stay
   flush right instead of fighting icons for space. */
.row-actions-below {
  display: none;
  gap: 8px;
  padding-bottom: 8px;
}
.entry-row:hover .row-actions-below,
.entry-row:focus-within .row-actions-below,
.entry-row.show-actions .row-actions-below {
  display: flex;
}
.row-actions-below button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  font-size: 15px;
  color: var(--muted);
  font-family: inherit;
}
.row-actions-below .delete-entry-btn { color: var(--danger); }
.entry-lock-chip {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--success-ink);
  background: var(--success-bg);
  border: 1px solid #b7e2cf;
  border-radius: 999px;
  padding: 2px 9px;
}

.entry-edit-fields { display: flex; flex-direction: column; gap: 8px; }
.entry-edit-fields .field-label {
  display: block;
  margin: 0;
  font-weight: 600;
  font-size: 0.82em;
  color: var(--muted);
}
.entry-edit-fields .field-label > select,
.entry-edit-fields .field-label > input,
.entry-edit-fields .field-label > textarea {
  margin-top: 4px;
}
.done-entry-btn {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88em;
}

.entry-row:not(.editing) .entry-edit-fields { display: none; }
.entry-row.editing .entry-view { display: none; }
.entry-row.editing {
  background: var(--app-bubble);
  border-radius: 10px;
  border-bottom-color: transparent;
  padding: 10px;
  margin: 2px 0;
}

/* needs-review is an actionable warning, not a status — gets a left flag on top of
   the row's normal 14px padding rather than replacing it. */
.entry-row.needs-review { border-left: 3px solid #f0b73f; padding-left: 11px; }

.row-delete-confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85em;
  color: var(--warn-ink);
  background: var(--warn-bg);
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 6px;
}
.row-delete-confirm[hidden] { display: none; }
.row-delete-confirm button {
  font: inherit;
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
.row-delete-confirm .row-delete-yes { background: var(--danger); color: #fff; }
.row-delete-confirm .row-delete-no { background: #fff; border: 1px solid var(--line); }
.row-delete-confirm button:disabled { opacity: 0.6; cursor: not-allowed; }

.entry-status { font-size: 0.85em; }
.entry-hint { font-size: 0.85em; color: var(--warn-ink); }
.entry-row.needs-review select,
.entry-row.needs-review .hours,
.entry-row.needs-review .title,
.entry-row.needs-review .description {
  border-color: #f0b73f;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ---- Draft/assistant card — component library's .dcard: one bordered card holding
   the conversation AND the confirm/mic row nested inside it (not a separate boxed
   section next to it). Sits directly under the header, the entries list coupled
   right below it (component 1B: dcard, then seclab + elist + addrow). ---- */
#assistant-panel.dcard {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-top: 4px;
  margin-bottom: 14px;
  background: var(--card);
}
.confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 10px 10px 8px;
  margin-top: 12px;
}
#handsfree-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#handsfree-btn svg { width: 16px; height: 16px; fill: #fff; }
#handsfree-btn.active { background: var(--danger); }
#handsfree-btn.listening { animation: pulse 1.2s infinite; }
.wave { display: flex; gap: 2px; align-items: center; height: 14px; flex-shrink: 0; width: 0; overflow: hidden; visibility: hidden; }
#handsfree-btn.listening + .wave { visibility: visible; width: auto; }
.wave i { width: 2.5px; border-radius: 2px; background: var(--accent); opacity: 0.55; animation: wave-bounce 0.9s ease-in-out infinite; }
.wave i:nth-child(1){height:5px; animation-delay: 0s}
.wave i:nth-child(2){height:11px; animation-delay: .1s}
.wave i:nth-child(3){height:7px; animation-delay: .2s}
.wave i:nth-child(4){height:13px; animation-delay: .3s}
.wave i:nth-child(5){height:6px; animation-delay: .4s}
.wave i:nth-child(6){height:10px; animation-delay: .5s}
.wave i:nth-child(7){height:4px; animation-delay: .6s}
@keyframes wave-bounce {
  0%, 100% { transform: scaleY(0.6); opacity: 0.55; }
  50% { transform: scaleY(1.4); opacity: 0.9; }
}
.assist-row-text { min-width: 0; flex: 1; }
#handsfree-label { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
#handsfree-status {
  font-size: 11.5px;
  color: var(--muted);
  min-height: 1.2em;
  line-height: 1.3;
}
#chat-input-toggle {
  flex-shrink: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
#chat-input-toggle:hover { text-decoration: underline; }
#chat-input-toggle[hidden] { display: none; }
#hf-transcript-toggle {
  margin-top: 10px;
  font: inherit;
  font-size: 0.82em;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--app-bubble);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#hf-unread-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.75em;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
#hf-transcript-toggle[hidden], #hf-unread-badge[hidden] { display: none; }

/* ---- Hands-free conversation drawer: transcript stays out of the way during a
   voice session (audio carries it); opens on demand instead of forcing a read. ---- */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(28, 28, 33, 0.35);
  z-index: 55;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.drawer-overlay.open { opacity: 1; }
.hf-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(340px, 88vw);
  background: var(--card);
  box-shadow: -4px 0 24px rgba(28, 28, 33, 0.12);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.hf-drawer.open { transform: translateX(0); }
.hf-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.hf-drawer-header button {
  border: none;
  background: none;
  font-size: 1.1em;
  cursor: pointer;
  color: var(--muted);
}
.hf-drawer-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* ---- Voice session sheet — component library's session sheet (Listening/Understood/
   Confirm/Done). Bottom sheet over the page, radius-top 20, grab handle 44x5, one state
   visible at a time. ---- */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(28, 28, 33, 0.35);
  z-index: 65;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sheet-overlay.open { opacity: 1; }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(28, 28, 33, 0.14);
  z-index: 70;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.open { transform: translateY(0); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 6px; }
.sheet .shead {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
  font-weight: 700; text-align: center; margin-bottom: 8px;
}
.sheet-close {
  position: absolute; top: 12px; right: 14px;
  border: none; background: none; color: var(--muted); font-size: 1em; cursor: pointer;
  padding: 4px;
}
.sheet .sbody { padding: 0 18px 18px; }

.sheet-listen-row { display: flex; align-items: center; gap: 10px; height: 16px; }
.sheet-listen-hint { font-size: 12.5px; color: var(--muted); }
.sheet-wave { display: flex; gap: 3px; align-items: center; height: 16px; }
.sheet-wave i { width: 3px; border-radius: 2px; background: var(--accent); animation: wave-bounce 0.9s ease-in-out infinite; }
.sheet-wave i:nth-child(1){height:6px; animation-delay: 0s}
.sheet-wave i:nth-child(2){height:12px; animation-delay: .1s}
.sheet-wave i:nth-child(3){height:8px; animation-delay: .2s}
.sheet-wave i:nth-child(4){height:14px; animation-delay: .3s}
.sheet-wave i:nth-child(5){height:7px; animation-delay: .4s}
.sheet-wave i:nth-child(6){height:11px; animation-delay: .5s}
.sheet-wave i:nth-child(7){height:5px; animation-delay: .6s}

.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pchip { background: var(--user-bubble); color: var(--user-ink); border-radius: 8px; font-size: 12px; font-weight: 600; padding: 5px 9px; }
.pchip.low { background: var(--warn-bg); color: var(--warn-ink); }
.hintline { font-size: 11.5px; color: var(--faint); margin-top: 8px; text-align: center; }

.bubble { max-width: 100%; padding: 9px 12px; border-radius: 15px; font-size: 13.5px; line-height: 1.5; margin-bottom: 9px; }
.bubble.appb { background: var(--app-bubble); color: var(--ink); border-bottom-left-radius: 4px; }

.sbtn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 40px; border-radius: 10px;
  background: var(--ink); color: #fff; font: inherit; font-weight: 500; font-size: 13px;
  border: none; cursor: pointer; margin-top: 8px;
}
.sbtn.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.sbtn[hidden] { display: none; }

.sheet-done-msg { font-size: 14.5px; font-weight: 600; text-align: center; padding-top: 4px; }

/* ---- Chat log (bubble language lifted from the mockups) — bubbles sit directly
   inside the dcard border, same as the mockup's agent line; no extra inner box. ---- */
#chat-log {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
#chat-log:empty { display: none; }
.chat-msg {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 15px;
  font-size: 0.9em;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--user-ink);
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--app-bubble);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-msg.chat-confirm {
  background: var(--warn-bg);
  color: var(--warn-ink);
  align-self: stretch;
  max-width: 100%;
}
.chat-confirm-btns { margin-top: 8px; display: flex; gap: 8px; }
.confirm-delete-btn {
  background: var(--danger);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.cancel-delete-btn {
  background: #fff;
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.confirm-delete-btn:disabled, .cancel-delete-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Typed input is collapsed behind the "Type instead" link by default — tapping it
   reveals input + mic buttons + Send, right under the assist row. */
#chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
#chat-input-row[hidden] { display: none; }
#chat-input { width: 100%; }
#mic-edit-btn {
  border: none;
  background: var(--app-bubble);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#mic-edit-btn svg { width: 17px; height: 17px; fill: var(--ink); }
#mic-edit-btn.recording {
  background: var(--danger);
  animation: pulse 1.2s infinite;
}
#mic-edit-btn.recording svg { fill: #fff; }
#chat-send-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}
#chat-send-btn:disabled, #mic-edit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
#chat-status { padding: 0 12px 10px; font-size: 0.85em; color: var(--muted); }

/* ---- Dashed add-entry row — component library's .addrow. No separate submit button:
   per 1A/1B, confirmation is conversational — the confirm row inside the assistant card
   below already says what's drafted (or that nothing is) and how to submit it. ---- */
.addrow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  margin-top: 0;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.privline { text-align: center; font-size: 11.5px; color: var(--faint); margin: 8px 0 0; }

#results { margin-top: 24px; }

/* Receipt card — the trust artefact a submit ends on, per the component library spec:
   entries + hours + a plain-language sync line, not a bare "N succeeded" sentence. */
.receipt { }
.receipt-heading { font-size: 14.5px; font-weight: 600; margin: 0 0 10px; }
.receipt-card { border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.receipt-row { display: flex; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; gap: 10px; }
.receipt-row:last-of-type { border-bottom: none; }
.receipt-row .rlabel { flex: 1; }
.receipt-row .rhours { font-weight: 700; }
.receipt-row.total { border-top: 1.5px solid var(--ink); border-bottom: none; font-weight: 700; }
.receipt-row.fail .rlabel { color: var(--danger); }
.receipt-sync { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--success-ink); font-weight: 600; padding: 9px 12px; border-top: 1px solid var(--line); }
.receipt-sync.fail { color: var(--danger); }
#results p.fail { color: var(--danger); }

/* ---- Profile modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28, 28, 33, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 360px;
}
.modal-card h2 { margin: 0 0 4px; font-size: 1.1em; }
.modal-card .modal-sub { color: var(--muted); font-size: 0.85em; margin: 0 0 16px; }
.modal-card label { margin-bottom: 14px; }
.voice-gender-options {
  display: flex; gap: 8px;
}
.voice-gender-options label {
  flex: 1; margin: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9em;
}
.voice-gender-options input { width: auto; }
.voice-gender-options label:has(input:checked) {
  border-color: var(--accent);
  background: var(--user-bubble);
  color: var(--user-ink);
}
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions button {
  flex: 1;
  font: inherit;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}
.modal-actions .save-btn { background: var(--accent); color: var(--accent-ink); }
.modal-actions .logout-btn { background: #fff; border: 1px solid var(--line); color: var(--danger); }

/* ---- Scenario 3: week locked after a manager approves it ---- */
.week-lock-banner {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--success-bg); color: var(--success-ink);
  border: 1px solid #b7e2cf; border-radius: 12px;
  padding: 10px 12px; margin: 4px 0 12px;
  font-size: 12.5px; line-height: 1.5;
}
.week-lock-banner[hidden] { display: none; }
.week-lock-banner .wlb-icon { flex-shrink: 0; }
/* submitted, waiting on the manager — locked, but not signed off yet (blue, not green) */
.week-lock-banner--pending {
  background: #eaf2fd; color: #1f4e8c; border-color: #b8d3f2;
}
.week-locked #add-entry,
.week-locked #chat-input-row,
.week-locked #chat-input-toggle,
.week-locked .confirm { display: none !important; }
.week-locked .entry-edit-fields { display: none !important; }
/* Locked week, Day view: swap the per-row edit/delete for a "🔒 Locked" chip, always
   visible (not hover-gated) so every row reads as read-only. */
.week-locked .row-actions-below { display: flex !important; }
.week-locked .row-actions-below .edit-entry-btn,
.week-locked .row-actions-below .delete-entry-btn { display: none !important; }
.week-locked .entry-lock-chip { display: inline-flex; }
/* Week view, locked: no voice review either — it's read-only end to end. */
.week-locked #week-voice-btn { opacity: 0.4; pointer-events: none; }

/* Manager raised a query — visible, but the week stays fully editable */
.week-query-banner {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid #f0d9a8; border-radius: 12px;
  padding: 10px 12px; margin: 4px 0 12px;
  font-size: 12.5px; line-height: 1.5;
}
.week-query-banner[hidden] { display: none; }
.week-query-banner .wqb-icon { flex-shrink: 0; }
.week-query-banner .wqb-head { font-weight: 700; }
.week-query-banner .wqb-hint { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.week-query-banner .wqb-body { flex: 1; min-width: 0; }
.week-query-banner .wqb-reply-sent {
  margin-top: 6px; padding: 6px 9px; border-radius: 8px;
  background: rgba(255,255,255,0.55); font-size: 12px; font-style: italic;
}
.week-query-banner .wqb-reply-sent[hidden] { display: none; }
.week-query-banner .wqb-reply {
  width: 100%; margin-top: 7px; font: inherit; font-size: 12.5px;
  border: 1px solid #e0c98a; border-radius: 8px; padding: 7px 9px;
  resize: vertical; background: #fff; color: var(--ink);
}
.week-query-banner .wqb-actions { display: flex; gap: 8px; margin-top: 7px; }
.week-query-banner .wqb-jump {
  font: inherit; font-size: 12px; font-weight: 600;
  background: var(--warn-ink); color: #fff; border: none;
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.week-query-banner .wqb-jump.ghost { background: #fff; color: var(--warn-ink); border: 1px solid #e0c98a; }
.week-query-banner .wqb-jump[hidden] { display: none; }
.week-query-banner .wqb-jump:disabled { opacity: 0.6; cursor: default; }
