:root {
  --bg: #f3f4f8;
  --panel: #ffffff;
  --panel-soft: #f7f8fc;
  --panel-muted: #eef1f7;
  --ink: #1f2433;
  --muted: #6f778d;
  --line: #d9deea;
  --line-strong: #cbd2e1;
  --accent: #2557f5;
  --accent-strong: #173fd0;
  --accent-soft: #ebf1ff;
  --green: #24c86f;
  --danger: #ff6b6b;
  --shadow: 0 18px 38px rgba(20, 38, 92, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --time-axis-width: 62px;
  --hour-height: 58px;
  --grid-height: calc(var(--hour-height) * 18);
  --week-header-row-height: 58px;
  --summary-row-height: 68px;
  --sticky-topbar-offset: 82px;
  --mobile-dock-offset: 0px;
  --scroll-lock-y: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--sticky-topbar-offset);
}

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(37, 87, 245, 0.1), transparent 24%),
    radial-gradient(circle at top right, rgba(36, 200, 111, 0.08), transparent 18%),
    linear-gradient(180deg, #f8f9fc 0%, #f2f4f8 50%, #edf1f7 100%);
}

body[data-theme="dark"] {
  --bg: #10141d;
  --panel: #161c27;
  --panel-soft: #1b2230;
  --panel-muted: #232c3d;
  --ink: #eef3ff;
  --muted: #97a3be;
  --line: #2a3448;
  --line-strong: #36425a;
  --accent-soft: rgba(37, 87, 245, 0.18);
  --shadow: 0 18px 38px rgba(2, 6, 18, 0.32);
  background:
    radial-gradient(circle at top left, rgba(37, 87, 245, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(36, 200, 111, 0.1), transparent 18%),
    linear-gradient(180deg, #0e131c 0%, #121824 46%, #151d2b 100%);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="system"] {
    --bg: #10141d;
    --panel: #161c27;
    --panel-soft: #1b2230;
    --panel-muted: #232c3d;
    --ink: #eef3ff;
    --muted: #97a3be;
    --line: #2a3448;
    --line-strong: #36425a;
    --accent-soft: rgba(37, 87, 245, 0.18);
    --shadow: 0 18px 38px rgba(2, 6, 18, 0.32);
    background:
      radial-gradient(circle at top left, rgba(37, 87, 245, 0.16), transparent 24%),
      radial-gradient(circle at top right, rgba(36, 200, 111, 0.1), transparent 18%),
      linear-gradient(180deg, #0e131c 0%, #121824 46%, #151d2b 100%);
  }
}

body.login-body {
  overflow: auto;
}

html.drag-scroll-locked,
body.drag-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

html.drag-scroll-locked-fixed body,
body.drag-scroll-locked-fixed {
  position: fixed;
  inset: 0;
  width: 100%;
  top: calc(var(--scroll-lock-y) * -1);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding:
    max(6px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 253, 0.96));
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand-title {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.login-copy h2 {
  margin: 0;
  font-size: 1.1rem;
}

.login-copy p,
.login-hint p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.auth-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-switch-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.login-error,
.login-hint {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-size: 0.76rem;
}

.login-error {
  border-color: rgba(255, 107, 107, 0.25);
  color: #a94040;
  background: rgba(255, 107, 107, 0.08);
}

.login-submit {
  width: 100%;
  justify-content: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: block;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.brand-block,
.topbar-quick-tabs,
.week-nav,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-quick-tabs {
  display: none;
  flex: 0 0 auto;
  justify-self: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-block.login-brand {
  display: flex;
  gap: 12px;
}

.brand-icon-image {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(21, 53, 141, 0.18);
}

.topbar-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  box-shadow: none;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.topbar-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 3px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 120px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  list-style: none;
}

.user-chip::-webkit-details-marker {
  display: none;
}

.user-menu {
  position: relative;
}

.user-menu[open] {
  z-index: 24;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 112px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
}

.user-menu-panel form {
  margin: 0;
}

.user-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 0.74rem;
}

.user-menu-item:hover {
  background: var(--accent-soft);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-tabs {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  padding: 2px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.widget-pill {
  border: 0;
  text-decoration: none;
}

.view-tab,
.nav-btn,
.mini-nav,
.primary-btn,
.secondary-btn,
.text-btn,
.inline-remove,
.icon-btn {
  border: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.view-tab {
  padding: 3px 8px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.view-tab.active {
  background: var(--accent);
  color: white;
}

.quick-view-tab {
  min-width: 28px;
  min-height: 22px;
  padding: 2px 5px;
  font-size: 0.55rem;
  font-weight: 800;
}

.week-nav {
  flex: 0 1 auto;
  min-width: 0;
  padding: 2px 4px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.week-nav strong,
.mini-month-toolbar strong {
  min-width: 108px;
  text-align: center;
  font-size: 0.82rem;
}

.nav-btn,
.mini-nav,
.secondary-btn,
.icon-btn {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.nav-btn.icon,
.mini-nav,
.tiny-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  font-size: 0.66rem;
}

.primary-btn {
  padding: 11px 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-size: 0.81rem;
  font-weight: 700;
  box-shadow: 0 12px 22px rgba(37, 87, 245, 0.24);
}

.secondary-btn {
  font-size: 0.76rem;
}

.secondary-btn.is-loading {
  position: relative;
  padding-left: 26px;
}

.secondary-btn.is-loading::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 999px;
  border: 2px solid rgba(37, 87, 245, 0.18);
  border-top-color: var(--accent-strong);
  animation: spin 0.8s linear infinite;
}

.text-btn {
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.inline-remove {
  padding: 0;
  background: transparent;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
}

.selection-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.date-jump-btn {
  position: relative;
  cursor: pointer;
}

.date-jump-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.selection-summary strong {
  color: var(--ink);
  font-size: 0.64rem;
}

.summary-label {
  display: none;
}

.summary-label::before,
.toolbar-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(37, 87, 245, 0.45);
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.view-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  margin-top: 6px;
}

.page {
  height: 100%;
  min-height: 0;
}

.install-hint,
.composer-status {
  margin: 0;
}

.install-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 87, 245, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(37, 87, 245, 0.08), rgba(37, 87, 245, 0.03));
}

.install-hint-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.install-hint-copy strong {
  font-size: 0.82rem;
}

.install-hint-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

#weekBoardSection,
#monthlySummarySection,
#templatesView,
#settingsView,
#integrationsView {
  scroll-margin-top: var(--sticky-topbar-offset);
  scroll-margin-bottom: var(--mobile-dock-offset);
}

.calendar-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 12px;
}

.templates-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.integrations-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
}

.left-rail,
.template-list-pane,
.settings-pane,
.integration-list-pane {
  min-height: 0;
}

.settings-pane {
  width: min(100%, 720px);
  margin: 0 auto;
}

.stats-pane {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
}

.stats-pane .editor-section {
  min-height: min-content;
}

.integration-list-pane {
  display: grid;
  gap: 12px;
}

.calendar-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.calendar-pane,
.inspector-pane,
.template-editor-pane,
.integration-preview-pane {
  min-height: 0;
}

.scroll-pane {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.scroll-pane::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.scroll-pane::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(130, 139, 160, 0.45);
  background-clip: content-box;
}

.side-section,
.calendar-pane,
.editor-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
}

.side-section,
.editor-section {
  padding: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.calendar-pane {
  padding: 14px 14px 16px;
}

#weekBoardSection {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.week-board-scroller {
  position: relative;
  min-height: 0;
  overflow: auto;
  border-radius: 18px 18px 0 18px;
  background: var(--panel);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  isolation: isolate;
}

.section-head,
.pane-head,
.linked-builder-head,
.linked-item-head,
.template-card-head,
.agenda-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.section-head.compact h2,
.pane-head h2 {
  margin: 0;
  font-size: 0.96rem;
}

.section-copy,
.pane-copy,
.linked-builder-head p,
.template-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.section-pill.accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.mini-month-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 10px;
}

.mini-weekdays,
.mini-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}

.mini-weekdays {
  margin-bottom: 8px;
}

.mini-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.mini-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  padding: 7px 3px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.mini-day.outside {
  opacity: 0.42;
}

.mini-day.selected {
  border-color: rgba(37, 87, 245, 0.56);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(37, 87, 245, 0.28);
}

.mini-day.today .mini-day-number {
  background: transparent;
  color: var(--accent);
}

.mini-day.today {
  border-color: rgba(37, 87, 245, 0.72);
  box-shadow: inset 0 0 0 1px rgba(37, 87, 245, 0.42);
}

.mini-day.sunday .mini-day-number,
.mini-day.holiday .mini-day-number {
  color: #d94a4a;
}

.mini-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  line-height: 1;
  border-radius: 0;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mini-day-meta {
  display: none;
}

.mini-day-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 6px;
}

.mini-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.memo-section {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.memo-section .section-pill[data-state="pending"],
.memo-section .section-pill[data-state="saving"] {
  background: color-mix(in srgb, #f6c34d 18%, var(--panel-muted));
  color: #8f6200;
}

.memo-section .section-pill[data-state="saved"] {
  background: color-mix(in srgb, #49c56f 16%, var(--panel-muted));
  color: #257744;
}

.memo-section .section-pill[data-state="error"] {
  background: color-mix(in srgb, #ef6262 14%, var(--panel-muted));
  color: #a43a3a;
}

.weekly-memo-field {
  display: grid;
}

.weekly-memo-input {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 88%, white);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.55;
}

.weekly-memo-input:focus {
  outline: none;
  border-color: rgba(37, 87, 245, 0.42);
  box-shadow: 0 0 0 3px rgba(37, 87, 245, 0.12);
}

.stat-card {
  padding: 9px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.02rem;
}

.compact-empty-state {
  padding: 12px 14px;
  font-size: 0.72rem;
}

.template-progress-section {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.template-progress-list {
  display: grid;
  gap: 8px;
}

.template-progress-card {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.template-progress-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.template-progress-headline strong {
  display: block;
  font-size: 0.78rem;
}

.template-progress-headline p,
.template-progress-date,
.template-progress-meta span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.template-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-muted);
  overflow: hidden;
}

.template-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.template-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.template-progress-meta strong {
  font-size: 0.72rem;
}

.stats-extended {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-date-toolbar {
  display: grid;
  grid-template-columns: auto auto max-content auto;
  gap: 6px;
  align-items: end;
  justify-content: start;
  margin-top: 10px;
}

.stats-date-input-wrap {
  display: grid;
  gap: 3px;
  inline-size: clamp(168px, 18vw, 198px);
  min-width: 0;
  justify-self: start;
}

.stats-date-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stats-date-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.stats-card,
.journal-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fafbff);
}

.journal-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.stats-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.stats-list.is-scrollable {
  overflow-y: auto;
  padding-right: 4px;
}

.stats-toggle-btn {
  display: none;
}

.stats-card.collapsed .stats-list {
  display: none;
}

.stats-list-item {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.stats-list-item.compact {
  gap: 4px;
}

.stats-list-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stats-list-copy strong {
  font-size: 0.8rem;
}

.stats-list-copy span {
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
}

.stats-list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stats-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.stats-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 36, 51, 0.06);
  overflow: hidden;
}

.stats-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.journal-output {
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  min-height: 148px;
}

.journal-markdown {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 0.82rem;
}

.journal-output-loading {
  display: grid;
  place-items: center;
  min-height: 148px;
}

.journal-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(37, 87, 245, 0.16);
  border-top-color: var(--accent-strong);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.stack-form {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.composer-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.68rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.tight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-meta-grid {
  grid-template-columns: minmax(0, 1fr) 54px;
}

.date-color-grid {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-secondary-grid {
  grid-template-columns: minmax(118px, 1fr) 72px;
  align-items: end;
}

.step-secondary-grid input[type="number"] {
  min-width: 0;
  text-align: center;
}

.left-rail .date-color-grid {
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 6px;
}

.left-rail .time-grid {
  gap: 6px;
}

.left-rail .step-meta-grid {
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px;
}

.left-rail .step-time-grid {
  grid-template-columns: 1fr;
  gap: 6px;
}

.left-rail .step-secondary-grid {
  grid-template-columns: minmax(124px, 1fr) 68px;
  gap: 6px;
}

.template-editor-pane .step-meta-grid {
  grid-template-columns: minmax(0, 1.1fr) 64px;
}

.template-editor-pane .step-time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-editor-pane .step-secondary-grid {
  grid-template-columns: minmax(126px, 1fr) 76px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span {
  font-size: 0.7rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.left-rail .field span,
.left-rail .advanced-details > summary,
.left-rail .checkbox-row {
  font-size: 0.66rem;
}

.left-rail .field input,
.left-rail .field textarea,
.left-rail .field select {
  padding: 7px 8px;
  font-size: 0.73rem;
}

.time-combobox {
  position: relative;
}

.time-combobox::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(111, 119, 141, 0.75);
  border-bottom: 2px solid rgba(111, 119, 141, 0.75);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  transition: transform 0.15s ease;
}

.time-combobox.open::after {
  transform: translateY(-35%) rotate(-135deg);
}

.time-combobox > [data-role="time-input"] {
  padding-right: 28px;
  letter-spacing: 0.01em;
}

.time-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 18;
  max-height: 176px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(31, 36, 51, 0.12);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.time-dropdown::-webkit-scrollbar {
  width: 10px;
}

.time-dropdown::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(130, 139, 160, 0.45);
  background-clip: content-box;
}

.time-option {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-top: 1px solid rgba(217, 222, 234, 0.75);
  background: white;
  color: var(--ink);
  font-size: 0.74rem;
  text-align: left;
}

.time-option:first-child {
  border-top: 0;
}

.time-option:hover,
.time-option.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.left-rail .time-dropdown {
  max-height: 152px;
}

.left-rail .section-head.compact h2 {
  font-size: 0.9rem;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(37, 87, 245, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 87, 245, 0.1);
}

.field input[type="color"] {
  min-height: 34px;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}

.field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 9px;
}

.field input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 9px;
}

.color-field {
  min-width: 0;
  align-self: end;
}

.color-picker {
  position: relative;
  isolation: isolate;
}

.color-picker.open {
  z-index: 60;
}

.color-trigger {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
}

.color-trigger-swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--color-preview, var(--accent));
  flex: 0 0 auto;
}

.color-trigger-label {
  display: none;
}

.color-palette {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  z-index: 48;
  display: grid;
  gap: 6px;
  width: 96px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 18px 28px rgba(31, 36, 51, 0.12);
}

.color-picker > .color-palette {
  display: none !important;
}

.color-palette-floating {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 72;
}

.settings-subsection {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.settings-subsection-head {
  display: grid;
  gap: 4px;
}

.settings-subsection-head strong {
  font-size: 0.74rem;
}

.settings-subsection-head span {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

.settings-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-color-label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.settings-color-chip {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: var(--settings-color);
}

.settings-color-label input {
  min-width: 0;
}

.color-palette.align-left {
  left: auto;
  right: calc(100% + 10px);
}

.color-palette.align-bottom {
  top: auto;
  bottom: 0;
}

.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 2px;
}

.palette-color-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 3px;
  background: var(--palette-color);
}

.palette-color-btn.active {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.92),
    0 0 0 2px rgba(37, 87, 245, 0.28);
}

.color-advanced input[type="color"] {
  width: 100%;
}

.small-field input {
  text-align: center;
  min-width: 0;
}

.advanced-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.advanced-details > summary {
  padding: 8px 11px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.advanced-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.details-body {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.location-search-field {
  gap: 8px;
}

.location-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.location-search-results {
  display: grid;
  gap: 8px;
  padding: 9px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  max-height: 220px;
  overflow-y: auto;
}

.location-search-result {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.location-search-result:hover,
.location-search-result:focus-visible {
  border-color: rgba(37, 87, 245, 0.38);
  background: rgba(37, 87, 245, 0.06);
  outline: none;
}

.location-search-result-main {
  font-size: 0.9rem;
  font-weight: 600;
}

.location-search-result-meta {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.repeat-grid {
  align-items: end;
}

.repeat-preview {
  margin-top: -2px;
}

.linked-builder {
  padding: 11px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  min-width: 0;
}

.linked-items {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.linked-item {
  padding: 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}

.linked-item .field-grid + .field-grid {
  margin-top: 8px;
}

.step-meta-grid {
  grid-template-columns: minmax(0, 1fr) minmax(88px, 112px);
}

.step-time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.linked-item-head {
  margin-bottom: 8px;
  align-items: center;
}

.linked-item-head strong {
  font-size: 0.76rem;
}

.linked-item .field span {
  line-height: 1.25;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--panel-muted);
  font-size: 0.76rem;
}

.template-fields {
  display: grid;
  gap: 8px;
}

.compact-settings-form {
  gap: 10px;
}

.admin-section {
  margin-top: 14px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fafbff);
}

.admin-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.admin-card-head h3 {
  margin: 0;
  font-size: 0.9rem;
}

.admin-card-copy {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-users-list,
.admin-audit-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-user-row,
.admin-audit-row,
.admin-empty-state {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.admin-user-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.admin-user-copy,
.admin-audit-copy,
.admin-empty-state {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-user-copy strong,
.admin-audit-copy strong,
.admin-empty-state strong {
  font-size: 0.82rem;
}

.admin-user-copy span,
.admin-audit-copy span,
.admin-empty-state span {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.admin-role-field {
  min-width: 136px;
}

.admin-role-field select {
  min-width: 100%;
}

.admin-self-pill,
.admin-audit-pill {
  justify-self: end;
}

.admin-audit-row[data-severity="warning"] {
  border: 1px solid rgba(224, 151, 29, 0.22);
}

.admin-audit-row[data-severity="error"] {
  border: 1px solid rgba(214, 84, 84, 0.24);
}

.pane-head {
  align-items: baseline;
  margin-bottom: 10px;
}

.board-pane-head {
  align-items: center;
}

.board-pane-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.board-pane-actions .pane-copy {
  max-width: 340px;
  text-align: right;
}

.board-week-nav {
  flex-shrink: 0;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pane-head h2 {
  margin: 0;
  font-size: 1rem;
}

.week-board {
  position: relative;
  display: grid;
  grid-template-columns: var(--time-axis-width) minmax(0, 1fr);
  grid-template-rows: var(--week-header-row-height) auto auto;
  gap: 0;
  min-width: 860px;
  min-height: 100%;
  overflow: visible;
  isolation: isolate;
  background: var(--panel);
}

.week-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: var(--time-axis-width);
  min-width: var(--time-axis-width);
  max-width: var(--time-axis-width);
  height: 100%;
  border: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-radius: 18px 0 0 0;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.week-header {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 0 18px 0 0;
  overflow: hidden;
}

.week-summary-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: var(--time-axis-width);
  min-width: var(--time-axis-width);
  max-width: var(--time-axis-width);
  height: 100%;
  border-left: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-top: 0;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
}

.week-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
  align-self: stretch;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  overflow: hidden;
}

.week-day {
  display: grid;
  grid-template-rows: minmax(12px, auto) 22px minmax(10px, auto);
  justify-items: center;
  align-content: center;
  gap: 0;
  min-height: var(--week-header-row-height);
  padding: 2px 4px;
  border: 0;
  border-left: 1px solid rgba(201, 208, 222, 0.92);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  background: var(--panel);
  overflow: visible;
}

.week-day:first-child {
  border-left: 0;
}

.week-day.selected {
  background: var(--accent-soft);
}

.week-day.today .week-day-number {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 2px var(--panel);
}

.week-day.sunday .week-day-name,
.week-day.holiday .week-day-name,
.week-day.holiday .week-day-number,
.week-day-holiday {
  color: #d94a4a;
}

.week-day-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 12px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.02;
}

.week-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef1f7;
  font-size: 0.71rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.week-day-holiday {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 10px;
  max-width: 100%;
  font-size: 0.47rem;
  line-height: 1.02;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-summary-day {
  min-width: 0;
  display: grid;
  grid-auto-rows: min-content;
  align-self: stretch;
  align-content: start;
  gap: 3px;
  height: 100%;
  min-height: 100%;
  padding: 2px 5px 2px;
  box-sizing: border-box;
  border-left: 1px solid var(--line);
}

.week-summary-day:first-child {
  border-left: 0;
}

.summary-chip,
.summary-empty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
  min-height: 15px;
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 0.56rem;
  line-height: 1.06;
}

.summary-chip {
  max-width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: color-mix(in srgb, var(--summary-color, var(--accent)) 14%, white);
  color: var(--ink);
}

.summary-chip.done strong {
  text-decoration: line-through;
}

.summary-chip span,
.summary-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-empty {
  color: var(--muted);
  background: transparent;
}

.time-axis {
  position: relative;
  align-self: start;
  width: var(--time-axis-width);
  min-width: var(--time-axis-width);
  max-width: var(--time-axis-width);
  border: 1px solid var(--line);
  border-top: 0;
  border-right: 0;
  border-radius: 0 0 0 18px;
  background: var(--panel-soft);
  overflow: hidden;
}

.time-slot {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: var(--hour-height);
  padding-top: 7px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.week-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  height: var(--grid-height);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--panel);
  -webkit-touch-callout: none;
  isolation: isolate;
  overscroll-behavior: contain;
}

.calendar-pane.drag-gesture-active,
.week-board-scroller.drag-gesture-active,
.week-grid.drag-gesture-active,
.week-board.drag-gesture-active {
  overscroll-behavior: none;
  touch-action: none;
}

.calendar-pane.drag-gesture-active,
.week-board-scroller.drag-gesture-active {
  -webkit-overflow-scrolling: auto;
}

.day-column-bg {
  position: relative;
  height: var(--grid-height);
  border: 0;
  border-left: 1px solid rgba(201, 208, 222, 0.92);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  background:
    linear-gradient(180deg, rgba(37, 87, 245, 0.02), rgba(37, 87, 245, 0.01)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent calc(var(--hour-height) - 1px),
      rgba(217, 222, 234, 0.92) calc(var(--hour-height) - 1px),
      rgba(217, 222, 234, 0.92) var(--hour-height)
    );
}

.day-column-bg:first-child {
  border-left: 0;
}

.day-column-bg.selected {
  background:
    linear-gradient(180deg, rgba(37, 87, 245, 0.08), rgba(37, 87, 245, 0.02)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent calc(var(--hour-height) - 1px),
      rgba(217, 222, 234, 0.92) calc(var(--hour-height) - 1px),
      rgba(217, 222, 234, 0.92) var(--hour-height)
    );
}

.day-column-bg.today {
  box-shadow: inset 0 0 0 2px rgba(37, 87, 245, 0.16);
}

.day-column-bg:focus,
.day-column-bg:focus-visible,
.day-column-bg:active {
  outline: none;
  box-shadow: none;
}

.current-time-indicator {
  position: absolute;
  z-index: 7;
  height: 0;
  pointer-events: none;
}

.current-time-indicator::before {
  content: "";
  position: absolute;
  top: 0;
  left: 4px;
  right: 4px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.44);
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.08);
}

.current-time-label {
  position: absolute;
  top: -11px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.54);
  color: white;
  font-size: 0.63rem;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: none;
  white-space: nowrap;
}

.week-event {
  position: absolute;
  z-index: 3;
  min-height: 24px;
  border-radius: 0;
  padding: 7px 6px 5px;
  box-shadow: none;
  cursor: grab;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  touch-action: auto;
}

.week-event * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.week-event.drag-armed {
  box-shadow: none;
}

.week-event.selected {
  z-index: 4;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.82);
}

.week-event.done .event-time,
.week-event.done .event-title,
.week-event.done .event-meta {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: currentColor;
}

.week-event.drag-origin {
  opacity: 0.16;
}

.week-event.drag-preview {
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

.week-event.drag-preview.preview-visible {
  opacity: 0.9;
  border: 2px dashed rgba(255, 255, 255, 0.95);
}

.week-event.drag-preview.preview-hidden {
  opacity: 0;
  border: 0;
}

.resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
  cursor: ns-resize;
  touch-action: auto;
}

.resize-handle::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-50%);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.resize-handle.top {
  top: 0;
}

.resize-handle.bottom {
  bottom: 0;
}

.week-event.selected .resize-handle::after,
.week-event.drag-armed .resize-handle::after,
.week-event:hover .resize-handle::after {
  background: rgba(255, 255, 255, 0.34);
}

.event-time {
  font-size: 0.58rem;
  font-weight: 600;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}

.event-title {
  margin-top: 3px;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.event-meta {
  margin-top: 4px;
  font-size: 0.58rem;
  line-height: 1.25;
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-event.is-compact {
  padding-top: 6px;
}

.week-event.is-compact .event-title,
.week-event.is-tiny .event-title,
.week-event.is-narrow .event-title {
  display: block;
  margin-top: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.week-event.is-narrow .event-meta,
.week-event.is-tiny .event-meta {
  display: none;
}

.week-event.is-very-narrow .event-title {
  font-size: 0.6rem;
  line-height: 1.18;
}

.guide-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 0;
  pointer-events: none;
}

.guide-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 1px dashed rgba(111, 119, 141, 0.32);
}

.guide-line-label {
  position: absolute;
  right: 8px;
  top: -9px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--muted);
  font-size: 0.58rem;
}

.agenda-list,
.template-list {
  display: grid;
  gap: 10px;
}

.integration-preview-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.template-card,
.agenda-card,
.upcoming-card-item,
.integration-card,
.group-card,
.export-event-card,
.mobile-draft-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.agenda-card,
.upcoming-card-item {
  position: relative;
}

.agenda-card.selected,
.upcoming-card-item.selected {
  border-color: rgba(37, 87, 245, 0.45);
  box-shadow: 0 10px 18px rgba(37, 87, 245, 0.08);
}

.template-card.selected {
  border-color: rgba(37, 87, 245, 0.5);
  background: var(--accent-soft);
}

.integration-card.selected,
.group-card.selected {
  border-color: rgba(37, 87, 245, 0.45);
  box-shadow: 0 10px 18px rgba(37, 87, 245, 0.08);
}

.template-card-head h3,
.agenda-topline h3,
.agenda-topline h4 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
}

.template-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.template-color,
.agenda-color {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.template-steps {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
}

.template-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--panel-soft);
  font-size: 0.72rem;
}

.template-step strong {
  display: block;
  font-size: 0.74rem;
}

.template-step span {
  color: var(--muted);
}

.integration-meta {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.integration-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
}

.integration-meta-row span {
  color: var(--muted);
}

.group-card-copy,
.export-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.integration-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.integration-actions .secondary-btn,
.integration-actions .primary-btn {
  flex: 1 1 auto;
}

.preview-summary-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f7f8fc);
}

.preview-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.preview-summary-top h3 {
  margin: 0;
  font-size: 1rem;
}

.preview-summary-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.preview-section {
  display: grid;
  gap: 10px;
}

.preview-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-section-head h3 {
  margin: 0;
  font-size: 0.88rem;
}

.preview-event-list {
  display: grid;
  gap: 10px;
}

.export-event-card {
  display: grid;
  gap: 6px;
  background: linear-gradient(180deg, #ffffff, #fafbff);
}

.export-event-time {
  color: var(--accent-strong);
  font-size: 0.73rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.export-event-card h4 {
  margin: 0;
  font-size: 0.84rem;
}

.mobile-draft-card {
  display: grid;
  gap: 10px;
  background: var(--panel-soft);
}

.mobile-step-list {
  display: grid;
  gap: 8px;
}

.mobile-step-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: white;
  font-size: 0.72rem;
}

.mobile-step-item strong {
  display: block;
  font-size: 0.78rem;
}

.mobile-step-item span,
.mobile-step-item p {
  color: var(--muted);
}

.mobile-step-item p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.comparison-summary-card,
.comparison-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fafbff);
}

.comparison-summary-card {
  display: grid;
  gap: 10px;
}

.comparison-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.comparison-metric {
  padding: 10px;
  border-radius: 14px;
  background: var(--panel-soft);
  text-align: center;
}

.comparison-metric strong {
  display: block;
  font-size: 1rem;
}

.comparison-metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.comparison-column,
.comparison-list {
  display: grid;
  gap: 10px;
}

.comparison-card {
  display: grid;
  gap: 8px;
}

.comparison-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.comparison-card-head h4 {
  margin: 0;
  font-size: 0.86rem;
}

.comparison-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.compare-badge.compare-matched {
  background: rgba(23, 178, 106, 0.12);
  color: #127a4d;
}

.compare-badge.compare-drifted {
  background: rgba(245, 158, 11, 0.14);
  color: #a86403;
}

.compare-badge.compare-local_only,
.compare-badge.compare-missing_remote {
  background: rgba(37, 87, 245, 0.1);
  color: var(--accent-strong);
}

.compare-badge.compare-remote_only {
  background: rgba(91, 99, 122, 0.12);
  color: #465064;
}

.text-link {
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.template-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.manager-list .template-actions {
  grid-template-columns: 1fr auto;
}

.agenda-card,
.upcoming-card-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.agenda-card.done,
.upcoming-card-item.done {
  border-color: rgba(37, 87, 245, 0.18);
  box-shadow: inset 3px 0 0 var(--todo-display-color, var(--accent));
}

.agenda-card.done.selected,
.upcoming-card-item.done.selected {
  border-color: rgba(37, 87, 245, 0.45);
  box-shadow:
    inset 3px 0 0 var(--todo-display-color, var(--accent)),
    0 10px 18px rgba(37, 87, 245, 0.08);
}

.toggle-btn {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 999px;
  border: 2px solid rgba(37, 87, 245, 0.3);
  background: transparent;
}

.toggle-btn.done {
  background: var(--todo-display-color, var(--accent));
  border-color: var(--todo-display-color, var(--accent));
  box-shadow: inset 0 0 0 5px white;
}

.agenda-time {
  margin-top: 6px;
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.agenda-card.done h3,
.agenda-card.done h4,
.agenda-card.done .agenda-time,
.agenda-card.done .agenda-notes,
.upcoming-card-item.done h3,
.upcoming-card-item.done h4,
.upcoming-card-item.done .agenda-time,
.upcoming-card-item.done .agenda-notes {
  color: var(--todo-display-color, var(--accent-strong));
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: currentColor;
}

.agenda-date {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.69rem;
}

.agenda-notes {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: #42495a;
  font-size: 0.68rem;
  font-weight: 700;
}

.selected-todo-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.inspector-divider {
  height: 1px;
  margin: 2px 12px 4px;
  background: linear-gradient(90deg, transparent, rgba(201, 208, 222, 0.92), transparent);
}

.selected-todo-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.selected-todo-card.done {
  box-shadow: inset 3px 0 0 var(--todo-display-color, var(--accent));
}

.selected-todo-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.selected-todo-heading {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.selected-todo-heading h3 {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.35;
  word-break: break-word;
}

.selected-todo-time {
  color: var(--accent-strong);
  margin-top: 5px;
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.selected-todo-date {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.84rem;
}

.detail-color-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.selected-todo-card.done .selected-todo-heading h3,
.selected-todo-card.done .selected-todo-time,
.selected-todo-card.done .selected-todo-date,
.selected-todo-card.done .detail-color-meta,
.selected-todo-card.done .detail-block-value strong,
.selected-todo-card.done .detail-block-value p,
.selected-todo-card.done .detail-block-value small {
  color: var(--todo-display-color, var(--accent-strong));
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: currentColor;
}

.selected-todo-grid {
  display: grid;
  gap: 10px;
}

.detail-chip-row {
  margin-top: -4px;
}

.detail-block {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(217, 222, 234, 0.9);
  background: rgba(246, 248, 253, 0.88);
}

.detail-block.emphasis {
  background: linear-gradient(180deg, rgba(37, 87, 245, 0.08), rgba(37, 87, 245, 0.03));
  border-color: rgba(37, 87, 245, 0.18);
}

.detail-block-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.detail-block-value {
  display: grid;
  gap: 5px;
}

.detail-block-value strong,
.detail-block-value p {
  margin: 0;
  min-width: 0;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 0.96rem;
  line-height: 1.58;
  font-weight: 600;
}

.detail-block-value small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.detail-sync-block {
  gap: 10px;
}

.detail-sync-list {
  display: grid;
  gap: 10px;
}

.detail-sync-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(217, 222, 234, 0.82);
}

.detail-sync-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.detail-sync-copy strong {
  font-size: 0.92rem;
}

.detail-sync-copy p,
.detail-sync-copy small,
.detail-sync-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.detail-sync-copy p {
  font-size: 0.82rem;
}

.detail-sync-copy small,
.detail-sync-empty {
  font-size: 0.76rem;
}

.detail-sync-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-sync-control {
  flex: 0 0 auto;
}

.detail-attachments-block {
  gap: 10px;
}

.detail-attachments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-attachments-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.attachment-pick-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attachment-pick-label.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.detail-attachment-list {
  display: grid;
  gap: 8px;
}

.detail-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(217, 222, 234, 0.82);
  background: rgba(255, 255, 255, 0.82);
}

.detail-attachment-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.detail-attachment-link {
  min-width: 0;
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.detail-attachment-link:hover {
  text-decoration: underline;
}

.detail-attachment-copy small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.sync-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37, 87, 245, 0.08);
  color: var(--accent-strong);
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.sync-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.sync-toggle.busy {
  opacity: 0.58;
  pointer-events: none;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-actions .secondary-btn {
  padding: 10px 14px;
  font-size: 0.84rem;
}

.detail-edit-form {
  display: grid;
  gap: 12px;
}

.detail-edit-form .field input,
.detail-edit-form .field textarea,
.detail-edit-form .field select {
  font-size: 0.88rem;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: rgba(255, 107, 107, 0.24);
  color: var(--danger);
}

.empty-state {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(31, 36, 51, 0.28);
  backdrop-filter: blur(4px);
}

.composer-section.composer-modal,
.modal-sheet {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 45;
  width: min(640px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 20px;
  overflow-y: auto;
  overflow-x: visible;
  transform: translate(-50%, -50%);
  scrollbar-gutter: stable;
}

.modal-sheet {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 253, 0.96));
  box-shadow: var(--shadow);
}

.modal-sheet-head {
  margin-bottom: 14px;
}

.composer-section.composer-modal .section-head.compact h2,
.modal-sheet-head h2 {
  font-size: 1.18rem;
}

.composer-section.composer-modal .section-copy,
.composer-section.composer-modal .composer-status,
.modal-sheet-head .section-copy {
  font-size: 0.86rem;
}

.composer-section.composer-modal .stack-form {
  gap: 12px;
}

.composer-section.composer-modal .field span,
.composer-section.composer-modal .advanced-details > summary {
  font-size: 0.8rem;
}

.composer-section.composer-modal .field input,
.composer-section.composer-modal .field textarea,
.composer-section.composer-modal .field select {
  padding: 11px 12px;
  font-size: 0.9rem;
}

.composer-section.composer-modal .linked-item .field input,
.composer-section.composer-modal .linked-item .field textarea,
.composer-section.composer-modal .linked-item .field select {
  font-size: 0.86rem;
}

.modal-close {
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: rgba(255, 107, 107, 0.26);
  color: #d84f4f;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 107, 107, 0.1);
}

.composer-section.composer-modal .stack-form,
.modal-sheet .selected-todo-panel {
  min-width: 0;
}

.modal-sheet .badge {
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  top: max(16px, calc(env(safe-area-inset-top) + 12px));
  left: 50%;
  bottom: auto;
  z-index: 120;
  width: min(calc(100vw - 24px), 420px);
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(31, 36, 51, 0.96);
  color: white;
  font-size: 0.82rem;
  box-shadow: 0 18px 32px rgba(31, 36, 51, 0.22);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.toast.error {
  background: rgba(128, 36, 36, 0.96);
}

.mobile-dock {
  display: none;
}

.mobile-dock-btn {
  border: 0;
}

body.is-templates-view .calendar-only {
  display: none;
}

body.is-settings-view .calendar-only {
  display: none;
}

body.is-integrations-view .calendar-only {
  display: none;
}

@media (max-width: 1180px) {
  .calendar-layout,
  .templates-layout,
  .settings-layout,
  .integrations-layout,
  .calendar-main {
    grid-template-columns: 1fr;
  }

  .scroll-pane {
    overflow: visible;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
  }
}

@media (max-width: 920px) {
  body {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    padding-bottom: calc(env(safe-area-inset-bottom) + 78px);
    overflow: hidden;
  }

  .topbar {
    gap: 0;
    padding: 3px 5px;
    border-radius: 12px;
  }

  .topbar-main {
    align-items: center;
    gap: 6px;
  }

  .topbar-quick-tabs {
    display: none !important;
  }

  .topbar-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 3px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .view-tabs {
    display: none;
  }

  .topbar-icon {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    box-shadow: none;
  }

  .brand-name {
    font-size: 0.78rem;
  }

  .comparison-grid,
  .comparison-metrics {
    grid-template-columns: 1fr;
  }

  .quick-view-tab {
    min-width: 26px;
    min-height: 22px;
    padding: 2px 5px;
    font-size: 0.49rem;
  }

  .week-nav strong,
  .mini-month-toolbar strong {
    min-width: 92px;
    font-size: 0.72rem;
  }

  .nav-btn,
  .mini-nav,
  .secondary-btn,
  .icon-btn {
    padding: 4px 7px;
    font-size: 0.64rem;
  }

  .selection-summary {
    flex: 0 1 auto;
    min-width: 0;
    padding: 3px 7px;
    font-size: 0.58rem;
  }

  .selection-summary strong {
    overflow: hidden;
    font-size: 0.66rem;
    text-overflow: ellipsis;
  }

  .selection-summary strong {
    font-size: 0;
  }

  .selection-summary strong::after {
    content: attr(data-short-label);
    display: inline-block;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .summary-label,
  .toolbar-btn::before {
    display: none;
  }

  .toolbar-btn {
    gap: 0;
  }

  .pane-head {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .board-pane-actions {
    align-items: stretch;
    gap: 6px;
  }

  .stats-date-toolbar {
    grid-template-columns: repeat(2, auto) max-content auto;
    gap: 5px;
  }

  .stats-date-label {
    font-size: 0.58rem;
  }

  .stats-date-input-wrap {
    inline-size: min(176px, 100%);
  }

  .stats-date-input {
    padding: 6px 8px;
    font-size: 0.71rem;
  }

  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-user-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-role-field,
  .admin-self-pill,
  .admin-audit-pill {
    justify-self: start;
  }

  .board-pane-actions .pane-copy {
    max-width: none;
    text-align: left;
  }

  .pane-head h2 {
    font-size: 0.94rem;
  }

  .pane-copy {
    font-size: 0.7rem;
  }

  .calendar-layout > .calendar-main {
    order: 1;
    min-height: 0;
  }

  .calendar-layout > .left-rail {
    order: 2;
    min-height: 0;
  }

  .install-hint {
    align-items: flex-start;
  }

  .install-hint-copy strong {
    font-size: 0.78rem;
  }

  .install-hint-copy p {
    font-size: 0.7rem;
  }

  .left-rail {
    display: grid;
    gap: 10px;
  }

  .view-shell,
  .page,
  .calendar-layout,
  .calendar-main {
    min-height: 0;
    height: 100%;
  }

  .scroll-pane {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .summary-section {
    order: 2;
  }

  .field-grid,
  .step-meta-grid,
  .step-secondary-grid,
  .step-time-grid,
  .location-input-row,
  .template-actions,
  .manager-list .template-actions {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .stats-extended {
    grid-template-columns: 1fr;
  }

  .stats-toggle-btn {
    display: inline-flex;
  }

  .stats-card.collapsed {
    gap: 0;
  }

  .week-board {
    min-width: 620px;
  }

  body.mobile-calendar-board .calendar-layout > .left-rail {
    display: grid;
    height: 0;
    max-height: 0;
    min-height: 0;
    overflow: visible;
  }

  body.mobile-calendar-board .calendar-layout > .calendar-main {
    display: grid;
  }

  body.mobile-calendar-board #monthlySummarySection {
    display: none;
  }

  body.mobile-calendar-month .calendar-layout > .calendar-main {
    display: none;
  }

  body.mobile-calendar-month .calendar-layout > .left-rail {
    display: grid;
  }

  body.mobile-calendar-board .calendar-layout > .calendar-main,
  body.mobile-calendar-month .calendar-layout > .left-rail {
    height: calc(100dvh - var(--sticky-topbar-offset) - var(--mobile-dock-offset) - 10px);
    max-height: calc(100dvh - var(--sticky-topbar-offset) - var(--mobile-dock-offset) - 10px);
  }

  .calendar-pane {
    overflow: hidden;
    max-height: none;
    height: 100%;
    background: var(--panel);
  }

  .week-board-scroller {
    height: 100%;
    max-height: 100%;
  }

  .week-corner,
  .week-header {
    position: sticky;
    top: 0;
  }

  .week-summary-corner,
  .week-summary {
    top: auto;
  }

  .week-summary {
    position: relative;
  }

  .week-corner,
  .time-axis {
    position: sticky;
    left: 0;
    isolation: isolate;
  }

  .week-summary-corner {
    position: sticky;
    left: 0;
    isolation: isolate;
    grid-column: 1;
    grid-row: 2;
  }

  .week-corner {
    z-index: 14;
  }

  .week-header {
    z-index: 9;
    background: var(--panel);
  }

  .week-summary-corner {
    z-index: 12;
    background: var(--panel-soft);
    border-right: 1px solid var(--line);
  }

  .week-summary {
    z-index: 3;
    background: var(--panel-soft);
  }

  .time-axis {
    z-index: 13;
    background: var(--panel-soft);
  }

  .week-corner {
    border-right: 1px solid var(--line);
  }

  .time-axis {
    border-right: 1px solid var(--line);
  }


  .event-title {
    font-size: 0.66rem;
  }

  .event-meta {
    display: none;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-block {
    padding: 12px;
  }

  .detail-sync-row,
  .detail-sync-empty {
    flex-direction: column;
    align-items: stretch;
  }

  .toast {
    top: calc(env(safe-area-inset-top) + 10px);
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(calc(100vw - 20px), 420px);
    max-width: 420px;
    transform: translateX(-50%);
  }

  .mobile-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 32px rgba(31, 36, 51, 0.16);
    backdrop-filter: blur(16px);
  }

  .mobile-dock-btn {
    padding: 10px 4px;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
  }

  .mobile-dock-btn.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .composer-section.composer-modal,
  .modal-sheet {
    top: max(10px, env(safe-area-inset-top));
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom) + 8px);
    left: 8px;
    width: auto;
    max-height: none;
    transform: none;
  }

  .modal-sheet-head {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-head-actions {
    justify-content: space-between;
  }

  .composer-section.composer-modal,
  .modal-sheet {
    padding: 16px;
  }

  .composer-section.composer-modal .section-head.compact h2,
  .modal-sheet-head h2 {
    font-size: 1.02rem;
  }

  .composer-section.composer-modal .field input,
  .composer-section.composer-modal .field textarea,
  .composer-section.composer-modal .field select {
    font-size: 0.84rem;
  }

  .color-palette-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .week-summary-day {
    gap: 2px;
    padding: 2px 4px 2px;
  }

  .summary-chip,
  .summary-empty {
    font-size: 0.6rem;
  }

  .selected-todo-heading h3 {
    font-size: 1.04rem;
  }

  .selected-todo-time {
    font-size: 0.88rem;
  }

  .detail-attachment-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-block-value strong,
  .detail-block-value p {
    font-size: 0.88rem;
  }
}
