:root {
  color-scheme: dark;
  --bg: #080b12;
  --rail: #090d14;
  --panel: #0e141f;
  --panel-2: #121a27;
  --panel-3: #172131;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f7f5;
  --muted: #93a0b3;
  --faint: #5d6879;
  --accent: #c7f65b;
  --accent-rgb: 199, 246, 91;
  --cyan: #55d6ff;
  --violet: #a895ff;
  --coral: #ff746a;
  --amber: #f8c45c;
  --sidebar-w: 224px;
  --rail-w: 68px;
  --flow-w: 306px;
  --topbar-h: 86px;
  --hour-h: 66px;
  --time-w: 58px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-accent="cyan"] { --accent: #55d6ff; --accent-rgb: 85, 214, 255; }
:root[data-accent="violet"] { --accent: #a895ff; --accent-rgb: 168, 149, 255; }
:root[data-accent="coral"] { --accent: #ff746a; --accent-rgb: 255, 116, 106; }
:root[data-accent="amber"] { --accent: #f8c45c; --accent-rgb: 248, 196, 92; }
:root[data-density="compact"] { --hour-h: 54px; }
:root[data-density="airy"] { --hour-h: 78px; }

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 65% -15%, rgba(var(--accent-rgb), 0.055), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button { border: 0; cursor: pointer; }
svg { width: 1em; height: 1em; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
[hidden] { display: none !important; }

.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail-w) var(--sidebar-w) minmax(0, 1fr);
}

.nav-rail {
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 17px 0 14px;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.brand-mark {
  position: relative;
  width: 39px;
  height: 39px;
  padding: 0;
  border-radius: 13px;
  background: #111923;
}
.brand-orbit { position: absolute; inset: 8px; border: 2px solid var(--accent); border-radius: 50%; border-right-color: transparent; transform: rotate(-25deg); }
.brand-core { position: absolute; left: 16px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.rail-nav { display: flex; flex: 1; flex-direction: column; gap: 8px; margin-top: 36px; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 13px; }
.rail-button, .icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  transition: .2s var(--ease);
}
.rail-button svg, .icon-button svg { width: 18px; height: 18px; }
.rail-button:hover, .icon-button:hover { color: var(--text); background: rgba(255,255,255,.07); }
.rail-button.is-active { color: var(--accent); background: rgba(var(--accent-rgb), .11); }
.rail-button.is-active::before { content: ""; position: absolute; left: -15px; width: 3px; height: 21px; background: var(--accent); border-radius: 0 4px 4px 0; box-shadow: 0 0 15px rgba(var(--accent-rgb), .45); }
.rail-button[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(4px,-50%); opacity: 0; pointer-events: none;
  padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #151d29; color: var(--text); font-size: 11px; white-space: nowrap; box-shadow: var(--shadow); transition: .16s;
}
.rail-button[data-tooltip]:hover::after { opacity: 1; transform: translate(0,-50%); }
.avatar-button { width: 35px; height: 35px; border-radius: 11px; background: linear-gradient(145deg,#304255,#182331); color: #e4edf6; font-size: 10px; font-weight: 700; letter-spacing: .08em; }

.sidebar {
  z-index: 20;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: rgba(14,20,31,.92);
  border-right: 1px solid var(--line);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.wordmark-wrap { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 12px; font-weight: 780; letter-spacing: .18em; }
.signal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .65); }

.mini-calendar { padding: 17px 17px 15px; border-bottom: 1px solid var(--line); }
.mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.mini-head strong { font-size: 12px; letter-spacing: .01em; }
.mini-head div { display: flex; gap: 2px; }
.mini-head button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; color: var(--muted); background: transparent; border-radius: 7px; }
.mini-head button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.mini-weekdays, .mini-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.mini-weekdays { margin-bottom: 4px; color: var(--faint); font-size: 8px; text-align: center; text-transform: uppercase; letter-spacing: .07em; }
.mini-day { position: relative; display: grid; place-items: center; min-width: 0; aspect-ratio: 1; padding: 0; border-radius: 7px; background: transparent; color: #aeb8c6; font-size: 9px; font-variant-numeric: tabular-nums; }
.mini-day:hover { background: rgba(255,255,255,.06); color: var(--text); }
.mini-day.is-outside { color: #424b59; }
.mini-day.is-today { background: var(--accent); color: #0b0f14; font-weight: 800; }
.mini-day.is-selected:not(.is-today) { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.mini-day.has-events::after { content: ""; position: absolute; bottom: 2px; width: 2px; height: 2px; border-radius: 50%; background: currentColor; }

.side-section { padding: 17px; }
.side-section + .side-section { border-top: 1px solid var(--line); }
.side-heading-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.side-heading-row h2 { margin: 0; color: #d8dee7; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.icon-button.small { width: 27px; height: 27px; border-radius: 8px; }
.icon-button.tiny { width: 24px; height: 24px; border-radius: 7px; }
.icon-button.tiny svg, .icon-button.small svg { width: 14px; height: 14px; }
.calendar-list, .lens-list { display: grid; gap: 4px; }
.calendar-toggle, .lens-row { width: 100%; display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 34px; padding: 6px 7px; border-radius: 9px; background: transparent; color: #b6c0cd; text-align: left; font-size: 11px; }
.calendar-toggle:hover, .lens-row:hover { background: rgba(255,255,255,.04); color: var(--text); }
.calendar-dot { width: 9px; height: 9px; margin-left: 3px; border-radius: 3px; box-shadow: 0 0 9px color-mix(in srgb, var(--dot-color), transparent 55%); background: var(--dot-color); }
.calendar-toggle.is-off { opacity: .48; }
.calendar-count { color: var(--faint); font-size: 9px; font-variant-numeric: tabular-nums; }
.beta-label { padding: 3px 5px; border-radius: 4px; background: rgba(var(--accent-rgb), .1); color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.lens-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--cyan); background: rgba(85,214,255,.09); }
.lens-icon.focus { color: var(--violet); background: rgba(168,149,255,.09); }
.lens-icon.travel { color: var(--amber); background: rgba(248,196,92,.09); }
.lens-icon svg { width: 12px; height: 12px; }
.toggle { width: 25px; height: 14px; padding: 2px; border-radius: 20px; background: #273140; transition: .2s; }
.toggle::after { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: #667286; transition: .2s; }
.toggle.is-on { background: rgba(var(--accent-rgb),.22); }
.toggle.is-on::after { transform: translateX(11px); background: var(--accent); }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.timezone-card { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 9px; padding: 8px; border-radius: 11px; background: #121a25; color: var(--muted); text-align: left; }
.timezone-card:hover { background: #17212f; }
.tz-globe { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(85,214,255,.08); color: var(--cyan); }
.timezone-card strong, .timezone-card small { display: block; }
.timezone-card strong { color: #dfe5ec; font-size: 10px; }
.timezone-card small { margin-top: 2px; color: var(--faint); font-size: 8px; }

.workspace { position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { min-height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 19px 12px 22px; border-bottom: 1px solid var(--line); background: rgba(8,11,18,.84); backdrop-filter: blur(20px); }
.date-nav, .date-controls, .top-actions { display: flex; align-items: center; }
.date-nav { min-width: 0; gap: 19px; }
.date-title-wrap { min-width: 165px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .17em; }
.date-title-wrap h1 { margin: 0; font-size: clamp(17px,1.5vw,22px); line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
.date-controls { gap: 4px; }
.today-button { height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: #c4cbd5; font-size: 10px; font-weight: 650; }
.today-button:hover { border-color: rgba(var(--accent-rgb),.35); color: var(--text); }
.top-actions { gap: 9px; }
.view-switcher, .segmented { display: flex; align-items: center; padding: 3px; border-radius: 10px; background: #101722; border: 1px solid var(--line); }
.view-switcher button, .segmented button { height: 28px; padding: 0 10px; border-radius: 7px; background: transparent; color: var(--faint); font-size: 9px; font-weight: 650; }
.view-switcher button:hover, .segmented button:hover { color: #d9e0e8; }
.view-switcher button.is-active, .segmented button.is-active { background: #222c3a; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.search-button { height: 35px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: #101722; color: var(--muted); font-size: 9px; }
.search-button svg { width: 14px; height: 14px; }
kbd { min-width: 18px; padding: 3px 5px; border: 1px solid rgba(255,255,255,.1); border-radius: 5px; background: rgba(255,255,255,.045); color: #758195; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; }
.create-button { height: 35px; display: flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: #0b0f14; font-size: 10px; font-weight: 800; box-shadow: 0 8px 24px rgba(var(--accent-rgb),.13); transition: .18s; }
.create-button:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 30px rgba(var(--accent-rgb),.22); }
.create-button svg { width: 14px; height: 14px; }
.mobile-menu { display: none; }

.timezone-strip { min-height: 32px; display: flex; align-items: center; gap: 19px; padding: 0 20px; border-bottom: 1px solid var(--line); background: #0a0e16; color: var(--faint); font-size: 8px; }
.tz-row-label { color: #647084; text-transform: uppercase; letter-spacing: .11em; font-weight: 700; }
.tz-time { display: inline-flex; gap: 5px; align-items: center; font-variant-numeric: tabular-nums; }
.tz-time strong { color: #b5bfcc; font-weight: 600; }
.tz-time.is-home strong { color: var(--accent); }
.timezone-strip button { margin-left: auto; display: flex; gap: 4px; align-items: center; background: transparent; color: var(--faint); font-size: 8px; }

.workspace-body { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0,1fr) var(--flow-w); }
.calendar-stage { position: relative; min-width: 0; overflow: hidden; background: #090d15; }
.flow-panel { z-index: 5; overflow: auto; padding: 18px 15px 88px; border-left: 1px solid var(--line); background: rgba(14,20,31,.92); scrollbar-width: thin; scrollbar-color: #263143 transparent; }
.flow-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 15px; }
.kicker, .card-label { color: var(--faint); font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.live-pulse { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.flow-header h2 { margin: 7px 0 0; font-size: 18px; letter-spacing: -.03em; }
.energy-card, .suggestion-card { padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(150deg,rgba(255,255,255,.04),rgba(255,255,255,.015)); }
.card-title-row { display: flex; justify-content: space-between; align-items: flex-start; }
.card-title-row strong { display: block; margin-top: 5px; font-size: 10px; }
.energy-score { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: rgba(var(--accent-rgb),.1); color: var(--accent); font-size: 11px; font-weight: 800; }
.energy-chart { height: 96px; margin-top: 9px; }
.energy-chart svg { width: 100%; height: 78px; overflow: visible; }
.energy-area { fill: url(#energyFill); }
.energy-line { fill: none; stroke: var(--accent); stroke-width: 1.7; vector-effect: non-scaling-stroke; }
.energy-peak-dot { fill: var(--accent); filter: drop-shadow(0 0 5px var(--accent)); }
.chart-labels { display: flex; justify-content: space-between; color: #4f5a6b; font-size: 7px; }
.flow-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 10px 0; }
.flow-metric { min-width: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 11px; background: #111925; }
.flow-metric strong, .flow-metric span { display: block; }
.flow-metric strong { margin-bottom: 3px; color: #e4e9ee; font-size: 14px; font-variant-numeric: tabular-nums; }
.flow-metric span { overflow: hidden; color: var(--faint); font-size: 7px; text-transform: uppercase; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }
.flow-metric.has-conflict strong { color: var(--coral); }
.suggestion-card { position: relative; overflow: hidden; border-color: rgba(var(--accent-rgb),.16); background: radial-gradient(circle at 100% 0,rgba(var(--accent-rgb),.1),transparent 40%),#111925; }
.suggestion-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: linear-gradient(transparent,var(--accent),transparent); }
.suggestion-top { display: flex; align-items: center; gap: 7px; }
.spark-badge { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: var(--accent); background: rgba(var(--accent-rgb),.1); }
.spark-badge svg { width: 12px; height: 12px; }
.suggestion-label { flex: 1; color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.suggestion-card h3 { margin: 12px 0 6px; font-size: 13px; line-height: 1.25; }
.suggestion-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.suggestion-move { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 11px 0; }
.move-time { padding: 6px 8px; border-radius: 7px; background: #1c2532; color: #8894a6; font-size: 9px; font-variant-numeric: tabular-nums; }
.move-time.new { background: rgba(var(--accent-rgb),.1); color: var(--accent); }
.reflow-button { width: 100%; height: 31px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(var(--accent-rgb),.24); border-radius: 9px; background: rgba(var(--accent-rgb),.07); color: var(--accent); font-size: 9px; font-weight: 700; }
.reflow-button:hover { background: rgba(var(--accent-rgb),.13); }
.up-next-section { margin-top: 17px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; }
.section-title-row h3 { margin: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.section-title-row button { background: transparent; color: var(--accent); font-size: 8px; }
#up-next-list { display: grid; gap: 6px; margin-top: 9px; }
.up-next-item { display: grid; grid-template-columns: 3px 1fr auto; gap: 9px; align-items: center; padding: 9px 8px; border-radius: 10px; background: rgba(255,255,255,.025); }
.up-next-item:hover { background: rgba(255,255,255,.05); }
.up-next-bar { align-self: stretch; border-radius: 3px; background: var(--event-color,var(--cyan)); }
.up-next-item strong, .up-next-item small { display: block; }
.up-next-item strong { color: #d6dde6; font-size: 9px; }
.up-next-item small { margin-top: 3px; color: var(--faint); font-size: 7px; }
.up-next-time { color: #7d899b; font-size: 8px; font-variant-numeric: tabular-nums; }

/* Calendar canvas */
.week-view, .day-view, .month-view, .agenda-view { height: 100%; min-height: 0; }
.week-view, .day-view { display: flex; flex-direction: column; }
.week-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: var(--time-w) repeat(var(--day-count,7),minmax(88px,1fr));
  min-width: calc(var(--time-w) + var(--day-count,7) * 88px);
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,14,22,.95);
}
.week-corner { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--faint); }
.week-corner svg { width: 13px; height: 13px; }
.day-heading { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 4px; border-right: 1px solid var(--line); background: transparent; }
.day-heading:hover { background: rgba(255,255,255,.025); }
.day-heading.is-today { background: rgba(var(--accent-rgb),.035); }
.day-heading.is-selected::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.day-name { color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.day-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; color: #d9e0e8; font-size: 12px; font-weight: 680; font-variant-numeric: tabular-nums; }
.day-heading.is-today .day-number { background: var(--accent); color: #0b0f14; }
.day-weather { color: #667284; font-size: 8px; }
.all-day-row { display: grid; grid-template-columns: var(--time-w) repeat(var(--day-count,7),minmax(88px,1fr)); min-width: calc(var(--time-w) + var(--day-count,7) * 88px); min-height: 30px; border-bottom: 1px solid var(--line); background: #0a0f17; }
.all-day-label { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--faint); font-size: 7px; text-transform: uppercase; letter-spacing: .05em; }
.all-day-cell { min-width: 0; padding: 4px 5px; border-right: 1px solid var(--line); }
.all-day-pill { overflow: hidden; padding: 4px 6px; border-radius: 5px; background: rgba(var(--accent-rgb),.1); color: var(--accent); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.week-scroll { min-height: 0; flex: 1; overflow: auto; scrollbar-color: #283344 #0b0f17; }
.week-grid { position: relative; display: grid; grid-template-columns: var(--time-w) repeat(var(--day-count,7),minmax(88px,1fr)); min-width: calc(var(--time-w) + var(--day-count,7) * 88px); height: calc(var(--hour-h) * var(--visible-hours,16)); }
.time-gutter { position: relative; z-index: 3; background: #0a0e16; border-right: 1px solid var(--line); }
.time-label { position: absolute; right: 8px; transform: translateY(-50%); color: #596476; font-size: 7px; font-variant-numeric: tabular-nums; }
.time-label:first-child { transform: none; }
.day-column { position: relative; min-width: 0; border-right: 1px solid var(--line); background: rgba(255,255,255,.006); }
.day-column.is-today { background: linear-gradient(180deg,rgba(var(--accent-rgb),.028),rgba(var(--accent-rgb),.012)); }
.day-column.is-weekend { background-color: rgba(0,0,0,.09); }
.day-column.energy-on::after { content: ""; position: absolute; z-index: 0; left: 5%; right: 5%; top: 15%; height: 34%; border-radius: 50%; background: radial-gradient(ellipse,rgba(var(--accent-rgb),.06),transparent 70%); pointer-events: none; }
.time-slot { position: absolute; z-index: 1; left: 0; right: 0; height: calc(var(--hour-h) / 2); border-top: 1px solid rgba(255,255,255,.034); background: transparent; }
.time-slot:nth-child(odd) { border-top-color: var(--line); }
.time-slot:hover { background: rgba(var(--accent-rgb),.025); }
.time-slot:hover::after { content: "+ 30m"; position: absolute; top: 3px; left: 5px; padding: 2px 4px; border-radius: 4px; background: rgba(var(--accent-rgb),.1); color: var(--accent); font-size: 6px; }
.quiet-block { position: absolute; z-index: 0; left: 0; right: 0; background: rgba(3,6,10,.3); pointer-events: none; }
.current-time-line { position: absolute; z-index: 12; left: 0; right: 0; height: 1px; background: var(--accent); pointer-events: none; box-shadow: 0 0 8px rgba(var(--accent-rgb),.25); }
.current-time-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.1),0 0 10px var(--accent); }
.calendar-event {
  position: absolute;
  z-index: 5;
  left: 4px;
  right: 4px;
  min-height: 22px;
  overflow: hidden;
  padding: 6px 7px 5px 9px;
  border: 1px solid color-mix(in srgb,var(--event-color) 30%,transparent);
  border-left: 2px solid var(--event-color);
  border-radius: 8px;
  background: color-mix(in srgb,var(--event-color) 11%,#111923);
  color: #eff3f6;
  text-align: left;
  box-shadow: 0 3px 12px rgba(0,0,0,.14);
  transition: transform .18s var(--ease),box-shadow .18s,border-color .18s,opacity .18s;
}
.calendar-event:hover { z-index: 9; transform: translateY(-1px); border-color: color-mix(in srgb,var(--event-color) 55%,transparent); box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.calendar-event.is-flexible { border-style: dashed; background: linear-gradient(135deg,color-mix(in srgb,var(--event-color) 13%,#111923),#121923); }
.calendar-event.is-conflict { right: 48%; border-color: rgba(255,116,106,.5); }
.calendar-event.is-conflict + .calendar-event.is-conflict { left: 52%; right: 4px; }
.calendar-event.is-proposed { animation: proposedGlow 1.5s ease-in-out infinite; border-color: var(--accent); box-shadow: 0 0 0 1px rgba(var(--accent-rgb),.23),0 0 24px rgba(var(--accent-rgb),.16); }
.calendar-event.is-original { opacity: .28; border-style: dashed; background: transparent; }
@keyframes proposedGlow { 50% { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.12),0 0 32px rgba(var(--accent-rgb),.22); } }
.event-title { display: block; overflow: hidden; font-size: 9px; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.event-meta { display: flex; align-items: center; gap: 4px; margin-top: 3px; overflow: hidden; color: color-mix(in srgb,var(--event-color) 55%,#aab4c2); font-size: 7px; white-space: nowrap; }
.event-meta svg { width: 8px; height: 8px; flex: 0 0 auto; }
.event-badges { position: absolute; right: 5px; top: 5px; display: flex; gap: 3px; color: color-mix(in srgb,var(--event-color) 65%,white); }
.event-badges svg { width: 8px; height: 8px; }
.event-resize { position: absolute; left: 20%; right: 20%; bottom: 1px; height: 4px; cursor: ns-resize; }
.empty-state { height: 100%; display: grid; place-items: center; padding: 40px; color: var(--muted); text-align: center; }
.empty-state svg { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--faint); }
.empty-state h3 { margin: 0 0 7px; color: var(--text); font-size: 16px; }
.empty-state p { max-width: 280px; margin: 0; font-size: 10px; line-height: 1.55; }

/* Month */
.month-view { display: flex; flex-direction: column; padding: 13px 15px 82px; overflow: auto; }
.month-weekdays { flex: 0 0 25px; display: grid; grid-template-columns: repeat(var(--day-count,7),1fr); color: var(--faint); font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.month-weekdays span { padding: 6px 9px; }
.month-grid { min-height: 590px; flex: 1; display: grid; grid-template-columns: repeat(var(--day-count,7),minmax(100px,1fr)); grid-template-rows: repeat(6,minmax(95px,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month-cell { position: relative; min-width: 0; overflow: hidden; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.006); text-align: left; }
.month-cell:hover { background: rgba(255,255,255,.025); }
.month-cell.is-outside { background: rgba(0,0,0,.12); color: #454f5e; }
.month-cell.is-today { background: rgba(var(--accent-rgb),.025); }
.month-number { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px; color: #9ea9b7; font-size: 9px; font-weight: 650; }
.month-cell.is-today .month-number { background: var(--accent); color: #0b0f14; }
.month-events { display: grid; gap: 3px; margin-top: 3px; }
.month-event { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 4px; border-radius: 5px; background: color-mix(in srgb,var(--event-color) 10%,transparent); color: #bac4d0; font-size: 7px; }
.month-event::before { content: ""; width: 4px; height: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--event-color); }
.month-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-more { padding-left: 4px; color: var(--faint); font-size: 7px; }

/* Agenda */
.agenda-view { overflow: auto; padding: 18px clamp(18px,4vw,58px) 100px; }
.agenda-header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.agenda-header h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.agenda-header p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.agenda-summary { display: flex; gap: 7px; }
.agenda-summary span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 8px; }
.agenda-group { display: grid; grid-template-columns: 94px minmax(0,1fr); border-top: 1px solid var(--line); }
.agenda-date { padding: 16px 12px 16px 0; }
.agenda-date strong,.agenda-date span { display: block; }
.agenda-date strong { font-size: 10px; }
.agenda-date span { margin-top: 4px; color: var(--faint); font-size: 8px; }
.agenda-events { padding: 9px 0 12px; }
.agenda-item { width: 100%; display: grid; grid-template-columns: 78px 3px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 9px 11px; border-radius: 10px; background: transparent; text-align: left; }
.agenda-item:hover { background: rgba(255,255,255,.03); }
.agenda-time { color: #8792a3; font-size: 8px; font-variant-numeric: tabular-nums; }
.agenda-color { align-self: stretch; border-radius: 3px; background: var(--event-color); }
.agenda-copy strong, .agenda-copy small { display: block; }
.agenda-copy strong { color: #dde3ea; font-size: 10px; }
.agenda-copy small { margin-top: 4px; color: var(--faint); font-size: 8px; }
.agenda-flex { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }

/* Command dock */
.command-dock { position: absolute; z-index: 20; left: 50%; bottom: 16px; width: min(540px,calc(100% - var(--flow-w) - 42px)); min-width: 320px; transform: translateX(calc(-50% - var(--flow-w)/2)); display: grid; grid-template-columns: 30px minmax(0,1fr) auto 31px; align-items: center; gap: 6px; padding: 6px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(20,28,40,.92); box-shadow: 0 16px 50px rgba(0,0,0,.48); backdrop-filter: blur(22px); }
.command-dock:focus-within { border-color: rgba(var(--accent-rgb),.4); box-shadow: 0 16px 50px rgba(0,0,0,.5),0 0 0 3px rgba(var(--accent-rgb),.06); }
.command-spark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: rgba(var(--accent-rgb),.1); color: var(--accent); }
.command-spark svg { width: 14px; height: 14px; }
.command-dock input { min-width: 0; height: 31px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.command-dock input::placeholder { color: #788497; }
.command-example { color: #505b6b; font-size: 7px; white-space: nowrap; }
.command-send { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 9px; background: var(--accent); color: #0b0f14; }
.command-send svg { width: 13px; height: 13px; }

.reflow-bar { position: fixed; z-index: 80; left: 50%; top: 14px; transform: translateX(-50%); min-width: 440px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 8px 9px 8px 13px; border: 1px solid rgba(var(--accent-rgb),.28); border-radius: 14px; background: rgba(20,29,40,.96); box-shadow: var(--shadow),0 0 30px rgba(var(--accent-rgb),.08); backdrop-filter: blur(20px); }
.reflow-state { display: grid; grid-template-columns: 23px auto; column-gap: 8px; align-items: center; }
.reflow-state > svg { grid-row: span 2; color: var(--accent); }
.reflow-state strong { font-size: 10px; }
.reflow-state small { color: var(--faint); font-size: 7px; }
.reflow-actions { display: flex; gap: 6px; }
.ghost-button,.apply-button,.save-button,.delete-button { height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; border-radius: 9px; font-size: 9px; font-weight: 700; }
.ghost-button { background: rgba(255,255,255,.05); color: #a9b3c0; }
.ghost-button:hover { background: rgba(255,255,255,.08); color: var(--text); }
.apply-button,.save-button { background: var(--accent); color: #0b0f14; }
.delete-button { background: rgba(255,116,106,.09); color: var(--coral); }
.delete-button:hover { background: rgba(255,116,106,.15); }

/* Dialogs and drawers */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(1,4,8,.72); backdrop-filter: blur(6px); }
body.has-fallback-modal::before { content: ""; position: fixed; z-index: 110; inset: 0; background: rgba(1,4,8,.72); backdrop-filter: blur(6px); }
dialog[data-fallback-modal="true"][open] { position: fixed; z-index: 120; inset: 0; }
.event-dialog { width: min(570px,calc(100vw - 28px)); max-height: calc(100dvh - 28px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 19px; background: #101722; box-shadow: 0 35px 100px rgba(0,0,0,.7); }
.event-dialog form { padding: 20px; }
.dialog-header,.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-kicker { color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.dialog-header h2,.drawer-head h2 { margin: 6px 0 0; font-size: 19px; letter-spacing: -.04em; }
.event-title-field { display: grid; grid-template-columns: 12px minmax(0,1fr); align-items: center; gap: 10px; margin: 18px 0 14px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: #141d2a; }
.event-title-field:focus-within { border-color: rgba(var(--accent-rgb),.45); }
.event-color-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--cyan); box-shadow: 0 0 12px currentColor; }
.event-title-field input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 620; }
.event-title-field input::placeholder { color: #647083; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 8px; }
.field-group { display: grid; gap: 6px; min-width: 0; }
.field-group > span,.constraint-heading > span { display: flex; align-items: center; gap: 6px; color: #7e8a9b; font-size: 8px; font-weight: 650; }
.field-group > span svg,.constraint-heading svg { width: 11px; height: 11px; }
.field-group input,.field-group select,.field-group textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #141d29; color: #d9e0e8; outline: 0; font-size: 10px; }
.field-group input,.field-group select { height: 36px; padding: 0 9px; }
.field-group textarea { padding: 9px; resize: vertical; }
.field-group input:focus,.field-group select:focus,.field-group textarea:focus { border-color: rgba(var(--accent-rgb),.4); }
.full-field { margin-top: 12px; }
.constraint-section { margin: 15px 0 13px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.constraint-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.constraint-heading small { color: var(--faint); font-size: 7px; }
.constraint-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.constraint-option { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #121a26; text-align: left; }
.constraint-option:hover { border-color: var(--line-strong); }
.constraint-option.is-active { border-color: rgba(var(--accent-rgb),.32); background: rgba(var(--accent-rgb),.04); }
.constraint-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.05); color: #8591a2; }
.constraint-icon.flex { background: rgba(var(--accent-rgb),.09); color: var(--accent); }
.constraint-option strong,.constraint-option small { display: block; }
.constraint-option strong { font-size: 9px; }
.constraint-option small { margin-top: 3px; color: var(--faint); font-size: 7px; }
.radio-dot { width: 12px; height: 12px; padding: 3px; border: 1px solid #465264; border-radius: 50%; }
.constraint-option.is-active .radio-dot { border-color: var(--accent); box-shadow: inset 0 0 0 3px #121a26; background: var(--accent); }
.optional-fields { grid-template-columns: 1.4fr 1fr; }
.notes-field { margin-top: 11px; }
.dialog-footer { display: flex; align-items: center; gap: 7px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.footer-spacer { flex: 1; }

.search-dialog { width: min(570px,calc(100vw - 28px)); margin: 14vh auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; background: #111824; box-shadow: 0 30px 100px rgba(0,0,0,.66); }
.search-box-head { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-box-head > svg { color: var(--muted); }
.search-box-head input { height: 34px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-results { max-height: 390px; overflow: auto; padding: 8px; }
.search-section-label { padding: 8px 9px 5px; color: var(--faint); font-size: 7px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.search-result { width: 100%; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px; border-radius: 9px; background: transparent; text-align: left; }
.search-result:hover,.search-result.is-active { background: rgba(255,255,255,.055); }
.search-result-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: color-mix(in srgb,var(--event-color,var(--accent)) 10%,transparent); color: var(--event-color,var(--accent)); }
.search-result strong,.search-result small { display: block; }
.search-result strong { color: #dce3ea; font-size: 9px; }
.search-result small { margin-top: 3px; color: var(--faint); font-size: 7px; }
.search-result time { color: #7e8999; font-size: 8px; }
.search-footer { display: flex; gap: 15px; padding: 9px 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 7px; }
.search-footer span { display: flex; align-items: center; gap: 4px; }

.settings-drawer { position: fixed; z-index: 101; top: 0; right: 0; bottom: 0; width: min(350px,100vw); padding: 21px; overflow: auto; background: #101722; border-left: 1px solid var(--line-strong); box-shadow: -30px 0 90px rgba(0,0,0,.5); transform: translateX(104%); transition: transform .28s var(--ease); }
.settings-drawer.is-open { transform: none; }
.drawer-scrim { position: fixed; z-index: 100; inset: 0; background: rgba(0,0,0,.52); opacity: 0; visibility: hidden; transition: .25s; }
.drawer-scrim.is-open { opacity: 1; visibility: visible; }
.setting-group { margin-top: 25px; }
.setting-group > label { display: block; margin-bottom: 10px; color: #9ba6b4; font-size: 9px; font-weight: 700; }
.accent-options { display: flex; gap: 9px; }
.accent-options button { position: relative; width: 31px; height: 31px; border-radius: 10px; background: currentColor; }
.accent-options button.is-active::after { content: ""; position: absolute; inset: -4px; border: 1px solid currentColor; border-radius: 13px; }
.accent-options .lime { color: #c7f65b; }.accent-options .cyan { color: #55d6ff; }.accent-options .violet { color: #a895ff; }.accent-options .coral { color: #ff746a; }.accent-options .amber { color: #f8c45c; }
.segmented { width: 100%; }
.segmented button { flex: 1; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row strong,.setting-row small { display: block; }
.setting-row strong { font-size: 10px; }
.setting-row small { margin-top: 4px; color: var(--faint); font-size: 8px; }
.setting-row input[type="checkbox"] { width: 31px; height: 17px; appearance: none; padding: 2px; border-radius: 20px; background: #283343; transition: .2s; cursor: pointer; }
.setting-row input[type="checkbox"]::before { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: #6f7a8b; transition: .2s; }
.setting-row input[type="checkbox"]:checked { background: rgba(var(--accent-rgb),.24); }
.setting-row input[type="checkbox"]:checked::before { transform: translateX(14px); background: var(--accent); }
.workday-setting > div { display: flex; align-items: center; gap: 8px; }
.workday-setting select { flex: 1; height: 35px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; background: #151e2b; color: var(--text); font-size: 9px; }
.workday-setting span { color: var(--faint); font-size: 8px; }
.reset-button { width: 100%; height: 36px; display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 27px; border: 1px solid rgba(255,116,106,.16); border-radius: 10px; background: rgba(255,116,106,.05); color: var(--coral); font-size: 9px; }

.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 340px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 12px; background: #17212e; box-shadow: var(--shadow); animation: toastIn .3s var(--ease); pointer-events: auto; }
.toast.is-leaving { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(10px); } }
.toast-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: rgba(var(--accent-rgb),.1); color: var(--accent); }
.toast strong,.toast small { display: block; }
.toast strong { font-size: 9px; }.toast small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.toast button { background: transparent; color: var(--accent); font-size: 8px; font-weight: 700; pointer-events: auto; }

.focus-overlay { position: fixed; z-index: 150; inset: 0; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 30%,rgba(var(--accent-rgb),.1),transparent 35%),rgba(5,8,13,.96); backdrop-filter: blur(15px); }
.focus-card { width: min(470px,100%); text-align: center; }
.focus-card .brand-mark { margin: 0 auto 28px; }
.focus-card .dialog-kicker { font-size: 8px; }
.focus-card h2 { margin: 12px 0 5px; font-size: clamp(30px,6vw,52px); letter-spacing: -.055em; }
.focus-card p { color: var(--muted); }
.focus-timer { margin: 36px 0; color: var(--accent); font: 600 clamp(40px,8vw,70px) ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: -.05em; }
.focus-actions { display: flex; justify-content: center; gap: 8px; }

@media (max-width: 1260px) {
  :root { --flow-w: 280px; --sidebar-w: 210px; }
  .command-example { display: none; }
  .command-dock { grid-template-columns: 30px minmax(0,1fr) 31px; }
  .search-label { display: none; }
  .search-button kbd { display: none; }
}
@media (max-width: 1060px) {
  :root { --sidebar-w: 0px; --flow-w: 270px; }
  .app-shell { grid-template-columns: var(--rail-w) minmax(0,1fr); }
  .sidebar { position: fixed; z-index: 90; left: var(--rail-w); top: 0; bottom: 0; width: 224px; transform: translateX(-110%); box-shadow: 20px 0 60px rgba(0,0,0,.5); transition: transform .25s var(--ease); }
  .sidebar.is-open { transform: none; }
  .mobile-menu { display: inline-grid; }
  .date-nav { gap: 10px; }
  .command-dock { width: min(500px,calc(100% - var(--flow-w) - 32px)); }
}
@media (max-width: 820px) {
  :root { --rail-w: 0px; --flow-w: 0px; --topbar-h: 76px; }
  .app-shell { display: block; }
  .nav-rail { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; height: 57px; flex-direction: row; padding: 6px 10px; border: 0; border-top: 1px solid var(--line); }
  .brand-mark,.rail-bottom { display: none; }
  .rail-nav { width: 100%; flex-direction: row; justify-content: space-around; margin: 0; }
  .rail-button { width: 42px; height: 42px; }
  .rail-button.is-active::before { left: 25%; right: 25%; top: -7px; width: auto; height: 2px; border-radius: 0 0 3px 3px; }
  .rail-button[data-tooltip]::after { display: none; }
  .sidebar { left: 0; bottom: 57px; }
  .flow-panel { position: fixed; z-index: 65; right: 0; top: var(--topbar-h); bottom: 57px; width: min(330px,90vw); transform: translateX(102%); box-shadow: -25px 0 60px rgba(0,0,0,.5); transition: transform .25s var(--ease); }
  .flow-panel.is-open { transform: none; }
  .workspace-body { display: block; }
  .calendar-stage { height: 100%; }
  .topbar { padding: 10px 12px; }
  .date-title-wrap { min-width: 120px; }
  .date-controls { display: none; }
  .view-switcher button { padding: 0 7px; }
  .view-switcher button[data-view="agenda"] { display: none; }
  .search-button { display: none; }
  .create-button { width: 35px; padding: 0; justify-content: center; }
  .create-button span:last-child { display: none; }
  .timezone-strip { overflow: hidden; padding: 0 12px; }
  .command-dock { position: fixed; left: 10px; right: 10px; bottom: 67px; width: auto; min-width: 0; transform: none; }
  .command-example { display: none; }
  .month-view { padding: 10px 10px 140px; }
  .month-grid { min-width: 700px; }
  .agenda-view { padding-bottom: 150px; }
}
@media (max-width: 560px) {
  .eyebrow { display: none; }
  .date-title-wrap h1 { font-size: 16px; }
  .view-switcher button[data-view="month"] { display: none; }
  .timezone-strip .tz-time:nth-of-type(n+3) { display: none; }
  .week-header,.all-day-row,.week-grid { --day-count: 1; min-width: 100%; }
  .form-grid,.optional-fields { grid-template-columns: 1fr; }
  .constraint-options { grid-template-columns: 1fr; }
  .event-dialog { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .search-dialog { width: calc(100vw - 16px); }
  .reflow-bar { top: auto; bottom: 128px; min-width: 0; width: calc(100vw - 20px); }
  .reflow-state small { display: none; }
  .toast-region { left: 10px; right: 10px; bottom: 126px; }
  .toast { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
