:root {
  color-scheme: dark;
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  color: #eef2ff;
  --paper: #141a34;
  --page: #10142b;
  --ink: #eef2ff;
  --secondary: #b5bedb;
  --line: #a0b2f130;
  --focus: #c5d5ff;
  --action: #c5d3ff;
  --action-ink: #172347;
  --hour: 96px;
  --rail: 166px;
  --ruler: 58px;
  --lane: 99px;
  --event-height: 62px;
  --stack-step: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100dvh; isolation: isolate; overflow-x: clip; background: var(--page); }
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(120deg, #19285542, #1419310a 56%, #21193a29), url('/astra-nebula.png') 65% center / cover no-repeat; }
.scene { --camera-distance: 130vw; --camera-angle: 9deg; --camera-width: 1.13; --camera: perspective(var(--camera-distance)) rotateY(var(--camera-angle)) scaleX(var(--camera-width)); transform: var(--camera); transform-origin: max(14px, calc((100% - 1920px) / 2)) 46%; }
.camera-enter .sky { animation: sky-arrival 1.25s cubic-bezier(.19,.73,.2,1) both; }
.camera-enter .scene { animation: scene-arrival 1.1s cubic-bezier(.19,.73,.2,1) both; }
@keyframes sky-arrival { from { transform: translate3d(16px, -11px, 0) scale(1.1); } to { transform: none; } }
@keyframes scene-arrival {
  from { opacity: .68; transform: perspective(var(--camera-distance)) translate3d(-21px, 16px, 0) rotateY(calc(var(--camera-angle) + 7deg)) scaleX(var(--camera-width)); }
  to { opacity: 1; transform: var(--camera); }
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.masthead-inner, .workspace { width: min(1920px, calc(100% - 64px)); margin: 0 auto; }
.masthead-inner { height: 68px; display: flex; justify-content: space-between; align-items: center; }
.wordmark { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
.brand-local { color: var(--secondary); font-size: 13px; font-weight: 500; letter-spacing: .035em; white-space: nowrap; }
.brand-icon { display: grid; align-content: center; gap: 3px; width: 27px; height: 31px; padding: 4px; filter: drop-shadow(0 0 6px #91a9ff64); }
.brand-icon i { display: block; height: 1.5px; width: 15px; border-radius: 2px; background: #c6d4fc; transform: rotate(-10deg); }
.brand-icon i:nth-child(2) { width: 13px; margin-left: 2px; }
.brand-icon i:nth-child(3) { width: 11px; margin-left: 4px; }
.brand-icon i:nth-child(4) { width: 9px; margin-left: 6px; }
.masthead-actions { display: flex; align-items: center; gap: 14px; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 13px; white-space: nowrap; }
.status-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #8995b6; }
.connection.ready .status-dot { background: #94dbbe; }
.sound-button { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border: 0; border-radius: 50%; background: none; color: #d1ddff; }
.sound-button:hover { color: #fff; filter: drop-shadow(0 0 5px #9cb1ff); }
.sound-icon { position: relative; display: block; width: 18px; height: 18px; }
.sound-icon::before { position: absolute; content: ''; inset: 3px 8px 3px 0; background: currentColor; clip-path: polygon(0 30%, 36% 30%, 100% 0, 100% 100%, 36% 70%, 0 70%); }
.sound-icon::after { position: absolute; content: ''; width: 11px; height: 13px; inset: 2.5px 0 auto auto; border-right: 1.5px solid currentColor; border-radius: 50%; }
.sound-button[aria-pressed='false'] .sound-icon::after { border: 0; inset: 8px 0 auto auto; width: 8px; height: 1.5px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }

.workspace { padding-top: 39px; padding-bottom: 100px; }
.day-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
.date-eyebrow { color: var(--secondary); font-size: 13px; line-height: 1.4; font-weight: 550; }
.date-title { display: flex; align-items: baseline; gap: 14px; margin: 5px 0 10px; }
.date-title h1 { font-size: clamp(2rem, 4.4vw, 3.125rem); font-weight: 680; letter-spacing: -.075em; line-height: 1.16; }
.date-title > span { font-size: 15px; color: var(--secondary); white-space: nowrap; }
.date-summary { min-height: 20px; color: var(--secondary); font-size: 14px; line-height: 1.45; }
.day-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; }
.date-navigation { display: inline-flex; align-items: center; }
.date-navigation button { height: 40px; background: transparent; border: 0; font-size: 14px; }
.date-navigation button:hover { text-shadow: 0 0 10px #9cb1ff; color: #fff; }
.date-navigation button:focus-visible { outline-offset: -3px; }
.date-arrow { display: grid; place-items: center; width: 37px; padding: 0; }
.today-button { padding: 0 14px; white-space: nowrap; }
.chevron { display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid; border-top: 1.5px solid; transform: translateX(-2px) rotate(45deg); }
.chevron.left { transform: translateX(2px) rotate(-135deg); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 10px; font-size: 14px; font-weight: 650; white-space: nowrap; border: 0; border-radius: 5px; background: none; color: var(--action); }
.secondary-button { color: var(--secondary); }
.primary-button:hover, .secondary-button:hover { color: #fff; text-shadow: 0 0 10px #94aafa; }
.analyze-button { font-size: 15px; }
.spark { font-size: 18px; line-height: 1; font-weight: 400; }

.timeline-header, .pending-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 57px; padding: 10px 10px; }
.timeline-title, .pending-header { display: flex; align-items: center; gap: 10px; }
.timeline-header h2, .pending-header h2 { font-size: 15px; line-height: 1.5; font-weight: 680; }
.timeline-icon { display: grid; gap: 2px; width: 17px; padding: 2px 0; }
.timeline-icon i { height: 1.5px; background: #becfff; width: 17px; border-radius: 2px; }
.timeline-icon i:nth-child(2) { width: 15px; }
.timeline-icon i:nth-child(3) { width: 13px; }
.timeline-icon i:nth-child(4) { width: 11px; }
.category-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--secondary); font-size: 13px; }
.category-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.category-key { width: 9px; height: 9px; border-radius: 3px; background: var(--badge); }

.tone-work { --fill: #264471; --fade: #364966; --badge: #a2c8ff; --edge: #9fc4ff; --event-ink: #ecf4ff; }
.tone-study { --fill: #493765; --fade: #514865; --badge: #cbb1fc; --edge: #c7aafa; --event-ink: #f1e9ff; }
.tone-life { --fill: #5b433b; --fade: #69554a; --badge: #f3ba9f; --edge: #eeba9d; --event-ink: #fff0e9; }
.tone-health { --fill: #24534e; --fade: #41625e; --badge: #8ddbc5; --edge: #94d5c0; --event-ink: #e4fbf2; }

.timeline-body { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.track-labels { position: relative; z-index: 5; }
.track-header, .track-name { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 17px 0 10px; }
.track-header { color: var(--secondary); font-size: 13px; height: var(--ruler); }
.track-name { position: relative; height: calc(var(--lane) + var(--stack-step) * var(--stacked, 0)); font-size: 15px; font-weight: 650; }
.track-name span { color: var(--secondary); font-size: 12px; font-weight: 400; }
.track-name::after { content: ''; position: absolute; width: 7px; height: 7px; right: -4px; top: calc(var(--lane) / 2 - 3.5px); border: 1px solid #101630; border-radius: 50%; background: var(--anchor, #d0d8fb); box-shadow: 0 0 10px var(--anchor, #d0d8fb); }
.track-name.recommended { --anchor: #a5caff; }
.track-name.alternate { --anchor: #addef0; }
.track-name.due { --anchor: #e6adcc; }
.timeline-scroll { min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-color: #6377a38c transparent; scrollbar-width: thin; }
.timeline-scroll:focus-visible { outline-offset: -2px; }
.plot { position: relative; isolation: isolate; width: calc(var(--hour) * 24 + 14px); }
.string-field { position: absolute; z-index: 0; top: 0; left: 0; pointer-events: none; }
.ruler, .lane { position: relative; }
.ruler { height: var(--ruler); }
.tick { position: absolute; top: 12px; left: calc(var(--hour) * var(--time) + 5px); transform: translate(var(--tick-x, 0), var(--depth-y, 0px)) scale(var(--depth-scale, 1)); transform-origin: left center; color: #c1cce8; font: 12px/1.4 ui-monospace, 'Cascadia Code', monospace; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 4px #040918; }
.tick:last-child { --tick-x: -100%; padding: 0 4px 0 3px; }
.fitted .tick:not(.even), .compact .tick:not(.major) { display: none; }
.compact .event { padding-inline: 1px; --near-width: 1px; }
.compact .event > span { visibility: hidden; }
.lane { height: calc(var(--lane) + var(--stack-step) * var(--stacked, 0)); }
.lane-empty { position: sticky; display: inline-flex; left: 16px; margin: 17px 0 0 16px; color: var(--secondary); font-size: 13px; pointer-events: none; }
.event { --card-height: max(40px, calc(var(--event-height) * var(--depth-scale, 1))); --surface: var(--fill); --near-edge: var(--edge); display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 4px; position: absolute; top: calc((var(--lane) - var(--card-height)) / 2 + var(--stack-step) * var(--row, 0) + var(--depth-y, 0px)); left: calc(var(--hour) * var(--from) + 2px); width: max(6px, calc(var(--hour) * var(--length) - 4px)); height: var(--card-height); transform: rotate(var(--depth-angle, 0deg)); isolation: isolate; border: 0; border-radius: 7px; padding: 0 8px; background: none; color: var(--event-ink); text-align: left; z-index: 2; }
.event::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 1px solid color-mix(in srgb, var(--edge) 58%, var(--surface)); border-left: var(--near-width, 3px) solid var(--near-edge); border-radius: inherit; background: color-mix(in srgb, var(--surface) 91%, #15172b); box-shadow: 0 5px 13px #060b2088; transform: perspective(360px) rotateY(15deg); pointer-events: none; }
.event.alt { --surface: var(--fade); --near-edge: color-mix(in srgb, var(--edge) 58%, var(--fade)); color: #d9e3fa; }
.event.short { padding-inline: 4px; }
.event.tiny { padding-inline: 0; }
.event.tiny > span { visibility: hidden; }
.event:hover, .event.related, .event:focus-visible { z-index: 4; }
.event:is(:hover, .related, :focus-visible)::before { box-shadow: 0 0 15px color-mix(in srgb, var(--edge) 38%, transparent), inset 0 0 0 1px var(--near-edge); }
.event.done .event-title { text-decoration: line-through; }
.event-title { font-size: 14px; line-height: 1.25; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event { container-type: inline-size; }
.event-time { font: 10.5px/1.2 ui-monospace, 'Cascadia Code', monospace; white-space: nowrap; overflow: hidden; }
.event-start { display: none; }
@container (max-width: 70px) {
  .event-range { display: none; }
  .event-start { display: inline; }
}
.now-line, .deadline-line { position: absolute; z-index: 1; top: var(--ruler); bottom: 0; left: calc(var(--hour) * var(--time)); pointer-events: none; }
.now-line { border-left: 1px solid #acbdff87; }
.now-line::before { content: ''; position: absolute; width: 7px; height: 7px; left: -4px; top: -4px; background: #c0d1ff; border: 1px solid #243961; border-radius: 50%; }
.now-label { position: absolute; bottom: 7px; right: 5px; width: max-content; color: #eaf0ff; font: 11px/1.25 ui-monospace, 'Cascadia Code', monospace; text-shadow: 0 1px 5px #020510; }
.deadline-line { border-left: 1px dashed #efa8d435; bottom: calc(var(--lane) / 2 - var(--depth-y, 0px)); }
.deadline-marker { position: absolute; bottom: calc(var(--lane) / 2 - 10px); left: calc(var(--hour) * var(--time)); transform: translate(-11px, var(--depth-y, 0px)); z-index: 3; display: flex; place-items: center; gap: 6px; min-width: 20px; height: 20px; border: 0; color: #f6d6ea; background: none; padding: 2px 7px; white-space: nowrap; text-shadow: 0 1px 5px #090715; }
.deadline-marker.day-end { flex-direction: row-reverse; transform: translate(calc(-100% + 11px), var(--depth-y, 0px)); }
.deadline-marker:hover { text-shadow: 0 0 9px #ef8dca; }
.deadline-marker i, .deadline-key { display: block; width: 7px; height: 7px; border: 1px solid #ebbad8; transform: rotate(45deg); background: #ad789a; }
.deadline-marker span { font: 10px/1.2 ui-monospace, 'Cascadia Code', monospace; }
.compact .deadline-marker span { display: none; }

.timeline-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 12px; padding: 10px; min-height: 49px; }
.timeline-key, .timeline-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--secondary); font-size: 12px; }
.timeline-key span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.backup-key { display: block; width: 12px; height: 9px; border: 1px solid #adbbdf; border-radius: 2px; background: #536389; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--secondary); font-size: 13px; }
.text-button:hover, .text-button[aria-pressed='true'] { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }

.pending-card { margin-top: 18px; }
.pending-header { justify-content: start; min-height: 49px; padding-top: 11px; padding-bottom: 10px; }
.pending-count { color: var(--secondary); font-variant-numeric: tabular-nums; font-size: 13px; }
.inbox-icon { position: relative; width: 15px; height: 11px; border: 1.25px solid var(--secondary); border-radius: 2px; }
.inbox-icon::after { position: absolute; content: ''; width: 6px; height: 4px; left: 3.25px; top: -1.25px; border: 1.25px solid var(--secondary); border-top: 0; border-radius: 0 0 2px 2px; background: var(--paper); }
.pending-list { padding: 0 10px 14px; }
.pending-empty { color: var(--secondary); font-size: 14px; }
.pending-item { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; text-align: left; padding: 11px 0; border: 0; font-size: 14px; }
.pending-item:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.pending-item strong { font-weight: 600; }
.pending-item small { margin-left: auto; color: var(--secondary); text-align: right; font-size: 12px; }
.workspace-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 15px 10px 0; color: var(--secondary); font-size: 12px; }
.workspace-footer .text-button { font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }

.quick-add { position: fixed; z-index: 8; right: max(27px, 3vw); bottom: max(27px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: end; gap: 12px; transform: perspective(650px) rotateY(9deg) rotate(-2deg) scale(.94); }
.add-button { width: 58px; height: 58px; border: 0; display: grid; place-items: center; border-radius: 50%; background: var(--action); color: var(--action-ink); box-shadow: 0 4px 16px #7e9cfe45; }
.add-button:hover { background: #e0e7ff; }
.add-button > span { position: relative; width: 22px; height: 22px; transition: transform 150ms; }
.add-button > span::before, .add-button > span::after { content: ''; position: absolute; top: 10px; left: 1px; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
.add-button > span::after { transform: rotate(90deg); }
.add-button[aria-expanded='true'] > span { transform: rotate(45deg); }
.add-menu { display: grid; gap: 3px; min-width: 146px; padding: 6px; background: radial-gradient(ellipse, #101531e0, #10153100 72%); text-shadow: 0 1px 5px #030514; }
.add-menu button { display: flex; align-items: center; gap: 9px; justify-content: start; min-height: 42px; padding: 7px 12px; background: none; border: 0; border-radius: 6px; font-size: 14px; }
.add-menu button:hover { color: var(--action); text-shadow: 0 0 9px #758cc5; }
.menu-icon { width: 18px; height: 18px; display: grid; place-items: center; font-weight: 600; }
.mic-icon { position: relative; }
.mic-icon::before { content: ''; position: absolute; width: 7px; height: 10px; border: 1.4px solid; border-radius: 6px; top: 1px; }
.mic-icon::after { content: ''; position: absolute; width: 13px; height: 7px; border: 1.4px solid; border-top: 0; border-radius: 0 0 6px 6px; top: 7px; }

.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; max-height: 100dvh; width: min(448px, 100%); max-width: 100%; height: 100dvh; border: 0; color: var(--ink); padding: 0; background: none; }
.drawer > *, .entry-dialog { transform: perspective(1080px) rotateY(7deg); transform-origin: left center; }
.drawer[open] { display: flex; flex-direction: column; }
.drawer::backdrop { background: linear-gradient(90deg, #070b204d, #090e24f5 75%); }
.drawer-heading { display: flex; gap: 10px; justify-content: space-between; align-items: start; padding: 26px 24px 20px; }
.drawer-heading p { color: var(--secondary); font-size: 13px; margin-bottom: 6px; }
.drawer-heading h2 { font-size: 24px; overflow-wrap: anywhere; }
.close-button { flex: 0 0 auto; display: grid; place-items: center; border: 0; background: none; border-radius: 7px; width: 35px; height: 35px; line-height: 1; font-size: 23px; }
.close-button:hover { color: var(--action); text-shadow: 0 0 9px #758cc5; }
.drawer-content { flex: 1; overflow: auto; padding: 21px 24px; }
.drawer-content dl { margin: 0 0 20px; display: grid; grid-template-columns: max-content 1fr; gap: 13px 20px; font-size: 14px; }
.drawer-content dt { color: var(--secondary); }
.drawer-content dd { margin: 0; }
.drawer-content h3 { font-size: 15px; margin-bottom: 8px; }
.drawer-content p { font-size: 14px; color: var(--secondary); line-height: 1.65; }
.insight { padding: 14px 0; border-bottom: 1px solid var(--line); }
.insight:first-child { padding-top: 0; }
.insight:last-child { border: 0; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); }
.drawer-actions:empty { display: none; }
.toast { position: fixed; z-index: 15; bottom: 30px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 135px); width: max-content; color: var(--ink); background: radial-gradient(ellipse, #0e1634ed, #0e163400 72%); padding: 10px 15px; font-size: 14px; text-shadow: 0 1px 6px #040718; }

@media (min-width: 1650px) {
  :root { --hour: 110px; --lane: 106px; }
}
@media (max-width: 1000px) {
  :root { --hour: 84px; --rail: 134px; --lane: 89px; --event-height: 58px; --stack-step: 64px; }
}
@media (max-width: 760px) {
  :root { --rail: 116px; --ruler: 48px; --lane: 73px; --event-height: 50px; --stack-step: 58px; }
  .masthead-inner, .workspace { width: calc(100% - 36px); }
  .masthead-inner { height: 57px; }
  .workspace { padding-top: 28px; }
  .day-header { flex-wrap: wrap; margin-bottom: 19px; gap: 13px; }
  .date-title { gap: 10px; margin-bottom: 6px; }
  .date-title h1 { font-size: 2.2rem; }
  .date-summary { font-size: 13px; }
  .event-title { font-size: 13px; }
  .tick { font-size: 12px; }
  .timeline-header, .pending-header { padding-inline: 13px; }
  .track-header, .track-name { padding: 0 8px 0 13px; }
  .timeline-footer { padding-inline: 13px; }
  .pending-list { padding-inline: 13px; }
  .drawer { inset: auto 0 0; height: auto; max-height: 82dvh; width: 100%; border-radius: 15px 15px 0 0; border: 0; }
  .drawer::backdrop { background: linear-gradient(#070b2065, #090e24fa 52%); }
  .drawer-actions { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .quick-add { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .add-button { width: 53px; height: 53px; }
}
@media (max-width: 430px) {
  :root { --rail: 94px; --hour: 62px; }
  .masthead-inner, .workspace { width: calc(100% - 28px); }
  .category-legend { gap: 7px 11px; }
  .timeline-key { gap: 8px 13px; }
  .date-navigation button { height: 37px; }
  .day-actions .primary-button { min-height: 39px; }
  .connection { font-size: 12px; }
  .wordmark { gap: 7px; font-size: 17px; }
  .masthead-actions { gap: 8px; }
  .sound-button { width: 34px; height: 34px; }
  .event:not(.short, .tiny) { padding-inline: 5px; }
  .pending-item { flex-wrap: wrap; }
  .pending-item small { flex-basis: 100%; margin: 0; padding-left: 17px; text-align: left; }
}
@media (max-width: 360px) {
  .brand-local { display: none; }
  .connection { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .camera-enter .sky, .camera-enter .scene { animation: none; }
}
