:root {
  --bg: #f6f7f9;
  --page-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 247, 249, 0.92)), var(--bg);
  --surface: #ffffff;
  --panel-bg: rgba(255, 255, 255, 0.94);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --control-bg: #ffffff;
  --surface-muted: #eef3f6;
  --soft-accent: #e8f7f4;
  --soft-accent-hover: #edf8f5;
  --soft-blue: #edf4ff;
  --soft-danger: #fff1f0;
  --soft-rose: #fff0f5;
  --text: #111827;
  --muted: #667085;
  --muted-strong: #475467;
  --border: #d9e1e7;
  --border-strong: #b8c4ce;
  --accent: #0f9f8f;
  --accent-dark: #08766b;
  --blue: #2f6fed;
  --amber: #d9822b;
  --rose: #c0446b;
  --green: #168f5b;
  --danger: #b42318;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --notice-bg: #eef5ff;
  --notice-border: #bfd7ff;
  --notice-text: #164a91;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419;
    --page-bg: #0f1419;
    --surface: #151c23;
    --panel-bg: rgba(21, 28, 35, 0.96);
    --nav-bg: rgba(17, 23, 30, 0.96);
    --control-bg: #111820;
    --surface-muted: #202a33;
    --soft-accent: #123f3c;
    --soft-accent-hover: #143a38;
    --soft-blue: #152a4a;
    --soft-danger: #3b1714;
    --soft-rose: #3a1725;
    --text: #ecf1f6;
    --muted: #9ba8b5;
    --muted-strong: #c5d0dc;
    --border: #2a3641;
    --border-strong: #465462;
    --accent: #2ec4b6;
    --accent-dark: #66ded4;
    --danger: #ff8b7e;
    --warning-bg: #382615;
    --warning-border: #7a4a1d;
    --notice-bg: #152844;
    --notice-border: #315981;
    --notice-text: #b8d8ff;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1419;
  --page-bg: #0f1419;
  --surface: #151c23;
  --panel-bg: rgba(21, 28, 35, 0.96);
  --nav-bg: rgba(17, 23, 30, 0.96);
  --control-bg: #111820;
  --surface-muted: #202a33;
  --soft-accent: #123f3c;
  --soft-accent-hover: #143a38;
  --soft-blue: #152a4a;
  --soft-danger: #3b1714;
  --soft-rose: #3a1725;
  --text: #ecf1f6;
  --muted: #9ba8b5;
  --muted-strong: #c5d0dc;
  --border: #2a3641;
  --border-strong: #465462;
  --accent: #2ec4b6;
  --accent-dark: #66ded4;
  --danger: #ff8b7e;
  --warning-bg: #382615;
  --warning-border: #7a4a1d;
  --notice-bg: #152844;
  --notice-border: #315981;
  --notice-text: #b8d8ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.boot-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  padding: 22px 18px;
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(15, 159, 143, 0.28);
  border-radius: var(--radius);
  background: #e8f7f4;
  color: var(--accent-dark);
  font-weight: 800;
}

.brand-logo {
  display: block;
  object-fit: contain;
  padding: 1px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  color: var(--muted-strong);
  padding: 10px 11px;
  font-size: 14px;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.is-active {
  background: #edf8f5;
  color: var(--accent-dark);
}

.product-meta {
  display: grid;
  gap: 4px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 12px 2px 0;
}

.product-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
}

.product-meta strong {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.25;
}

.nav-icon,
.button-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: currentColor;
}

.app-main {
  min-width: 0;
  padding: 28px;
}

.page-stack {
  display: grid;
  gap: 20px;
  max-width: 1480px;
  margin: 0 auto;
}

.topbar,
.filter-header,
.section-heading,
.overlap-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  min-height: 58px;
}

.topbar h1,
.section-heading h2,
.filter-header h2,
.settings-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 26px;
  line-height: 1.1;
}

.section-heading h2,
.filter-header h2,
.settings-panel h2 {
  font-size: 18px;
  line-height: 1.25;
}

.muted-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.topbar-actions,
.chip-row,
.event-meta,
.event-tags,
.week-summary,
.calendar-name-list,
.tag-filter-row,
.security-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.source-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 4px;
}

.source-toggle button,
.primary-button,
.ghost-button,
.danger-button,
.mode-pill,
.chip-button,
.tag-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 720;
}

.source-toggle button,
.ghost-button,
.chip-button,
.tag-button {
  border-color: var(--border);
  background: #ffffff;
  color: var(--muted-strong);
}

.source-toggle button.is-active,
.tag-button.is-active,
.chip-button:hover,
.tag-button:hover {
  border-color: rgba(15, 159, 143, 0.25);
  background: #e8f7f4;
  color: var(--accent-dark);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.danger-button {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff1f0;
  color: var(--danger);
}

.mode-pill {
  border-color: rgba(15, 159, 143, 0.18);
  background: #e8f7f4;
  color: var(--accent-dark);
}

.capacity-meter-group {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(126px, 1fr));
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.capacity-meter-group.is-compact {
  grid-template-columns: repeat(2, minmax(104px, 126px));
}

.capacity-meter {
  display: grid;
  min-width: 0;
  gap: 6px;
  border: 1px solid rgba(15, 159, 143, 0.2);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--control-bg) 82%, var(--soft-accent));
  padding: 8px 9px;
  color: var(--muted-strong);
}

.capacity-meter-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.capacity-meter-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.capacity-meter-head strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.capacity-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 62%, transparent);
  appearance: none;
}

.capacity-track::-webkit-progress-bar {
  border-radius: inherit;
  background: color-mix(in srgb, var(--border) 62%, transparent);
}

.capacity-track::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2f6fed);
}

.capacity-track::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2f6fed);
}

.capacity-meter small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.capacity-meter.is-over-limit {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.capacity-meter.is-over-limit .capacity-track::-webkit-progress-value {
  background: #d9822b;
}

.capacity-meter.is-over-limit .capacity-track::-moz-progress-bar {
  background: #d9822b;
}

.capacity-meter.is-compact {
  gap: 4px;
  padding: 6px 7px;
}

.capacity-meter.is-compact .capacity-track {
  height: 5px;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #bfd7ff;
  border-radius: var(--radius);
  background: #eef5ff;
  color: #164a91;
  padding: 8px 10px 8px 12px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.notice > span {
  min-width: 0;
}

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

.notice-help,
.notice-close {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  color: currentColor;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}

.notice-close {
  width: 28px;
  padding: 0;
}

.notice.warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: #9a4b13;
}

.mobile-focus-strip {
  display: none;
}

.setup-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--notice-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--notice-bg);
  padding: 12px 14px;
  color: var(--notice-text);
}

.setup-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 8px 10px;
  color: var(--muted-strong);
  font-size: 12px;
}

.setup-strip span {
  color: var(--accent-dark);
  font-weight: 780;
}

.setup-strip p {
  margin: 0;
  flex: 1 1 auto;
}

.setup-strip a {
  color: var(--accent-dark);
  font-weight: 760;
}

.setup-banner h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.setup-banner p {
  margin: 5px 0 0;
  max-width: 820px;
  font-size: 13px;
  line-height: 1.45;
}

.setup-banner code {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--control-bg);
  padding: 1px 4px;
  color: var(--text);
  font-size: 12px;
}

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

.metric-card,
.filter-panel,
.context-panel,
.timeline-panel,
.week-day,
.settings-panel,
.parser-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
}

.metric-card {
  min-height: 112px;
  padding: 14px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.35;
}

.overview-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.filter-panel,
.context-panel,
.timeline-panel,
.settings-panel,
.parser-panel {
  padding: 18px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.system-flags-heading {
  align-items: flex-start;
}

.admin-only-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.feature-flag-list {
  display: grid;
  gap: 10px;
}

.feature-flag-row {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, var(--control-bg));
  color: var(--text);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.feature-flag-row:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
  box-shadow: 0 8px 24px rgba(32, 33, 36, 0.06);
}

.feature-flag-row:active {
  transform: scale(0.995);
}

.feature-flag-row:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 2px;
}

.feature-flag-row.is-enabled {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.feature-flag-row.is-pending {
  cursor: wait;
  opacity: 0.72;
}

.feature-flag-copy {
  min-width: 0;
}

.feature-flag-titleline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-flag-row strong,
.feature-flag-row small {
  display: block;
}

.feature-flag-row strong {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.feature-flag-row small {
  margin-top: 4px;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.45;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(217, 130, 43, 0.12);
  color: #9a5a18;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.feature-impact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.feature-impact-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.feature-impact-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.feature-impact-items > span,
.feature-impact-empty {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, var(--control-bg));
  color: var(--text);
  font-size: 10px;
  font-weight: 680;
}

.feature-impact.is-beta .feature-impact-label {
  color: #9a5a18;
}

.feature-impact.is-beta .feature-impact-items > span,
.feature-impact.is-beta .feature-impact-empty {
  border-color: rgba(217, 130, 43, .22);
  background: rgba(217, 130, 43, .08);
  color: #8b531a;
}

.feature-impact-note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 620px) {
  .feature-impact {
    align-items: flex-start;
  }

  .feature-impact-label {
    flex-basis: 100%;
  }
}

.feature-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 24%, var(--control-bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 14%, transparent);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.feature-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 1px 2px rgba(60, 64, 67, 0.16);
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.feature-flag-row.is-enabled .feature-switch {
  background: var(--accent);
  box-shadow: none;
}

.feature-flag-row.is-enabled .feature-switch-thumb {
  transform: translateX(20px);
}

.feature-switch-thumb .spinner {
  width: 12px;
  height: 12px;
}

@media (max-width: 640px) {
  .feature-flag-row {
    gap: 12px;
    min-height: 68px;
    padding: 12px 13px;
    border-radius: 16px;
  }

  .admin-only-badge {
    display: none;
  }
}

.profile-grid {
  margin-top: 10px;
}

.filter-panel {
  display: grid;
  gap: 16px;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.filter-group input[type="date"],
.filter-group input[type="search"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

.filter-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
}

.checkbox-grid {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 14px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 620;
}

.calendar-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.calendar-demo-sales {
  --event-color: #0f9f8f;
  background-color: #0f9f8f;
}

.calendar-demo-service {
  --event-color: #2f6fed;
  background-color: #2f6fed;
}

.calendar-demo-logistics {
  --event-color: #d9822b;
  background-color: #d9822b;
}

.calendar-demo-internal {
  --event-color: #c0446b;
  background-color: #c0446b;
}

.active-filters {
  display: grid;
  gap: 8px;
}

.active-filters h3 {
  margin: 0;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 10px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.chip button {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #eef3f6;
  color: var(--muted-strong);
  padding: 0;
}

.context-copy,
.empty-state {
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.55;
}

.calendar-name-list span,
.security-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 9px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}

.timeline-panel {
  display: grid;
  gap: 14px;
}

.timeline-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

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

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

.time-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

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

.event-card {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--border);
  border-left: 5px solid var(--event-color, var(--accent));
  border-radius: var(--radius);
  background: #ffffff;
  padding: 13px 14px;
  color: var(--text);
  text-align: left;
}

.event-card:hover,
.event-card:focus-visible,
.event-card.is-selected,
.mini-event:hover,
.mini-event:focus-visible,
.mini-event.is-selected,
.compact-event:hover,
.compact-event:focus-visible,
.compact-event.is-selected {
  border-color: rgba(15, 159, 143, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
  outline: none;
}

.event-card.is-selected,
.mini-event.is-selected,
.compact-event.is-selected {
  background: var(--soft-accent);
}

.event-card.needs-review {
  background: #fffaf5;
}

.event-card.needs-review.is-selected {
  background: color-mix(in srgb, var(--warning-bg) 58%, var(--soft-accent));
}

.event-card h3 {
  margin: 7px 0 0;
  font-size: 17px;
  line-height: 1.3;
}

.event-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.event-tags {
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 4px 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.tag.ref {
  border-color: rgba(47, 111, 237, 0.2);
  background: #edf4ff;
  color: #2457b8;
}

.tag.safe {
  border-color: rgba(22, 143, 91, 0.18);
  background: #ebf8f0;
  color: #126c46;
}

.tag.warn {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: #9a4b13;
}

.tag.overlap {
  border-color: rgba(192, 68, 107, 0.18);
  background: #fff0f5;
  color: #9f2f54;
}

.warnings {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #9a4b13;
  font-size: 13px;
  line-height: 1.45;
}

.all-day {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 12px;
}

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

.settings-grid {
  align-content: start;
}

.week-grid {
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  overflow-x: auto;
}

.week-day {
  display: grid;
  min-height: 250px;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.week-day h2 {
  margin: 0;
  font-size: 16px;
}

.week-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.week-mini-list {
  display: grid;
  gap: 8px;
}

.mini-event {
  display: grid;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 3px;
  border-left: 4px solid var(--event-color, var(--accent));
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
}

.mini-event span {
  color: var(--muted);
  font-size: 11px;
}

.mini-event small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.mini-event small.is-warning {
  color: #9a4b13;
}

.mini-event strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-workspace {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.week-workspace.has-detail {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.detail-panel {
  align-content: start;
  overflow: auto;
  overscroll-behavior: contain;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(86px, 0.7fr) minmax(0, 1.3fr);
  gap: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 10px;
}

.detail-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.detail-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.detail-tags {
  gap: 5px;
}

.detail-warnings {
  margin-top: 0;
}

.service-link-card,
.service-toolbar,
.service-order-card,
.service-detail,
.admission-panel,
.readonly-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
}

.service-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.service-link-card h3,
.admission-panel h3 {
  margin: 0;
  font-size: 15px;
}

.service-link-card span,
.readonly-box span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admission-panel {
  display: grid;
  gap: 12px;
  padding: 10px;
}

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

.admission-grid label,
.appointment-grid label,
.appointment-section label,
.service-toolbar label,
.service-status-control {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.admission-grid input,
.admission-grid select,
.admission-grid textarea,
.appointment-grid input,
.appointment-grid select,
.appointment-grid textarea,
.appointment-section input,
.appointment-section select,
.appointment-section textarea,
.service-toolbar input,
.service-toolbar select,
.service-status-control select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  padding: 7px 9px;
  font-size: 12px;
  text-transform: none;
}

.admission-grid textarea {
  min-height: 74px;
  resize: vertical;
}

.appointment-grid textarea {
  min-height: 86px;
  resize: vertical;
}

.admission-grid .wide,
.appointment-grid .wide,
.readonly-box.wide {
  grid-column: 1 / -1;
}

.readonly-box {
  padding: 9px;
  text-transform: none;
}

.service-board {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
}

.service-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px max-content;
  align-items: end;
  gap: 10px;
  padding: 10px;
}

.toggle-row {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  text-transform: none;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.service-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.25fr);
  gap: 10px;
}

.simple-service-layout {
  grid-template-columns: 1fr;
}

.service-list,
.service-detail {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.service-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.service-order-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px;
  color: var(--text);
  text-align: left;
}

.service-order-card:hover,
.service-order-card:focus-visible,
.service-order-card.is-selected {
  border-color: rgba(15, 159, 143, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
  outline: none;
}

.service-order-card.is-selected {
  background: var(--soft-accent);
}

.service-order-card strong {
  font-size: 15px;
}

.service-order-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.service-status-control {
  text-transform: none;
}

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

.service-notes div,
.history-list span {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 9px;
}

.service-notes p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.history-list {
  display: grid;
  gap: 6px;
}

.history-list span {
  color: var(--muted-strong);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 13, 20, 0.58);
  padding: 18px;
}

.modal-dialog {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-dialog .detail-panel,
.modal-content-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.modal-dialog .detail-panel {
  position: static;
  max-height: none;
  overflow: visible;
}

.modal-content-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.appointment-form {
  align-content: start;
  gap: 14px;
}

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

.appointment-modal-header,
.appointment-action-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 12px;
}

.appointment-modal-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.appointment-modal-header span,
.appointment-section-title span,
.appointment-action-bar > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.icon-only-button {
  width: 34px;
  min-width: 34px;
  justify-content: center;
  padding: 0;
}

.settings-panel,
.parser-panel {
  display: grid;
  gap: 16px;
}

.status-list {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px 16px;
  align-items: start;
}

.status-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.status-list strong {
  font-size: 14px;
}

.code-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.code-table th,
.code-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  font-size: 14px;
}

.code-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.code-table tr:last-child td {
  border-bottom: 0;
}

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

.example-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
}

.example-card strong,
.example-card span {
  display: block;
}

.example-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 16px;
}

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

.sidebar {
  background: var(--nav-bg);
}

.brand-mark {
  background: var(--soft-accent);
  color: var(--accent-dark);
}

.nav-item:hover,
.nav-item.is-active,
.source-toggle button.is-active,
.tag-button.is-active,
.chip-button:hover,
.tag-button:hover,
.mode-pill {
  background: var(--soft-accent);
  color: var(--accent-dark);
}

.source-toggle,
.source-toggle button,
.ghost-button,
.chip-button,
.tag-button,
.chip,
.chip button,
.calendar-name-list span,
.security-list span,
.example-card,
.mini-event,
.filter-group input[type="date"],
.filter-group input[type="search"],
.single-field input,
.editor-row input,
.parser-textarea,
.file-control {
  background: var(--control-bg);
  color: var(--text);
}

.metric-card,
.filter-panel,
.context-panel,
.timeline-panel,
.week-day,
.settings-panel,
.parser-panel,
.event-card {
  background: var(--panel-bg);
}

.event-card.needs-review,
.all-day,
.empty-state {
  background: color-mix(in srgb, var(--warning-bg) 42%, var(--panel-bg));
}

.notice {
  border-color: var(--notice-border);
  background: var(--notice-bg);
  color: var(--notice-text);
}

.tag.ref {
  background: var(--soft-blue);
}

.tag.overlap {
  background: var(--soft-rose);
}

.danger-button {
  background: var(--soft-danger);
}

.auth-status {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--muted-strong);
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 720;
}

.auth-status.muted {
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-action-row {
  justify-content: flex-end;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--muted-strong);
}

.icon-button:hover {
  border-color: rgba(15, 159, 143, 0.25);
  color: var(--accent-dark);
}

.code-editor,
.tag-editor {
  display: grid;
  gap: 10px;
}

.editor-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.5fr) minmax(140px, 1fr) minmax(120px, 1fr) 40px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.tag-row {
  grid-template-columns: minmax(140px, 0.75fr) minmax(220px, 1.4fr) 40px;
}

.editor-row label,
.single-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.editor-row input,
.single-field input,
.parser-textarea,
.file-control {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 10px;
  outline: none;
  text-transform: none;
}

.editor-row input:focus,
.single-field input:focus,
.parser-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
}

.parser-textarea {
  min-height: 190px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

.file-control {
  max-width: 280px;
  color: var(--muted-strong);
}

.calendar-google {
  --event-color: #6b7cff;
  background-color: #6b7cff;
}

/* Compact workflow redesign */
.app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: 176px minmax(0, 1fr);
}

.sidebar {
  gap: 14px;
  padding: 14px 10px;
}

.brand {
  gap: 9px;
  padding: 0 3px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.brand strong {
  font-size: 14px;
}

.brand small {
  font-size: 10px;
  line-height: 1.2;
}

.product-meta {
  padding-top: 9px;
}

.sidebar-google-status {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 8px;
  color: var(--muted-strong);
}

.sidebar-google-status span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.sidebar-google-status strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-google-status small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: var(--muted);
}

.sidebar-google-status.is-connected .connection-dot {
  background: #14b86a;
  box-shadow: 0 0 0 0 rgba(20, 184, 106, 0.45);
  animation: pulse-dot 1.8s ease-out infinite;
}

.sidebar-google-status.is-warning .connection-dot,
.sidebar-google-status.is-checking .connection-dot {
  background: #d9822b;
}

.sidebar-google-status.is-disconnected .connection-dot {
  background: #c0446b;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 184, 106, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(20, 184, 106, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(20, 184, 106, 0);
  }
}

.product-meta span {
  font-size: 10px;
}

.product-meta strong {
  font-size: 11px;
}

.nav-list {
  gap: 3px;
}

.nav-item {
  min-height: 34px;
  gap: 8px;
  padding: 8px 9px;
  font-size: 12px;
}

.nav-icon,
.button-icon {
  width: 15px;
  height: 15px;
}

.app-main {
  height: 100vh;
  overflow: hidden;
  padding: 14px;
}

.page-stack {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: none;
  gap: 10px;
}

.topbar {
  min-height: 44px;
  padding: 0;
}

.topbar h1 {
  font-size: 22px;
}

.muted-label {
  margin-bottom: 3px;
  font-size: 10px;
}

.topbar-actions {
  gap: 6px;
}

.source-toggle {
  gap: 2px;
  padding: 3px;
}

.source-toggle button,
.primary-button,
.ghost-button,
.danger-button,
.mode-pill,
.chip-button,
.tag-button,
.auth-status {
  min-height: 30px;
  gap: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.icon-label-button {
  white-space: nowrap;
}

.notice {
  padding: 8px 10px;
  font-size: 12px;
}

.setup-banner {
  padding: 9px 11px;
}

.setup-banner h2 {
  font-size: 14px;
}

.setup-banner p {
  margin-top: 3px;
  font-size: 12px;
}

.metrics-grid {
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 8px;
}

.metric-card {
  min-height: 62px;
  padding: 9px 10px;
}

.metric-card span {
  font-size: 10px;
}

.metric-card strong {
  display: inline-block;
  margin-top: 4px;
  font-size: 22px;
}

.metric-card small {
  display: inline-block;
  margin: 0 0 0 6px;
  font-size: 11px;
}

.workflow-grid {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: 284px minmax(420px, 1fr) 300px;
  gap: 10px;
  align-items: stretch;
}

.dashboard-command-bar {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 8px;
}

.dashboard-command-bar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.dashboard-command-bar input {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  padding: 7px 9px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.focus-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.focus-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: baseline;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 10px 12px;
}

.focus-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.focus-card strong {
  grid-row: span 2;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.focus-card small {
  color: var(--muted-strong);
  font-size: 12px;
}

.mode-pill.is-warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: #9a4b13;
}

.dashboard-grid {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  gap: 10px;
  align-items: stretch;
}

.simple-dashboard {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
}

.day-toolbar {
  display: grid;
  grid-template-columns: 190px minmax(240px, 1fr) max-content;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 8px;
}

.day-toolbar label,
.service-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.day-toolbar input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  padding: 7px 9px;
}

.day-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.day-workspace {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: minmax(420px, 1fr) 320px;
  gap: 10px;
  align-items: stretch;
}

.day-workspace.show-filters {
  grid-template-columns: 260px minmax(420px, 1fr) 300px;
}

.dashboard-main-stack,
.dashboard-side-stack {
  display: grid;
  min-height: 0;
  gap: 10px;
}

.dashboard-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 12px;
}

.dashboard-list {
  display: grid;
  gap: 7px;
}

.dashboard-list-item {
  display: grid;
  grid-template-columns: minmax(82px, 0.22fr) minmax(0, 1fr) minmax(110px, auto);
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-left: 4px solid var(--event-color, var(--accent));
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  padding: 8px 9px;
  text-align: left;
}

.dashboard-list-item:hover,
.dashboard-list-item:focus-visible {
  border-color: rgba(15, 159, 143, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
  outline: none;
}

.dashboard-list-item.needs-review {
  border-left-color: var(--amber);
}

.dashboard-list-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list-item > span:not(.dashboard-time):not(.dashboard-tags) {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-time {
  grid-row: span 2;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.3;
}

.dashboard-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.week-grid,
.parser-workspace {
  flex: 1 1 auto;
  min-height: 0;
}

.settings-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 2px 2px 0;
}

.help-layout {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 2px 2px 0;
}

.help-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 12px;
}

.help-priority {
  grid-column: 1 / -1;
}

.help-steps,
.help-list {
  display: grid;
  gap: 7px;
}

.help-steps div,
.help-list div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 8px;
}

.help-list div {
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
}

.help-steps strong,
.help-list strong {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.35;
}

.help-steps strong {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--soft-accent);
  color: var(--accent-dark);
}

.help-steps span,
.help-list span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.filter-panel,
.timeline-panel,
.context-panel {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.filter-panel,
.context-panel,
.timeline-panel,
.settings-panel,
.parser-panel {
  padding: 12px;
}

.filter-panel {
  align-content: start;
  gap: 11px;
}

.filter-header,
.section-heading {
  gap: 8px;
}

.section-heading h2,
.filter-header h2,
.settings-panel h2,
.parser-panel h2 {
  font-size: 15px;
}

.filter-group {
  gap: 6px;
}

.filter-group label,
.editor-row label,
.single-field {
  font-size: 10px;
}

.filter-group input[type="date"],
.filter-group input[type="search"],
.editor-row input,
.single-field input,
.file-control {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.checkbox-grid {
  gap: 4px;
}

.check-row {
  grid-template-columns: 16px 11px minmax(0, 1fr);
  gap: 6px;
  font-size: 12px;
}

.calendar-swatch {
  width: 10px;
  height: 10px;
}

.tag-filter-row,
.chip-row,
.event-tags,
.calendar-name-list,
.security-list {
  gap: 5px;
}

.tag-button {
  min-height: 28px;
  padding: 5px 7px;
}

.active-filters {
  gap: 5px;
}

.active-filters h3 {
  font-size: 11px;
}

.chip {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 11px;
}

.context-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.compact-heading {
  align-items: flex-start;
}

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

.summary-grid span {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
}

.summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.compact-list span,
.calendar-name-list span,
.security-list span {
  padding: 4px 7px;
  font-size: 11px;
}

.context-copy,
.empty-state {
  font-size: 12px;
  line-height: 1.45;
}

.compact-event-list {
  display: grid;
  gap: 6px;
}

.compact-event {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.compact-event strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-event span {
  color: var(--muted);
  font-size: 11px;
}

.compact-empty {
  padding: 10px;
}

.timeline-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 9px;
}

.timeline-header,
.time-row {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
}

.timeline-header {
  font-size: 10px;
}

.timeline-list,
.event-stack {
  gap: 7px;
}

.time-label {
  font-size: 11px;
}

.event-card {
  border-left-width: 4px;
  padding: 8px 10px;
}

.event-card h3 {
  margin-top: 4px;
  font-size: 14px;
}

.event-meta {
  gap: 6px;
  font-size: 10px;
}

.event-tags {
  margin-top: 6px;
}

.tag {
  min-height: 20px;
  padding: 2px 6px;
  font-size: 10px;
}

.warnings {
  margin-top: 6px;
  padding-left: 14px;
  font-size: 10px;
  line-height: 1.35;
}

.all-day {
  gap: 6px;
  padding: 8px;
}

.week-grid {
  min-height: 0;
}

.week-day {
  min-height: 0;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 10px;
}

.parser-workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 10px;
}

.parser-editors,
.parser-utility {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 10px;
  overflow: auto;
  overscroll-behavior: contain;
}

.parser-panel {
  gap: 10px;
}

.compact-panel {
  padding: 12px;
}

.code-editor,
.tag-editor {
  gap: 7px;
}

.editor-row {
  grid-template-columns: 72px minmax(120px, 1fr) minmax(110px, 0.9fr) 34px;
  gap: 6px;
  padding: 7px;
}

.tag-row {
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1.3fr) 34px;
}

.icon-button {
  width: 34px;
  min-width: 34px;
  height: 32px;
}

.button-row {
  gap: 6px;
}

.parser-textarea {
  min-height: 116px;
  max-height: 160px;
  padding: 8px;
  font-size: 11px;
}

.example-list {
  gap: 6px;
}

.example-card {
  padding: 8px;
}

.example-card span {
  margin-top: 4px;
  font-size: 11px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.public-help-shell {
  min-height: 100vh;
  background: var(--surface);
  padding: 14px;
}

.public-help-frame {
  width: min(1120px, 100%);
  height: calc(100vh - 28px);
  margin: 0 auto;
}

.public-help-stack {
  height: 100%;
}

.auth-card {
  display: grid;
  width: min(520px, 100%);
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.profile-auth-card {
  width: min(620px, 100%);
}

.auth-brand {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.auth-copy h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.auth-copy p:last-child {
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.5;
}

.auth-status-card,
.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 10px 12px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
}

.auth-status-card {
  justify-content: flex-start;
}

.loading-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--control-bg) 78%, var(--panel-bg));
  padding: 13px;
}

.loading-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loading-panel-head div {
  display: grid;
  gap: 2px;
}

.loading-panel-head strong {
  color: var(--text);
  font-size: 14px;
}

.loading-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.loading-progress {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 64%, transparent);
}

.loading-progress span {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2f6fed);
  animation: loading-slide 1.45s ease-in-out infinite;
}

.loading-steps {
  display: grid;
  gap: 7px;
}

.loading-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 8px;
}

.loading-step > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 860;
}

.loading-step.is-active > span {
  background: var(--accent);
  color: #ffffff;
}

.loading-step strong,
.loading-step small {
  display: block;
}

.loading-step strong {
  color: var(--text);
  font-size: 12px;
}

.loading-step small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

@keyframes loading-slide {
  0% {
    transform: translateX(-120%);
  }

  50% {
    transform: translateX(55%);
  }

  100% {
    transform: translateX(235%);
  }
}

.auth-foot span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

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

.calendar-view-bar,
.month-summary,
.help-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 8px;
}

.view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 3px;
}

.view-tabs a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  color: var(--muted-strong);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 760;
}

.view-tabs a.is-active {
  background: var(--soft-accent);
  color: var(--accent-dark);
}

.calendar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.calendar-nav strong {
  min-width: 220px;
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.week-day.is-today,
.month-day.is-today {
  border-color: rgba(15, 159, 143, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
}

.month-summary {
  grid-template-columns: max-content minmax(280px, 460px) max-content;
  justify-content: space-between;
}

.month-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.month-grid {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  overflow: auto;
  overscroll-behavior: contain;
}

.month-weekday {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 7px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.month-day {
  display: grid;
  min-width: 0;
  min-height: 154px;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 8px;
  contain: paint;
  overflow: hidden;
}

.month-day.is-outside {
  opacity: 0.58;
}

.month-day-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.month-day-head a {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--soft-accent);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 820;
}

.month-day-head span,
.month-more {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-capacity {
  min-width: 0;
}

.month-event-list,
.appointment-sections {
  display: grid;
  gap: 7px;
}

.month-event-list {
  min-width: 0;
  align-content: start;
  overflow: visible;
}

.month-event-list .mini-event {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 3px 6px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 5px 6px;
}

.month-event-list .mini-event span,
.month-event-list .mini-event small,
.month-event-list .mini-event strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-event-list .mini-event span {
  grid-column: 1;
}

.month-event-list .mini-event strong {
  grid-column: 2;
}

.month-event-list .mini-event small {
  display: none;
}

.appointment-sections {
  gap: 10px;
}

.appointment-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--control-bg) 74%, var(--panel-bg));
  padding: 12px;
}

.appointment-section-primary {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}

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

.appointment-section-title {
  display: grid;
  gap: 2px;
}

.appointment-section-title strong {
  color: var(--text);
  font-size: 14px;
}

.appointment-toggle-row {
  align-self: end;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: 7px 9px;
}

.appointment-grid em,
.appointment-section em {
  color: var(--danger);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.has-error input,
.has-error select,
.has-error textarea {
  border-color: var(--danger);
}

.field-error,
.field-hint {
  color: var(--danger);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
  text-transform: none;
}

.field-hint {
  color: var(--muted);
}

.appointment-action-bar {
  align-items: center;
  position: sticky;
  bottom: -14px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  margin: 0 -14px -14px;
}

.appointment-action-bar > span em {
  color: var(--danger);
  font-style: normal;
  font-weight: 900;
}

.admission-heading span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admission-inline-message {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  color: var(--muted-strong);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 720;
}

.admission-inline-message.is-loading {
  color: var(--accent-dark);
}

.admission-actions {
  justify-content: flex-end;
}

.help-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.help-toolbar input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  padding: 7px 9px;
}

@media (max-width: 1100px) {
  .app-shell {
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-meta {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }

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

  .setup-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .overview-grid,
  .dashboard-grid,
  .day-workspace,
  .day-workspace.show-filters,
  .workflow-grid,
  .week-workspace.has-detail,
  .calendar-view-bar,
  .help-toolbar,
  .help-layout,
  .service-layout,
  .parser-workspace {
    grid-template-columns: 1fr;
  }

  .service-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .app-main {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .page-stack {
    height: auto;
  }

  .filter-panel,
  .timeline-panel,
  .context-panel,
  .dashboard-panel,
  .detail-panel,
  .settings-grid,
  .help-layout,
  .service-list,
  .service-detail,
  .parser-editors,
  .parser-utility {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .app-main {
    padding: 12px 10px 18px;
  }

  .sidebar {
    gap: 8px;
    padding: 10px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .brand strong {
    font-size: 12px;
  }

  .brand small,
  .product-meta {
    display: none;
  }

  .topbar,
  .filter-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .dashboard-command-bar,
  .day-toolbar,
  .calendar-view-bar,
  .help-toolbar,
  .source-toggle {
    width: 100%;
  }

  .dashboard-command-bar,
  .day-toolbar {
    grid-template-columns: 1fr;
  }

  .dashboard-actions,
  .day-toolbar-actions {
    justify-content: stretch;
  }

  .dashboard-actions .capacity-meter-group,
  .day-toolbar-actions .capacity-meter-group,
  .capacity-meter-group,
  .capacity-meter-group.is-compact {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .dashboard-actions > *,
  .day-toolbar-actions > * {
    flex: 1 1 145px;
  }

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

  .view-tabs {
    width: 100%;
  }

  .calendar-nav {
    justify-content: stretch;
  }

  .calendar-nav strong,
  .calendar-nav .ghost-button {
    width: 100%;
    min-width: 0;
  }

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

  .nav-item {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .page-stack {
    gap: 8px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar-actions .auth-status,
  .topbar-actions .mode-pill {
    display: none;
  }

  .setup-banner {
    gap: 8px;
  }

  .setup-banner p {
    display: none;
  }

  .setup-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .setup-strip p {
    display: none;
  }

  .mobile-focus-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    padding: 8px;
  }

  .mobile-focus-strip label,
  .mobile-capacity {
    display: grid;
    min-width: 0;
    gap: 4px;
  }

  .mobile-focus-strip span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
  }

  .mobile-focus-strip input {
    width: 100%;
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--control-bg);
    color: var(--text);
    padding: 6px 8px;
    font-size: 12px;
  }

  .mobile-capacity {
    min-width: 78px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--control-bg);
    padding: 6px 8px;
  }

  .mobile-capacity strong {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-capacity.is-warning {
    border-color: var(--warning-border);
    background: var(--warning-bg);
  }

  .metrics-grid,
  .filter-panel,
  .context-panel:not(.detail-panel),
  .settings-grid,
  .help-layout,
  .parser-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid,
  .filter-panel,
  .context-panel:not(.detail-panel) {
    display: none;
  }

  .day-workspace.show-filters .filter-panel {
    display: grid;
  }

  .service-toolbar,
  .admission-grid,
  .service-notes {
    grid-template-columns: 1fr;
  }

  .focus-row,
  .dashboard-grid,
  .dashboard-main-stack,
  .dashboard-side-stack {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-panel {
    max-height: none;
    overflow: visible;
    padding: 10px;
  }

  .dashboard-list-item {
    grid-template-columns: 1fr;
  }

  .dashboard-time {
    grid-row: auto;
  }

  .dashboard-tags {
    justify-content: flex-start;
  }

  .notice {
    align-items: flex-start;
  }

  .notice-actions {
    margin-left: auto;
  }

  .help-list div {
    grid-template-columns: 1fr;
  }

  .month-summary {
    grid-template-columns: 1fr;
  }

  .month-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .month-day {
    min-height: 76px;
    padding: 5px;
  }

  .month-day-head {
    gap: 2px;
    font-size: 10px;
  }

  .month-event-list {
    gap: 3px;
  }

  .month-capacity .capacity-meter {
    padding: 3px;
  }

  .month-capacity .capacity-meter-head {
    gap: 3px;
  }

  .month-capacity .capacity-meter-head span {
    display: none;
  }

  .month-capacity .capacity-meter-head strong {
    font-size: 9px;
  }

  .month-capacity .capacity-track {
    height: 4px;
  }

  .month-event-list .mini-event {
    border-left-width: 2px;
    padding: 4px 3px;
  }

  .month-event-list .mini-event span,
  .month-event-list .mini-event small {
    display: none;
  }

  .month-event-list .mini-event strong {
    font-size: 10px;
  }

  .service-board,
  .service-layout {
    min-height: 0;
  }

  .admission-grid .wide,
  .readonly-box.wide {
    grid-column: auto;
  }

  .time-row,
  .timeline-header {
    grid-template-columns: 1fr;
  }

  .status-list {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .editor-row,
  .tag-row {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  .auth-status,
  .primary-button,
  .ghost-button,
  .danger-button,
  .mode-pill {
    width: 100%;
  }

  .event-card {
    padding: 8px;
  }

  .event-card h3 {
    font-size: 13px;
  }

  .event-tags .tag:nth-child(n + 5) {
    display: none;
  }

  .detail-panel {
    position: fixed;
    z-index: 40;
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-height: min(72vh, 620px);
    overflow: auto;
    box-shadow: var(--shadow);
  }

  .detail-panel .section-heading {
    align-items: flex-start;
    flex-direction: row;
  }

  .detail-panel .ghost-button,
  .detail-panel .danger-button {
    width: auto;
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .modal-dialog {
    width: 100%;
    max-height: 82vh;
  }

  .modal-dialog .detail-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .modal-dialog .section-heading {
    align-items: flex-start;
    flex-direction: row;
  }

  .modal-dialog .section-heading .ghost-button,
  .modal-dialog .section-heading .danger-button {
    width: auto;
    flex: 0 0 auto;
  }

  .detail-action-row {
    width: 100%;
    justify-content: flex-start;
  }

  .appointment-grid {
    grid-template-columns: 1fr;
  }

  .appointment-section.appointment-grid {
    grid-template-columns: 1fr;
  }

  .appointment-modal-header,
  .appointment-action-bar,
  .public-help-topbar {
    flex-direction: column;
  }

  .appointment-action-bar {
    align-items: stretch;
    bottom: -16px;
  }

  .appointment-action-bar .button-row,
  .auth-toolbar,
  .public-help-topbar .topbar-actions {
    width: 100%;
  }

  .appointment-modal-header .icon-only-button {
    width: 34px;
    align-self: flex-end;
  }

  .sidebar-google-status {
    padding: 7px;
  }

  .public-help-shell {
    padding: 10px;
  }

  .public-help-frame {
    height: auto;
    min-height: calc(100vh - 20px);
  }

  .auth-card {
    padding: 16px;
  }
}

/* FlowCal 0.0.6: capacity-safe, permission-aware calendar workflow */
.calendar-overview-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 360px) max-content max-content;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-bg);
  padding: 12px 14px;
}

.calendar-overview-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.calendar-overview-copy strong {
  font-size: 15px;
}

.calendar-overview-copy small,
.permission-summary {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.permission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.permission-summary span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--control-bg);
  padding: 5px 8px;
}

.week-day,
.month-day {
  border-color: var(--border);
  box-shadow: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.week-day:hover,
.month-day:hover {
  border-color: var(--border-strong);
}

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

.week-day-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.week-day.is-today .week-day-number,
.month-day.is-today .month-day-head a {
  background: var(--blue);
  color: #fff;
}

.month-summary-functional {
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
}

.month-week-capacity-row {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  gap: 6px;
  padding: 2px;
}

.month-week-capacity {
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control-bg);
  padding: 6px 9px;
}

.month-week-capacity span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.month-week-capacity strong {
  font-size: 12px;
}

.month-week-capacity.is-full {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.event-detail-full {
  display: grid;
  gap: 14px;
}

.event-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

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

.detail-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--control-bg);
  padding: 11px;
}

.detail-card .detail-list {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.permission-readonly {
  display: grid;
  gap: 3px;
  border-color: var(--warning-border);
  background: var(--warning-bg);
  padding: 10px 12px;
}

.permission-readonly strong {
  font-size: 13px;
}

.permission-readonly span {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.event-description-full {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.attendee-list {
  display: grid;
  gap: 6px;
}

.attendee-list > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.attendee-list > span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.attendee-list small {
  color: var(--muted);
}

.appointment-suggestion-section {
  border-color: rgba(47, 111, 237, 0.35);
  background: var(--soft-blue);
}

.appointment-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 7px;
}

.suggestion-card {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control-bg);
  padding: 9px 10px;
  color: var(--text);
  text-align: left;
}

.suggestion-card:hover,
.suggestion-card:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.suggestion-card strong {
  font-size: 12px;
}

.suggestion-card span,
.suggestion-card small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 980px) {
  .calendar-overview-bar,
  .month-summary-functional,
  .detail-section-grid {
    grid-template-columns: 1fr;
  }

  .calendar-overview-bar > .primary-button,
  .month-summary-functional > .primary-button {
    justify-self: start;
  }
}

.capacity-meter.is-full {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

/* Densere, Google-Calendar-nahe Raster ohne auf FlowCal-Kapazitätsinfos zu verzichten. */
.week-grid,
.month-grid {
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
}

.week-day,
.month-day,
.month-weekday {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel-bg);
}

.week-day:last-child {
  border-right: 0;
}

.month-weekday {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.month-day {
  min-height: 165px;
}

.mini-event {
  border-radius: 5px;
  box-shadow: none;
}


/* FlowCal user calendar colors */
.calendar-color-field {
  align-self: end;
}
.calendar-color-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.calendar-color-control input[type="color"] {
  width: 54px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--control-bg);
  cursor: pointer;
}
.calendar-color-control strong {
  font-size: 0.82rem;
  color: var(--muted-strong);
  letter-spacing: 0.04em;
}
.calendar-color-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

/* ========================================================================== */
/* FlowCal Workspace UI refresh · Google Workspace inspired                    */
/* ========================================================================== */

:root {
  --bg: #f8fafd;
  --page-bg: #f8fafd;
  --surface: #ffffff;
  --panel-bg: #ffffff;
  --nav-bg: #f8fafd;
  --control-bg: #ffffff;
  --surface-muted: #f1f3f4;
  --soft-accent: #e8f0fe;
  --soft-accent-hover: #dbe7fb;
  --soft-blue: #e8f0fe;
  --soft-danger: #fce8e6;
  --soft-rose: #fce8e6;
  --text: #1f1f1f;
  --muted: #5f6368;
  --muted-strong: #3c4043;
  --border: #dadce0;
  --border-strong: #bdc1c6;
  --accent: #1a73e8;
  --accent-dark: #1558b0;
  --blue: #1a73e8;
  --amber: #f9ab00;
  --rose: #d93025;
  --green: #188038;
  --danger: #d93025;
  --warning-bg: #fef7e0;
  --warning-border: #fdd663;
  --notice-bg: #e8f0fe;
  --notice-border: #aecbfa;
  --notice-text: #174ea6;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.12), 0 1px 3px rgba(60, 64, 67, 0.08);
  --shadow-raised: 0 2px 6px rgba(60, 64, 67, 0.18), 0 1px 2px rgba(60, 64, 67, 0.1);
  --radius: 12px;

  --kd: #1a73e8;
  --kd-soft: #e8f0fe;
  --kd-text: #174ea6;
  --ah: #34a853;
  --ah-soft: #e6f4ea;
  --ah-text: #137333;
  --pf: #f9ab00;
  --pf-soft: #fef7e0;
  --pf-text: #b06000;
}

:root[data-theme="dark"] {
  --bg: #202124;
  --page-bg: #202124;
  --surface: #292a2d;
  --panel-bg: #292a2d;
  --nav-bg: #202124;
  --control-bg: #303134;
  --surface-muted: #3c4043;
  --soft-accent: #394457;
  --soft-accent-hover: #41506a;
  --soft-blue: #394457;
  --soft-danger: #4a2726;
  --soft-rose: #4a2726;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --muted-strong: #bdc1c6;
  --border: #3c4043;
  --border-strong: #5f6368;
  --accent: #8ab4f8;
  --accent-dark: #aecbfa;
  --blue: #8ab4f8;
  --amber: #fdd663;
  --green: #81c995;
  --danger: #f28b82;
  --warning-bg: #443914;
  --warning-border: #6f5b16;
  --notice-bg: #29384f;
  --notice-border: #4e6d98;
  --notice-text: #aecbfa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-raised: 0 2px 8px rgba(0, 0, 0, 0.42);

  --kd: #8ab4f8;
  --kd-soft: #29384f;
  --kd-text: #d2e3fc;
  --ah: #81c995;
  --ah-soft: #253b2b;
  --ah-text: #b7e1c1;
  --pf: #fdd663;
  --pf-soft: #443914;
  --pf-text: #feefc3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #202124;
    --page-bg: #202124;
    --surface: #292a2d;
    --panel-bg: #292a2d;
    --nav-bg: #202124;
    --control-bg: #303134;
    --surface-muted: #3c4043;
    --soft-accent: #394457;
    --soft-accent-hover: #41506a;
    --soft-blue: #394457;
    --soft-danger: #4a2726;
    --soft-rose: #4a2726;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --muted-strong: #bdc1c6;
    --border: #3c4043;
    --border-strong: #5f6368;
    --accent: #8ab4f8;
    --accent-dark: #aecbfa;
    --blue: #8ab4f8;
    --amber: #fdd663;
    --green: #81c995;
    --danger: #f28b82;
    --warning-bg: #443914;
    --warning-border: #6f5b16;
    --notice-bg: #29384f;
    --notice-border: #4e6d98;
    --notice-text: #aecbfa;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-raised: 0 2px 8px rgba(0, 0, 0, 0.42);
    --kd: #8ab4f8;
    --kd-soft: #29384f;
    --kd-text: #d2e3fc;
    --ah: #81c995;
    --ah-soft: #253b2b;
    --ah-text: #b7e1c1;
    --pf: #fdd663;
    --pf-soft: #443914;
    --pf-text: #feefc3;
  }
}

body {
  letter-spacing: 0;
  background: var(--page-bg);
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  gap: 18px;
  border-right: 0;
  background: var(--nav-bg);
  padding: 16px 12px 14px;
}

.brand {
  min-height: 48px;
  padding: 0 8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.brand strong {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.nav-list {
  gap: 2px;
}

.nav-item {
  min-height: 42px;
  border-radius: 0 22px 22px 0;
  padding: 9px 14px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 560;
}

.nav-item:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--soft-accent);
  color: var(--kd-text);
  font-weight: 700;
}

.sidebar-google-status {
  margin: 0 4px;
  border: 0;
  border-radius: 16px;
  background: var(--surface-muted);
  padding: 9px 11px;
}

.product-meta {
  margin-inline: 6px;
  border-top-color: var(--border);
}

.app-main {
  height: 100vh;
  overflow: hidden;
  border-radius: 22px 0 0 0;
  background: var(--surface);
  padding: 18px 22px 22px;
}

.page-stack {
  gap: 14px;
}

.topbar {
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.topbar h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.primary-button,
.ghost-button,
.danger-button,
.tag-button,
.chip-button,
.mode-pill,
.source-toggle button {
  min-height: 36px;
  border-radius: 18px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 620;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: var(--shadow);
}

.ghost-button,
.tag-button,
.chip-button,
.mode-pill {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted-strong);
}

.ghost-button:hover,
.tag-button:hover,
.chip-button:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

input,
select,
textarea {
  border-color: var(--border) !important;
  border-radius: 8px !important;
  background: var(--control-bg) !important;
  box-shadow: none !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* Type language: replaces user/calendar colors in the workflow UI. */
.event-type-kd {
  --event-color: var(--kd);
  --event-soft: var(--kd-soft);
  --event-text: var(--kd-text);
}

.event-type-ah {
  --event-color: var(--ah);
  --event-soft: var(--ah-soft);
  --event-text: var(--ah-text);
}

.event-type-pf {
  --event-color: var(--pf);
  --event-soft: var(--pf-soft);
  --event-text: var(--pf-text);
}

.event-type-other {
  --event-color: #9aa0a6;
  --event-soft: var(--surface-muted);
  --event-text: var(--muted-strong);
}

.appointment-type-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.type-legend-item {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--event-color) 32%, var(--border));
  border-radius: 999px;
  background: var(--event-soft);
  color: var(--event-text);
  padding: 5px 9px;
}

.type-legend-item i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--event-color);
}

.type-legend-item strong {
  font-size: 11px;
  letter-spacing: .02em;
}

.type-legend-item small {
  color: currentColor;
  font-size: 10px;
  opacity: .78;
}

.appointment-type-legend.is-compact .type-legend-item {
  min-height: 26px;
  padding: 4px 8px;
}

.appointment-type-legend.is-compact .type-legend-item small {
  display: none;
}

/* Dashboard */
.dashboard-command-bar {
  grid-template-columns: 220px minmax(0, 1fr);
  border: 0;
  border-radius: 16px;
  background: var(--surface-muted);
  padding: 10px 12px;
  box-shadow: none;
}

.dashboard-command-bar label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .05em;
}

.dashboard-actions {
  align-items: center;
  gap: 8px;
}

.focus-row {
  gap: 10px;
}

.focus-card {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.focus-card::after {
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  content: "";
}

.focus-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
}

.focus-card strong {
  color: var(--text);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.focus-card small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid,
.simple-dashboard {
  gap: 12px;
}

.dashboard-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.section-heading h2 {
  font-weight: 550;
  letter-spacing: -0.02em;
}

.dashboard-list {
  gap: 2px;
}

.dashboard-list-item {
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--event-color);
  border-radius: 0;
  background: transparent;
  padding: 10px 12px;
}

.dashboard-list-item:last-child {
  border-bottom: 0;
}

.dashboard-list-item:hover,
.dashboard-list-item:focus-visible {
  border-color: var(--border);
  border-left-color: var(--event-color);
  background: var(--event-soft);
  box-shadow: none;
}

.dashboard-list-item strong {
  font-size: 13px;
  font-weight: 600;
}

/* Calendar frame and controls */
.calendar-view-bar,
.month-summary,
.help-toolbar,
.day-toolbar {
  border: 0;
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 8px 10px;
}

.calendar-view-bar {
  grid-template-columns: max-content max-content minmax(0, 1fr);
}

.view-tabs {
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.view-tabs a {
  min-height: 32px;
  border-radius: 16px;
  font-weight: 580;
}

.view-tabs a.is-active {
  background: var(--soft-accent);
  color: var(--kd-text);
  font-weight: 700;
}

.calendar-nav strong {
  font-size: 14px;
  font-weight: 560;
}

/* Week / month are closer to Google Calendar: one continuous grid. */
.week-grid,
.month-grid {
  gap: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--border);
  box-shadow: none;
}

.week-day,
.month-day,
.month-weekday {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.week-day:hover,
.month-day:hover {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface) 95%, var(--soft-accent));
}

.week-day.is-today,
.month-day.is-today {
  border-color: var(--border);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.week-day-number,
.month-day-head a {
  background: transparent;
  color: var(--muted-strong);
}

.week-day.is-today .week-day-number,
.month-day.is-today .month-day-head a {
  background: var(--accent);
  color: #fff;
}

.month-weekday {
  color: var(--muted);
  font-weight: 650;
  letter-spacing: .04em;
}

.month-day {
  min-height: 172px;
}

/* Event cards: type is the primary color signal. */
.event-card {
  border: 1px solid color-mix(in srgb, var(--event-color) 32%, var(--border));
  border-left: 5px solid var(--event-color);
  border-radius: 10px;
  background: var(--event-soft);
  color: var(--text);
  box-shadow: none;
}

.event-card:hover,
.event-card:focus-visible,
.event-card.is-selected {
  border-color: var(--event-color);
  background: color-mix(in srgb, var(--event-soft) 84%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--event-color) 16%, transparent);
}

.event-card h3 {
  color: var(--event-text);
  font-weight: 650;
}

.event-card .event-meta {
  color: var(--muted);
}

.mini-event {
  border: 0;
  border-left: 4px solid var(--event-color);
  border-radius: 5px;
  background: var(--event-soft);
  color: var(--event-text);
  box-shadow: none;
}

.mini-event:hover,
.mini-event:focus-visible,
.mini-event.is-selected {
  background: color-mix(in srgb, var(--event-soft) 82%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--event-color);
}

.mini-event strong {
  color: var(--event-text);
  font-weight: 650;
}

.event-type-kd .tag.safe,
.event-type-ah .tag.safe,
.event-type-pf .tag.safe {
  border-color: color-mix(in srgb, var(--event-color) 34%, var(--border));
  background: var(--event-soft);
  color: var(--event-text);
}

/* Timeline and detail panels */
.timeline-panel,
.context-panel,
.detail-card,
.service-board,
.service-detail,
.service-toolbar {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}

.timeline-panel,
.context-panel {
  border-radius: 14px;
}

.timeline-header {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .05em;
}

.time-row {
  border-top-color: var(--border);
}

.time-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
}

.event-detail-full {
  border-top: 5px solid var(--event-color);
}

.event-detail-full .section-heading h2 {
  color: var(--event-text);
}

.detail-card {
  border-radius: 12px;
}

.detail-list span {
  color: var(--muted);
  font-weight: 500;
}

.detail-list strong {
  font-weight: 580;
}

/* Calendar source list is deliberately neutral; colors now mean KD/AH/PF. */
.calendar-swatch {
  width: 10px;
  height: 10px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: transparent !important;
}

/* User-specific calendar color is intentionally not part of the visual system. */
.calendar-color-field,
.calendar-color-control {
  display: none !important;
}

/* Tags become secondary information, not a rainbow. */
.tag {
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 620;
}

.tag.safe {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--muted-strong);
}

.tag.warn,
.tag.overlap {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--pf-text);
}

.tag.ref {
  border-color: color-mix(in srgb, var(--ah) 30%, var(--border));
  background: var(--ah-soft);
  color: var(--ah-text);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .calendar-view-bar {
    grid-template-columns: 1fr;
  }

  .calendar-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-main {
    border-radius: 0;
    padding: 12px;
  }

  .dashboard-command-bar,
  .focus-row,
  .dashboard-grid,
  .simple-dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

  .appointment-type-legend {
    width: 100%;
  }
}

/* Dashboard type cards */
.focus-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.focus-card.event-type-kd,
.focus-card.event-type-ah,
.focus-card.event-type-pf {
  border-top: 4px solid var(--event-color);
}

.focus-card.event-type-kd::after,
.focus-card.event-type-ah::after,
.focus-card.event-type-pf::after {
  background: color-mix(in srgb, var(--event-color) 12%, transparent);
}

.focus-card.event-type-kd strong,
.focus-card.event-type-ah strong,
.focus-card.event-type-pf strong {
  color: var(--event-text);
}

@media (max-width: 1150px) {
  .focus-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .focus-row {
    grid-template-columns: 1fr;
  }
}

/* FlowCal 0.1.0: dynamic startup experience */
.dynamic-loader {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 48%),
    var(--surface);
}

.flow-loader {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 2px auto 18px;
  display: grid;
  place-items: center;
}

.flow-loader-core {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.04em;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 24%, transparent);
  animation: flow-loader-core 2.4s ease-in-out infinite;
}

.flow-loader i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .2;
  transform-origin: 38px 38px;
  animation: flow-loader-orbit 2.4s ease-in-out infinite;
}
.flow-loader i:nth-child(2) { transform: rotate(0deg) translateY(-33px); animation-delay: 0s; }
.flow-loader i:nth-child(3) { transform: rotate(90deg) translateY(-33px); animation-delay: .18s; }
.flow-loader i:nth-child(4) { transform: rotate(180deg) translateY(-33px); animation-delay: .36s; }
.flow-loader i:nth-child(5) { transform: rotate(270deg) translateY(-33px); animation-delay: .54s; }

.dynamic-head {
  justify-content: center;
  text-align: center;
  margin-bottom: 18px;
}
.dynamic-head > div { max-width: 520px; }
.dynamic-head strong { font-size: 1.08rem; }

.loading-track {
  height: 4px;
  width: min(440px, 100%);
  margin: 0 auto 20px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 9%, transparent);
}
.loading-track span {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: flow-loader-track 1.8s cubic-bezier(.4,0,.2,1) infinite;
}

.dynamic-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.dynamic-steps .loading-step {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  opacity: .46;
  animation: flow-step-cycle 4.8s ease-in-out infinite;
  animation-delay: calc(var(--step-index) * 1.2s);
}
.dynamic-steps .loading-step > span {
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.dynamic-steps .loading-step strong,
.dynamic-steps .loading-step small {
  display: block;
}

.loading-live-copy {
  height: 22px;
  margin-top: 16px;
  position: relative;
  text-align: center;
  color: var(--muted);
  font-size: .84rem;
}
.loading-live-copy span {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(5px);
  animation: flow-copy-cycle 4.8s ease-in-out infinite;
}
.loading-live-copy span:nth-child(2) { animation-delay: 1.2s; }
.loading-live-copy span:nth-child(3) { animation-delay: 2.4s; }
.loading-live-copy span:nth-child(4) { animation-delay: 3.6s; }

@keyframes flow-loader-core {
  0%, 100% { transform: scale(1); border-radius: 14px; }
  50% { transform: scale(1.06); border-radius: 18px; }
}
@keyframes flow-loader-orbit {
  0%, 100% { opacity: .18; filter: saturate(.75); }
  35% { opacity: 1; filter: saturate(1.15); }
}
@keyframes flow-loader-track {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(125%); }
  100% { transform: translateX(285%); }
}
@keyframes flow-step-cycle {
  0%, 18% { opacity: 1; background: color-mix(in srgb, var(--accent) 9%, transparent); transform: translateY(-2px); }
  30%, 100% { opacity: .46; background: transparent; transform: translateY(0); }
}
@keyframes flow-copy-cycle {
  0%, 18% { opacity: 1; transform: translateY(0); }
  28%, 100% { opacity: 0; transform: translateY(-5px); }
}

@media (max-width: 720px) {
  .dynamic-loader { padding: 22px 18px; }
  .dynamic-steps { grid-template-columns: 1fr 1fr; }
  .dynamic-steps .loading-step small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-loader-core,
  .flow-loader i,
  .loading-track span,
  .dynamic-steps .loading-step,
  .loading-live-copy span {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .dynamic-steps .loading-step { opacity: 1; }
  .loading-live-copy span:first-child { opacity: 1; transform: none; }
}

/* FlowCal 0.1.0 – setup & help refinement */
.setup-onboarding-shell {
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 30%),
    var(--surface);
  padding: 28px;
}

.setup-onboarding {
  display: grid;
  width: min(1040px, 100%);
  min-height: 610px;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel-bg);
  box-shadow: 0 18px 50px rgba(60, 64, 67, .10);
}

.setup-onboarding-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 22px;
  padding: 28px 32px;
}

.setup-onboarding-main .auth-toolbar { margin-bottom: -6px; }
.setup-brand { padding-bottom: 16px; }

.setup-progress {
  display: grid;
  grid-template-columns: 34px 54px 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
}

.setup-progress > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--control-bg);
  font-size: 12px;
  font-weight: 800;
}

.setup-progress > span svg { width: 16px; height: 16px; }
.setup-progress > span.is-done { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); background: var(--soft-accent); color: var(--accent-dark); }
.setup-progress > span.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.setup-progress > i { height: 1px; background: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.setup-progress > div { display: grid; gap: 2px; }
.setup-progress small { color: var(--muted); font-size: 11px; }
.setup-progress strong { color: var(--text); font-size: 13px; }

.setup-copy { max-width: 640px; }
.setup-copy h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.035em; }
.setup-copy p:last-child { max-width: 620px; }

.profile-setup-form { display: grid; gap: 16px; }
.profile-setup-fields { display: grid; grid-template-columns: 1.55fr .75fr; gap: 12px; }
.field-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-bg) 86%, var(--surface));
  padding: 14px;
}
.field-card .field-title { color: var(--text); font-size: 13px; font-weight: 760; }
.field-card small { min-height: 30px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.field-card input { width: 100%; min-height: 42px; border-radius: 10px; font-size: 14px; }

.profile-inline-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  background: var(--control-bg);
  padding: 10px 12px;
}
.profile-inline-preview > div { display: grid; gap: 2px; }
.profile-inline-preview small { color: var(--muted); font-size: 10px; }
.profile-inline-preview strong { font-size: 12px; }
.setup-save-button { min-height: 40px; padding-inline: 16px; }
.profile-setup-actions { justify-content: flex-start; }

.setup-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.45;
}
.setup-privacy-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--accent); }

.setup-preview-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  border-left: 1px solid var(--border);
  background: color-mix(in srgb, var(--soft-accent) 42%, var(--panel-bg));
  padding: 36px;
}
.setup-preview-panel h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.setup-preview-panel > p:not(.muted-label) { margin: 0; color: var(--muted-strong); font-size: 13px; line-height: 1.5; }
.setup-profile-preview {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 8px 0 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 16px;
  background: var(--panel-bg);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(60,64,67,.07);
}
.setup-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .02em;
}
.setup-avatar.small { width: 32px; height: 32px; font-size: 10px; }
.setup-profile-preview > div { display: grid; gap: 3px; }
.setup-profile-preview strong { font-size: 14px; }
.setup-profile-preview span:not(.setup-avatar) { color: var(--muted); font-size: 11px; font-weight: 700; }
.setup-preview-list { display: grid; gap: 8px; }
.setup-preview-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  padding: 9px 10px;
}
.setup-preview-list svg { width: 18px; height: 18px; color: var(--accent-dark); }
.setup-preview-list span { display: grid; gap: 2px; }
.setup-preview-list strong { font-size: 12px; }
.setup-preview-list small { color: var(--muted); font-size: 10px; }

/* Help center */
.help-page { gap: 12px; }
.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--soft-accent) 54%, var(--panel-bg)), var(--panel-bg) 68%);
  padding: 22px 24px;
}
.help-hero-copy { max-width: 760px; }
.help-hero h1 { margin: 2px 0 5px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.03em; }
.help-hero-copy > p:last-of-type { margin: 0 0 14px; color: var(--muted-strong); font-size: 13px; }
.help-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.help-search-box {
  display: grid;
  max-width: 620px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-bg);
  padding: 7px 10px 7px 13px;
  box-shadow: 0 2px 7px rgba(60,64,67,.08);
}
.help-search-box > svg { width: 18px; height: 18px; color: var(--muted); }
.help-search-box input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.help-search-clear { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.help-search-clear:hover { background: var(--control-bg); color: var(--text); }

.help-topic-strip { display: flex; gap: 7px; overflow-x: auto; padding: 1px 1px 3px; scrollbar-width: thin; }
.help-topic-chip {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-bg);
  color: var(--muted-strong);
  padding: 5px 11px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 720;
}
.help-topic-chip:hover { background: var(--soft-accent); color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 26%, var(--border)); }
.help-result-line { color: var(--muted-strong); font-size: 12px; padding: 0 3px; }

.help-workspace {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: minmax(240px, .72fr) minmax(0, 2.28fr);
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 2px 2px 0;
}
.help-side-card,
.help-topic-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-bg);
}
.help-side-card { display: grid; align-content: start; gap: 12px; padding: 16px; }
.help-side-card h2 { margin: 0; font-size: 18px; }
.help-checklist { display: grid; gap: 4px; }
.help-checklist > div { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.help-checklist > div:last-child { border-bottom: 0; }
.help-checklist > div > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--soft-accent); color: var(--accent-dark); font-size: 10px; font-weight: 800; }
.help-checklist p { display: grid; gap: 2px; margin: 0; }
.help-checklist strong { font-size: 12px; }
.help-checklist small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.help-support-card { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 8px; margin-top: 4px; border-radius: 12px; background: var(--control-bg); padding: 10px; }
.help-support-card > svg { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }
.help-support-card > div { display: grid; gap: 2px; }
.help-support-card strong { font-size: 11px; }
.help-support-card span { color: var(--muted); font-size: 10px; word-break: break-word; }
.help-support-card a { grid-column: 2; color: var(--accent-dark); font-size: 11px; font-weight: 760; }

.help-content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.help-topic-card { display: grid; align-content: start; gap: 12px; padding: 14px; }
.help-card-head { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 10px; align-items: center; }
.help-card-head h2 { margin: 1px 0 0; font-size: 15px; line-height: 1.25; }
.help-card-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--soft-accent); color: var(--accent-dark); }
.help-card-icon svg { width: 17px; height: 17px; }
.help-topic-card .help-list { gap: 0; }
.help-topic-card .help-list > div { grid-template-columns: minmax(105px,.42fr) minmax(0,1fr); border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; padding: 8px 0; }
.help-topic-card .help-list > div:first-child { border-top: 0; }
.help-topic-card .help-list strong { font-size: 11px; }
.help-topic-card .help-list span { color: var(--muted-strong); font-size: 11px; }
.help-card-note { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 7px; border-radius: 10px; background: var(--control-bg); padding: 9px; }
.help-card-note svg { width: 15px; height: 15px; color: var(--accent); }
.help-card-note p { margin: 0; color: var(--muted-strong); font-size: 10px; line-height: 1.4; }
.help-empty-state { grid-column: 1 / -1; display: grid; min-height: 260px; place-items: center; align-content: center; gap: 8px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted-strong); text-align: center; padding: 24px; }
.help-empty-state > svg { width: 28px; height: 28px; }
.help-empty-state h2, .help-empty-state p { margin: 0; }
.help-empty-state p { font-size: 12px; }

.public-help-shell { padding: 20px; }
.public-help-frame { width: min(1180px, 100%); height: calc(100vh - 40px); }

@media (max-width: 900px) {
  .setup-onboarding { grid-template-columns: 1fr; }
  .setup-preview-panel { border-top: 1px solid var(--border); border-left: 0; padding: 24px 28px; }
  .help-workspace { grid-template-columns: 1fr; }
  .help-content-grid { grid-template-columns: 1fr; }
  .help-side-card { order: 2; }
}

@media (max-width: 640px) {
  .setup-onboarding-shell { padding: 10px; align-items: start; }
  .setup-onboarding { min-height: 0; border-radius: 18px; }
  .setup-onboarding-main { padding: 18px; gap: 17px; }
  .setup-preview-panel { padding: 20px 18px; }
  .profile-setup-fields { grid-template-columns: 1fr; }
  .setup-progress { grid-template-columns: 30px 30px 30px minmax(0,1fr); }
  .setup-progress > span { width: 30px; height: 30px; }
  .help-hero { grid-template-columns: 1fr; gap: 14px; padding: 17px; }
  .help-hero-actions { justify-content: flex-start; }
  .public-help-shell { padding: 8px; }
  .public-help-frame { height: calc(100vh - 16px); }
}

/* 0.1.0 setup/help refinement */
.setup-onboarding-shell {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.setup-simple-card {
  width: min(100%, 700px);
  display: grid;
  gap: 22px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 38px rgba(60,64,67,.10);
}
.setup-simple-card .auth-toolbar { margin: 0 0 -4px; }
.setup-simple-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.setup-step-pill {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px;
  border-radius: 999px; background: var(--soft-accent); color: var(--accent-dark);
  font-size: 12px; font-weight: 700;
}
.setup-status-line {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 14px; background: color-mix(in srgb, #34a853 9%, var(--surface));
  border: 1px solid color-mix(in srgb, #34a853 22%, var(--border));
}
.setup-status-line > div { display: grid; gap: 2px; }
.setup-status-line strong { font-size: 13px; }
.setup-status-line small { color: var(--muted); font-size: 11px; }
.setup-status-check { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #34a853; color: #fff; }
.setup-status-check svg { width: 17px; height: 17px; }
.setup-simple-card .setup-copy { max-width: 600px; }
.setup-simple-card .setup-copy h1 { font-size: clamp(25px,4vw,34px); margin-bottom: 8px; }
.setup-identity-preview {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-subtle);
}
.setup-identity-preview > div { display: grid; gap: 1px; min-width: 0; }
.setup-identity-preview > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.setup-identity-preview > div span, .setup-identity-preview > small { color: var(--muted); font-size: 11px; }
.setup-simple-note { display: flex; align-items: center; gap: 9px; color: var(--muted-strong); font-size: 12px; }
.setup-simple-note svg { width: 17px; height: 17px; color: var(--accent-dark); flex: 0 0 auto; }

.help-center-head {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px;
  padding: 22px 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
}
.help-center-head h1 { margin: 2px 0 0; font-size: clamp(25px,3vw,34px); letter-spacing: -.035em; }
.help-center-actions { display: flex; align-items: flex-start; gap: 8px; }
.help-search-primary { grid-column: 1 / -1; max-width: none; min-height: 48px; border-radius: 14px; background: var(--surface-subtle); }
.help-center-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 18px; align-items: start; }
.help-category-nav {
  position: sticky; top: 18px; display: grid; gap: 4px; padding: 12px;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
}
.help-category-nav > .muted-label { padding: 6px 10px 4px; }
.help-category-link {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600;
}
.help-category-link:hover, .help-category-link.is-active { background: var(--soft-accent); color: var(--accent-dark); }
.help-category-link span { width: 22px; height: 22px; display: grid; place-items: center; }
.help-category-link svg { width: 16px; height: 16px; }
.help-category-support { display: grid; gap: 5px; margin-top: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--border); }
.help-category-support strong { font-size: 12px; }
.help-category-support span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.help-category-support a { margin-top: 3px; color: var(--accent-dark); font-size: 11px; font-weight: 700; text-decoration: none; word-break: break-word; }
.help-center-content { min-width: 0; display: grid; gap: 10px; }
.help-intro-line, .help-result-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 2px 8px; }
.help-intro-line strong { font-size: 14px; }
.help-intro-line span { color: var(--muted); font-size: 11px; }
.help-article-list { display: grid; gap: 10px; }
.help-article-list .help-topic-card { border-radius: 16px; box-shadow: none; }
.help-article-list .help-topic-card .help-list > div { grid-template-columns: minmax(120px,.36fr) minmax(0,1fr); }

@media (max-width: 820px) {
  .help-center-layout { grid-template-columns: 1fr; }
  .help-category-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .help-category-nav > .muted-label, .help-category-support { display: none; }
  .help-category-link { width: auto; flex: 0 0 auto; padding: 0 11px; }
  .help-center-head { grid-template-columns: 1fr; padding: 18px; }
  .help-center-actions { grid-row: 3; }
  .help-search-primary { grid-column: 1; }
}
@media (max-width: 560px) {
  .setup-onboarding-shell { padding: 10px; align-items: start; }
  .setup-simple-card { padding: 18px; gap: 18px; border-radius: 18px; }
  .setup-simple-head { align-items: flex-start; }
  .setup-step-pill { font-size: 10px; }
  .setup-identity-preview { grid-template-columns: auto minmax(0,1fr); }
  .setup-identity-preview > small { grid-column: 2; }
  .help-center-actions { flex-wrap: wrap; }
  .help-article-list .help-topic-card .help-list > div { grid-template-columns: 1fr; gap: 3px; }
}

/* FlowCal 0.1.0 – compact loader + setup/system refinement */
.compact-event-meta {
  justify-content: flex-start;
}

.minimal-loader {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px 28px 20px;
  text-align: center;
  background: var(--surface);
}
.minimal-loader-brand {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.04em;
}
.minimal-loader > strong {
  font-size: .98rem;
  font-weight: 680;
}
.minimal-loading-track {
  position: relative;
  width: min(260px, 72vw);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 9%, transparent);
}
.minimal-loading-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: var(--accent);
  animation: minimal-loader-track 1.5s cubic-bezier(.4,0,.2,1) infinite;
}
.minimal-loading-copy {
  position: relative;
  width: 240px;
  height: 18px;
  color: var(--muted);
  font-size: .78rem;
}
.minimal-loading-copy span {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: minimal-loader-copy 4.2s ease-in-out infinite;
}
.minimal-loading-copy span:nth-child(2) { animation-delay: 1.4s; }
.minimal-loading-copy span:nth-child(3) { animation-delay: 2.8s; }
@keyframes minimal-loader-track {
  0% { transform: translateX(-110%); }
  60% { transform: translateX(170%); }
  100% { transform: translateX(300%); }
}
@keyframes minimal-loader-copy {
  0%, 24% { opacity: 1; transform: translateY(0); }
  33%, 100% { opacity: 0; transform: translateY(-3px); }
}

.setup-page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--surface);
}
.setup-page-card {
  width: min(620px, 100%);
  display: grid;
  gap: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel-bg);
  padding: 24px 28px 22px;
  box-shadow: 0 12px 34px rgba(60,64,67,.08);
}
.setup-page-card .auth-toolbar {
  margin: 0 0 -4px;
}
.setup-page-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.setup-page-brand > div {
  display: grid;
  gap: 1px;
}
.setup-page-brand strong {
  font-size: 14px;
}
.setup-page-brand span {
  color: var(--muted);
  font-size: 11px;
}
.setup-page-header {
  display: grid;
  gap: 7px;
}
.setup-kicker {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.setup-page-header h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -.035em;
}
.setup-page-header p {
  max-width: 560px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}
.setup-connection-row {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--control-bg);
  padding: 11px 13px;
}
.setup-connection-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--panel-bg);
}
.setup-connection-icon svg { width: 18px; height: 18px; }
.setup-connection-row > div { display: grid; gap: 2px; }
.setup-connection-row strong { font-size: 12px; }
.setup-connection-row small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot.is-online { background: #34a853; }
.setup-page-form-wrap .profile-inline-preview { display: none; }
.setup-page-form-wrap .profile-setup-fields { grid-template-columns: minmax(0,1fr) 140px; }
.setup-page-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.setup-page-foot {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.system-page { gap: 16px; }
.system-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  padding: 10px 2px 20px;
}
.system-hero h1 {
  margin: 2px 0 6px;
  font-size: clamp(26px, 3.6vw, 36px);
  letter-spacing: -.035em;
}
.system-hero p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
}
.system-health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-bg);
  padding: 8px 12px;
  font-size: 12px;
}
.system-health span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.system-health.is-online span { background: #34a853; }
.system-health.is-offline span { background: #ea4335; }
.system-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}
.system-overview-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr);
  gap: 12px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-bg);
  padding: 15px;
}
.system-card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--control-bg);
  color: var(--accent-dark);
}
.system-card-icon svg { width: 19px; height: 19px; }
.system-card-copy { min-width: 0; display: grid; gap: 2px; }
.system-card-copy > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.system-card-copy strong { font-size: 14px; }
.system-card-copy small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.system-card-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 4px;
}
.system-card-actions button { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.system-profile-panel,
.system-flags-panel {
  box-shadow: none;
}

@media (max-width: 840px) {
  .system-overview-grid { grid-template-columns: 1fr; }
  .system-hero { align-items: flex-start; }
}
@media (max-width: 620px) {
  .setup-page-shell { padding: 0; align-items: stretch; }
  .setup-page-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 18px;
    box-shadow: none;
  }
  .setup-page-form-wrap .profile-setup-fields { grid-template-columns: 1fr; }
  .system-hero { flex-direction: column; gap: 12px; }
  .system-health { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .minimal-loading-track span,
  .minimal-loading-copy span {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .minimal-loading-copy span:first-child { opacity: 1; transform: none; }
}

/* FlowCal 0.1.0 – setup/help scrolling fix */
/* The main workspace intentionally stays viewport-locked. Setup and Help own their scrolling. */
.system-page,
.help-page {
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
  padding-bottom: 28px;
}

/* The nested help workspace must be allowed to grow naturally when the page itself scrolls. */
.help-page .help-workspace,
.help-page .help-center-layout {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

/* Public help is outside the normal app shell, so the browser/page itself becomes the scroll area. */
.public-help-shell {
  height: 100dvh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.public-help-frame {
  height: auto;
  min-height: calc(100dvh - 28px);
}

.public-help-stack {
  height: auto;
  min-height: 100%;
  overflow: visible;
  padding-bottom: 28px;
}

/* First-login setup may exceed the viewport on small laptops/mobile. */
.setup-page-shell,
.setup-onboarding-shell {
  height: 100dvh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  align-items: start;
}

.setup-page-card,
.setup-onboarding {
  margin-block: auto;
}

@media (max-height: 760px) {
  .setup-page-shell,
  .setup-onboarding-shell {
    place-items: start center;
  }

  .setup-page-card,
  .setup-onboarding {
    margin-block: 12px 28px;
  }
}

@media (max-width: 620px) {
  .system-page,
  .help-page {
    padding-right: 0;
    padding-bottom: 80px;
  }

  .setup-page-shell,
  .setup-onboarding-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .setup-page-card,
  .setup-onboarding {
    margin: 0;
    min-height: 100dvh;
  }

  .public-help-shell {
    padding: 10px;
  }

  .public-help-frame {
    min-height: calc(100dvh - 20px);
  }
}

/* Appointment workflow redesign */
.appointment-workflow-form {
  width: min(980px, calc(100vw - 32px));
  max-width: 980px;
}

.appointment-workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  align-items: start;
}

.appointment-main-column,
.appointment-side-column {
  display: grid;
  gap: 10px;
}

.appointment-side-column {
  position: sticky;
  top: 0;
}

.appointment-type-section {
  padding-bottom: 14px;
}

.appointment-type-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.appointment-type-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 1px 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-bg);
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.appointment-type-option > strong {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--control-bg);
  font-size: 12px;
}

.appointment-type-option > span {
  font-size: 13px;
  font-weight: 760;
}

.appointment-type-option > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-type-option.is-active {
  border-color: currentColor;
  box-shadow: 0 0 0 1px currentColor inset;
}

.appointment-type-option.type-kd.is-active { color: var(--type-kd, #1a73e8); background: color-mix(in srgb, var(--type-kd, #1a73e8) 8%, var(--panel-bg)); }
.appointment-type-option.type-ah.is-active { color: var(--type-ah, #188038); background: color-mix(in srgb, var(--type-ah, #188038) 8%, var(--panel-bg)); }
.appointment-type-option.type-pf.is-active { color: var(--type-pf, #e37400); background: color-mix(in srgb, var(--type-pf, #e37400) 8%, var(--panel-bg)); }

.appointment-title-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-radius: 9px;
  background: var(--control-bg);
  padding: 8px 10px;
}

.appointment-title-preview span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.appointment-title-preview strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prefix-input {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  overflow: hidden;
}

.prefix-input > span {
  display: grid;
  place-items: center;
  height: 100%;
  background: var(--control-bg);
  color: var(--muted-strong);
  font-weight: 800;
}

.prefix-input input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.appointment-date-shortcuts,
.appointment-duration-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.appointment-duration-row > span {
  margin-right: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.chip-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-bg);
  color: var(--muted-strong);
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.chip-button:hover,
.chip-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel-bg));
  color: var(--accent-dark);
}

.appointment-capacity-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--type-kd, #1a73e8) 22%, var(--border));
  border-radius: 10px;
  background: var(--border);
}

.appointment-capacity-strip > div {
  display: grid;
  gap: 2px;
  background: color-mix(in srgb, var(--type-kd, #1a73e8) 5%, var(--panel-bg));
  padding: 9px 10px;
}

.appointment-capacity-strip span {
  color: var(--muted);
  font-size: 10px;
}

.appointment-capacity-strip strong {
  font-size: 13px;
}

.appointment-capacity-strip.is-warning {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

.appointment-calendar-section select {
  width: 100%;
}

.appointment-summary-card {
  position: relative;
  overflow: hidden;
  gap: 7px;
}

.appointment-summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--type-kd, #1a73e8);
}

.appointment-summary-card.type-ah::before { background: var(--type-ah, #188038); }
.appointment-summary-card.type-pf::before { background: var(--type-pf, #e37400); }

.appointment-summary-card > strong {
  font-size: 17px;
}

.appointment-summary-card > span,
.appointment-summary-card > small {
  color: var(--muted-strong);
  font-size: 11px;
}

.appointment-summary-time {
  display: grid;
  gap: 1px;
  margin-top: 3px;
}

.appointment-summary-time b {
  font-size: 12px;
}

.appointment-summary-time span {
  color: var(--muted);
  font-size: 11px;
}

.appointment-note-section textarea {
  min-height: 84px;
}

@media (max-width: 820px) {
  .appointment-workflow-form {
    width: 100%;
  }

  .appointment-workflow-grid {
    grid-template-columns: 1fr;
  }

  .appointment-side-column {
    position: static;
  }

  .appointment-type-picker {
    grid-template-columns: 1fr;
  }

  .appointment-type-option {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
  }

  .appointment-type-option > strong {
    grid-row: 1;
  }

  .appointment-type-option > small {
    display: none;
  }

  .appointment-capacity-strip {
    grid-template-columns: 1fr;
  }
}

/* 0.1.0 appointment viewport safety: never require horizontal scrolling */
.modal-dialog:has(.appointment-workflow-form) {
  width: min(980px, calc(100vw - 32px));
  overflow-x: clip;
}

.appointment-workflow-form,
.appointment-workflow-grid,
.appointment-main-column,
.appointment-side-column,
.appointment-section,
.appointment-grid,
.appointment-time-grid,
.appointment-type-picker,
.appointment-capacity-strip,
.appointment-suggestions,
.appointment-action-bar,
.appointment-modal-header,
.appointment-title-preview,
.appointment-summary-card,
.prefix-input {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.appointment-workflow-form {
  width: 100%;
  overflow-x: clip;
}

.appointment-section input,
.appointment-section select,
.appointment-section textarea,
.appointment-section button,
.appointment-grid input,
.appointment-grid select,
.appointment-grid textarea {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.appointment-modal-header > div,
.appointment-action-bar > span,
.appointment-section-title,
.appointment-section-title > span,
.appointment-summary-card,
.appointment-summary-card > strong,
.appointment-summary-card > span,
.appointment-summary-card > small,
.suggestion-card,
.suggestion-card > strong,
.suggestion-card > span,
.suggestion-card > small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.appointment-title-preview {
  flex-wrap: wrap;
}

.appointment-title-preview strong {
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.appointment-date-shortcuts,
.appointment-duration-row,
.appointment-action-bar .button-row {
  max-width: 100%;
  flex-wrap: wrap;
}

.appointment-date-shortcuts .chip-button,
.appointment-duration-row .chip-button,
.appointment-action-bar .button-row > * {
  flex: 0 1 auto;
  min-width: 0;
}

.appointment-suggestions {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}

@media (max-width: 860px) {
  .modal-backdrop {
    padding: 10px;
  }

  .modal-dialog:has(.appointment-workflow-form) {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

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

  .appointment-side-column {
    position: static;
  }

  .appointment-type-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal-dialog:has(.appointment-workflow-form) {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .appointment-workflow-form {
    padding-inline: 12px;
  }

  .appointment-type-picker,
  .appointment-grid,
  .appointment-time-grid,
  .appointment-capacity-strip,
  .appointment-suggestions {
    grid-template-columns: minmax(0, 1fr);
  }

  .appointment-type-option {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .appointment-type-option > strong {
    grid-row: 1 / 3;
  }

  .appointment-type-option > small {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .appointment-modal-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .appointment-modal-header .icon-only-button {
    align-self: start;
  }

  .appointment-action-bar {
    align-items: stretch;
  }

  .appointment-action-bar .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .appointment-action-bar .button-row > button {
    width: 100%;
  }
}

/* FlowCal notification banner system */
.notification-banner {
  position: fixed;
  z-index: 4000;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: min(430px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 4px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 14px 38px rgba(32, 33, 36, 0.16), 0 2px 8px rgba(32, 33, 36, 0.08);
  color: var(--text);
  padding: 12px 12px 12px 0;
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  transform-origin: top right;
  animation: flowcal-notification-in 360ms cubic-bezier(.2,.8,.2,1) both;
}

.notification-accent {
  align-self: stretch;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #1a73e8;
}

.notification-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1967d2;
}

.notification-svg {
  width: 18px;
  height: 18px;
}

.notification-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.notification-copy strong {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
  letter-spacing: .01em;
}

.notification-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.notification-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notification-help,
.notification-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.notification-help {
  padding: 0 9px;
  color: #1967d2;
  font-size: 12px;
  font-weight: 700;
}

.notification-close {
  width: 32px;
  padding: 0;
  cursor: pointer;
}

.notification-help:hover,
.notification-close:hover {
  background: var(--surface-muted);
}

.notification-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  background: #1a73e8;
  opacity: .7;
  animation: flowcal-notification-progress 4.5s linear forwards;
}

.notification-success .notification-accent,
.notification-success .notification-progress { background: #188038; }
.notification-success .notification-icon { background: #e6f4ea; color: #137333; }

.notification-warning .notification-accent,
.notification-warning .notification-progress { background: #f9ab00; }
.notification-warning .notification-icon { background: #fef7e0; color: #b06000; }
.notification-warning .notification-progress { animation-duration: 6.5s; }

.notification-error .notification-accent,
.notification-error .notification-progress { background: #d93025; }
.notification-error .notification-icon { background: #fce8e6; color: #c5221f; }
.notification-error .notification-progress { animation-duration: 8s; }

.notification-info .notification-accent,
.notification-info .notification-progress { background: #1a73e8; }

[data-theme="dark"] .notification-banner {
  background: color-mix(in srgb, #202124 94%, transparent);
  border-color: #3c4043;
  box-shadow: 0 16px 42px rgba(0,0,0,.4);
}
[data-theme="dark"] .notification-success .notification-icon { background: #1e3a29; color: #81c995; }
[data-theme="dark"] .notification-warning .notification-icon { background: #3d3217; color: #fdd663; }
[data-theme="dark"] .notification-error .notification-icon { background: #442321; color: #f28b82; }
[data-theme="dark"] .notification-info .notification-icon { background: #263850; color: #8ab4f8; }
[data-theme="dark"] .notification-help { color: #8ab4f8; }

@keyframes flowcal-notification-in {
  from { opacity: 0; transform: translate3d(14px,-10px,0) scale(.985); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}

@keyframes flowcal-notification-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 680px) {
  .notification-banner {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    width: auto;
    grid-template-columns: 4px 34px minmax(0, 1fr) auto;
    gap: 9px;
    border-radius: 16px;
  }
  .notification-actions { gap: 0; }
  .notification-help { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-banner,
  .notification-progress {
    animation: none !important;
  }
}

/* FlowCal 0.1.1 – Admin diagnostics */
.admin-diagnostics-panel {
  box-shadow: none;
}
.admin-diagnostics-heading {
  align-items: flex-start;
  gap: 16px;
}
.admin-diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.admin-diagnostics-empty {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--control-bg);
  padding: 16px;
}
.admin-diagnostics-empty > div:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.admin-diagnostics-empty strong { font-size: 13px; }
.admin-diagnostics-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.admin-diagnostics-content {
  display: grid;
  gap: 14px;
}
.admin-diagnostics-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--control-bg);
  padding: 14px;
}
.admin-diagnostics-summary > div:first-child {
  display: grid;
  gap: 6px;
}
.admin-diagnostics-summary small {
  color: var(--muted);
  font-size: 10px;
}
.diagnostic-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
}
.diagnostic-status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.diagnostic-status.is-ok > span { background: #34a853; }
.diagnostic-status.is-error > span { background: #ea4335; }
.diagnostic-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, auto));
  gap: 8px;
}
.diagnostic-mini-grid span {
  display: grid;
  gap: 1px;
  min-width: 72px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
  color: var(--muted);
  font-size: 9px;
}
.diagnostic-mini-grid strong {
  color: var(--text);
  font-size: 16px;
  letter-spacing: -.02em;
}
.diagnostic-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.diagnostic-check {
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-bg);
  padding: 12px;
}
.diagnostic-check-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--muted);
}
.diagnostic-check.is-ok .diagnostic-check-dot { background: #34a853; }
.diagnostic-check.is-error .diagnostic-check-dot { background: #ea4335; }
.diagnostic-check > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.diagnostic-check strong { font-size: 11px; }
.diagnostic-check small {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.diagnostic-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.diagnostic-detail-grid article {
  min-width: 0;
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  padding: 9px 2px 11px;
}
.diagnostic-detail-grid article > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.diagnostic-detail-grid strong { font-size: 12px; }
.diagnostic-detail-grid small {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.diagnostic-raw-details {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--control-bg);
  overflow: hidden;
}
.diagnostic-raw-details summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 13px;
  font-size: 11px;
  font-weight: 700;
}
.diagnostic-raw-details summary::-webkit-details-marker { display: none; }
.diagnostic-raw-details pre {
  max-height: 320px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--border);
  padding: 13px;
  color: var(--muted-strong);
  font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 980px) {
  .diagnostic-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostic-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-diagnostics-summary { align-items: flex-start; flex-direction: column; }
  .diagnostic-mini-grid { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .admin-diagnostics-heading { flex-direction: column; }
  .admin-diagnostics-actions { width: 100%; justify-content: stretch; }
  .admin-diagnostics-actions button { flex: 1 1 auto; }
  .diagnostic-check-grid,
  .diagnostic-detail-grid { grid-template-columns: 1fr; }
  .diagnostic-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostic-mini-grid span:nth-child(3) { border-left: 0; padding-left: 0; }
}

/* 0.1.1 UI consistency pass: form controls and text contrast */
:root {
  color-scheme: light;
  --field-bg: var(--control-bg);
  --field-text: var(--text);
  --field-placeholder: var(--muted);
  --field-disabled-bg: color-mix(in srgb, var(--surface-muted) 72%, var(--control-bg));
  --field-disabled-text: var(--muted);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  }
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
textarea,
select {
  background-color: var(--field-bg) !important;
  color: var(--field-text) !important;
  caret-color: var(--field-text);
  border-color: var(--border) !important;
  -webkit-text-fill-color: var(--field-text);
  opacity: 1;
}

input::placeholder,
textarea::placeholder {
  color: var(--field-placeholder) !important;
  -webkit-text-fill-color: var(--field-placeholder);
  opacity: .82;
}

select option,
select optgroup {
  background: var(--control-bg);
  color: var(--text);
}

input:disabled,
textarea:disabled,
select:disabled,
input[readonly],
textarea[readonly] {
  background-color: var(--field-disabled-bg) !important;
  color: var(--field-disabled-text) !important;
  -webkit-text-fill-color: var(--field-disabled-text) !important;
  opacity: 1 !important;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent) !important;
  outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent) !important;
  outline-offset: 1px;
}

/* Prevent browser autofill from forcing a bright field with dark-mode text. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--field-text) !important;
  caret-color: var(--field-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--field-bg) inset !important;
  transition: background-color 9999s ease-out 0s;
}

/* Native date/time controls otherwise keep light-mode chrome in some browsers. */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  color-scheme: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: .72;
  cursor: pointer;
}

/* Search and file controls should visually behave like every other field. */
input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

input[type="file"] {
  color: var(--muted-strong) !important;
}

input[type="file"]::file-selector-button {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 9px;
  margin-right: 9px;
  font: inherit;
  cursor: pointer;
}

/* Keep labels/help copy readable without competing with entered values. */
label,
.field-title,
.form-label {
  text-wrap: pretty;
}

.readonly-box,
.output-box,
.code-output,
.parser-textarea,
.file-control {
  color: var(--text);
}

.muted,
.field-help,
.field-hint,
.form-hint {
  color: var(--muted);
}

/* Prefix fields had a different panel background than their actual input. */
.prefix-input {
  background: var(--field-bg);
}

.prefix-input > span {
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted-strong);
}

.prefix-input input {
  background: var(--field-bg) !important;
  color: var(--field-text) !important;
}

/* Help search is intentionally borderless inside its shell, but text still follows theme. */
.help-search-box input {
  background: transparent !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}

.help-search-box input::placeholder {
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
}

/* Validation must remain legible in both themes. */
.has-error input,
.has-error select,
.has-error textarea {
  border-color: var(--danger) !important;
}

.has-error input:focus-visible,
.has-error select:focus-visible,
.has-error textarea:focus-visible {
  outline-color: color-mix(in srgb, var(--danger) 28%, transparent) !important;
}


/* Dashboard current-time marker. It is part of the list flow and never reloads data. */
.dashboard-now-marker {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 5px 12px;
  color: #d93025;
}
.dashboard-now-time { font-size: 11px; font-weight: 700; white-space: nowrap; }
.dashboard-now-line { position: relative; display: block; min-width: 0; height: 1px; background: currentColor; }
.dashboard-now-line::before { content: ""; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: currentColor; transform: translateY(-50%); }
[data-theme="dark"] .dashboard-now-marker { color: #f28b82; }
