:root {
  --ui-scale: 1.1;
  zoom: var(--ui-scale);
  color-scheme: dark;
  --paper: #101010;
  --surface: #181818;
  --hover: #242424;
  --ink: #d0d0d0;
  --muted: #969696;
  --line: #303030;
  --accent: #eeeeee;
  --red: #d0d0d0;
  --control-border: #4c4c4c;
  --selection: #4d4d4d;
  --selection-text: #f1f1f1;
  font-family: "JetBrains Mono", "IBM Plex Mono", "Liberation Mono", "DejaVu Sans Mono", Consolas, monospace;
  font-size: 13px;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f5f5f5;
  --surface: #ffffff;
  --hover: #e9e9e9;
  --ink: #222222;
  --muted: #626262;
  --line: #d3d3d3;
  --accent: #111111;
  --red: #333333;
  --control-border: #a8a8a8;
  --selection: #c9c9c9;
  --selection-text: #111111;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent); outline-offset: -1px; }
::selection { background: var(--selection); color: var(--selection-text); }
button, input, textarea, select { border-radius: 2px; }
.loading { padding: 24px; color: var(--muted); }
.app { min-height: calc(100dvh / var(--ui-scale)); }
.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 26px;
  min-height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); font-size: 14px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.prompt { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 22px; overflow-x: auto; min-width: 0; scrollbar-width: thin; }
.nav a { color: var(--muted); padding: 20px 0 18px; white-space: nowrap; border-bottom: 2px solid transparent; font-size: 12px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--accent); border-color: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.search input { width: 145px; padding: 7px 0; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 12px; }
.search input:focus { outline: none; border-color: var(--accent); }
.user-name { color: var(--muted); font-size: 11px; }
.main { min-width: 0; }
.content { padding: 22px 24px 30px; margin: 0 auto; max-width: 1920px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; min-height: 32px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.5; }
h2 { font-size: 14px; font-weight: 500; }
h3 { font-size: 13px; font-weight: 500; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--control-border);
  background: transparent;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  white-space: nowrap;
}
.btn:hover { background: var(--hover); text-decoration: none; border-color: var(--accent); }
.btn.primary { color: var(--accent); border-color: var(--muted); }
.btn.primary:hover { background: var(--hover); }
.btn.small { padding: 5px 8px; font-size: 11px; }
.btn.danger, .danger { color: var(--red); }
.icon-btn { border: 0; background: transparent; padding: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.icon-btn:hover { color: var(--accent); background: var(--hover); }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.text-button { border: 0; background: none; color: inherit; padding: 0; text-align: left; cursor: pointer; }
.text-button:hover { color: var(--accent); }
.muted, .count-label { color: var(--muted); }
.count-label { font-size: 11px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.filters select, .filters input, .calendar-options select, #calendar-jump {
  padding: 6px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12px;
  min-width: 0;
}
.segmented { display: inline-flex; align-items: center; gap: 16px; }
.segmented button { border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; padding: 7px 0; border-radius: 0; }
.segmented button:hover { color: var(--ink); }
.segmented button.active { color: var(--accent); border-color: var(--accent); }
.board { display: flex; gap: 0; overflow-x: auto; align-items: stretch; min-height: 55vh; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: var(--control-border) var(--paper); }
.column { width: 265px; min-width: 265px; padding: 0 16px; border-left: 1px solid var(--line); }
.column:first-child { padding-left: 0; border-left: 0; }
.column-head { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink); min-height: 30px; margin-bottom: 10px; }
.column-head .count { color: var(--muted); font-size: 11px; }
.column-head .count::before { content: "("; }
.column-head .count::after { content: ")"; }
.column-head .icon-btn { margin-left: auto; font-size: 16px; }
.column.dragover { background: var(--hover); }
.job-card { padding: 15px 8px 15px 0; margin-bottom: 0; border-bottom: 1px solid var(--line); cursor: grab; overflow-wrap: anywhere; }
.job-card:hover { background: var(--surface); }
.job-card:active { cursor: grabbing; }
.job-card.dragging { opacity: .35; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.company-name { color: var(--accent); font-size: 12px; }
.priority { color: var(--accent); }
.job-card h3 { margin: 0 0 8px; font-weight: 400; line-height: 1.6; font-size: 13px; }
.card-meta, .tags, .card-footer, .card-next { color: var(--muted); font-size: 11px; line-height: 1.7; }
.tags { margin: 8px 0 0; }
.card-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 10px; }
.card-next { margin-top: 7px; color: var(--accent); font-size: 10px; }
.add-card { padding: 13px 0; border: 0; background: none; color: var(--muted); font-size: 11px; text-align: left; }
.add-card:hover { color: var(--accent); }
.panel { min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 0 0 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; }
.panel-head small, .panel-link { color: var(--muted); font-size: 11px; }
.panel-body { padding: 0; }
.table-wrap { overflow-x: auto; scrollbar-width: thin; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { color: var(--muted); font-size: 11px; font-weight: 400; padding: 11px 14px; border-bottom: 1px solid var(--control-border); white-space: nowrap; }
.data-table td { padding: 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.data-table tbody tr:hover { background: var(--surface); }
.company-cell strong, .document-table strong { display: block; font-weight: 400; color: var(--ink); }
.company-cell small, .document-table td>small { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.pill { color: var(--muted); font-size: 11px; }
.empty { padding: 38px 0; color: var(--muted); line-height: 1.8; font-size: 12px; }
.empty p { margin: 0 0 10px; }
.empty .btn { margin-top: 6px; }
.footnote, .file-limit, .calendar-note { margin: 18px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted); }
.file-limit { margin: -4px 0 22px; }
.calendar-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.calendar-period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.calendar-period .icon-btn { font-size: 16px; padding: 4px 6px; }
.calendar-period h2 { font-size: 15px; font-weight: 400; margin: 0 10px 0 0; }
#calendar-jump { padding: 4px 7px; font-size: 11px; width: 135px; color: var(--muted); }
.calendar-options { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; font-size: 11px; flex-wrap: wrap; }
.calendar-options select { padding: 5px 7px; font-size: 11px; }
.calendar-options .text-button { margin-left: auto; color: var(--muted); font-size: 11px; }
.calendar { border-top: 1px solid var(--control-border); border-bottom: 1px solid var(--line); }
.month-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-bottom: 1px solid var(--line); }
.month-weekdays div { padding: 10px; font-size: 11px; color: var(--muted); }
.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); grid-template-rows: repeat(var(--weeks),minmax(105px,1fr)); min-height: 450px; height: calc(100dvh / var(--ui-scale) - 267px); }
.month-day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; cursor: cell; min-width: 0; overflow: hidden; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day:nth-last-child(-n+7) { border-bottom: 0; }
.month-day:hover { background: var(--surface); }
.month-day.outside { color: var(--control-border); }
.month-day.is-today { background: var(--surface); }
.day-number { display: flex; align-items: center; gap: 7px; font-size: 12px; height: 21px; margin-bottom: 8px; }
.is-today .day-number { color: var(--accent); }
.today-label { font-size: 9px; opacity: .8; }
.month-day.dragover { background: var(--hover); }
.cal-event { display: block; position: relative; width: 100%; border: 0; border-left: 2px solid var(--muted); background: var(--hover); color: var(--ink); padding: 4px 6px; margin: 0 0 5px; font-size: 11px; line-height: 1.5; text-align: left; cursor: grab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 0; }
.cal-event:hover { background: var(--hover); border-left-color: var(--accent); }
.cal-event time, .cal-event b { font-weight: 400; color: var(--accent); font-size: 10px; }
.cal-event time { margin-right: 6px; }
.cal-company { display: block; font-size: 10px; color: var(--muted); }
.cal-event.done { opacity: .55; }
.cal-event.cancelled { opacity: .45; text-decoration: line-through; background: var(--surface); border-color: var(--muted); }
.month-more { border: 0; background: transparent; color: var(--muted); font-size: 10px; padding: 1px 0; }
.week-scroll { overflow: auto; max-height: calc(100dvh / var(--ui-scale) - 260px); min-height: 350px; position: relative; scrollbar-width: thin; }
.week-header { display: grid; grid-template-columns: 54px repeat(7,minmax(105px,1fr)); position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--control-border); min-width: 800px; }
.week-header.day-view { grid-template-columns: 54px minmax(250px,1fr); min-width: 0; }
.week-header>div { padding: 10px; font-size: 11px; color: var(--muted); text-align: left; border-right: 1px solid var(--line); }
.week-header strong { display: inline; font-size: 14px; margin-left: 8px; color: var(--ink); font-weight: 400; }
.week-header .today { background: var(--surface); }
.week-header .today strong { color: var(--accent); }
.week-body { display: grid; grid-template-columns: 54px repeat(7,minmax(105px,1fr)); min-width: 800px; }
.week-body.day-view { grid-template-columns: 54px minmax(250px,1fr); min-width: 0; }
.time-labels { height: 1152px; position: relative; }
.hour-label { height: 48px; font-size: 10px; color: var(--muted); padding: 3px 9px 0 0; text-align: right; }
.time-day { height: 1152px; border-right: 1px solid var(--line); position: relative; background: repeating-linear-gradient(to bottom,transparent 0,transparent 47px,var(--line) 47px,var(--line) 48px); cursor: cell; }
.time-day .cal-event { position: absolute; white-space: normal; left: 3px; width: calc(100% - 6px); margin: 0; min-height: 20px; padding: 4px 6px; overflow: hidden; z-index: 1; }
.time-day .cal-event small { display: block; font-size: 10px; color: var(--muted); }
.resize-handle { position: absolute; bottom: 0; height: 8px; left: 0; right: 0; cursor: ns-resize; border-bottom: 2px solid var(--muted); }
.all-day-strip { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.all-day-strip>small { color: var(--muted); font-size: 10px; }
.all-day-strip .cal-event { width: auto; max-width: 260px; margin: 0; }
.agenda-day { padding: 14px 0 9px; font-size: 12px; color: var(--accent); border-bottom: 1px solid var(--line); }
.event-row { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding: 15px 0; }
.event-row:last-child { border-bottom: 0; }
.event-time { color: var(--accent); min-width: 66px; font-size: 12px; }
.event-time small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.event-info { flex: 1; min-width: 0; }
.event-info strong { display: block; font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.event-info small { display: block; font-size: 10px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.event-status { font-size: 10px; color: var(--muted); }
.event-row.done { opacity: .55; }
.event-row.cancelled .event-info strong { text-decoration: line-through; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 24px 48px; border-block: 1px solid var(--line); padding: 18px 0; margin: 0 0 32px; }
.stats>div { display: flex; align-items: baseline; gap: 14px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; color: var(--ink); font-size: 20px; }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; max-width: 1200px; }
.analytics-grid h2 { margin: 0 0 24px; }
.analytics-grid h2 small { color: var(--muted); font-size: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(120px,180px) minmax(50px,1fr) 24px; gap: 16px; align-items: center; font-size: 11px; margin-bottom: 19px; }
.bar-track { height: 3px; background: var(--line); }
.bar-fill { height: 100%; background: var(--muted); }
.bar-value { color: var(--muted); text-align: right; }
.analytics-note { font-size: 12px; margin: 24px 0 0; line-height: 1.8; }
.settings-grid { display: grid; grid-template-columns: minmax(0,600px) minmax(260px,1fr); gap: 64px; max-width: 1250px; align-items: start; }
.settings-grid>.panel { border: 0; }
.settings-grid>div>.panel+section { margin-top: 32px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 17px; min-width: 0; }
.field>span, .field>label { font-size: 11px; color: var(--muted); }
.field input, .field select, .field textarea { background: var(--surface); border: 1px solid var(--control-border); padding: 9px 10px; width: 100%; min-width: 0; font-size: 12px; }
.field textarea { min-height: 85px; resize: vertical; line-height: 1.7; }
.field small { font-size: 10px; line-height: 1.6; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 12px; line-height: 1.7; margin-bottom: 14px; }
.check input { accent-color: var(--ink); }
.section-title { padding-top: 26px; margin: 28px 0 20px; border-top: 1px solid var(--line); font-weight: 400; }
.section-title:first-child { padding-top: 0; margin-top: 0; border: 0; }
.settings-description { font-size: 11px; color: var(--muted); line-height: 1.9; margin: 0 0 18px; }
code { color: var(--ink); font: inherit; }
.stage-editor-row { display: grid; grid-template-columns: 1fr 30px; gap: 10px; align-items: center; margin-bottom: 8px; }
.stage-editor-row input[type=text] { width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; font-size: 12px; }
.delivery-row { border-bottom: 1px solid var(--line); padding: 12px 0; font-size: 11px; line-height: 1.7; }
.delivery-row strong { font-weight: 400; }
.delivery-row small { display: block; font-size: 10px; color: var(--muted); }
.delivery-row.failed { color: var(--red); }
.login-page { min-height: calc(100dvh / var(--ui-scale)); display: grid; place-items: center; padding: 24px; }
.login-form { width: 100%; max-width: 330px; }
.login-form h1 { font-size: 17px; font-weight: 400; margin-bottom: 32px; }
.login-form .btn { margin-top: 4px; }
.login-note { font-size: 11px; color: var(--muted); margin: 24px 0 0; }
.form-error { color: var(--red); font-size: 12px; line-height: 1.7; margin: 10px 0; white-space: pre-wrap; }
dialog { padding: 0; width: calc(100% - 32px); max-width: 740px; max-height: calc(92dvh / var(--ui-scale)); border: 1px solid var(--control-border); border-radius: 2px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #00000099; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 22px; position: sticky; top: 0; z-index: 4; background: var(--paper); border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 15px; }
.modal-header p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.modal-body { padding: 22px; }
.modal-footer { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 22px; background: var(--paper); border-top: 1px solid var(--line); }
.modal-footer .actions { justify-content: flex-end; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.detail-meta small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.detail-meta p { margin: 0; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.detail-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-section h3, .detail-section summary { margin: 0 0 14px; font-size: 12px; }
.detail-text { font-size: 12px; line-height: 1.8; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.document-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; font-size: 11px; }
.document-row span { flex: 1; overflow-wrap: anywhere; }
.attach-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-select { padding: 6px 8px; font-size: 11px; background: var(--surface); border: 1px solid var(--line); max-width: 260px; }
.history-item { font-size: 11px; border-left: 1px solid var(--line); padding: 0 0 16px 14px; margin-left: 3px; }
.history-item small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.upload-zone { margin-bottom: 20px; }
.file-input { max-width: 100%; }
.confirm-text { font-size: 12px; color: var(--muted); line-height: 1.8; }
.warning, .screen-error { border-left: 2px solid var(--red); padding: 10px 14px; font-size: 12px; line-height: 1.8; color: var(--red); margin-bottom: 18px; }
.hidden { display: none !important; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 11px 16px; background: var(--hover); border: 1px solid var(--control-border); color: var(--ink); font-size: 12px; opacity: 0; pointer-events: none; z-index: 100; }
#toast.show { opacity: 1; }
@media (min-width:1760px) { .column { min-width: 270px; width: 270px; } }
@media (max-width:1320px) {
  .site-header { grid-template-columns: auto minmax(0,1fr) auto; column-gap: 20px; padding-top: 12px; }
  .nav { grid-column: 1/-1; grid-row: 2; gap: 26px; }
  .nav a { padding: 13px 0 11px; }
  .search { justify-self: end; }
  .user-name { display: none; }
  .site-header>.icon-btn { grid-column: 3; grid-row: 1; }
  .settings-grid { gap: 32px; }
  .month-grid { height: calc(100dvh / var(--ui-scale) - 305px); }
}
@media (max-width:880px) {
  .analytics-grid, .settings-grid { grid-template-columns: 1fr; gap: 30px; }
  .content { padding: 20px 16px; }
  .site-header { padding-inline: 16px; }
  .calendar-heading { align-items: flex-start; }
  .calendar-period { gap: 7px; }
  .calendar-period h2 { font-size: 13px; margin-right: 4px; }
  .calendar-heading .segmented { gap: 20px; }
  .today-label { display: none; }
  .cal-company { display: none; }
  .month-day { padding: 6px 4px; }
  .cal-event { font-size: 10px; padding: 3px 4px; }
  .cal-event time { display: block; margin: 0; }
  .stats { gap: 16px 26px; }
  .stats>div { gap: 10px; }
}
@media (max-width:550px) {
  .site-header { column-gap: 12px; }
  .brand { font-size: 12px; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .site-header>.icon-btn { font-size: 10px; padding-right: 0; }
  .nav { gap: 23px; }
  .nav a { font-size: 11px; }
  .page-heading { margin-bottom: 18px; }
  h1 { font-size: 16px; }
  .btn { font-size: 11px; padding: 7px 9px; }
  .toolbar { gap: 12px; }
  .filters { gap: 12px; }
  .filters select { max-width: 175px; font-size: 11px; }
  .segmented { gap: 12px; }
  .segmented button { font-size: 11px; }
  .column { min-width: 250px; width: 250px; padding-inline: 14px; }
  .calendar-heading { gap: 12px; }
  .calendar-period { width: 100%; gap: 5px; }
  .calendar-period h2 { flex: 1; white-space: nowrap; font-size: 12px; }
  #calendar-jump { width: 27px; padding: 3px; color: transparent; border-color: transparent; }
  #calendar-jump::-webkit-datetime-edit { display: none; }
  #calendar-jump::-webkit-calendar-picker-indicator { margin: 0; padding: 2px; }
  .calendar-heading .segmented { width: 100%; justify-content: space-between; }
  .calendar-options { gap: 10px; font-size: 10px; }
  .calendar-options select { max-width: 155px; font-size: 10px; }
  .calendar-options .text-button { font-size: 10px; }
  .month-weekdays div { font-size: 10px; padding: 8px 5px; }
  .month-grid { height: calc(100dvh / var(--ui-scale) - 322px); min-height: 350px; grid-template-rows: repeat(var(--weeks),minmax(70px,1fr)); }
  .month-day { padding: 4px 2px; }
  .day-number { font-size: 10px; margin-bottom: 5px; height: 18px; }
  .month-day .cal-event { font-size: 9px; padding: 2px 3px; margin-bottom: 3px; border-left-width: 1px; line-height: 1.35; }
  .month-day .cal-event time { font-size: 9px; }
  .month-day .cal-title { display: block; overflow: hidden; text-overflow: ellipsis; }
  .month-more { font-size: 9px; }
  .week-scroll { max-height: calc(100dvh / var(--ui-scale) - 310px); }
  .event-row { gap: 12px; padding: 14px 0; }
  .event-time { min-width: 58px; font-size: 11px; }
  .event-info strong { font-size: 11px; }
  .event-info small { font-size: 10px; }
  .event-status { display: none; }
  .event-row>.icon-btn { font-size: 10px; }
  .event-row>.btn { padding: 4px 6px; font-size: 10px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .stats dd { font-size: 18px; }
  .bar-row { grid-template-columns: minmax(115px,150px) minmax(30px,1fr) 20px; gap: 12px; font-size: 10px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .modal-header, .modal-footer { padding: 14px 16px; }
  .modal-body { padding: 18px 16px; }
  .modal-footer { flex-wrap: wrap; }
  .detail-meta { gap: 16px; }
  .detail-meta p { font-size: 11px; }
  .actions { gap: 8px; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; } }
.date-control { width: 100%; min-width: 0; }
.picker-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px; padding: 9px 10px; border: 1px solid var(--hover); background: var(--surface); color: var(--ink); text-align: left; font-size: 12px; }
.picker-trigger:hover { border-color: var(--muted); }
.picker-trigger>span:last-child { color: var(--muted); }
#date-picker { width: min(400px,calc(100% - 24px)); max-height: calc(94dvh / var(--ui-scale)); padding: 0; }
.picker-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.picker-tabs { display: flex; align-items: center; gap: 22px; padding: 12px 18px 0; }
.picker-tabs button { padding: 6px 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 12px; }
.picker-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.picker-body { padding: 14px 18px 18px; }
.picker-month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.picker-month-nav>div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.picker-month-nav .icon-btn { font-size: 16px; }
.picker-weekdays, .picker-day-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
.picker-weekdays { margin-bottom: 8px; color: var(--muted); font-size: 10px; text-align: center; }
.picker-weekdays span { padding: 5px 0; }
.picker-day-grid button, .picker-year-grid button { border: 1px solid transparent; background: transparent; color: var(--ink); min-width: 0; padding: 9px 2px; font-size: 12px; }
.picker-day-grid button:hover, .picker-year-grid button:hover { background: var(--hover); border-color: var(--muted); }
.picker-day-grid .outside { color: var(--control-border); }
.picker-day-grid .current { text-decoration: underline; text-underline-offset: 5px; }
.picker-day-grid .selected, .picker-year-grid .selected { background: var(--accent); border-color: var(--accent); color: var(--paper); text-decoration: none; }
.picker-year-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; min-height: 190px; }
.picker-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.picker-footer .text-button { color: var(--muted); font-size: 11px; }
.clock-readout { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 0 12px; }
.clock-readout button { background: none; border: 0; border-bottom: 1px solid transparent; border-radius: 0; font-size: 28px; color: var(--muted); padding: 0 2px 4px; font-variant-numeric: tabular-nums; }
.clock-readout button.active { color: var(--accent); border-bottom-color: var(--accent); }
.clock-readout>span { font-size: 24px; color: var(--muted); }
.clock-face { width: min(246px,100%); aspect-ratio: 1; margin: 0 auto; position: relative; border: 1px solid var(--control-border); border-radius: 50%; background: var(--surface); cursor: crosshair; }
.clock-number { position: absolute; width: 27px; height: 27px; transform: translate(-50%,-50%); padding: 0; border: 1px solid transparent; background: none; border-radius: 50%; color: var(--accent); font-size: 12px; z-index: 2; }
.clock-number.inner { font-size: 10px; color: var(--muted); width: 24px; height: 24px; }
.clock-number:hover { border-color: var(--muted); }
.clock-number.selected { background: var(--accent); color: var(--paper); }
.clock-hand { position: absolute; bottom: 50%; left: 50%; width: 1px; background: var(--ink); transform-origin: center bottom; pointer-events: none; }
.clock-thumb { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); transform: translate(-50%,-50%); pointer-events: none; }
.clock-center { position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.clock-step { display: flex; align-items: center; justify-content: center; gap: 25px; margin-top: 13px; font-size: 11px; color: var(--muted); }
.clock-step button { font-size: 17px; padding: 1px 10px; }
@media(max-width:550px) {
  .picker-trigger { min-height: 39px; font-size: 13px; }
  .picker-header, .picker-footer { padding: 10px; }
  .picker-body { padding: 12px 10px; }
  .picker-tabs { padding: 10px 10px 0; gap: 16px; }
  .picker-tabs button { font-size: 11px; }
  .picker-day-grid { gap: 1px; }
  .picker-day-grid button { padding: 7px 0; font-size: 11px; }
  .picker-footer { flex-wrap: wrap; }
  .picker-footer .actions { gap: 9px; }
  .picker-footer .text-button { font-size: 10px; }
  .clock-face { width: min(220px,100%); }
  .clock-number { width: 24px; height: 24px; font-size: 11px; }
  .clock-number.inner { width: 22px; height: 22px; font-size: 9px; }
}
.reminder-control { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.reminder-control legend { color: var(--muted); font-size: 11px; padding: 0; margin-bottom: 12px; }
.reminder-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 16px; }
.reminder-option { display: flex; align-items: center; gap: 9px; font-size: 12px; line-height: 1.6; cursor: pointer; }
.reminder-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); flex: none; }
.reminder-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 14px; }
.reminder-actions button { color: var(--muted); font-size: 11px; }
.reminder-custom { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.reminder-custom[hidden], .reminder-empty[hidden] { display: none; }
.reminder-custom label { display: flex; flex-direction: column; gap: 7px; }
.reminder-custom label span { color: var(--muted); font-size: 10px; }
.reminder-custom input, .reminder-custom select { background: var(--surface); border: 1px solid var(--hover); padding: 7px 9px; font-size: 12px; min-width: 0; }
.reminder-custom input { width: 85px; }
.reminder-custom .btn { padding: 7px 9px; }
.reminder-empty { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.reminder-error:empty { display: none; }
@media(max-width:550px) {
  .reminder-choices { grid-template-columns: 1fr; gap: 8px; }
  .reminder-option { font-size: 12px; }
  .reminder-actions { gap: 12px; }
  .reminder-actions button { font-size: 10px; }
}
/* Workspace navigation */
.app { display: grid; grid-template-columns: 190px minmax(0,1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 190px; padding: 22px 16px; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; }
.sidebar .brand { padding: 0 9px; }
.sidebar .nav { display: flex; flex-direction: column; align-items: stretch; gap: 3px; margin-top: 32px; overflow: visible; }
.sidebar .nav a { border: 0; border-left: 2px solid transparent; padding: 10px 12px; font-size: 12px; }
.sidebar .nav a.active { border-left-color: var(--accent); background: var(--surface); }
.sidebar-footer { margin-top: auto; padding: 22px 9px 0; }
.theme-toggle { font-size: 11px; color: var(--muted); }
.theme-toggle:hover { color: var(--accent); }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 15px; }
.sidebar .user-name { display: block; }
.sidebar-user .icon-btn { padding-right: 0; font-size: 11px; }
.main { grid-column: 2; }
.workspace-header { min-height: 48px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.workspace-header .search { width: 220px; }
.workspace-header .search input { flex: 1; width: 100%; }
.menu-toggle, .sidebar-backdrop { display: none; }
.login-form>.theme-toggle { margin-top: 20px; }
.calendar-page-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.calendar-page-heading .page-heading { flex: 1; margin-bottom: 0; }
.ics-preview-list { max-height: 290px; overflow: auto; border-block: 1px solid var(--line); margin: 14px 0 20px; }
.ics-preview-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ics-preview-row:last-child { border-bottom: 0; }
.ics-preview-row input { margin-top: 3px; accent-color: var(--ink); }
.ics-preview-row strong { display: block; font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.ics-preview-row small { display: block; font-size: 10px; color: var(--muted); line-height: 1.7; margin-top: 5px; }
.ics-preview-row.duplicate { opacity: .6; cursor: default; }
.ics-select-actions { display: flex; gap: 18px; font-size: 11px; }
.ics-warnings { border-left: 2px solid var(--control-border); padding-left: 12px; font-size: 11px; line-height: 1.8; margin-bottom: 18px; }
.ics-warnings summary { cursor: pointer; }
.ics-warnings ul { max-height: 130px; overflow: auto; padding-left: 18px; color: var(--muted); }
@media(max-width:880px) {
  .app { display: block; }
  .main { grid-column: auto; }
  .sidebar { visibility: hidden; transform: translateX(-100%); width: 205px; }
  .app.menu-open .sidebar { visibility: visible; transform: none; }
  .app.menu-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: #00000080; z-index: 9; }
  .menu-toggle { display: inline-flex; margin-right: auto; font-size: 16px; }
  .workspace-header { padding: 0 16px; }
  .workspace-header .search { max-width: 220px; }
  .sidebar .nav { gap: 3px; }
}
@media(max-width:550px) {
  .calendar-page-heading { flex-wrap: wrap; }
  .calendar-page-heading .page-heading { min-width: 100%; }
  .calendar-page-heading>.btn { margin-left: auto; }
}
