.workspace-mode {
  display: grid;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
}
.workspace-mode button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 5px 9px;
  text-align: left;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  transition: color .18s ease, background .18s ease;
}
.workspace-mode .icon { width: 16px; height: 16px; flex-shrink: 0; }
.workspace-mode button:hover { color: var(--text); background: var(--surface); }
.workspace-mode button[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); }
@media (min-width: 761px) {
  .is-minimised .workspace-mode button { justify-content: center; padding-inline: 0; }
  .is-minimised .workspace-mode button span { display: none; }
}

.life-main .breadcrumb-dot { flex-shrink: 0; background: var(--accent); }
.life-main .topbar-right { margin-left: auto; }
.life-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-gutter: stable;
}
.life-page {
  width: min(100%, 1232px);
  padding: 30px 32px 48px;
  margin-inline: auto;
}
.life-page:not(.life-calendar-page), .life-calendar-scroll {
  animation: life-enter .25s ease both;
}
@keyframes life-enter {
  from { opacity: .55; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.life-page h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.045em;
}
.life-page h1:focus { outline: none; }
.life-page p { margin: 0; }
.life-page-head, .life-day-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.life-page-head p, .life-day-summary p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.life-day-banner {
  padding: 24px;
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent-faint);
}
.life-date-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.life-progress {
  display: grid;
  gap: 9px;
  width: min(235px, 34%);
  flex-shrink: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 12px;
}
.life-progress > span { display: flex; justify-content: space-between; gap: 8px; }
.life-progress strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.life-progress small { color: var(--muted); }
.life-progress progress {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--accent-soft);
  accent-color: var(--accent);
}
.life-progress progress::-webkit-progress-bar { background: var(--accent-soft); }
.life-progress progress::-webkit-progress-value { border-radius: 8px; background: var(--accent); }
.life-progress progress::-moz-progress-bar { border-radius: 8px; background: var(--accent); }

.life-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.life-dashboard { align-items: stretch; }
.life-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.life-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.life-panel-head h2 {
  flex: 1;
  margin: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.life-section-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  border-radius: 7px;
  background: var(--accent-faint);
  color: var(--accent-strong);
}
.life-section-icon .icon { width: 17px; height: 17px; }
.life-icon-button { flex-shrink: 0; width: 34px; height: 34px; border-radius: 6px; }
.life-icon-button .icon { width: 17px; height: 17px; }
.life-panel-body { padding: 12px 16px 16px; }
.life-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 13px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.life-empty .icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--faint); }
.life-list, .life-hours { list-style: none; margin: 0; padding: 0; }
.life-list { display: grid; gap: 6px; }
.life-list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 39px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  transition: background .18s ease, border-color .18s ease;
}
.life-list-row:hover, .life-note:hover { background: var(--accent-faint); border-color: var(--accent); }
.life-task-row button, .life-shifts th button {
  text-align: left;
  min-width: 0;
  padding: 6px 0;
  overflow-wrap: anywhere;
}
.life-task-row button { flex: 1; }
.life-task-row:has(input:checked) button { text-decoration: line-through; color: var(--muted); }
.life-page input[type="checkbox"], .dialog-body .life-check-label input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.life-note-list { display: grid; gap: 8px; }
.life-note, .life-event {
  display: grid;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
  transition: background .18s ease, border-color .18s ease;
}
.life-note-body, .life-event small {
  white-space: pre-line;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.life-event {
  border-inline-start: 3px solid var(--event-color);
  background: color-mix(in srgb, var(--event-color) 12%, var(--surface));
}
.life-event:hover { background: color-mix(in srgb, var(--event-color) 22%, var(--surface)); }
.life-event-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.life-toolbar, .life-period-arrows {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.life-day-banner + .life-toolbar { margin-bottom: 16px; }
.life-period-arrows { gap: 4px; flex-wrap: nowrap; }
.life-period-arrows button { border: 1px solid var(--border); background: var(--surface); }
.life-period-arrows button[data-direction="prev"] .icon { transform: rotate(180deg); }
.life-period-arrows button:hover { background: var(--accent-soft); }
.life-page input:is([type="date"], [type="month"], [type="time"]), .life-page select {
  min-height: 34px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.life-page :is(.primary-button, .secondary-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  text-align: center;
}
.life-page :is(.primary-button, .secondary-button) .icon { width: 15px; height: 15px; flex-shrink: 0; }
.life-calendar-scroll { scrollbar-gutter: auto; }
.life-calendar-page {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2vw, 24px);
}
.life-calendar-page > .life-page-head { margin-bottom: 14px; }
.life-calendar-page h1 { font-size: clamp(24px, 3vw, 34px); }
.life-calendar-page:not(.is-month) .life-calendar { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.life-calendar-page.is-month .life-calendar { flex-shrink: 0; }
.life-calendar-page.is-month > .life-panel + .life-panel { margin-top: 12px; }
.life-calendar-toolbar, .life-calendar-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.life-calendar-heading { padding-top: 0; }
.life-calendar-heading h2 {
  margin: 0;
  font-size: clamp(15px, 2vw, 21px);
  text-transform: capitalize;
}
.life-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.life-weekday {
  padding: 9px 5px;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  font-size: 11px;
  text-transform: uppercase;
}
.life-day-cell {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 4px;
  min-width: 0;
  min-height: 76px;
  padding: 5px 6px;
  border: solid var(--border);
  border-width: 1px 0 0 1px;
  text-align: left;
  transition: background .18s ease;
}
.life-day-cell:nth-child(7n + 1) { border-inline-start: 0; }
.life-day-cell.out-of-month { background: var(--bg); color: var(--muted); }
.life-day-cell:hover, .life-day-cell[aria-pressed="true"] { background: var(--accent-faint); }
.life-day-cell[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.life-day-number {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 550;
}
.life-day-cell[aria-current="date"] .life-day-number { background: var(--accent); color: var(--bg); border-radius: 50%; }
.life-cell-events { width: 100%; display: grid; gap: 2px; }
.life-cell-events > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  border-inline-start: 2px solid var(--event-color);
  background: color-mix(in srgb, var(--event-color) 18%, var(--surface));
  color: var(--text);
  padding: 2px 3px;
  font-size: 9px;
}
.life-cell-events small { color: var(--muted); font-size: 9px; }
.life-time-hint { color: var(--muted); font-size: 11px; margin-inline-end: auto; }
.life-time-scroll { flex: 1; overflow: auto; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; }
.life-time-grid { --hour: 56px; --axis: 56px; --days: 7; min-width: 680px; }
.life-time-grid.single-day { --days: 1; min-width: 0; }
.life-time-head, .life-time-body { display: grid; grid-template-columns: var(--axis) repeat(var(--days), minmax(0, 1fr)); }
.life-time-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--border); }
.life-time-body { isolation: isolate; }
.life-time-date {
  min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 2px;
  color: var(--muted); font-size: 10px; text-transform: uppercase;
}
.life-time-date strong { display: grid; place-items: center; width: 29px; height: 29px; font-size: 19px; color: var(--text); }
button.life-time-date:hover, .life-time-date[data-selected] { background: var(--accent-faint); }
.life-time-date[aria-current="date"] strong { background: var(--accent); color: var(--surface); border-radius: 50%; }
.life-time-all-label, .life-time-all {
  min-height: 26px; padding: 3px; border-top: 1px solid var(--border);
}
.life-time-all-label { align-content: center; color: var(--muted); font-size: 9px; }
.life-time-all { display: grid; align-content: start; gap: 3px; border-inline-start: 1px solid var(--border); max-height: 96px; overflow-y: auto; }
.life-time-axis, .life-time-corner, .life-time-all-label { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.life-time-axis { z-index: 3; }
.life-time-axis span {
  display: block; height: var(--hour); padding: 3px 8px; text-align: end;
  color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums;
}
.life-time-column {
  --event-gutter: 14px;
  position: relative; border-inline-start: 1px solid var(--border); user-select: none;
}
.life-time-slot {
  display: block; width: 100%; height: var(--hour); padding: 0; border-bottom: 1px solid var(--border);
  cursor: default;
}
.life-time-slot:focus-visible { outline-offset: -2px; }
.life-time-event, .life-time-preview {
  display: flex; flex-direction: column; align-items: start; gap: 2px; padding: 4px 6px;
  min-width: 0; overflow: hidden; text-align: start; font-size: 11px; border-radius: 5px;
}
.life-time-event {
  border-inline-start: 3px solid var(--event-color);
  background: color-mix(in srgb, var(--event-color) 26%, var(--surface));
}
.life-time-event:hover, .life-time-event:focus-visible {
  background: color-mix(in srgb, var(--event-color) 42%, var(--surface));
}
.life-time-event strong, .life-time-event small { flex-shrink: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 14px; }
.life-time-event small { font-size: 10px; line-height: 12px; font-variant-numeric: tabular-nums; }
.life-time-event[data-short] { padding-block: 1px; gap: 0; }
.life-time-event[data-short] strong { line-height: 12px; }
.life-time-event[data-short] small { line-height: 10px; }
.life-time-event[data-compact], .life-time-preview { padding-block: 0; line-height: 12px; }
.life-time-event[data-compact] strong, .life-time-event[data-compact] small { line-height: 12px; }
.life-time-event[data-compact] small { display: none; }
.life-time-column > :is(.life-time-event, .life-time-preview) {
  position: absolute; top: calc(var(--start) * var(--hour) / 60);
  height: max(12px, calc(var(--duration) * var(--hour) / 60 - 1px));
}
.life-time-column > .life-time-event {
  --stack-inset: min(calc(var(--depth) * 14px), calc(34% * var(--depth) / max(1, var(--stack-depth))));
  left: calc(2px + var(--stack-inset)); right: var(--event-gutter); width: auto; z-index: var(--layer);
}
.life-time-event[data-overlap] { box-shadow: 0 1px 4px #0003; border-top: 1px solid color-mix(in srgb, var(--event-color) 50%, var(--surface)); }
.life-time-resize {
  position: absolute; inset-inline: 0; bottom: 0; height: 9px;
  display: grid; place-items: center; cursor: ns-resize;
}
.life-time-resize::after {
  content: ''; width: 16px; max-width: 55%; height: 2px; border-radius: 2px;
  background: currentColor; opacity: .35;
}
.life-time-resize:hover::after, .life-time-event[data-resizing] .life-time-resize::after { opacity: .8; }
.life-time-event:is([data-compact], [data-short]) .life-time-resize { height: 5px; }
.life-time-event[data-compact]:not(:hover):not(:focus-visible) .life-time-resize::after { opacity: 0; }
.life-time-column > .life-time-event[data-resizing] { z-index: 10000; box-shadow: inset 0 0 0 1px var(--event-color); }
.life-time-event[data-resizing][data-compact] strong { display: none; }
.life-time-event[data-resizing][data-compact] small { display: block; }
.life-time-resizing, .life-time-resizing :is(.life-time-slot, .life-time-event) { cursor: ns-resize; }
.life-time-preview {
  inset-inline: 2px var(--event-gutter, 2px); z-index: 10000; pointer-events: none; border: 1px solid var(--accent);
  background: var(--accent-soft); color: var(--text); font-weight: 600;
}
.life-time-now {
  position: absolute; inset-inline: 0; top: calc(var(--minute) * var(--hour) / 60);
  z-index: 10001; height: 2px; background: var(--danger); pointer-events: none;
}
.life-time-now::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: inherit;
}

.life-weather-location {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}
.life-weather-location .icon { width: 15px; height: 15px; color: var(--accent); }
.life-weather-location strong { font-size: 12px; color: var(--text); }
.life-forecast-current { display: flex; align-items: center; gap: 9px; padding: 12px 0; }
.life-forecast-current > .icon { width: 32px; height: 32px; color: var(--accent-strong); }
.life-forecast-current > strong { font-size: 34px; line-height: 1; font-weight: 650; letter-spacing: -.06em; }
.life-forecast-current > div { display: grid; gap: 4px; margin-left: 4px; font-size: 12px; }
.life-forecast-current small, .life-weather-status, .life-weather-source { color: var(--muted); font-size: 11px; }
.life-page .life-weather-status { padding-top: 14px; }
.life-weather-source { display: inline-block; margin-top: 9px; text-decoration: underline; }
.life-hours {
  display: flex;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}
.life-hours li {
  display: grid;
  place-items: center;
  gap: 4px;
  flex: 0 0 53px;
  padding: 5px 3px;
  border-inline-end: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}
.life-hours .icon { width: 18px; height: 18px; color: var(--accent-strong); }
.life-hours strong { color: var(--text); font-size: 12px; }
[data-weather] > .secondary-button, .life-weather-location + .life-empty { margin-top: 8px; }
.life-city-results { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.life-city-results button {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.life-city-results button:hover { background: var(--accent-faint); }
.life-city-results strong { color: var(--text); }

.life-work-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.life-job-select { max-width: min(230px, 100%); }
.life-work-summary { margin-bottom: 16px; }
.life-metrics { display: grid; grid-template-columns: 1fr 1.35fr 1.65fr; }
.life-metrics > div { display: grid; align-content: start; gap: 7px; padding: 16px; min-width: 0; }
.life-metrics > div + div { border-inline-start: 1px solid var(--border); }
.life-metrics > div:last-child { background: var(--accent-faint); border-radius: 0 10px 0 0; }
.life-metrics span, .life-metrics small { color: var(--muted); font-size: 11px; }
.life-metrics strong { font-size: clamp(18px, 2.6vw, 28px); font-weight: 650; overflow-wrap: anywhere; }
.life-deductions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  padding: 11px 16px;
  margin: 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}
.life-deductions div { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.life-deductions dd { margin: 0; color: var(--text); font-weight: 600; }
.life-work-empty { padding: 16px; }
.life-table-scroll { position: relative; overflow: auto; scrollbar-width: thin; }
.life-shifts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.life-shifts :is(th, td) {
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.life-shifts thead th { color: var(--muted); background: var(--bg); font-size: 11px; font-weight: 550; }
.life-shifts tbody tr:hover { background: var(--accent-faint); }
.life-shifts tbody tr:last-child > * { border-bottom: 0; }
.life-shifts input[type="time"] { min-height: 32px; padding: 4px 6px; }
.life-shifts sup { color: var(--muted); }
.life-shift-pay { font-weight: 650; }
.life-accrual-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.6; }
.life-worked-check { accent-color: var(--green); }
.life-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.life-field-pair[hidden] { display: none; }
.life-field-pair input { min-width: 0; max-width: 100%; }
.life-time-picker { display: flex; align-items: center; gap: 2px; min-width: 0; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); }
.dialog-body .life-time-picker select { flex: 1; min-width: 0; width: 0; border: 0; padding: 10px 8px; background: transparent; font-variant-numeric: tabular-nums; }
.life-time-picker > span { color: var(--muted); }
.life-field-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.dialog-body label.life-check-label { flex-direction: row; align-items: center; }
.life-dialog-delete { margin-inline-end: auto; }
.life-dialog-delete button { color: var(--danger); }
.life-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 760px) {
  .life-scroll { scrollbar-gutter: auto; }
  .life-page { padding: 20px 14px 30px; }
  .life-calendar-page { padding: 12px; }
  .life-page-head { gap: 12px; }
  .life-day-banner { padding: 16px; }
  .life-panel-head { padding-inline: 12px; }
  .life-panel-body { padding-inline: 12px; }
}
@media (max-width: 520px) {
  .life-dashboard { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .life-day-banner { display: grid; gap: 12px; }
  .life-progress { width: 100%; }
  .life-page-head { align-items: flex-start; flex-wrap: wrap; }
  .life-day-cell { padding: 4px 3px; min-height: 62px; }
  .life-metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .life-metrics > div { padding: 12px; }
  .life-metrics > div:last-child { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
  .life-shifts :is(th, td) { padding-inline: 9px; }
}

/* 1.2.1: legible event colors and move feedback; grid lines stay hourly. */
.life-time-column>.life-time-event{cursor:grab}
.life-time-event[data-moving]{opacity:.35}
.life-time-moving,.life-time-moving .life-time-event{cursor:grabbing}
.life-time-all>.life-time-preview{min-height:22px}
:root:not([data-theme=dark]) .life-calendar{--muted:#5c6075;--border:#cfd3df;--accent:#6943ce}
:root:not([data-theme=dark]) .life-time-event{color:#242537;border-inline-start-color:color-mix(in srgb,var(--event-color) 65%,#242537);background:color-mix(in srgb,var(--event-color) 24%,#fff)}
:root:not([data-theme=dark]) .life-time-event:hover{background:color-mix(in srgb,var(--event-color) 34%,#fff)}
.life-time-event small{color:inherit;opacity:.9}
