/* Layout: narrow rail on the left, worksheet in the middle, a column with the month calendar on the right; the 06–06 timeline is the signature element. */
:root {
  --paper: #eef1f0;
  --sheet: #ffffff;
  --sheet-2: #f5f7f6;
  --ink: #16201d;
  --ink-2: #55625e;
  --ink-3: #7b8884;
  --rule: #d6ddda;
  --accent: #0a6d67;
  --accent-ink: #ffffff;
  --accent-soft: #dcefec;
  --pending: #8a5a00;
  --pending-soft: #fbefd6;
  --danger: #b42323;
  --heat-0: #f2f5f4; --heat-1: #dcefec; --heat-2: #b3ddd7; --heat-3: #74bdb4; --heat-4: #2a8c82; --heat-ink: #ffffff;
  --p1: #2a78d6; --p2: #eb6834; --p3: #1baf7a; --p4: #eda100;
  --p5: #e87ba4; --p6: #008300; --p7: #6250d6; --p8: #e34948; --p0: #9aa5a1;
  --shadow: rgba(8, 28, 24, .18);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 4px;
  --r-md: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1513; --sheet: #161e1b; --sheet-2: #1c2522; --ink: #e2eae7; --ink-2: #9caba6; --ink-3: #74837e;
    --rule: #2a3531; --accent: #3bb7ab; --accent-ink: #052320; --accent-soft: #133530;
    --pending: #e3ad4f; --pending-soft: #3a2c10; --danger: #f07a7a;
    --heat-0: #1a2320; --heat-1: #173430; --heat-2: #1d4a44; --heat-3: #23675f; --heat-4: #34a093; --heat-ink: #04201c;
    --p1: #3987e5; --p2: #d95926; --p3: #199e70; --p4: #c98500;
    --p5: #d55181; --p6: #008300; --p7: #9085e9; --p8: #e66767; --p0: #5f6d69;
    --shadow: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1513; --sheet: #161e1b; --sheet-2: #1c2522; --ink: #e2eae7; --ink-2: #9caba6; --ink-3: #74837e;
  --rule: #2a3531; --accent: #3bb7ab; --accent-ink: #052320; --accent-soft: #133530;
  --pending: #e3ad4f; --pending-soft: #3a2c10; --danger: #f07a7a;
  --heat-0: #1a2320; --heat-1: #173430; --heat-2: #1d4a44; --heat-3: #23675f; --heat-4: #34a093; --heat-ink: #04201c;
  --p1: #3987e5; --p2: #d95926; --p3: #199e70; --p4: #c98500;
  --p5: #d55181; --p6: #008300; --p7: #9085e9; --p8: #e66767; --p0: #5f6d69;
  --shadow: rgba(0, 0, 0, .5);
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
/* The hidden attribute wins over the display rules of panels and views (the draft got this from its host page). */
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }

/* Rail */
.rail {
  position: sticky; top: env(safe-area-inset-top, 0px); align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding-block: 26px 20px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: 18px;
  border-right: 1px solid var(--rule);
  background: var(--sheet);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-stretch: 100%; font-weight: 750; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; flex: none; align-self: center; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; text-align: left; cursor: pointer; font-weight: 500; color: var(--ink-2);
}
.nav button:hover { background: var(--sheet-2); color: var(--ink); }
.nav button[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.nav .count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 650; text-align: center;
  background: var(--pending-soft); color: var(--pending);
}
.rail-note { margin-top: auto; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* Worksheet */
.main {
  min-width: 0;
  padding-block: 30px 64px;
  padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
}
.view { max-width: 1600px; display: flex; flex-direction: column; gap: 26px; }
.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.view-title { font-stretch: 125%; font-weight: 720; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.015em; line-height: 1.1; }
.view-sub { color: var(--ink-2); margin-top: 6px; max-width: 64ch; }
.figures { display: flex; gap: 28px; }
.figure { display: flex; flex-direction: column; }
.figure-label { font-size: 12.5px; color: var(--ink-2); }
.figure-value { font-stretch: 85%; font-weight: 650; font-size: 24px; line-height: 1.15; }

.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-md); }

.work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; align-items: start; }
.work-main { min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.aside { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1500px) {
  .work { grid-template-columns: minmax(0, 1fr) 356px; }
  .aside { position: sticky; top: calc(24px + env(safe-area-inset-top, 0px)); }
}

/* Input: command bar */
.composer { display: flex; flex-direction: column; transition: box-shadow .15s ease; }
.composer:focus-within { box-shadow: 0 0 0 4px var(--accent-soft); }
.top { display: flex; align-items: center; gap: 12px; padding-right: 14px; border-bottom: 1px solid var(--rule); }
.top .actions { display: flex; gap: 8px; flex: none; }
.field-text {
  flex: 1 1 auto; min-width: 0; padding: 20px 20px 18px; border: 0; border-radius: var(--r-md) 0 0 0;
  background: transparent; font-size: 20px; font-weight: 450; letter-spacing: -0.005em;
}
.field-text:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.field-text::placeholder { color: var(--ink-3); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.bar-group { display: flex; align-items: center; gap: 4px; padding: 0 10px; border-left: 1px solid var(--rule); }
.bar-ctl {
  height: 38px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent;
}
.bar-ctl:hover { background: var(--sheet-2); }
.bar-ctl:focus { border-color: var(--accent); background: var(--sheet); outline: none; }
.ctl-time { width: 68px; text-align: center; font-weight: 600; font-size: 16px; }
.ctl-dur { width: 78px; text-align: right; font-weight: 700; font-stretch: 88%; font-size: 19px; }
.ctl-time::placeholder, .ctl-dur::placeholder { color: var(--ink-3); font-weight: 500; font-size: 14px; font-stretch: 100%; }
.date-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.date-btn svg { width: 16px; height: 16px; color: var(--ink-2); }
.days { display: inline-flex; gap: 2px; }
.days button { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 550; cursor: pointer; }
.days button:hover { background: var(--sheet-2); color: var(--ink); }
.days button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
.dash { color: var(--ink-3); }
.btn {
  height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--rule);
  background: var(--sheet); cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--sheet-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); }
.btn-danger { border-color: transparent; background: transparent; color: var(--danger); }
.btn-danger.armed { border-color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.toggle-bill {
  width: 38px; height: 38px; margin-left: 6px; border: 1px solid var(--rule); border-radius: 50%; background: transparent;
  font-weight: 700; color: var(--ink-3); cursor: pointer; flex: none;
}
.toggle-bill[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.spacer { flex: 1 1 0; }
.timer-live { color: var(--accent); }
.pick-btn {
  height: 38px; min-width: 240px; max-width: 100%; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; font-weight: 600;
}
.pick-btn:hover { background: var(--sheet-2); }
.pick-btn .cname { color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-btn .chev { margin-left: auto; color: var(--ink-3); flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--p0); }

.preview { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 6px 14px; padding: 34px 20px 14px; }
.preview-label { font-size: 13px; color: var(--ink-2); font-weight: 600; padding-top: 14px; }
.preview-note { grid-column: 2; font-size: 13.5px; color: var(--ink-2); min-height: 1.45em; }
.preview-note.warn { color: var(--pending); font-weight: 600; }

/* Timeline 06–06, dragged on a 15-minute grid */
.tl { position: relative; user-select: none; -webkit-user-select: none; }
.tl-track {
  position: relative; height: 50px; border-radius: 10px; background: var(--sheet-2); border: 1px solid var(--rule);
  cursor: crosshair; touch-action: none; overflow: hidden;
}
.tl-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); opacity: .45; }
.tl-tick.major { opacity: 1; }
.tl-night { position: absolute; top: 0; bottom: 0; left: 75%; right: 0; background: var(--paper); opacity: .6; }
.tl-axis { position: relative; height: 16px; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.tl-axis span { position: absolute; transform: translateX(-50%); }
.tl-axis span:first-child { transform: none; }
.tl-axis span:last-child { transform: translateX(-100%); }
.tl-block {
  position: absolute; top: 7px; bottom: 7px; border-radius: 7px; min-width: 8px;
  background: color-mix(in srgb, var(--c) 24%, var(--sheet)); border: 1.5px solid var(--c); color: var(--ink);
  display: flex; align-items: center; cursor: grab; overflow: hidden;
}
.tl-block:hover { box-shadow: 0 2px 8px var(--shadow); }
.tl-block.pending { border-style: dashed; }
.tl-block.static { cursor: default; opacity: .5; }
.tl-block.static:hover { box-shadow: none; }
.tl-block.planned { background: var(--accent-soft); border: 2px dashed var(--accent); }
.tl-block.dragging { cursor: grabbing; box-shadow: 0 6px 16px var(--shadow); z-index: 2; }
.tl-label { flex: 1; min-width: 0; padding: 0 9px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-grip { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 1; }
.tl-grip.l { left: -1px; } .tl-grip.r { right: -1px; }
.tl-grip::after { content: ""; position: absolute; top: 30%; bottom: 30%; left: 3px; width: 2px; border-radius: 1px; background: var(--c); opacity: 0; }
.tl-block:hover .tl-grip::after, .tl-block:focus-visible .tl-grip::after { opacity: .9; }
.tl-block.planned .tl-grip::after { background: var(--accent); }
.tl-sel { position: absolute; top: 5px; bottom: 5px; border-radius: 7px; background: var(--accent-soft); border: 2px solid var(--accent); pointer-events: none; }
.tl-bubble {
  position: absolute; top: -28px; transform: translateX(-50%); padding: 3px 9px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 650; white-space: nowrap; pointer-events: none; z-index: 3;
}

/* Day ruler in the list: the same timeline, small and without labels; a vertical swipe still scrolls on a phone */
.tl-day .tl-track { height: 24px; border-radius: 7px; touch-action: pan-y; transition: border-color .12s ease; }
.tl-day .tl-track:hover { border-color: var(--ink-3); }
.tl-day .tl-block { top: 3px; bottom: 3px; border-radius: 4px; min-width: 6px; background: var(--c); border: 0; }
.tl-day .tl-block.static.pending { opacity: 1; background: color-mix(in srgb, var(--c) 28%, var(--sheet)); border: 1.5px dashed var(--c); }
.tl-day .tl-label { display: none; }
.tl-day .tl-grip { width: 8px; }
.tl-day .tl-grip::after { left: 3px; top: 25%; bottom: 25%; background: var(--sheet); }
.tl-day .tl-sel { top: 2px; bottom: 2px; border-radius: 5px; }
.tl-day .tl-bubble { top: -31px; }
.scale { position: relative; height: 16px; font-size: 11.5px; color: var(--ink-3); }
.scale span { position: absolute; top: 0; transform: translateX(-50%); }
.scale span:first-child { transform: none; }
.scale span:last-child { transform: translateX(-100%); }

/* Popovers: project and date picker */
.pop {
  position: absolute; z-index: 40; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 18px 40px var(--shadow), 0 2px 6px var(--shadow);
}
.pp { width: min(390px, calc(100vw - 24px)); padding: 8px; }
.pp-search { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet-2); }
.pp-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.pp-group { padding: 8px 8px 4px; font-size: 12px; color: var(--ink-3); }
.pp-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; }
.pp-opt[aria-selected="true"], .pp-opt:hover { background: var(--accent-soft); }
.pp-opt .client { color: var(--ink-2); font-size: 13px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pp-empty { padding: 10px 8px; color: var(--ink-2); font-size: 14px; }

.dp { width: min(324px, calc(100vw - 24px)); padding: 14px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-stretch: 115%; font-weight: 700; font-size: 16px; }
.round-btn { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.round-btn:hover { background: var(--sheet-2); color: var(--ink); }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dp-wd { text-align: center; font-size: 11.5px; color: var(--ink-3); padding: 4px 0 6px; }
.dp-day {
  height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-weight: 550;
}
.dp-day:hover { background: var(--sheet-2); }
.dp-day.out { color: var(--ink-3); font-weight: 400; }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.dp-day i { display: block; height: 3px; border-radius: 2px; background: var(--accent); opacity: .75; }
.dp-day[aria-pressed="true"] i { background: var(--accent-ink); }
.dp-foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.dp-foot .btn { height: 34px; padding: 0 12px; }

/* Suggestions from Claude */
.inbox { padding: 14px 16px; border-color: var(--pending); background: var(--pending-soft); display: flex; flex-direction: column; gap: 10px; }
.inbox-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.inbox-title { font-weight: 650; }
.inbox-sub { font-size: 13.5px; color: var(--ink-2); }
.inbox-list { display: flex; flex-direction: column; gap: 6px; }
.prop {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px auto; grid-template-areas: "time main dur act";
  align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sheet);
}
.prop .p-time { grid-area: time; font-size: 13.5px; color: var(--ink-2); }
.prop .e-main { grid-area: main; }
.prop .p-dur { grid-area: dur; text-align: right; font-weight: 650; }
.prop .p-act { grid-area: act; display: flex; gap: 4px; justify-content: flex-end; }
.aside .prop { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time dur" "main main" "act act"; }
.aside .prop .p-act { justify-content: flex-start; }
.aside .prop .p-act .btn { height: 34px; padding: 0 12px; }

/* Right column */
.cal { padding: 16px; }
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.cal-title { font-stretch: 115%; font-weight: 700; font-size: 17px; margin-right: auto; }
.cal-sum { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 11.5px; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1 / 1.08; border: 0; border-radius: 8px; background: var(--heat-0); cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 5px 6px; text-align: left; color: var(--ink);
}
.cal-day:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.cal-day .n { font-size: 12.5px; font-weight: 650; }
.cal-day .h { font-size: 11px; font-stretch: 88%; font-weight: 650; color: var(--ink-2); }
.cal-day.h1 { background: var(--heat-1); } .cal-day.h2 { background: var(--heat-2); } .cal-day.h3 { background: var(--heat-3); }
.cal-day.h4 { background: var(--heat-4); }
.cal-day.h4 .n, .cal-day.h4 .h, .cal-day.h3 .h { color: var(--heat-ink); }
.cal-day.h3 .n { color: var(--heat-ink); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-blank { aspect-ratio: 1 / 1.08; }
.cal-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 11.5px; color: var(--ink-3); }
.cal-legend i { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }
.wk { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.wk-title { font-weight: 650; display: flex; justify-content: space-between; }
.wk-title span { font-weight: 650; font-stretch: 88%; }
.wk-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.wk-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.wk-name span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-h { text-align: right; font-weight: 650; }
.wk-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--sheet-2); overflow: hidden; }
.wk-bar i { display: block; height: 100%; border-radius: 3px; }

/* List */
.week { display: flex; flex-direction: column; gap: 10px; }
.week-head, .day-head { display: grid; grid-template-columns: 132px minmax(0, 1fr) 78px; align-items: center; gap: 12px; }
.week-head { padding: 0 16px; }
.week-label { font-stretch: 112%; font-weight: 700; font-size: 15px; }
.week-total, .day-total { text-align: right; font-weight: 650; }
.week-total { font-stretch: 85%; font-size: 18px; }
.day { overflow: visible; }
.day-head { padding: 12px 16px; background: var(--sheet-2); border-bottom: 1px solid var(--rule); border-radius: var(--r-md) var(--r-md) 0 0; }
.day-label { font-weight: 600; font-size: 14px; }
.day-label .wd { color: var(--ink-2); font-weight: 500; }
.entry {
  display: grid; grid-template-columns: 124px minmax(0, 1fr) auto 76px 132px; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--rule); cursor: pointer;
}
.day > .entry:last-child, .day > .editor:last-child { border-bottom: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
.entry:hover { background: var(--sheet-2); }
.entry.selected { background: var(--accent-soft); border-bottom-color: transparent; }
.entry.flash { animation: flash 1.2s ease-out; }
.e-time { display: flex; align-items: center; gap: 1px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.e-time sup { font-size: 10.5px; color: var(--ink-3); margin-left: 1px; }
.e-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.e-proj {
  display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); min-width: 0; max-width: 100%;
  border: 0; background: transparent; padding: 2px 5px; margin-left: -5px; border-radius: var(--r-sm); cursor: pointer; text-align: left;
}
.e-proj:hover { background: var(--sheet); }
.e-proj .pname { color: var(--ink); font-weight: 550; white-space: nowrap; }
.e-proj .cname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inl { border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; cursor: text; }
.inl:hover { border-color: var(--rule); background: var(--sheet); }
.inl:focus { outline: none; border-color: var(--accent); background: var(--sheet); }
.e-time .inl { width: 50px; padding: 2px 0; text-align: center; color: var(--ink-2); }
.e-time .inl:focus { color: var(--ink); }
.e-text { display: block; max-width: 100%; padding: 1px 5px; margin-left: -6px; overflow-wrap: anywhere; }
.e-dur { width: 76px; padding: 3px 6px; text-align: right; font-weight: 650; font-stretch: 90%; font-size: 16px; }
.e-actions { display: flex; justify-content: flex-end; gap: 2px; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-3); cursor: pointer;
}
.icon-btn:hover { background: var(--sheet); color: var(--ink); }
.icon-btn.armed { width: auto; padding: 0 8px; color: var(--danger); font-size: 13px; font-weight: 600; }
.icon-btn svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .entry .e-actions { opacity: 0; transition: opacity .12s ease; }
  .entry:hover .e-actions, .entry:focus-within .e-actions, .entry.selected .e-actions { opacity: 1; }
}
.badges { display: flex; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--rule); color: var(--ink-2); background: var(--sheet); white-space: nowrap;
}
.badge.nb { color: var(--ink-3); }

/* Editor right below the entry */
.editor {
  display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 16px;
  background: var(--accent-soft); border-bottom: 1px solid var(--rule);
}
.ed-text { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); font-size: 16px; }
.ed-text:focus { outline: none; border-color: var(--accent); }
.ed-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld-label { font-size: 12px; color: var(--ink-2); }
.ed-ctl {
  height: 40px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet);
  display: flex; align-items: center; gap: 8px;
}
.ed-ctl:focus { outline: none; border-color: var(--accent); }
button.ed-ctl { cursor: pointer; font-weight: 600; white-space: nowrap; }
.ed-ctl svg { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
button.ed-ctl:hover { border-color: var(--ink-3); }
.ed-ctl.t { width: 76px; text-align: center; font-weight: 600; }
.ed-ctl.d { width: 84px; text-align: right; font-weight: 700; font-stretch: 90%; font-size: 17px; }
.ed-project { min-width: 250px; max-width: 100%; }
.ed-project .cname { color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-project .chev { margin-left: auto; color: var(--ink-3); }
.ed-tl { padding-top: 26px; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Report */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); }
.stepper button { width: 38px; height: 38px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.stepper button:hover { color: var(--ink); }
.stepper .month { min-width: 136px; text-align: center; font-weight: 650; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); padding: 2px; }
.seg button { height: 34px; padding: 0 12px; border: 0; border-radius: 3px; background: transparent; cursor: pointer; color: var(--ink-2); font-weight: 550; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
.select { height: 40px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); max-width: 100%; }
.chart-panel { padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; }
.chart-title { font-weight: 650; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-wrap { overflow-x: auto; }
.chart-wrap svg { display: block; width: 100%; min-width: 560px; height: auto; }
.chart-wrap text { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--paper); font-size: 13px; box-shadow: 0 8px 20px var(--shadow);
}
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.table-wrap { overflow-x: auto; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rtable th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.rtable td { padding: 8px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.rtable .num { text-align: right; white-space: nowrap; }
.rtable tr.lvl-client td { background: var(--sheet-2); font-weight: 650; padding-top: 12px; padding-bottom: 12px; }
.rtable tr.lvl-project td { font-weight: 550; }
.rtable tr.lvl-desc td { color: var(--ink-2); }
.rtable tr.lvl-desc td:first-child { padding-left: 36px; }
.rtable tr.total td { font-weight: 700; border-bottom: 0; font-size: 15.5px; }
.pcell { display: inline-flex; align-items: center; gap: 8px; }
.invoice { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.invoice h2 { font-size: 16px; font-weight: 650; }
.invoice pre {
  margin: 0; padding: 12px; border-radius: var(--r-sm); background: var(--sheet-2); border: 1px solid var(--rule);
  font-family: var(--font); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.hint { font-size: 13px; color: var(--ink-2); }
.pending-note {
  padding: 8px 12px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600;
  background: var(--pending-soft); color: var(--pending);
}
.exports { display: flex; flex-wrap: wrap; gap: 8px; }

/* Customers and projects */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 14px; align-items: start; }
.client { overflow: hidden; }
.client-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; background: var(--sheet-2); border-bottom: 1px solid var(--rule); }
.client-name { font-weight: 650; font-size: 16px; margin-right: auto; }
.rate { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.rate input { width: 74px; height: 34px; padding: 0 8px; text-align: right; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: grid; grid-template-columns: 18px minmax(0, 1fr) 110px; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--rule); }
.plist li:last-child { border-bottom: 0; }
.plist .hours { text-align: right; color: var(--ink-2); }
.newproj { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.newproj input { height: 40px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet-2); min-width: 220px; flex: 1 1 220px; }

/* Claude */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.card-pad { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card-pad h2 { font-size: 17px; font-weight: 650; }
.card-pad p { margin: 0; color: var(--ink-2); max-width: 62ch; }
.tools { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tools li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tools li:last-child { border-bottom: 0; }
.tools code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 13px; color: var(--ink); }
.code {
  margin: 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sheet-2); border: 1px solid var(--rule);
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre;
}
.keyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.keyrow .key { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 13px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--sheet-2); border: 1px solid var(--rule); }

.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  padding: 10px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 22px var(--shadow);
}

/* Application additions: rail footer, loading older weeks, editing customers and projects */
.weeks { display: flex; flex-direction: column; gap: 26px; }
.more { display: flex; justify-content: center; }
.rail-foot { margin-top: auto; }
.rail-logout {
  width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; text-align: left; cursor: pointer; font-weight: 500; color: var(--ink-3);
}
.rail-logout:hover { background: var(--sheet-2); color: var(--ink); }
.entry.saving { opacity: .6; cursor: progress; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.btn-small { height: 32px; padding: 0 12px; }
.seg button[disabled] { cursor: not-allowed; opacity: .6; }
.soon {
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap;
  background: var(--pending-soft); color: var(--pending);
}

.catalog-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
input.client-name { flex: 1 1 100px; min-width: 0; margin-right: auto; margin-left: -7px; padding: 2px 6px; font-weight: 650; font-size: 16px; }
.plist li.prow { grid-template-columns: 18px minmax(0, 1fr) 110px 32px; }
.plist .pname-input { width: 100%; min-width: 0; margin-left: -7px; padding: 2px 6px; }
.plist li.pedit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; background: var(--accent-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: var(--c); cursor: pointer;
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--ink); }
.archived { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.archived h2 { font-size: 16px; font-weight: 650; }
.archived-list { list-style: none; margin: 0; padding: 0; }
.archived-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.archived-list li:last-child { border-bottom: 0; }
.archived-list .what { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.archived-list .kind { color: var(--ink-3); font-size: 12.5px; }

@media (max-width: 1100px) {
  .report-grid, .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--sheet); }
  .rail {
    position: sticky; z-index: 9; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px;
    padding-block: 12px;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
    border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav button { width: auto; padding: 7px 10px; }
  .rail-note { display: none; }
  .main { padding-block: 20px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .top { flex-wrap: wrap; padding: 0 16px 12px 0; }
  .top .actions { flex: 1 1 100%; flex-wrap: wrap; padding-left: 16px; }
  .top .actions .btn { flex: 1 1 0; }
  /* „Messung verwerfen“ takes a row of its own below the two main buttons. */
  .top .actions .btn-quiet { flex-basis: 100%; order: 1; }
  .field-text { font-size: 18px; padding: 16px; }
  .bar { gap: 8px; }
  .bar-group { border-left: 0; padding: 0; }
  .pick-btn { min-width: 0; width: 100%; }
  .preview { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .preview-label { padding-top: 0; padding-bottom: 26px; }
  .preview-note { grid-column: 1; }
  .entry {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main dur" "time act" "badges act";
    row-gap: 4px;
  }
  .e-main { grid-area: main; } .e-dur { grid-area: dur; } .e-time { grid-area: time; } .badges { grid-area: badges; } .e-actions { grid-area: act; align-self: end; }
  .week-head, .day-head { grid-template-columns: 92px minmax(0, 1fr) 62px; }
  .prop { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time dur" "main main" "act act"; }
  .prop .p-act { justify-content: flex-start; }
  .ed-project { min-width: 0; width: 100%; }
  .ed-fields .fld:first-child { flex: 1 1 100%; }
  .tools li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .figures { gap: 20px; }
}
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .entry.flash { animation: none; }
  .composer, .tl-day .tl-track { transition: none; }
}
@media (max-width: 820px) {
  .rail-foot { margin-top: 0; margin-left: auto; }
  .rail-logout { width: auto; padding: 7px 10px; }
  .plist li.prow { grid-template-columns: 18px minmax(0, 1fr) 76px 32px; }
}

/* Login and setup pages: one card in the middle, the brand above it */
.auth-page { min-height: 100%; }
.auth {
  max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px;
  padding-block: clamp(24px, 8vh, 72px) 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.auth-wide { max-width: 560px; }
.auth-brand { justify-content: center; }
.auth-card { padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-title { font-stretch: 125%; font-weight: 720; font-size: 26px; letter-spacing: -0.015em; line-height: 1.1; }
.auth-note { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.auth-error {
  margin: 0; padding: 10px 12px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--danger) 12%, var(--sheet)); color: var(--danger); font-weight: 600; font-size: 14px;
}
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label, .auth-label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 8px; }
.auth-hint { font-size: 12.5px; color: var(--ink-3); }
.auth-text { margin: 0 0 4px; color: var(--ink-2); font-size: 14px; }
.auth-input {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--sheet-2); font-size: 16px;
}
.auth-input:focus { outline: none; border-color: var(--accent); background: var(--sheet); }
.auth-input-code { font-size: 22px; font-weight: 600; letter-spacing: .18em; text-align: center; }
.auth-submit { width: 100%; height: 46px; margin-top: 12px; }
.auth-link { align-self: center; margin-top: 4px; padding: 8px; border: 0; background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 2px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.auth-full { display: flex; flex-direction: column; gap: 12px; }
.auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.steps li { padding: 3px 10px; border-radius: 999px; background: var(--sheet-2); }
.steps li[aria-current="step"] { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.steps li.done { color: var(--accent); }
.qr-wrap { align-self: center; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--rule); background: #ffffff; }
.qr { display: block; width: 200px; height: 200px; }
.secret-code {
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 15px; letter-spacing: .04em; overflow-wrap: anywhere;
  user-select: all; -webkit-user-select: all;
}
.codes {
  margin: 0; padding: 12px 14px 12px 38px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet-2);
  columns: 2; column-gap: 24px; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 15px; line-height: 1.8;
  user-select: all; -webkit-user-select: all;
}
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 420px) {
  .codes { columns: 1; }
}

/* Security view */
.sec-locked { padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.sec-locked p { margin: 0; font-weight: 600; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.sec-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sec-card h2 { font-size: 17px; font-weight: 650; }
.sec-card > p { margin: 0; color: var(--ink-2); font-size: 14px; }
.sec-card > .btn { align-self: flex-start; }
.sec-wide { grid-column: 1 / -1; }
.sec-form { display: flex; flex-direction: column; gap: 6px; }
.sec-form label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 6px; }
.sec-form input { width: 100%; max-width: 360px; height: 40px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet-2); font-size: 15px; }
.sec-form input:focus { outline: none; border-color: var(--accent); background: var(--sheet); }
.sec-form .btn { align-self: flex-start; margin-top: 8px; }
.sec-form .auth-actions { margin-top: 8px; }
.sec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sec-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.sec-list li:last-child { border-bottom: 0; }
.sec-list .what { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.sec-list .name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sec-list .meta { font-size: 12.5px; color: var(--ink-3); }
.sec-list .empty { color: var(--ink-2); font-size: 14px; }
.sec-list li.current { background: var(--accent-soft); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: var(--r-sm); }
.sec-list .btn-danger.armed { border-color: var(--danger); }
.btn-small.btn-danger { height: 32px; padding: 0 10px; }
.btn.armed { border-color: var(--danger); color: var(--danger); }
.sec-codes { display: flex; flex-direction: column; gap: 10px; }
.sec-codes p { margin: 0; color: var(--ink-2); font-size: 14px; }
.events li { display: grid; grid-template-columns: 136px 130px minmax(0, 1fr); gap: 2px 12px; align-items: baseline; font-size: 13.5px; }
.events .time { color: var(--ink-2); white-space: nowrap; }
.events .ip { color: var(--ink-2); overflow-wrap: anywhere; }
.events .way { font-weight: 550; }
.events .detail { grid-column: 1 / -1; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.events .failure .way, .events .locked .way { color: var(--danger); }
@media (max-width: 820px) {
  .events li { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .sec-list li.current { margin: 0; padding-left: 8px; padding-right: 8px; }
}

/* Confirmation dialog for security actions */
dialog.dialog {
  width: min(420px, calc(100vw - 32px)); margin: auto; padding: 22px 22px 20px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); color: var(--ink);
  box-shadow: 0 18px 40px var(--shadow);
}
dialog.dialog::backdrop { background: rgba(8, 28, 24, .45); }
.dialog-form { display: flex; flex-direction: column; gap: 8px; }
.dialog-form h2 { font-size: 20px; font-weight: 700; font-stretch: 115%; letter-spacing: -0.01em; }
.dialog-form .hint { margin: 0; }
.dialog-form label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 6px; }
.dialog-form .auth-submit { margin-top: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
