/* =====================================================================
   Tokens
   ===================================================================== */
:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color-scheme: light;
  --ink: #20231f;
  --ink-2: #4b4f49;
  --muted: #77776f;
  --faint: #a1a49c;
  --line: #e6e3dc;
  --line-soft: #f0ede7;
  --bg: #fafbf9;
  --paper: #fffdf9;
  --field: #ffffff;
  --run: #ee981f;
  --run-ink: #a35a00;
  --run-soft: #fff3e2;
  --ok: #3f7a32;
  --bad: #b2432c;
  --bad-soft: #fff4f1;
  --focus: #ed9d3e;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 10px 24px -16px rgb(0 0 0 / .35);
  --shadow-card: 0 1px 2px rgb(0 0 0 / .05), 0 8px 18px -12px rgb(0 0 0 / .25);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .06), 0 30px 60px -24px rgb(0 0 0 / .4);
  color: var(--ink);
  background: var(--bg);
}

/* =====================================================================
   Base
   ===================================================================== */
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
body:has(dialog:modal) { overflow: hidden; overscroll-behavior: none; overflow-anchor: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, [role="link"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.input-note { color: var(--faint); font-size: 11.5px; line-height: 1.5; margin: 6px 0 0; }
.loading { text-align: center; color: var(--faint); margin-top: 120px; font-size: 13px; }
.working button { cursor: wait; }
kbd { font: 600 11px/1 Inter, sans-serif; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 3px 5px; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: rgb(0 0 0 / .07); color: rgb(0 0 0 / .55); font-size: 11px; font-weight: 600; vertical-align: 3px; }

/* =====================================================================
   Buttons
   ===================================================================== */
.primary-button, .secondary-button, .danger-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.primary-button { border: 0; background: var(--ink); color: #fff; }
.primary-button:hover:not(:disabled) { background: #3a3d38; }
.secondary-button { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.secondary-button:hover:not(:disabled) { border-color: #c9c6be; }
.danger-button { border: 1px solid #ecc4ba; background: var(--bad-soft); color: var(--bad); }
.danger-button:hover:not(:disabled) { background: #fdeeea; }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .5; }
.text-button { border: 0; background: none; padding: 4px 8px; border-radius: 8px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.text-button:hover:not(:disabled) { background: #efeee9; }
.text-button:disabled { opacity: .45; }
.close-button { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; line-height: 1; }
.close-button:hover { background: #efeee9; color: var(--ink); }
.icon, .icon-button { flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); }
.icon:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: rgb(0 0 0 / .06); }
.icon svg, .icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon:disabled, .icon-button:disabled { opacity: .45; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }

/* =====================================================================
   Forms
   ===================================================================== */
label { display: block; margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); font-size: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #b9b6ae; box-shadow: 0 0 0 3px rgb(0 0 0 / .05); }
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
.form-error { margin: 10px 0 0; color: var(--bad); font-size: 12.5px; line-height: 1.5; }
.form-error:empty { display: none; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.date-time-fields { display: grid; grid-template-columns: 1fr 100px; gap: 8px; }

/* =====================================================================
   Dialogs: a paper sheet in the middle; on phones a sheet from the bottom of the visible area
   ===================================================================== */
dialog {
  width: 520px; max-width: calc(100vw - 32px); max-height: 86vh; overflow: auto;
  padding: 20px 22px; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgb(32 35 31 / .28); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 19px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.dialog-heading label { margin: 6px 0 0; font-size: 15px; }
.dialog-body > :first-child { margin-top: 10px; }

/* =====================================================================
   Header
   ===================================================================== */
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 28px; background: rgb(250 251 249 / .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 16.5px; letter-spacing: -.015em; }
/* the logo: one bucket square, outlined */
.brand-mark { box-sizing: border-box; width: 15px; height: 15px; border: 2.2px solid #4b5a43; border-radius: 4.5px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-button kbd { margin-left: 2px; }
.header-icon { display: none; }
.account-menu { position: relative; }
.avatar { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #e8e5dd; color: var(--ink-2); font-weight: 700; font-size: 13px; }
.avatar:hover:not(:disabled) { background: #dedad0; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; border-radius: 16px; border: 1px solid #ece9e2; background: var(--paper); box-shadow: var(--shadow-lg); }
.account-name { margin: 0; padding: 8px 10px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.account-name b { display: block; color: var(--ink); font-size: 14px; }
.account-dropdown button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 13.5px; }
.account-dropdown button:hover { background: #f2f0eb; }

/* =====================================================================
   Login
   ===================================================================== */
.login-view { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 24px; }
.login-form { width: min(380px, 100%); padding: 28px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--faint); }
.login-form h1 { margin: 6px 0 10px; font-size: 28px; letter-spacing: -.02em; }
.login-form > .primary-button { width: 100%; margin-top: 18px; min-height: 42px; }

/* =====================================================================
   Week strip
   ===================================================================== */
.week-panel { max-width: 1260px; margin: 4px auto 0; padding: 0 28px; }
.calendar-status { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 11.5px; color: #996d54; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.week-day { min-width: 0; padding: 10px 10px 12px; border-radius: 16px; cursor: pointer; }
.week-day:hover { background: rgb(0 0 0 / .025); }
.week-day.today { background: var(--paper); box-shadow: var(--shadow); cursor: default; }
.day-head { display: flex; align-items: baseline; gap: 8px; }
.day-head h2 { margin: 0; }
.week-day-open { display: flex; align-items: baseline; gap: 6px; padding: 0; border: 0; background: none; text-align: left; }
.day-number { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.day-weekday { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.week-day.past .day-number { color: #8f938b; }
.week-day.future .day-number, .week-day.future .day-weekday { color: #c4c6bf; }
.week-day.today .day-number { font-size: 30px; }
#available { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
#available.overtime { color: var(--bad); }
.week-meta { margin: 2px 0 0; font-size: 10.5px; color: var(--faint); letter-spacing: .02em; }
.tracked-bar { display: flex; gap: 2px; height: 6px; margin-top: 9px; border-radius: 3px; background: #efede8; overflow: hidden; }
.week-segment { display: block; min-width: 2px; flex-basis: 0; }
.day-footer { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.week-day.today .day-spent b { color: var(--ink); font-weight: 600; }
.day-spent b { font-weight: 500; }
.day-calendar-events { display: grid; gap: 5px; margin-top: 8px; max-height: 190px; overflow-y: auto; }
.day-calendar-events:empty { display: none; }
.day-calendar-event { display: grid; gap: 1px; padding: 3px 0 3px 8px; border-left: 2.5px solid var(--calendar-color); color: var(--ink-2); font-size: 11.5px; line-height: 1.3; text-decoration: none; }
.day-calendar-event time { color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.day-calendar-event span { overflow-wrap: anywhere; }
a.day-calendar-event[href]:hover { background: #f2f0eb; border-radius: 0 4px 4px 0; }
.day-calendar-event.declined { opacity: .45; text-decoration: line-through; }

/* =====================================================================
   Notices
   ===================================================================== */
.notice { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 40; width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 16px; border-radius: 14px; background: var(--ink); color: #f4f3ee; font-size: 13px; line-height: 1.45; box-shadow: var(--shadow-lg); }
.notice button { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 18px; }
.notice button:hover { background: rgb(255 255 255 / .1); }
.day-notice { position: static; transform: none; width: auto; max-width: 1204px; margin: 12px auto 0; background: #fff1ec; color: #7a2f1e; box-shadow: none; }
.day-notice button:hover { background: rgb(0 0 0 / .06); }

/* =====================================================================
   Field: the paper stack of the current bucket
   ===================================================================== */
#workspace { padding-bottom: 60px; }
.app-field { max-width: 1260px; margin: 20px auto 0; padding: 0 28px; }
.runchip { display: inline-flex; gap: 6px; align-items: center; min-width: 0; max-width: 46vw; height: 36px; padding: 0 14px; border: 1px solid #f1d7a8; border-radius: 999px; background: var(--run-soft); color: var(--run-ink); font-size: 12.5px; font-weight: 600; }
.runchip:hover { border-color: var(--run); }
.runchip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runchip .num { flex: 0 0 auto; white-space: nowrap; }
.stackwrap { padding: 0 0 8px 0; }
/* Sheets and layers stay neutral; the bucket color lives in the name, the square and the cards */
.layer { position: relative; padding-top: 34px; border-radius: 22px; background: #ebeae5; box-shadow: var(--shadow); }
/* The stack steps only down, so the current sheet keeps the full width */
.layer > .layer, .layer > .sheet { margin: 0 0 -8px 0; }
/* A nested layer lies on its parent: a thin edge and a shadow cast upward keep the levels apart */
.layer > .layer { border: 1px solid rgb(0 0 0 / .09); box-shadow: 0 -6px 14px -8px rgb(0 0 0 / .22); }
.lrow { position: absolute; left: 18px; right: 18px; top: 8px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.llab { display: flex; gap: 8px; align-items: baseline; padding: 0; border: 0; background: none; color: #5b5e57; font-size: 12.5px; white-space: nowrap; }
.llab:hover { color: var(--ink); }
/* The whole strip of a layer opens it; the chips and the running dot lie above and keep their own clicks */
.llab::after { content: ""; position: absolute; inset: -8px -18px; }
.lrow > .ri-dot, .also { position: relative; }
.llab b { font-weight: 650; color: color-mix(in srgb, var(--tone) 55%, black); }
.llab .num { color: #9a9d96; }
.llab i { width: 9px; height: 9px; border-radius: 3px; background: var(--tone); align-self: center; }
.also { display: flex; gap: 4px; align-items: center; min-width: 0; margin-left: auto; overflow: hidden; }
.also button { padding: 1px 8px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--k) 55%, white); color: rgb(0 0 0 / .6); font-size: 11.5px; white-space: nowrap; }
.also button:hover { background: var(--k); color: var(--ink); }
.also button.run { box-shadow: inset 0 -2px 0 var(--run); }
.also .more { color: var(--faint); font-size: 11px; white-space: nowrap; }

.sheet { position: relative; padding: 22px 24px 24px; border-radius: 22px; background: #f3f2ee; border: 1px solid rgb(0 0 0 / .1); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 14px 30px -16px rgb(0 0 0 / .4); }
.sheet.act { box-shadow: 0 0 0 2.5px var(--run), 0 14px 30px -16px rgb(0 0 0 / .4); }
.sheet.done { border-style: dashed; }
/* name | time and buttons: a long name wraps instead of sliding under the time */
/* The sheet header repeats the card: name and menu, then the time, then facts and cap */
.sh-top { display: flex; align-items: flex-start; gap: 8px; }
/* Experiment: the open sheet's controls stand in one column of icons on its left; it follows the page while the cards scroll */
.sheet { display: flex; gap: 14px; }
.sheet-main { flex: 1; min-width: 0; }
.sheet-rail { position: sticky; top: 72px; align-self: flex-start; display: flex; flex-direction: column; gap: 4px; margin: 2px 0 0 -8px; }
.sheet-rail .icon { width: 34px; height: 34px; color: #8a8d86; }
.sheet-rail .icon:hover:not(:disabled) { color: var(--ink-2); }
/* Experiment: on phones and on All buckets the controls are a row at the title's right (stack.js sets .tools-row) */
.sheet.tools-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 6px; }
.tools-row .sheet-main { display: contents; }
.tools-row .sh { grid-column: 1; grid-row: 1; }
.tools-row .sheet-rail { grid-column: 2; grid-row: 1; position: static; flex-direction: row; gap: 0; margin: -2px -8px 0 0; }
.tools-row .grid { grid-column: 1 / -1; }
.sheet.root .sheet-rail { margin-top: -8px; margin-bottom: -8px; }
.rail-done { position: relative; }
.sheet-rail .icon.rail-sort { display: inline-flex; width: auto; gap: 4px; padding: 0 9px 0 7px; border-radius: 17px; }
.rail-sort small { font-size: 12px; font-weight: 600; }
.rail-done[aria-pressed="true"] { background: rgb(0 0 0 / .1); color: var(--ink); }
.rail-done small { position: absolute; right: 1px; bottom: 1px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--ink-2); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 14px; }
.sh-n { flex: 1; min-width: 0; margin: 0; color: color-mix(in srgb, var(--tone) 55%, black); font-size: 28px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.sheet.root .sh-n { font-size: 16px; }
.sh-m { margin-top: 4px; font-size: 13px; color: rgb(0 0 0 / .55); line-height: 1.5; }
.sh-body { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.sh-body .tbtn { margin-left: -12px; }
.sh-body .tbtn.on { margin-left: 0; }
/* facts are unbreakable pieces; a line wraps between them */
.it { white-space: nowrap; }
.it + .it::before { content: "·"; margin: 0 6px; color: rgb(0 0 0 / .28); }
.capline { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; color: rgb(0 0 0 / .55); white-space: nowrap; }
.capline b { color: var(--ok); font-weight: 650; }
.capline b.bad { color: var(--bad); }
.capbar { flex: 0 1 140px; min-width: 60px; height: 5px; border-radius: 3px; background: rgb(0 0 0 / .1); overflow: hidden; }
.capbar i { display: block; height: 100%; border-radius: 3px; background: rgb(0 0 0 / .45); }

/* the time is the start / stop button */
.tbtn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border: 0; border-radius: 999px; background: none;
  font-size: 19px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* only the running time carries an icon: stop */
.tbtn .ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgb(0 0 0 / .14); color: #2a1800; }
.tbtn .ic svg { width: 9px; height: 9px; fill: currentColor; }
.tbtn:hover:not(:disabled) { background: rgb(0 0 0 / .05); }
.tbtn.on { padding: 3px 4px 3px 12px; background: var(--run); color: #2a1800; }
.tbtn.big { gap: 10px; padding: 4px 12px; font-size: 30px; letter-spacing: -.02em; }
.tbtn.big.on { padding-right: 5px; }
.tbtn.big .ic { width: 32px; height: 32px; }
.tbtn.big .ic svg { width: 12px; height: 12px; }
.tbtn:disabled { cursor: default; }

/* "running inside": an orange circle that leads to the running bucket */
.ri-dot { flex: 0 0 auto; margin-left: 6px; padding: 0 2px; border: 0; border-radius: 4px; background: none; color: var(--run); font-size: 14px; font-weight: 700; line-height: 1; }
.ri-dot:hover { background: var(--run-soft); }
.sh-n .ri-dot { font-size: 20px; margin-left: 8px; vertical-align: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-top: 18px; align-items: start; }
.card { position: relative; padding: 13px 14px 14px 16px; border-radius: 16px; background: var(--paper); border: 1px solid rgb(0 0 0 / .08); box-shadow: var(--shadow-card); }
.card.act { background: var(--run-soft); box-shadow: 0 0 0 2.5px var(--run), var(--shadow-card); }
.card.done { opacity: .62; border-style: dashed; }
.ch { display: flex; align-items: flex-start; gap: 8px; }
.cname { flex: 1; min-width: 0; display: flex; align-items: baseline; padding-top: 4px; }
.cn { padding: 0; border: 0; background: none; text-align: left; font-size: 16px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
/* The card opens on a click anywhere but its controls; hovering it lights the color square instead of underlining the name */
.card { cursor: pointer; }
/* Custom order: a held card lifts; a bar beside another card marks where it lands */
.card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.reordering, .reordering * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.card.lifted { z-index: 5; pointer-events: none; opacity: .92; box-shadow: var(--shadow-lg); rotate: -1deg; }
.card:is(.drop-before, .drop-after, .drop-above, .drop-below)::after { content: ""; position: absolute; border-radius: 2px; background: var(--ink-2); }
.card:is(.drop-before, .drop-after)::after { top: 6px; bottom: 6px; width: 3px; }
.card.drop-before::after { left: -9px; }
.card.drop-after::after { right: -9px; }
.card:is(.drop-above, .drop-below)::after { left: 10px; right: 10px; height: 3px; }
.card.drop-above::after { top: -9px; }
.card.drop-below::after { bottom: -9px; }
.ch .icon { margin: -2px -4px 0 0; }
.cbody { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.cbody .tbtn { margin-left: -10px; }
.cbody .tbtn.on { margin-left: 0; }
.cbody .icon { margin-right: -4px; }
.cs { height: 4px; margin-top: 8px; border-radius: 2px; background: #efede8; overflow: hidden; }
.cs i { display: block; height: 100%; background: var(--tone); filter: brightness(.82); }
.cm { margin-top: 5px; font-size: 11.5px; color: #8a8d86; line-height: 1.5; }
/* Experiment: no share bar and no "N% of …" on cards */
.card .cs, .card .share { display: none; }
.card .share + .it::before { content: none; }
.card .capline { margin-top: 6px; font-size: 11.5px; }
.peek { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
/* Experiment: card color variants, switched by look_lab.js (?look=…); "base" adds nothing */
/* text: the name and time carry the bucket color, darkened to stay readable */
:is([data-look="text"], [data-look="marker"]) :is(.cn, .tbtn:not(.on) .num) { color: color-mix(in srgb, var(--tone) 55%, black); }
/* marker: the card name sits on a light marker of the bucket color, shifted left so the text keeps its place */
[data-look="marker"] .cn { margin-left: -10px; padding: 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--tone) 55%, white); }
/* pill: the time button is a light pill of the bucket color */
[data-look="pill"] .tbtn:not(.on) { background: color-mix(in srgb, var(--tone) 40%, white); }
[data-look="pill"] .tbtn:not(.on):hover:not(:disabled) { background: color-mix(in srgb, var(--tone) 60%, white); }
[data-look="pill"] :is(.cbody, .sh-body) .tbtn { margin-left: 0; }
/* square: a color square before the card name, like the stack strips and search results */
[data-look~="square"] .cn::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; background: var(--tone); vertical-align: 1px; transition: box-shadow .15s; }
[data-look~="square"] .card:hover:not(:has(button:not(.cn):hover, [role="link"]:hover)) .cn::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 35%, transparent), 0 0 12px 2px var(--tone); }
[data-look~="square"] .sheet:not(.root) .sh-n::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .3em; border-radius: .14em; background: var(--tone); vertical-align: .06em; }
/* tint: the whole card is lightly tinted with the bucket color */
[data-look="tint"] .card:not(.act) { background: color-mix(in srgb, var(--tone) 16%, var(--paper)); }
/* tab: a folder tab of the bucket color sticks out above the card's top edge */
[data-look="tab"] .card::before { content: ""; position: absolute; top: -6px; left: 14px; width: 48px; height: 10px; border-radius: 6px 6px 0 0; background: var(--tone); }
/* highlight: a highlighter stroke of the bucket color under the lower half of the card name */
[data-look="highlight"] .cn { background: linear-gradient(transparent 55%, var(--tone) 55%, var(--tone) 92%, transparent 92%); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
/* wash: the card header fades from the bucket color into the paper */
[data-look="wash"] .card:not(.act) { background: linear-gradient(color-mix(in srgb, var(--tone) 45%, var(--paper)), var(--paper) 72px); }
/* corner: a folded paper corner of the bucket color in the card's top left */
[data-look="corner"] .card:not(.act) { background: linear-gradient(135deg, var(--tone) 22px, var(--paper) 22px); }
/* sticky: the card is a sticky note of the bucket color; child tiles turn lighter than it */
[data-look="sticky"] .card:not(.act) { background: var(--tone); border-color: transparent; }
[data-look="sticky"] .card:not(.act) .mini { background: color-mix(in srgb, var(--tone) 35%, white); }
/* ink: the card is a dark shade of the bucket color with light text; child tiles keep their pastel */
[data-look="ink"] .card:not(.act) { background: color-mix(in srgb, var(--tone) 40%, var(--ink)); border-color: transparent; color: #fff; }
[data-look="ink"] .card:not(.act) :is(.icon, .cm, .capline) { color: rgb(255 255 255 / .72); }
[data-look="ink"] .card:not(.act) .tag { background: rgb(255 255 255 / .16); color: rgb(255 255 255 / .8); }
[data-look="ink"] .card:not(.act) :is(.icon, .tbtn):hover:not(:disabled) { background: rgb(255 255 255 / .12); }
[data-look="ink"] .card:not(.act) .mini { color: var(--ink); }
/* brutal: a hard offset shadow of the bucket color and a dark outline */
[data-look~="brutal"] .card:not(.act) { border: 1.5px solid color-mix(in srgb, var(--tone) 35%, black); box-shadow: 5px 5px 0 var(--tone); }
/* spine: a thick book spine of the bucket color along the left edge */
[data-look="spine"] .card { border-left: 10px solid var(--tone); padding-left: 12px; }
/* sun: a big circle of the bucket color peeks in from the card's top right corner */
[data-look="sun"] .card:not(.act) { background: radial-gradient(circle at calc(100% + 10px) -24px, var(--tone) 0 74px, transparent 75px), var(--paper); }
/* hatch: light diagonal stripes of the bucket color over the whole card */
[data-look="hatch"] .card:not(.act) { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--tone) 45%, var(--paper)) 0 7px, var(--paper) 7px 14px); }
/* slab: a thick bottom edge of the bucket color, as if the card were a block of colored paper */
[data-look="slab"] .card:not(.act) { box-shadow: 0 5px 0 color-mix(in srgb, var(--tone) 80%, black), var(--shadow-card); }
/* pile: two sheets of the bucket color peek out from under the card */
[data-look="pile"] .card:not(.act) { box-shadow: 4px 4px 0 -1px var(--paper), 4px 4px 0 0 var(--tone), 8px 8px 0 -1px var(--paper), 8px 8px 0 0 color-mix(in srgb, var(--tone) 70%, white); }
/* frame: a wide inner frame of the bucket color, like a passe-partout */
[data-look="frame"] .card:not(.act) { border-color: transparent; box-shadow: inset 0 0 0 6px var(--tone), var(--shadow-card); }
/* halo: a soft colored glow around the card */
[data-look~="halo"] .card:not(.act) { border-color: var(--tone); box-shadow: 0 6px 22px -4px color-mix(in srgb, var(--tone) 85%, black); }
/* dots: a light polka dot pattern of the bucket color */
[data-look="dots"] .card:not(.act) { background: radial-gradient(color-mix(in srgb, var(--tone) 70%, var(--paper)) 2px, transparent 2.5px) 0 0 / 12px 12px, var(--paper); }
/* cap: a thick top edge of the bucket color */
[data-look="cap"] .card { border-top: 7px solid var(--tone); padding-top: 9px; }
/* combinations: square, brutal and halo are words in one look ("square brutal"); these rules settle what two of them both set */
[data-look~="brutal"][data-look~="halo"] .card:not(.act) { box-shadow: 5px 5px 0 var(--tone), 0 8px 26px -4px color-mix(in srgb, var(--tone) 85%, black); }
/* soft: brutal with a smaller offset and an outline in the bucket color; halo with a fainter glow */
[data-look~="brutal"][data-look~="soft"] .card:not(.act) { border-color: color-mix(in srgb, var(--tone) 60%, black); box-shadow: 3px 3px 0 var(--tone); }
[data-look~="halo"][data-look~="soft"] .card:not(.act) { box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--tone) 85%, black); }
/* Experiment: own time of a bucket with children, switched by look_lab.js (?own); "base" shows none */
.own-tile, .own-bar, .own-badge { display: none; }
.own-tile, .own-bar { background: repeating-linear-gradient(-45deg, rgb(0 0 0 / .09) 0 2px, transparent 2px 7px), rgb(255 255 255 / .45); }
/* tile: a hatched block after the cards with only the own time */
[data-own="tile"] .own-tile { display: flex; align-items: center; min-height: 56px; padding: 0 18px; border: 1px dashed rgb(0 0 0 / .14); border-radius: 16px; color: var(--ink-2); font-size: 17px; font-weight: 600; text-align: left; }
[data-own="tile"] .own-tile:hover { border-color: rgb(0 0 0 / .3); color: var(--ink); }
/* bar: under the header, the total split into children (bucket color) and own time (hatched) */
[data-own="bar"] .own-bar { display: block; width: min(320px, 100%); height: 8px; margin-top: 10px; padding: 0; border: 0; border-radius: 4px; overflow: hidden; }
.own-bar i { display: block; height: 100%; background: var(--tone); }
[data-own="bar"] .own-bar:hover { box-shadow: 0 0 0 1.5px rgb(0 0 0 / .2); }
/* badge: a small pie next to the time, its grey slice is the own share */
[data-own="badge"] .own-badge { display: block; flex: 0 0 auto; width: 20px; height: 20px; margin-right: auto; padding: 0; border: 0; border-radius: 50%;
  background: conic-gradient(#8a8d86 0 var(--own), var(--tone) var(--own) 100%); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
[data-own="badge"] .own-badge:hover { box-shadow: 0 0 0 2px rgb(0 0 0 / .15); }
/* Experiment: own sessions drawn one by one under the cards (own_lab.js) */
.os { display: flex; width: 100%; margin-top: 16px; padding: 0; border: 0; background: none; text-align: left; }
.tools-row .os { grid-column: 1 / -1; }
.os i { display: block; background: color-mix(in srgb, var(--tone) 80%, black); }
.os i:hover { background: var(--ink-2); }
.os-squares { flex-wrap: wrap; align-items: flex-end; gap: 4px; }
.os-squares i { width: var(--s); height: var(--s); border-radius: 3px; background: color-mix(in srgb, var(--tone) 55%, #f3f2ee); }
.os-squares i:hover { background: color-mix(in srgb, var(--tone) 80%, black); }
.os-card { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 3px; margin-top: 10px; }
.os-card i { display: block; border-radius: 2px; background: color-mix(in srgb, var(--tone) 55%, var(--paper)); }
.os-card-squares i { width: var(--s); height: var(--s); }
.os-card-bricks i { width: min(var(--w), 100%); height: 8px; }
.os-card i:hover { background: color-mix(in srgb, var(--tone) 80%, black); }
.os-beads { align-items: center; gap: 3px; flex-wrap: wrap; background: linear-gradient(rgb(0 0 0 / .15), rgb(0 0 0 / .15)) 0 calc(50% + 5px) / 100% 1px no-repeat; min-height: 40px; }
.os-beads i { width: var(--s); height: var(--s); border-radius: 50%; }
.os-barcode { position: relative; height: 34px; }
.os-barcode::before { content: ""; position: absolute; inset: 10px 0 0; border-radius: 4px; background: rgb(0 0 0 / .04); }
.os-barcode i { position: absolute; top: 10px; bottom: 0; }
.os-calendar { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); grid-auto-columns: 11px; gap: 3px; }
.os-calendar i { border-radius: 2px; }
.os-calendar .l0 { background: rgb(0 0 0 / .05); }
.os-calendar .l1 { background: color-mix(in srgb, var(--tone) 45%, white); }
.os-calendar .l2 { background: var(--tone); }
.os-calendar .l3 { background: color-mix(in srgb, var(--tone) 70%, black); }
.os-calendar .l4 { background: color-mix(in srgb, var(--tone) 45%, black); }
.os-bricks { flex-wrap: wrap; gap: 3px; }
.os-bricks i { width: min(var(--w), 100%); height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--tone) 55%, #f3f2ee); }
.os-bricks i:hover { background: color-mix(in srgb, var(--tone) 80%, black); }
.os-skyline { align-items: flex-end; gap: 2px; height: 66px; border-bottom: 1px solid rgb(0 0 0 / .12); }
.os-skyline i { flex: 0 0 6px; height: var(--h); border-radius: 2px 2px 0 0; }
/* Experiment: the card title style, switched by look_lab.js (?title-size, ?title-weight, ?title-color); "base" adds nothing */
[data-title-size="14"] .card .ch .cn { font-size: 14px; }
[data-title-size="15"] .card .ch .cn { font-size: 15px; }
[data-title-size="17"] .card .ch .cn { font-size: 17px; }
[data-title-size="18"] .card .ch .cn { font-size: 18px; }
[data-title-size="20"] .card .ch .cn { font-size: 20px; }
[data-title-weight="300"] .card .ch .cn { font-weight: 300; }
[data-title-weight="400"] .card .ch .cn { font-weight: 400; }
[data-title-weight="500"] .card .ch .cn { font-weight: 500; }
[data-title-weight="600"] .card .ch .cn { font-weight: 600; }
[data-title-weight="700"] .card .ch .cn { font-weight: 700; }
[data-title-weight="800"] .card .ch .cn { font-weight: 800; }
[data-title-color="muted"] .card .ch .cn { color: var(--ink-2); }
[data-title-color="grey"] .card .ch .cn { color: #8a8d86; }
[data-title-color="tone"] .card .ch .cn { color: color-mix(in srgb, var(--tone) 55%, black); }
[data-title-color="tonedark"] .card .ch .cn { color: color-mix(in srgb, var(--tone) 30%, black); }
/* Experiment: the card clock style, switched by look_lab.js (?clock-size, ?clock-weight, ?clock-color); "base" adds nothing */
[data-clock-size="15"] .card .tbtn { font-size: 15px; }
[data-clock-size="17"] .card .tbtn { font-size: 17px; }
[data-clock-size="21"] .card .tbtn { font-size: 21px; }
[data-clock-size="24"] .card .tbtn { font-size: 24px; }
[data-clock-weight="200"] .card .tbtn { font-weight: 200; }
[data-clock-weight="300"] .card .tbtn { font-weight: 300; }
[data-clock-weight="400"] .card .tbtn { font-weight: 400; }
[data-clock-weight="500"] .card .tbtn { font-weight: 500; }
[data-clock-weight="700"] .card .tbtn { font-weight: 700; }
[data-clock-weight="800"] .card .tbtn { font-weight: 800; }
[data-clock-color="muted"] .card .tbtn:not(.on) .num { color: var(--ink-2); }
[data-clock-color="grey"] .card .tbtn:not(.on) .num { color: #8a8d86; }
[data-clock-color="tone"] .card .tbtn:not(.on) .num { color: color-mix(in srgb, var(--tone) 55%, black); }
[data-clock-color="tonedark"] .card .tbtn:not(.on) .num { color: color-mix(in srgb, var(--tone) 30%, black); }
.mini { position: relative; flex-grow: var(--g); min-width: 78px; padding: 6px 9px 8px; border-radius: 10px; background: color-mix(in srgb, var(--tone) 70%, white); font-size: 12px; cursor: pointer; }
.mini:hover { box-shadow: 0 0 0 1.5px rgb(0 0 0 / .25); }
.mini b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini em { margin-left: 5px; font-style: normal; font-size: 10px; font-weight: 500; color: rgb(0 0 0 / .45); }
.mini .ri-dot { font-size: 11px; margin-left: 4px; }
.mini > .num { color: rgb(0 0 0 / .6); }
.mini.zero { background: none; border: 1px dashed #c9c6be; color: #a5a8a1; }
.mini.act { background: #ffd9a6; box-shadow: 0 0 0 2px var(--run); }
/* quick start on a tile: on hover, only where there is a mouse */
.mplay { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--tone) 55%, #5b4a40); color: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); opacity: 0; transition: opacity .12s; }
.mplay svg { width: 8px; height: 8px; fill: currentColor; }
.mini:hover .mplay, .mplay:focus-visible { opacity: 1; }
.mplay:hover { filter: brightness(.9); }
.mplay.on { opacity: 1; background: var(--run); color: #2a1800; }
/* Only the running tile reserves room for its button; hover must not change the layout, or the tiles reflow under the cursor */
.mini.act b { padding-right: 26px; }
/* No hover on touch screens: on tiles only the running one keeps its stop */
@media (hover: none) {
  .mplay:not(.on) { display: none; }
  /* a held tile starts its timer: no callout or text selection, and a slow squeeze while holding */
  .mini { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; transition: transform .15s; }
  .mini.holding { transform: scale(.95); transition: transform .5s; }
  .mplay.on { width: 30px; height: 30px; }
}

/* =====================================================================
   Bucket actions menu and find bucket
   ===================================================================== */
dialog.menu { position: fixed; inset: auto; margin: 0; width: 260px; padding: 6px; border: 1px solid #ece9e2; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: visible; }
dialog.menu::backdrop { background: transparent; }
.menu .ph { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.menu .ph b { display: block; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.menu .sep { height: 1px; margin: 5px 6px; background: #efece6; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 13.5px; }
.mi:hover { background: #f2f0eb; }
.mi svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mi-play { display: inline-flex; }
.mi-mark { display: inline-flex; width: 16px; height: 16px; }
.mi-play svg { width: 16px; height: 16px; padding: 2px; fill: var(--muted); stroke: none; }
.mi.danger svg { stroke: var(--bad); }
.mi .k { margin-left: auto; color: var(--faint); font-size: 11px; }
.mi.danger { color: var(--bad); }
.mi:disabled { color: var(--faint); cursor: default; }
.mi:disabled:hover { background: none; }
.mi .k svg { width: 14px; height: 14px; }
/* Move from the menu: a path back up, then the places of one level */
.move-path { display: flex; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.move-crumb { padding: 1px 3px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; }
.move-crumb:hover { color: var(--ink); background: #f2f0eb; text-decoration: underline; text-underline-offset: 2px; }
.move-crumb + .move-crumb::before { content: "›"; margin-right: 6px; color: var(--faint); }
.move-crumb[aria-current="true"] { color: var(--ink); font-weight: 650; }
.move-crumb:not([aria-current="true"]) { text-decoration: underline; text-decoration-color: rgb(0 0 0 / .2); text-underline-offset: 2px; }
.move-list { max-height: min(320px, 50vh); overflow-y: auto; }
.move-row { display: flex; align-items: center; }
.move-row .mi { flex: 1; min-width: 0; }
.move-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 3px; background: var(--tone); }
.move-into { width: 32px; height: 32px; }
dialog.search { position: fixed; top: 64px; inset-inline: 0; margin: 0 auto; width: min(560px, calc(100vw - 32px)); padding: 10px; border: 1px solid #ece9e2; border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 25; }
.search input { font-size: 15px; }
.search .input-note { padding: 0 4px; }
.results { max-height: 360px; overflow: auto; margin-top: 6px; }
.result { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 13.5px; }
.result:hover, .result:focus-visible, .result.is-picked { background: #f2f0eb; }
.result i { width: 10px; height: 10px; border-radius: 3px; background: var(--tone); }
.result small { display: block; color: var(--faint); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .num { color: var(--muted); font-size: 12.5px; }
.result-run { margin-left: 6px; color: var(--run); font-size: 12px; }

/* =====================================================================
   Session dialog
   ===================================================================== */
#session-dialog { width: 560px; }
#session-context { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
#session-context:empty { display: none; }
#session-duration-field { margin-top: 14px; }
#session-duration { display: block; width: 140px; margin-top: 6px; padding: 4px 12px; font-size: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#session-discard { margin-right: auto; color: var(--muted); }
.session-actions { flex-wrap: wrap; }

/* inbox picker, GitHub issues, calendar suggestions, linked items */
.inbox-picker { margin-top: 14px; }
.inbox-review-actions { display: flex; gap: 8px; align-items: center; }
.inbox-picker-label { margin: 0 0 6px; color: var(--faint); font-size: 12px; }
.inbox-picker-label b { color: var(--ink-2); font-weight: 600; }
.sugs { display: flex; flex-wrap: wrap; gap: 6px; }
.sug { padding: 5px 11px; border: 0; border-radius: 999px; background: #f2f0eb; color: var(--ink-2); font-size: 12.5px; text-align: left; overflow-wrap: anywhere; }
.sug:hover { background: #e8e5de; }
.sug.on { background: var(--ink); color: #fff; }
.calendar-suggestions { margin: 14px 0 0; }
.calendar-suggestion-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 170px; overflow-y: auto; margin-top: 6px; }
.calendar-suggestion { display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 11px; border: 0; border-radius: 999px; background: #f2f0eb; color: var(--ink-2); font-size: 12.5px; text-align: left; }
.calendar-suggestion:hover:not(:disabled) { background: #e8e5de; }
.calendar-suggestion:disabled { background: var(--ink); color: #fff; opacity: 1; }
.calendar-suggestion time { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
#session-issue-results { display: grid; gap: 4px; max-height: 200px; overflow-y: auto; margin-top: 6px; }
.issue-result { padding: 8px 10px; border: 0; border-radius: 10px; background: #f6f5f1; text-align: left; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.issue-result:hover { background: #ecebe6; }
.linked-items { display: grid; gap: 4px; margin-top: 12px; }
.linked-item-row { display: flex; align-items: baseline; gap: 8px; }
.linked-item { min-width: 0; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
a.linked-item { color: #3d5a8a; }
.linked-item-remove { flex: 0 0 auto; padding: 0 6px; font-size: 16px; }

/* =====================================================================
   Bucket dialog and recorded sessions
   ===================================================================== */
#bucket-context { margin: 2px 0 0; }
.bucket-properties { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 18px; } /* cap and palette side by side */
.bucket-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.color-swatch { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; }
.color-swatch::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .1); }
.color-swatch[aria-pressed="true"]::before { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.color-auto { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: #efede8; font-size: 12px; font-weight: 600; color: var(--muted); }
.color-auto[aria-pressed="true"] { background: var(--ink); color: #fff; }
.history-section { margin-top: 18px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-heading h3 { margin: 0; font-size: 13px; }
.history-open { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; font-weight: 700; font-size: 13px; }
.history-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.history-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #efede8; color: var(--muted); font-weight: 600; font-size: 11.5px; text-align: center; }
.history-chevron { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.move-section { margin-top: 18px; border-radius: 14px; border: 1px solid #e8e5de; background: #fbfaf7; }
.move-section summary { cursor: pointer; padding: 10px 14px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.move-now { margin-left: 10px; color: var(--muted); font-weight: 400; }
.move-now b { margin-left: 4px; padding: 2px 9px; border-radius: 999px; background: #ebe8e1; color: var(--ink); font-weight: 650; }
.move-section p { margin: 0 14px 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.move-options { display: flex; gap: 8px; padding: 0 14px 14px; }
.move-options select { flex: 1; min-width: 0; }
.delete-section { margin-top: 18px; border-radius: 14px; border: 1px solid #f0d6cf; background: #fffaf8; }
.delete-section summary { cursor: pointer; padding: 10px 14px; color: var(--bad); font-size: 13px; font-weight: 600; }
.delete-section p { margin: 0 14px 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.delete-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.bucket-footer .input-note { margin: 0 auto 0 0; }
#recorded-dialog { width: 640px; }
.recorded-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
#recorded-summary { margin: 0; }
.recorded-query { width: 100%; margin-top: 10px; }
.recorded-query[hidden] { display: none; }
.recorded-actions { display: flex; gap: 4px; }
#recorded-list { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); overflow: hidden; }
#recorded-list > .muted, #recorded-list > .input-note { margin: 0; padding: 12px 14px; }
.session-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 10px 10px 14px; border-top: 1px solid var(--line-soft); }
.session-row:first-child { border-top: 0; }
.session-content { flex: 1; min-width: 0; }
.session-edit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.session-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.session-duration { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.session-description { grid-column: 1 / -1; color: var(--ink-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.session-edit:hover .session-description { color: var(--ink); }
.session-delete { flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: #b07b70; font-size: 17px; }
.session-delete:hover { background: var(--bad-soft); color: var(--bad); }

/* =====================================================================
   Settings
   ===================================================================== */
#settings-dialog { width: 560px; }
.settings-work h3 { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-2); }
.capacity-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.capacity-day label { margin: 0 0 4px; text-align: center; font-size: 11px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.capacity-day input { padding: 8px 4px; text-align: center; }
.settings-sounds { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); }
.settings-sounds summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 650; }
.settings-sounds summary .input-note { margin-left: 6px; }
.settings-sound-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px 32px; gap: 8px; align-items: center; padding: 0 14px 10px; }
.settings-sound-row > label { margin: 0; font-weight: 500; font-size: 13px; }
.settings-sound-duration { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.settings-sound-duration input { padding: 8px 6px; text-align: center; }
.settings-sound-preview { width: 32px; min-height: 32px; padding: 0; border-radius: 50%; }
.settings-sound-preview svg { width: 12px; height: 12px; fill: currentColor; }
.settings-sound-footer { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px; }
.settings-sound-footer .input-note { margin: 0 auto 0 0; }
.settings-links { display: grid; gap: 8px; margin-top: 16px; }
.settings-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); text-align: left; }
.settings-link:hover:not(:disabled) { border-color: #c9c6be; }
.settings-link > span { display: flex; flex-direction: column; min-width: 0; }
.settings-link strong { font-size: 14px; }
.settings-link small { color: var(--muted); font-size: 12px; }
.settings-link svg { width: 18px; height: 18px; margin-left: auto; fill: none; stroke: var(--faint); stroke-width: 1.8; }

/* =====================================================================
   Inbox
   ===================================================================== */
#inbox-dialog { width: 520px; }
.inbox-review { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: #fff7e8; font-size: 13px; }
.inbox-review p { margin: 0; flex: 1 1 200px; }
.inbox-tasks { margin: 10px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 14px; background: var(--field); overflow: hidden; }
.inbox-tasks:empty { display: none; }
.inbox-task { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 14px; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.inbox-task:first-child { border-top: 0; }
.inbox-task > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.inbox-delete { width: 28px; height: 28px; padding: 0; border-radius: 50%; color: var(--faint); font-size: 16px; }

/* =====================================================================
   GitHub, calendars, data
   ===================================================================== */
.github-oauth-connection { margin: 16px 0 20px; }
.github-oauth-connection .input-note { overflow-wrap: anywhere; }
.github-repositories { margin-bottom: 20px; }
.github-repository-list { max-height: 240px; overflow-y: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--field); }
.github-repository-list .github-repository { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 14px; border-top: 1px solid var(--line-soft); font-weight: 500; font-size: 13px; cursor: pointer; }
.github-repository-list .github-repository:first-child { border-top: 0; }
.github-repository input { flex: 0 0 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.github-repository span { min-width: 0; overflow-wrap: anywhere; }
#calendar-dialog { width: 560px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; }
.calendar-toolbar .input-note { margin: 0; }
.calendar-accounts { margin: 0; }
.calendar-account { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.calendar-account-heading { display: flex; align-items: flex-start; gap: 8px; }
.calendar-account-toggle { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; color: var(--ink-2); }
.calendar-account-identity { min-width: 0; }
.calendar-account-identity strong { display: block; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.calendar-account-identity small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.calendar-chevron { display: grid; place-items: center; flex: 0 0 18px; height: 22px; font-size: 20px; color: var(--faint); }
.calendar-account-toggle[aria-expanded="true"] .calendar-chevron { transform: rotate(90deg); }
.calendar-more { width: 30px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 18px; }
.calendar-more:hover { background: #efeee9; }
.calendar-menu-wrap { position: relative; flex-shrink: 0; }
.calendar-menu { position: absolute; z-index: 5; top: calc(100% + 5px); right: 0; min-width: 200px; padding: 6px; border: 1px solid #ece9e2; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-lg); }
.calendar-account:last-child .calendar-menu { top: auto; bottom: calc(100% + 5px); }
.calendar-menu button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 13px; }
.calendar-menu button:hover:not(:disabled) { background: #f2f0eb; }
.calendar-menu button small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.calendar-menu .calendar-disconnect { color: var(--bad); }
.calendar-provider-menu { min-width: 220px; }
.calendar-account-body { margin: 12px 0 0 28px; }
.calendar-choices { max-height: 280px; overflow-y: auto; }
.calendar-choice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 0; font-weight: 500; cursor: pointer; }
.calendar-choice input { flex: 0 0 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.calendar-choice span { padding-left: 9px; border-left: 3px solid var(--calendar-color); font-size: 13px; overflow-wrap: anywhere; }
.calendar-empty { margin: 14px 0 4px; padding: 20px 0; border-top: 1px solid var(--line-soft); text-align: center; }
.calendar-save-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.calendar-save-actions .input-note { margin: 0; }
.calendar-password-connection { margin-top: 14px; }
.calendar-password-connection h3 { margin: 16px 0; font-size: 16px; }
.calendar-password-connection a { color: #3d5a8a; }
.calendar-back { padding-left: 0; }
.data-restore { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.data-restore h3 { margin: 0; font-size: 15px; }
.data-file { font-size: 12px; overflow-wrap: anywhere; }
.data-file:empty { display: none; }
.data-summary { margin-bottom: 0; font-weight: 600; }

/* =====================================================================
   Report: full screen, days carry their sessions, the chosen day opens on the side
   ===================================================================== */
#report-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0; overflow: hidden; background: var(--bg); box-shadow: none; }
#report-dialog[open] { display: flex; flex-direction: column; }
.report-shell { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* report header, grouped left to right: what, when and how much, how to view; the ⋯ menu and close on the right */
.report-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--paper); flex-shrink: 0; }
.report-title { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 32ch; margin: 0; font-size: 19px; font-weight: 700; }
.report-title > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-branches { position: relative; min-width: 0; }
.report-title-button { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 8px; background: none; font: inherit; color: inherit; }
.report-title-button:hover, .report-title-button[aria-expanded="true"] { background: #efede8; }
.report-title-button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-title-button svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.report-branch-menu { left: 0; right: auto; min-width: 250px; max-height: min(420px, 60vh); overflow-y: auto; }
.report-branch-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 10px 8px; color: var(--muted); font-size: 12px; }
.report-branch { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.report-branch:hover { background: #f2f0eb; }
.report-branch i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; background: var(--tone); }
.report-branch span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-branch small { margin-left: auto; color: var(--faint); font-size: 11px; }
.report-branch-mark { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 4px; background: var(--report-color); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.report-period { display: flex; align-items: center; gap: 14px; }
.report-navigation { display: flex; align-items: center; gap: 2px; }
.report-navigation h2 { margin: 0; min-width: 132px; text-align: center; font-size: 15px; font-weight: 700; white-space: nowrap; }
#report-prev, #report-next { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; }
#report-prev svg, #report-next svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.report-sum { display: flex; flex-direction: column; line-height: 1.1; font-variant-numeric: tabular-nums; }
.report-sum strong { font-size: 24px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; }
.report-cap { font-size: 11.5px; color: var(--ok); white-space: nowrap; }
.report-weeks { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.report-cap.over { color: var(--bad); }
.report-actions { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: #efede8; }
.report-actions button { padding: 5px 14px; border-radius: 999px; color: var(--muted); font-size: 12.5px; }
.report-actions button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.report-more { position: relative; margin-left: auto; }
.report-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 220px; padding: 6px; border: 1px solid #ece9e2; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-lg); }
.report-menu-total { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.report-menu-total b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
#report-close { margin-left: -12px; }
.report-error { display: flex; align-items: center; gap: 12px; padding: 10px 22px; color: var(--bad); font-size: 13px; }
#report-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 22px 24px; }
#report-body.report-month { overflow: hidden; padding: 0; }
/* the shown month stays while the next one loads; it dims only if the wait is noticeable */
#report-body.is-loading > * { opacity: .5; transition: opacity .15s .12s; }
#report-body > .muted { padding: 16px 22px; }
.report-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100%; min-height: 0; }
.report-side { overflow: auto; padding: 18px 20px; border-left: 1px solid var(--line); background: var(--paper); }
.report-calendar { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 14px 22px 18px; }
.report-weekdays, .report-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 128px; gap: 6px; }
.report-weekdays { flex-shrink: 0; padding-bottom: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--faint); text-align: center; }
.report-week-heading { text-align: right; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); gap: 6px; flex: 1; min-height: 0; }
.report-week { min-height: 0; }
.report-week-total { grid-column: 8; grid-row: 1; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.report-week-total > span { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); order: 2; }
.report-week-total strong { font-size: 13px; font-weight: 650; }
/* the week split by the first level under the report's bucket */
.report-week-split, .report-week-groups { order: 3; width: 100%; }
.report-week-split { display: flex; gap: 1px; height: 6px; margin-top: 8px; border-radius: 3px; overflow: hidden; }
.report-week-split i { min-width: 2px; }
.report-week-groups { display: grid; gap: 2px; margin-top: 6px; font-size: 11px; line-height: 1.35; }
.report-week-groups > span { display: flex; justify-content: space-between; gap: 6px; }
.report-week-groups em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; color: var(--faint); }
.report-week-groups b { flex: 0 0 auto; font-weight: 600; }
.report-week-groups .more { justify-content: flex-end; color: var(--faint); }
.report-day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 0; overflow: hidden; padding: 6px 7px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #c4c6bf; text-align: left; font-size: 11.5px; }
.report-day.is-blank { visibility: hidden; }
/* days of the neighbouring months that complete the first and last weeks */
.report-day.is-outside { opacity: .45; }
.report-day.is-outside:hover:not(:disabled), .report-day.is-outside.is-selected { opacity: .8; }
.report-day.has-sessions { background: var(--field); border-color: #efece6; color: var(--ink); }
.report-day.has-sessions:hover { border-color: #c9c6be; }
.report-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.report-day.is-selected { background: var(--paper); box-shadow: inset 0 0 0 2px #8b8d86; }
.report-date-row { display: flex; align-items: baseline; gap: 6px; flex-shrink: 0; }
.report-date { font-size: 13px; font-weight: 700; }
.report-day-total { margin-left: auto; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.report-more { font-size: 10px; color: var(--faint); white-space: nowrap; }
.report-markers { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; row-gap: 3px; line-height: 18px; }
.report-marker { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 5px; align-items: center; padding: 0 5px; border-radius: 6px; background: color-mix(in srgb, var(--marker) 45%, white); font-size: 10.5px; line-height: inherit; }
.report-marker time { color: var(--muted); font-variant-numeric: tabular-nums; }
.report-marker-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-marker b { font-weight: 600; font-variant-numeric: tabular-nums; }
.report-marker.is-running { background: #ffe1b8; }
.report-dots { display: none; }
.report-details { display: grid; gap: 16px; max-width: 860px; margin: 0 auto; }
.report-empty { padding: 30px 0; text-align: center; }
.report-detail { padding: 18px 20px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-card); }
.report-side .report-detail { padding: 0; background: none; box-shadow: none; }
.report-day-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 10px; }
.report-day-heading h2 { margin: 0; font-size: 16px; }
.report-day-heading > span { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.report-session { position: relative; padding: 10px 0 10px 16px; border-top: 1px solid var(--line-soft); }
.report-session::before { content: ""; position: absolute; left: 0; top: 14px; width: 8px; height: 8px; border-radius: 2px; background: var(--session-color); }
.report-session-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.report-session-path { margin: 2px 0 0; color: var(--faint); font-size: 11.5px; overflow-wrap: anywhere; }
.report-description { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.report-description span { white-space: pre-wrap; }
.report-session .input-note { margin-top: 4px; }

/* tablets: five days of the week, the rest by horizontal scroll */
@media (min-width: 641px) and (max-width: 1100px) {
  .week-days { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 4px; }
  .week-days::-webkit-scrollbar { display: none; }
  .week-day { flex: 0 0 calc((100% - 40px) / 5); scroll-snap-align: center; }
}

/* =====================================================================
   Phones
   ===================================================================== */
@media (max-width: 640px) {
  .app-header { padding: 10px 12px; gap: 4px; }
  .brand { font-size: 15.5px; }
  .header-button { display: none; }
  .header-icon { display: inline-grid; width: 36px; height: 36px; }
  .account-menu { margin-left: 4px; }

  /* exactly three days on screen: yesterday, today, tomorrow */
  .week-panel { padding: 0; }
  .calendar-status { padding: 0 12px; }
  .week-days { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 10px 4px; scrollbar-width: none; }
  .week-days::-webkit-scrollbar { display: none; }
  .week-day { flex: 0 0 calc((100% - 12px) / 3); scroll-snap-align: center; padding: 8px 8px 10px; border-radius: 14px; }
  .day-number, .week-day.today .day-number { font-size: 21px; }
  .day-weekday { font-size: 9.5px; letter-spacing: .06em; }
  #available { font-size: 12px; }
  .week-meta, .day-planned { display: none; }
  .day-calendar-events { display: none; }
  .week-day.today .day-calendar-events { display: grid; }
  .day-notice { margin: 10px 12px 0; }

  .app-field { padding: 0 10px; margin-top: 14px; }
  .runchip { height: 32px; padding: 0 10px; }
  .runchip-name { display: none; }
  .layer { border-radius: 18px; }
  .layer.has-also { padding-top: 60px; }
  .lrow { left: 12px; right: 10px; flex-wrap: wrap; row-gap: 6px; }
  .llab::after { inset: -8px -10px -8px -12px; }
  .also { flex: 0 0 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .also::-webkit-scrollbar { display: none; }
  .also button { padding: 4px 10px; font-size: 12px; }
  .sheet { padding: 16px 14px; border-radius: 18px; }
  /* All buckets and the levels inside it run edge to edge on phones: fewer frames, more room for the cards */
  .sheet.root, .layer.root { margin-inline: -10px; border: 0; box-shadow: none; }
  .sh-n { font-size: 21px; }
  .sheet.root .sh-n { font-size: 15px; }
  .sh-m { font-size: 12px; }
  .sh-body .tbtn { margin-left: -8px; }
  .tbtn.big { gap: 6px; padding: 3px 8px; font-size: 19px; letter-spacing: -.02em; }
  .tbtn.big.on { padding-right: 3px; }
  .tbtn.big .ic { width: 26px; height: 26px; }
  .tbtn.big .ic svg { width: 10px; height: 10px; }
  .grid { grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
  .sheet-rail .icon { width: 32px; height: 32px; }
  .card { padding: 12px 12px 12px 14px; }
  .cn { font-size: 15px; }
  .tbtn { font-size: 17px; }

  /* menus: centered over a blurred page */
  dialog.menu { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(340px, calc(100vw - 32px)); border-radius: 20px; padding: 8px; }
  dialog.menu::backdrop { background: rgb(32 35 31 / .16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .mi { padding: 12px; font-size: 15px; }
  dialog.search { top: 10px; width: calc(100vw - 20px); }

  /* dialogs: sheets anchored to the bottom of the visible area, so a keyboard never hides them */
  dialog[open]:not(#report-dialog):not(.menu):not(.search) {
    position: fixed; inset: auto 0 auto 0; margin: 0; width: 100%; max-width: none;
    top: calc(var(--dialog-viewport-top, 0px) + var(--dialog-viewport-height, 100dvh)); transform: translateY(-100%);
    max-height: calc(var(--dialog-viewport-height, 100dvh) - 16px);
    display: flex; flex-direction: column; overflow: hidden;
    padding: 18px 16px max(16px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
  }
  dialog[open]:not(#report-dialog):not(.menu):not(.search)::before { content: ""; flex: 0 0 auto; align-self: center; width: 40px; height: 5px; margin: -8px 0 8px; border-radius: 3px; background: #dedad2; }
  .dialog-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  .dialog-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
  #recorded-list { overflow: auto; flex: 1 1 auto; }
  .form-actions { flex-wrap: wrap; flex-shrink: 0; }
  .form-actions .primary-button { flex: 1 1 auto; }
  .bucket-footer .input-note { flex-basis: 100%; }
  .date-time-fields { grid-template-columns: 1fr 92px; }
  .bucket-properties { grid-template-columns: 1fr; }
  .capacity-days { gap: 4px; }
  .settings-sound-row { grid-template-columns: minmax(0, 1fr) 84px 32px; }
  .settings-sound-row > label { grid-column: 1 / -1; margin-top: 4px; }

  /* report: compact cells with colored dots; the chosen day under the month */
  /* three rows: title with ⋯ and close; period with its total; the view switch */
  .report-header { padding: 10px 12px; gap: 8px; }
  .report-branches { order: 1; flex: 1 1 0; }
  .report-title { max-width: none; font-size: 17px; }
  .report-more { order: 2; margin-left: 0; }
  #report-close { order: 3; margin-left: 0; }
  .report-period { order: 4; width: 100%; justify-content: space-between; }
  .report-navigation h2 { min-width: 0; }
  .report-sum { align-items: flex-end; }
  .report-sum strong { font-size: 20px; }
  .report-actions, .report-back { order: 5; }
  #report-body.report-month { overflow: auto; }
  .report-split { display: block; height: auto; }
  .report-calendar { height: 70vh; padding: 10px; }
  .report-weekdays, .report-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .report-week-heading, .report-week-total { display: none; }
  .report-grid { gap: 3px; }
  .report-day { padding: 4px 5px; border-radius: 9px; }
  .report-date-row { flex-direction: column; align-items: flex-start; gap: 0; }
  .report-day-total { margin-left: 0; font-size: 10px; }
  .report-markers, .report-more { display: none; }
  .report-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; }
  .report-dots i { width: 6px; height: 6px; border-radius: 2px; }
  .report-side { border-left: 0; border-top: 1px solid var(--line); }
  #report-body { padding: 12px; }
}

/* touch: larger targets and no zoom on focus */
.touch :is(input, select, textarea) { font-size: 16px; }
.touch :is(input:not([type="checkbox"]):not([type="radio"]), select) { min-height: 44px; }
.touch .keyboard-hint { display: none; }
.touch dialog:not(#report-dialog) :is(.primary-button, .secondary-button, .danger-button) { min-height: 44px; }
.touch :is(.close-button, .session-delete, .color-swatch, .linked-item-remove, .calendar-more) { min-width: 40px; min-height: 40px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Temporary: the look switcher from look_lab.js */
.looklab { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.looklab-toggle { height: 36px; padding: 0 14px; border: 1px solid #ece9e2; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; }
.looklab-panel { width: min(300px, calc(100vw - 32px)); max-height: calc(100dvh - 120px); overflow-y: auto; padding: 4px 10px 10px; border: 1px solid #ece9e2; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-lg); }
.looklab-panel[hidden] { display: none; }
.looklab-title { margin: 10px 2px 4px; color: #8a8d86; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.looklab-options { display: flex; flex-wrap: wrap; gap: 4px; }
.looklab-options.list { display: grid; gap: 2px; max-height: 40dvh; overflow-y: auto; }
.looklab-options button { padding: 6px 10px; border: 0; border-radius: 9px; background: rgb(0 0 0 / .04); text-align: left; font-size: 13px; }
.looklab-options.list button { background: none; }
.looklab-options button:hover { background: rgb(0 0 0 / .07); }
.looklab-options button.on { background: rgb(0 0 0 / .12); font-weight: 650; }
