:root {
  color-scheme: light;
  --ink: #24262b;
  --muted: #6f7480;
  --line: #dde2e8;
  --paper: #f3f4f6;
  --panel: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-muted: #eef1ef;
  --surface-hover: rgba(255, 255, 255, .72);
  --surface-glass: rgba(255, 255, 255, .92);
  --topbar-surface: rgba(243, 244, 246, .88);
  --input-surface: #ffffff;
  --primary-bg: #202124;
  --primary-fg: #ffffff;
  --secondary-bg: #ffffff;
  --secondary-fg: #24262b;
  --soft-inset: rgba(255, 255, 255, .86);
  --overlay: rgba(31, 36, 42, .28);
  --tooltip-surface: rgba(255, 255, 255, .88);
  --danger-surface: #fff5f6;
  --accent: #62b487;
  --accent-2: #b4563a;
  --accent-3: #7763c6;
  --ok: #2d7a48;
  --warn: #a55d18;
  --shadow: 0 18px 44px rgba(30, 34, 40, .07);
  --soft-shadow: 0 8px 24px rgba(30, 34, 40, .055);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.public-demo-banner {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(760px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(58, 103, 81, .18);
  border-radius: 14px;
  background: rgba(243, 250, 245, .94);
  color: #315340;
  box-shadow: 0 12px 30px rgba(30, 60, 39, .14);
  font-size: 13px;
  line-height: 1.45;
  backdrop-filter: blur(12px);
}

.public-demo-banner strong { white-space: nowrap; }

@media (max-width: 680px) {
  .public-demo-banner { align-items: flex-start; bottom: 12px; }
}

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

button {
  border: 0;
  background: var(--primary-bg);
  color: var(--primary-fg);
  min-height: 34px;
  padding: 0 14px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 14px rgba(28, 31, 36, .08);
}

button.secondary {
  background: var(--secondary-bg);
  color: var(--secondary-fg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 5px 13px rgba(28, 31, 36, .06);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 22px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.15;
  margin: 6px 0 0;
  text-align: left;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
}

.eyebrow {
  color: #2f7c64;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
}

.nav a:hover {
  background: var(--surface-hover);
  border-color: rgba(210, 216, 223, .85);
}

.sidebar-top {
  width: 100%;
}

.sidebar-brand {
  padding: 0 14px;
}

.workbench-logo {
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
  color: #2f7c64;
}

.workbench-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status-box #saveState { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.status-box button { flex: 0 0 auto; }

.content-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 9px 18px 8px;
  background: var(--topbar-surface);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(218, 224, 230, .62);
}

.traffic-lights {
  display: flex;
  gap: 8px;
  align-items: center;
}

.traffic {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.traffic.red { background: #ff5f57; }
.traffic.yellow { background: #ffbd2e; }
.traffic.green { background: #28c840; }

.top-search {
  min-height: 44px;
  border: 0;
  background: var(--surface-soft);
  border-radius: 999px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 0 16px;
  color: #848994;
  box-shadow: 0 7px 18px rgba(28, 31, 36, .055), 0 1px 0 rgba(255, 255, 255, .9) inset;
}

.top-search input {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 40px;
}

.top-search input:focus {
  outline: 0;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.appearance-control { position: relative; }
.appearance-trigger {
  min-width: 94px;
  height: 44px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: 0 5px 14px rgba(28, 31, 36, .055), 0 1px 0 var(--soft-inset) inset;
  font-size: 12px;
  white-space: nowrap;
}
.appearance-trigger:hover,
.appearance-trigger[aria-expanded="true"] { color: var(--ink); transform: translateY(-1px); }
.appearance-trigger:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 68%, transparent); outline-offset: 2px; }
.appearance-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: grid;
  width: 164px;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--tooltip-surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
}
.appearance-menu button {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}
.appearance-menu button:hover,
.appearance-menu button:focus-visible { background: color-mix(in srgb, var(--accent) 13%, transparent); transform: none; }
.appearance-menu button[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 20%, transparent); color: color-mix(in srgb, var(--accent) 74%, var(--ink)); }
.appearance-menu button span { margin-right: auto; }
.appearance-menu button small { color: var(--muted); font-size: 10px; }

.round-tool {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  color: #626873;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(28, 31, 36, .055), 0 1px 0 rgba(255, 255, 255, .85) inset;
}

main {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(28, 31, 36, .045), 0 1px 0 rgba(255, 255, 255, .9) inset;
}

.calendar-tools-shell { padding: 0; border: 0; background: transparent; box-shadow: none; }
.calendar-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.calendar-tool-card { display: grid; min-height: 230px; grid-template-rows: auto minmax(0, 1fr) auto auto; align-content: stretch; padding: 20px; border-radius: 18px; background: var(--surface-raised); box-shadow: var(--soft-shadow); }
.calendar-tool-card .hint { max-width: 54ch; line-height: 1.7; }
.calendar-tool-actions { display: flex; align-self: end; justify-content: flex-end; margin-top: 16px; }

.top-grid,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

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

.stack,
.event-list,
.log {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.item,
.project,
.event-row {
  border: 0;
  border-radius: 14px;
  padding: 11px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(28, 31, 36, .045), 0 1px 0 rgba(255, 255, 255, .86) inset;
}

.item strong,
.event-row strong {
  display: block;
  margin-bottom: 4px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.project {
  display: grid;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.project-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.project { min-height: 126px; padding: 18px; align-content: start; }
.project-arrow { color: var(--muted); font-size: 12px; white-space: nowrap; }
.project-next { min-height: 40px; color: var(--ink); font-size: 14px; line-height: 1.45; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f4ee;
  color: #2f7c64;
  font-size: 12px;
  white-space: nowrap;
}

.progress {
  height: 8px;
  background: #edf0f2;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

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

.task {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 14px;
}

.task input {
  margin-top: 2px;
}

.project-task > span {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.project-task-stage {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.project-stage-promo { background: #f0ebff; color: #705ab3; }
.project-stage-setup { background: #e7f2ff; color: #3671a9; }
.project-stage-service { background: #fff0e4; color: #aa672f; }
.project-stage-default { background: #edf1f2; color: #59646d; }

.project-task-title {
  flex: 1 1 180px;
  color: var(--ink);
  line-height: 24px;
}

.project-task {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
}

.project-task > input {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 4px 0 0;
  padding: 0;
  border: 1.5px solid #afb7c1;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, .94);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px 10px;
  box-shadow: 0 2px 5px rgba(28, 31, 36, .08);
  cursor: pointer;
}

.project-task > input:checked {
  border-color: #2f7c64;
  background-color: #2f7c64;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.2 8.2 2.9 2.9 6.7-6.7' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.3'/%3E%3C/svg%3E");
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.execution-layout {
  display: grid;
  grid-template-columns: minmax(250px, .28fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.execution-main {
  min-width: 0;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .85fr);
  gap: 14px;
  align-items: stretch;
}

.project-calendar {
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 26px rgba(40, 54, 45, .08), inset 0 1px 0 #fff;
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 16px;
  border-bottom: 0;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-grid {
  user-select: none;
  -webkit-user-select: none;
}

.calendar-weekdays span {
  padding: 8px 4px 10px;
  color: #858d88;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.calendar-day {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 128px;
  padding: 11px 8px 10px;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid #e1e6e1;
  text-align: left;
  font-weight: 400;
  cursor: pointer;
}

.calendar-day:nth-child(n + 36) { border-bottom: 0; }
.calendar-day:hover { background: #f3faf2; box-shadow: inset 0 0 0 1px #bbdabc; }
.calendar-day.selected { background: #eff8ed; box-shadow: inset 0 0 0 2px #5aa977; }
.calendar-date-stack { display: grid; height: 38px; align-content: start; justify-items: center; margin-bottom: 7px; }
.calendar-day.today .calendar-date-stack { width: 38px; height: 38px; align-content: center; justify-self: center; gap: 1px; margin-bottom: 7px; border-radius: 50%; background: #3f8e74; color: white; }
.calendar-day.today.selected .calendar-date-stack { background: #2f7c64; }
.calendar-day.camp-start { background: #fff5ef; }
.calendar-day.muted-day { background: rgba(249, 250, 248, .6); color: #aab2ae; }
.calendar-day.muted-day:hover { background: rgba(249, 250, 248, .8); box-shadow: none; }
.calendar-number { justify-self: center; font-size: 20px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.calendar-lunar { justify-self: center; min-height: 10px; margin: 1px 0 0; color: #535d57; font-size: 10px; font-weight: 500; line-height: 1; }
.calendar-day.today .calendar-number,
.calendar-day.today .calendar-lunar { color: white; }
.calendar-day.muted-day .calendar-lunar { color: #aab2ae; }
.calendar-preview { display: grid; gap: 3px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.2; }
.calendar-event-chip { display: block; overflow: hidden; padding: 2px 5px; border: 0; border-radius: 5px; white-space: nowrap; text-overflow: ellipsis; cursor: grab; touch-action: none; box-shadow: none; font-size: 11px; font-weight: 550; }
.calendar-more { padding-left: 4px; color: #8a948e; font-size: 10px; font-weight: 600; line-height: 1.1; }
.calendar-solar-term { display: block; overflow: hidden; padding: 2px 5px; border-radius: 5px; background: #f8e7bf; color: #865f21; font-size: 10px; font-weight: 600; line-height: 1.1; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; user-select: none; -webkit-user-select: none; }
.calendar-day.muted-day .calendar-solar-term { opacity: .55; }
.calendar-event-chip.calendar-event-done { opacity: .64; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.master-chip { background: color-mix(in srgb, var(--project-color) 18%, white); color: #33413b; }
.calendar-event-chip.sync-locked-chip { cursor: grab; opacity: .74; }
.event-guide { background: #eef1ff; color: #405dbd; }
.event-audio { background: #f0f2f5; color: #5d6671; }
.event-coach { background: #fff2dd; color: #a36408; }
.event-checkin { background: #fff0f2; color: #b03b4d; }
.event-operations { background: #eaf7f5; color: #2f7c70; }
.calendar-event-chip:active { cursor: grabbing; }
.calendar-event-chip:focus,
.relative-day-items > span:focus,
.template-agenda-card:focus { outline: none; }
.calendar-event-chip:focus-visible,
.relative-day-items > span:focus-visible,
.template-agenda-card:focus-visible { outline: 2px solid color-mix(in srgb, var(--project-color, var(--template-item-color, #5a8fd8)) 62%, #3f7bb6); outline-offset: 1px; }
.unified-drag-placeholder { display: block !important; box-sizing: border-box; min-width: 0; margin: 0 !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; transition: width .11s ease, height .11s ease; }
.unified-drag-source,
.unified-drag-source:hover,
.unified-drag-source:focus,
.unified-drag-source:focus-visible { display: none !important; opacity: 0 !important; outline: 0 !important; box-shadow: none !important; filter: none !important; transform: none !important; transition: none !important; cursor: grabbing !important; }
.unified-drag-preview,
.unified-drag-preview:hover,
.unified-drag-preview:focus,
.unified-drag-preview:focus-visible { position: fixed !important; z-index: 260 !important; box-sizing: border-box !important; max-width: min(360px, calc(100vw - 16px)); margin: 0 !important; overflow: hidden !important; opacity: .72 !important; outline: 0 !important; box-shadow: none !important; filter: none !important; transform: translate(var(--drag-anchor-x, 0), var(--drag-anchor-y, 0)) !important; transition: width .11s ease, height .11s ease, border-radius .11s ease !important; pointer-events: none !important; cursor: grabbing !important; will-change: left, top, width, height; }
.unified-drag-preview.drag-as-chip { display: block !important; min-height: 0 !important; padding: var(--drag-chip-padding, 2px 5px) !important; border: 0 !important; border-radius: var(--drag-chip-radius, 5px) !important; background: color-mix(in srgb, var(--project-color, var(--template-item-color, #5a8fd8)) 18%, white) !important; color: #33413b !important; font-size: var(--drag-chip-font-size, 11px) !important; font-weight: 550 !important; line-height: var(--drag-chip-line-height, 1.2) !important; white-space: nowrap !important; text-overflow: ellipsis !important; }
.unified-drag-preview.drag-as-chip > * { display: none !important; }
.unified-drag-preview.drag-as-chip .agenda-summary,
.unified-drag-preview.drag-as-chip .template-agenda-summary,
.unified-drag-preview.drag-as-chip .agenda-summary > span,
.unified-drag-preview.drag-as-chip .agenda-summary strong,
.unified-drag-preview.drag-as-chip .template-agenda-summary strong { display: block !important; min-height: 0 !important; overflow: hidden !important; padding: 0 !important; color: inherit !important; font-size: inherit !important; font-weight: inherit !important; line-height: inherit !important; white-space: nowrap !important; text-overflow: ellipsis !important; }
.unified-drag-preview.drag-as-chip .agenda-summary small,
.unified-drag-preview.drag-as-chip .template-agenda-summary small { display: none !important; }
.unified-drag-preview.drag-as-card:not(.agenda-card):not(.template-agenda-card) { display: grid !important; min-height: 34px !important; grid-template-columns: 18px minmax(0, 1fr) !important; align-items: center !important; gap: 8px !important; padding: 7px 8px !important; border: 0 !important; border-radius: 7px !important; background: color-mix(in srgb, var(--project-color, var(--template-item-color, #5a8fd8)) 18%, white) !important; color: var(--ink) !important; font-size: 12px !important; font-weight: 600 !important; line-height: 1.3 !important; white-space: normal !important; }
.unified-drag-preview.drag-as-card:not(.agenda-card):not(.template-agenda-card)::before { content: "⠿"; display: grid; width: 18px; min-height: 25px; place-items: center; color: #87919b; font-size: 15px; font-weight: 400; line-height: 1; }
.is-task-dragging [data-tooltip-title]:hover,
.is-task-dragging [data-tooltip-title]:focus-visible,
.is-task-dragging .agenda-card:hover,
.is-task-dragging .template-agenda-card:hover,
.is-task-dragging .relative-day-items span:hover { transform: none !important; filter: none !important; box-shadow: none !important; }
.calendar-event-chip,
.agenda-sort-handle,
.template-drag-handle,
.relative-day-items > span { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; }
.agenda-card.drag-as-chip,
.template-agenda-card.drag-as-chip { display: block; width: 100%; min-height: 0; padding: 2px 5px; border: 0; border-radius: 5px; background: color-mix(in srgb, var(--project-color, var(--template-item-color, #5a8fd8)) 18%, white); color: #33413b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-card.drag-as-chip > *,
.template-agenda-card.drag-as-chip > * { display: none; }
.agenda-card.drag-as-chip .agenda-summary,
.template-agenda-card.drag-as-chip .template-agenda-summary { display: block; min-height: 0; overflow: hidden; color: #33413b; white-space: nowrap; text-overflow: ellipsis; }
.agenda-card.drag-as-chip .agenda-summary > span { display: block; }
.agenda-card.drag-as-chip .agenda-summary strong,
.template-agenda-card.drag-as-chip .template-agenda-summary strong { display: block; overflow: hidden; font-size: 11px; font-weight: 550; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.agenda-card.drag-as-chip .agenda-summary small,
.template-agenda-card.drag-as-chip .template-agenda-summary small { display: none; }
.calendar-event-chip.drag-as-card,
.relative-day-items > span.drag-as-card,
.template-agenda-list > span.drag-as-card { display: grid; width: 100%; min-height: 34px; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 7px; background: color-mix(in srgb, var(--project-color, var(--template-item-color, #5a8fd8)) 18%, white); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.3; white-space: normal; }
.calendar-event-chip.drag-as-card::before,
.relative-day-items > span.drag-as-card::before,
.template-agenda-list > span.drag-as-card::before { content: "⠿"; display: grid; width: 18px; min-height: 25px; place-items: center; color: #87919b; font-size: 15px; font-weight: 400; line-height: 1; }
.info-tooltip { position: fixed; z-index: 60; width: min(300px, calc(100vw - 28px)); padding: 11px 13px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .82); color: var(--ink); box-shadow: 0 16px 36px rgba(28, 31, 36, .14), 0 1px 0 rgba(255, 255, 255, .92) inset; backdrop-filter: blur(20px) saturate(1.15); -webkit-backdrop-filter: blur(20px) saturate(1.15); pointer-events: none; font-size: 12px; line-height: 1.55; }
.info-tooltip strong, .info-tooltip span { display: block; }.info-tooltip strong { font-size: 12px; }.info-tooltip span { color: #59616d; margin-top: 2px; }.info-tooltip p { margin: 7px 0 0; color: #30343b; }

[data-tooltip-title],
[data-tooltip-text] {
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

[data-tooltip-title]:hover,
[data-tooltip-title]:focus-visible,
[data-tooltip-text]:hover,
[data-tooltip-text]:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.015);
}

.calendar-event-chip[data-tooltip-title]:hover,
.calendar-event-chip[data-tooltip-title]:focus-visible { box-shadow: 0 3px 7px rgba(40, 54, 45, .1); filter: brightness(1.01); transform: translateY(-1px); }

.rebase-button[data-tooltip-title]:hover,
.rebase-button[data-tooltip-title]:focus-visible,
.color-dot[data-tooltip-title]:hover,
.color-dot[data-tooltip-title]:focus-visible {
  box-shadow: 0 8px 16px rgba(28, 31, 36, .12);
}

.day-detail { display: grid; align-content: start; gap: 14px; padding: 16px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .92); box-shadow: 0 8px 22px rgba(40, 54, 45, .07), inset 0 1px 0 #fff; overflow: visible; }
.calendar-layout > .day-detail, .master-day-detail { align-self: stretch; }
.calendar-sidebar { display: grid; min-width: 0; align-content: start; gap: 12px; }
.project-calendar-sidebar { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; }
.day-events { display: grid; grid-auto-rows: min-content; align-content: start; align-items: start; gap: 8px; max-height: none; overflow: visible; padding-right: 3px; }
.agenda-scroll { max-height: none; overflow: visible; padding-right: 3px; }
.agenda-card { display: grid; width: 100%; min-width: 0; min-height: 0; align-self: start; grid-template-columns: 18px 16px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 7px 8px; border: 0; border-radius: 6px; background: color-mix(in srgb, var(--project-color) 18%, white); box-shadow: none; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.agenda-card:hover { background: color-mix(in srgb, var(--project-color) 24%, white); box-shadow: 0 5px 12px rgba(40, 54, 45, .08); transform: translateY(-1px); }
.agenda-card.multi-selected { background: color-mix(in srgb, var(--project-color) 30%, white); box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--project-color) 72%, transparent); }
.agenda-summary { display: grid; align-self: center; grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 0; background: transparent; color: var(--ink); box-shadow: none; text-align: left; }
.agenda-summary > span { display: grid; align-content: center; gap: 3px; min-width: 0; }.agenda-summary strong { display: block; overflow: hidden; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: normal; text-overflow: ellipsis; }.agenda-summary small { display: block; color: #66716a; font-size: 10px; line-height: 1.25; }
.agenda-inline-actions { display: flex; align-self: center; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; min-width: 0; }.agenda-inline-actions .event-sync { min-height: 24px; padding: 0 7px; font-size: 11px; }
.agenda-expanded { grid-column: 3 / 5; align-self: start; display: grid; gap: 10px; padding: 3px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.6; animation: expand-event .18s ease-out; }.agenda-expanded p { margin: 0; }.agenda-expanded .agenda-project-meta { color: color-mix(in srgb, var(--project-color) 76%, #4d5661); font-weight: 700; }.agenda-expanded .event-actions { justify-content: flex-start; }
@keyframes expand-event { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.agenda-card.done { background: color-mix(in srgb, var(--project-color) 5%, white); }.agenda-card.done:hover { background: color-mix(in srgb, var(--project-color) 5%, white); box-shadow: none; transform: none; }.agenda-card.done strong { color: var(--muted); text-decoration: line-through; }
.agenda-done { width: 16px; align-self: center; padding-top: 0; }.agenda-done input { width: 14px; height: 14px; margin: 0; accent-color: #65766e; }
.agenda-editor { grid-template-columns: 1fr; background: color-mix(in srgb, var(--project-color) 18%, white); }
.agenda-editor input,
.agenda-editor textarea,
.agenda-editor .glass-select-trigger,
.agenda-editor .glass-picker-trigger { background: #fff; font-size: 13px; line-height: 1.35; }
.agenda-sort-handle { display: grid; width: 18px; min-height: 25px; align-self: center; place-items: center; padding: 0; border-radius: 8px; background: transparent; color: #87919b; box-shadow: none; cursor: grab; font-size: 15px; line-height: 1; touch-action: none; outline: none; }.agenda-sort-handle:hover { background: rgba(255,255,255,.68); color: var(--ink); transform: none; }.agenda-sort-handle:active { cursor: grabbing; }.agenda-sort-handle:focus { outline: none; box-shadow: none; }.agenda-sort-handle:focus-visible { outline: 2px solid color-mix(in srgb, var(--project-color) 64%, #3f7bb6); outline-offset: 1px; }
.checklist-event { min-height: 0; padding: 7px 0; background: transparent; color: var(--accent-3); text-align: left; box-shadow: none; border-radius: 0; font-size: 13px; font-weight: 600; }
.checklist-event:hover { color: var(--accent-2); }

.project-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

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

.weekday-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
}

.weekday-frequency {
  display: grid;
  gap: 4px;
}

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

.batch-calendar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.weekday-chip {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.weekday-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-chip span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.weekday-chip:hover span {
  background: color-mix(in srgb, var(--frequency-color, var(--accent)) 12%, transparent);
  color: var(--ink);
}

.weekday-chip input:checked + span {
  background: color-mix(in srgb, var(--frequency-color, var(--accent)) 28%, transparent);
  color: color-mix(in srgb, var(--frequency-color, var(--accent)) 78%, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--frequency-color, var(--accent)) 48%, transparent);
  transform: scale(1.04);
}

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

.full-task-list,
.timeline {
  display: grid;
  gap: 8px;
}

.timeline {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.stage-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: #f5f7f4;
  border-bottom: 1px solid var(--line);
}

.stage-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.stage-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 3px 7px;
}

.stage-body {
  display: grid;
  grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
}

.stage-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.execution-task {
  padding: 7px 0;
  border-bottom: 1px solid rgba(217, 222, 229, .75);
}

.execution-task:last-child {
  border-bottom: 0;
}

.stage-events {
  display: grid;
  gap: 8px;
}

.stage-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfb;
}

.stage-event.synced {
  border-color: rgba(45, 122, 72, .45);
  background: #f5fbf7;
}

.stage-event.past {
  background: #faf7f3;
}

.stage-event .date {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent-3);
  font-weight: 700;
  font-size: 13px;
}

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

.automation-item {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.automation-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.form {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.checkline input {
  width: 18px;
  min-height: 18px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 10px;
  background: var(--input-surface);
  color: var(--ink);
}

.native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.glass-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.glass-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 34px 0 10px;
  border: 1px solid rgba(211, 218, 226, .9);
  border-radius: 11px;
  background-color: rgba(255, 255, 255, .76);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-color: rgba(211, 218, 226, .9);
  box-shadow: 0 7px 18px rgba(28, 31, 36, .055), 0 1px 0 rgba(255, 255, 255, .9) inset;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  transition: transform .22s cubic-bezier(.2, .85, .25, 1.25), box-shadow .22s ease, background-color .22s ease;
}

.glass-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid #6f7480;
  border-bottom: 1.7px solid #6f7480;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}

.glass-select-trigger:hover {
  background-color: rgba(255, 255, 255, .92);
  box-shadow: 0 9px 22px rgba(28, 31, 36, .08), 0 1px 0 rgba(255, 255, 255, .94) inset;
}

.glass-select.is-open .glass-select-trigger,
.glass-select-trigger:focus-visible {
  outline: 0;
  transform: scale(1.025);
  border-color: rgba(98, 180, 135, .55);
  box-shadow: 0 12px 26px rgba(28, 31, 36, .12), 0 0 0 3px rgba(98, 180, 135, .14), 0 1px 0 rgba(255, 255, 255, .94) inset;
  animation: control-pop .28s cubic-bezier(.2, .85, .25, 1.25);
}

.glass-select.is-open .glass-select-trigger::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.glass-select-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  min-width: 100%;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 18px 38px rgba(28, 31, 36, .17), 0 1px 0 rgba(255, 255, 255, .94) inset;
  backdrop-filter: blur(22px) saturate(1.16);
  -webkit-backdrop-filter: blur(22px) saturate(1.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(.94);
  transform-origin: top center;
}

.glass-select.is-open .glass-select-menu {
  visibility: visible;
  pointer-events: auto;
  animation: glass-select-menu-in .24s cubic-bezier(.2, .85, .25, 1.18) both;
}

.glass-select-menu.is-open,
.glass-picker-menu.is-open {
  visibility: visible;
  pointer-events: auto;
  animation: glass-select-menu-in .24s cubic-bezier(.2, .85, .25, 1.18) both;
}

.glass-portal-menu {
  position: fixed !important;
  z-index: 200 !important;
  min-width: 0 !important;
}

.glass-select-option {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: none;
}

.glass-select-option:hover,
.glass-select-option:focus-visible {
  background: rgba(255, 255, 255, .72);
  outline: 0;
}

.glass-select-option.selected {
  background: rgba(98, 180, 135, .16);
  color: #22684b;
  font-weight: 700;
}

@keyframes glass-select-menu-in {
  from { opacity: 0; transform: translateY(-8px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.task-card .glass-select {
  width: auto;
  min-width: 72px;
}

.task-card .glass-select-trigger {
  min-height: 26px;
  padding: 0 26px 0 7px;
  border-radius: 999px;
  font-size: 10px;
}

.task-card .glass-select-trigger::after {
  right: 9px;
  width: 5px;
  height: 5px;
}

.task-card .glass-select-menu {
  padding: 5px;
  font-size: 11px;
}

.task-card .glass-select-option {
  min-height: 28px;
  padding: 0 7px;
  font-size: 10px;
}

.native-picker {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.glass-picker {
  position: relative;
  width: 100%;
  min-width: 0;
}
.glass-picker.is-open { z-index: 205; }

.glass-picker-trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(211, 218, 226, .9);
  border-radius: 11px;
  background: rgba(255, 255, 255, .76);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 7px 18px rgba(28, 31, 36, .055), 0 1px 0 rgba(255, 255, 255, .9) inset;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  transition: transform .22s cubic-bezier(.2, .85, .25, 1.25), box-shadow .22s ease, background-color .22s ease;
}

.glass-picker-trigger::after { display: none; }

.glass-picker.is-open .glass-picker-trigger,
.glass-picker-trigger:focus-visible {
  outline: 0;
  transform: scale(1.025);
  border-color: rgba(98, 180, 135, .55);
  box-shadow: 0 12px 26px rgba(28, 31, 36, .12), 0 0 0 3px rgba(98, 180, 135, .14), 0 1px 0 rgba(255, 255, 255, .94) inset;
  animation: control-pop .28s cubic-bezier(.2, .85, .25, 1.25);
}


.glass-picker-menu {
  position: absolute;
  z-index: 46;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(28, 31, 36, .07);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(.94);
  transform-origin: top left;
}

.calendar-sidebar .glass-picker-menu,
.day-detail .glass-picker-menu { left: auto; right: 0; }

.glass-picker.is-open .glass-picker-menu {
  visibility: visible;
  pointer-events: auto;
  animation: glass-select-menu-in .24s cubic-bezier(.2, .85, .25, 1.18) both;
}

.glass-picker-menu.is-open { visibility: visible; pointer-events: auto; animation: glass-select-menu-in .24s cubic-bezier(.2, .85, .25, 1.18) both; }

.glass-picker-toolbar {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  text-align: center;
}

.glass-picker-toolbar strong { font-size: 12px; }
.glass-picker-nav { min-height: 28px; padding: 0; border-radius: 9px; background: rgba(255, 255, 255, .62); color: var(--ink); box-shadow: none; }
.glass-picker-weekdays,
.glass-picker-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.glass-picker-weekdays { margin-bottom: 3px; color: var(--muted); font-size: 10px; text-align: center; }
.glass-picker-day { min-height: 30px; padding: 0; border-radius: 9px; background: transparent; color: var(--ink); box-shadow: none; font-size: 12px; font-weight: 500; }
.glass-picker-day:hover:not(:disabled) { background: rgba(255, 255, 255, .78); }
.glass-picker-day.muted { color: #b1b6be; }
.glass-picker-day.disabled, .glass-picker-day:disabled { color: #c8cdd3; cursor: not-allowed; opacity: .55; }
.glass-picker-day.selected { background: rgba(98, 180, 135, .2); color: #22684b; font-weight: 800; }
.glass-picker-day.today { box-shadow: inset 0 0 0 1px rgba(98, 180, 135, .5); }
.glass-picker-time { margin: 0; padding: 0; border: 0; }
.glass-time-wheels { display: grid; grid-template-columns: 52px 8px 52px; justify-content: center; gap: 2px; align-items: center; }
.glass-time-wheel { display: grid; gap: 3px; max-height: 152px; overflow-y: auto; padding: 2px; scroll-snap-type: y mandatory; scrollbar-width: none; }
.glass-time-wheel::-webkit-scrollbar { display: none; }
.glass-time-option { min-height: 28px; padding: 0 5px; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; font-size: 12px; font-weight: 500; scroll-snap-align: center; }
.glass-time-option:hover { background: rgba(255, 255, 255, .78); }
.glass-time-option.selected { background: transparent; color: #22684b; font-weight: 800; text-decoration: underline; text-decoration-color: rgba(98, 180, 135, .55); text-underline-offset: 4px; }
.glass-time-divider { color: var(--muted); font-size: 15px; font-weight: 800; text-align: center; }
.glass-time-apply { display: block; width: 116px; min-height: 30px; margin: 8px auto 0; border-radius: 10px; background: #2f7c64; color: white; font-size: 11px; }

button:not(:disabled),
.nav a,
.project,
.routine-row,
.task-card,
.compact-task,
.calendar-day,
.calendar-event-chip {
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

button:not(:disabled):hover,
button:not(:disabled):focus-visible,
.nav a:hover,
.nav a:focus-visible,
.project:hover,
.project:focus-visible,
.routine-row:hover,
.routine-row:focus-visible,
.task-card:hover,
.task-card:focus-visible,
.compact-task:hover,
.compact-task:focus-visible,
.calendar-day:hover,
.calendar-day:focus-visible,
.calendar-event-chip:hover,
.calendar-event-chip:focus-visible {
  transform: translateY(-1px);
}

.project:hover,
.project:focus-visible,
.calendar-day:hover,
.calendar-day:focus-visible,
.agenda-card .agenda-summary:hover,
.agenda-card .agenda-summary:focus-visible {
  transform: none;
}

.project:hover,
.project:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(28, 31, 36, .045), 0 0 0 1px rgba(98, 180, 135, .34) inset;
}

.project:has(.project-task > input:hover),
.project:has(.project-task > input:focus-visible) {
  transform: none;
  filter: none;
}

@keyframes control-pop {
  0% { transform: scale(.96); }
  68% { transform: scale(1.035); }
  100% { transform: scale(1.025); }
}

textarea {
  min-height: 68px;
  padding: 8px;
  resize: vertical;
}

.compact-form {
  display: grid;
  gap: 8px;
}

.compact-form input,
.compact-form textarea,
.compact-form .glass-select-trigger,
.compact-form .glass-picker-trigger {
  font-size: 14px;
  line-height: 1.35;
}

.rebase-button {
  justify-self: center;
  min-width: 190px;
  margin: 11px 0 10px;
}

#masterEventForm > button[type="submit"],
#projectEventForm > button[type="submit"],
#routineProjectQuickAddForm > button[type="submit"] {
  margin: 8px 0 6px;
}

#masterEventForm .glass-select-trigger,
#masterEventForm .glass-picker-trigger,
#projectEventForm .glass-select-trigger,
#projectEventForm .glass-picker-trigger {
  box-shadow: none;
}

#masterEventForm .glass-select-trigger:hover,
#masterEventForm .glass-picker-trigger:hover,
#projectEventForm .glass-select-trigger:hover,
#projectEventForm .glass-picker-trigger:hover {
  background: rgba(255, 255, 255, .76);
  box-shadow: none;
  transform: none;
}

label:has(#projectStartDate) .glass-picker-trigger {
  box-shadow: none;
}

label:has(#projectStartDate) .glass-picker-trigger:hover {
  background: rgba(255, 255, 255, .76);
  box-shadow: none;
  transform: none;
}

#masterEventForm .glass-select.is-open .glass-select-trigger,
#masterEventForm .glass-picker.is-open .glass-picker-trigger,
#masterEventForm .glass-select-trigger:focus-visible,
#masterEventForm .glass-picker-trigger:focus-visible,
#projectEventForm .glass-select.is-open .glass-select-trigger,
#projectEventForm .glass-picker.is-open .glass-picker-trigger,
#projectEventForm .glass-select-trigger:focus-visible,
#projectEventForm .glass-picker-trigger:focus-visible {
  outline: 0;
  transform: scale(1.025);
  border-color: rgba(98, 180, 135, .55);
  box-shadow: 0 12px 26px rgba(28, 31, 36, .12), 0 0 0 3px rgba(98, 180, 135, .14), 0 1px 0 rgba(255, 255, 255, .94) inset;
  animation: control-pop .28s cubic-bezier(.2, .85, .25, 1.25);
}

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

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

.routine-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

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

.metric {
  border: 0;
  border-radius: 13px;
  padding: 10px 12px;
  background: #fbfcfd;
  box-shadow: 0 8px 18px rgba(28, 31, 36, .045), 0 1px 0 rgba(255, 255, 255, .88) inset;
}

.metric strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.routine-table {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: white;
}

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

.master-calendar-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .85fr); gap: 14px; align-items: start; }
.master-calendar-layout > .item { margin: 0; }
.master-day-detail { min-height: 0; }
.master-event { width: 100%; min-width: 0; min-height: 0; align-self: start; padding: 9px 10px; text-align: left; background: color-mix(in srgb, var(--project-color) 12%, rgba(255,255,255,.78)); color: var(--ink); box-shadow: 0 5px 14px rgba(28,31,36,.06), inset 0 1px 0 rgba(255,255,255,.82); backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1); }
.master-event strong, .master-event span { display: block; }
.master-event span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.compact-task .meta, .task-card .meta, .status-select { font-size: 12px; white-space: nowrap; }

.task-lane {
  border: 0;
  border-radius: 16px;
  background: #fbfcfd;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  min-height: 120px;
  max-height: 390px;
  box-shadow: 0 8px 18px rgba(28, 31, 36, .04), 0 1px 0 rgba(255, 255, 255, .9) inset;
}

.task-lane-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid rgba(221, 226, 232, .82);
  padding-bottom: 9px;
}

.task-lane-head span {
  color: var(--muted);
  font-size: 12px;
}

.task-lane-scroll {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 111, 115, .28) transparent;
}

.task-lane-scroll::-webkit-scrollbar {
  width: 6px;
}

.task-lane-scroll::-webkit-scrollbar-thumb {
  background: rgba(47, 111, 115, .24);
  border-radius: 999px;
}

.task-lane-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.mini-link {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  text-decoration: none;
  background: white;
  box-shadow: 0 4px 10px rgba(28, 31, 36, .045), 0 1px 0 rgba(255, 255, 255, .8) inset;
}

.mini-link:hover {
  color: var(--ink);
  box-shadow: 0 5px 13px rgba(28, 31, 36, .07), 0 1px 0 rgba(255, 255, 255, .8) inset;
}

.task-card {
  border: 0;
  border-radius: 13px;
  background: white;
  padding: 9px 9px 9px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 16px rgba(28, 31, 36, .045);
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.task-card::before {
  content: none;
}

.task-card:hover {
  box-shadow: 0 8px 22px rgba(30, 34, 40, .055);
  transform: translateY(-1px);
}

.task-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.32;
}

.task-card .meta {
  font-size: 12px;
  line-height: 1.36;
  margin-top: 3px;
}

.task-card .status-select {
  min-width: 72px;
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
}

.task-card.priority-urgent-important {
  --task-accent: #e02f45;
  background: #fff5f6;
  border-color: #ead8d5;
}

.task-card.priority-important {
  --task-accent: #4f6fdc;
  background: #f6f8ff;
  border-color: #ded9ee;
}

.task-card.priority-urgent {
  --task-accent: #d99a1f;
  background: #fffaf0;
  border-color: #eadfcf;
}

.task-card.priority-low {
  --task-accent: #858d99;
  background: #f8fafc;
  border-color: #dde1e6;
}

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

.compact-task {
  --task-accent: #9aa1aa;
  border: 0;
  border-radius: 9px;
  background: white;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 46px;
  padding: 8px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 5px 12px rgba(28, 31, 36, .04), 0 1px 0 rgba(255, 255, 255, .85) inset;
}

.compact-task:hover {
  box-shadow: 0 7px 16px rgba(28, 31, 36, .06), 0 1px 0 rgba(255, 255, 255, .85) inset;
}

.compact-task strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.3;
}

.compact-task .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  margin-top: 2px;
}

.compact-task-dot {
  display: none;
}

.compact-task.priority-urgent-important {
  --task-accent: #e02f45;
  background: #fff5f6;
}

.compact-task.priority-important {
  --task-accent: #4f6fdc;
  background: #f6f8ff;
}

.compact-task.priority-urgent {
  --task-accent: #d99a1f;
  background: #fffaf0;
}

.compact-task.priority-low {
  --task-accent: #858d99;
  background: #f8fafc;
}

.status-select {
  width: auto;
  min-width: 82px;
  min-height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  background: white;
}

.color-dots {
  display: flex;
  gap: 0;
  margin-top: 6px;
  opacity: .56;
  transition: opacity .16s ease;
  width: max-content;
}

.task-card:hover .color-dots,
.task-card:focus-within .color-dots {
  opacity: 1;
}

.color-dot {
  width: 17px;
  height: 17px;
  min-height: 17px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  box-shadow: none;
}

.color-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(32, 33, 36, .16);
  background: var(--dot-color, #858d99);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.color-dot.selected {
  box-shadow: none;
}

.color-dot.selected::after {
  border-color: rgba(32, 33, 36, .48);
  box-shadow: 0 0 0 2px white, 0 0 0 3px rgba(32, 33, 36, .16);
}

.priority-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.priority-tag.priority-urgent-important,
.color-dot.priority-urgent-important {
  color: #9d1d30;
  --dot-color: #e02f45;
  background: #fdecef;
  border-color: #f3b8c1;
}

.priority-tag.priority-important,
.color-dot.priority-important {
  color: #334fa8;
  --dot-color: #4f6fdc;
  background: #eef2ff;
  border-color: #bdc8f5;
}

.priority-tag.priority-urgent,
.color-dot.priority-urgent {
  color: #8f5f00;
  --dot-color: #d99a1f;
  background: #fff2d8;
  border-color: #efc878;
}

.priority-tag.priority-low,
.color-dot.priority-low {
  color: #545b65;
  --dot-color: #858d99;
  background: #eef1f4;
  border-color: #d2d8df;
}

.priority-tag.priority-inbox,
.color-dot.priority-inbox {
  color: #2f6f73;
  background: #e9f3f2;
  border-color: #bdd8d6;
}

.priority-tag.priority-urgent-important {
  background: #fdecef;
  border-color: #f3b8c1;
}

.priority-tag.priority-important {
  background: #f0edf8;
  border-color: #cfc5e8;
}

.priority-tag.priority-urgent {
  background: #fff2d8;
  border-color: #efc878;
}

.priority-tag.priority-low {
  background: #eef1f4;
  border-color: #d2d8df;
}

.color-dot.priority-urgent-important,
.color-dot.priority-important,
.color-dot.priority-urgent,
.color-dot.priority-low,
.color-dot.priority-inbox {
  background: transparent;
  border-color: transparent;
}

.muted-card {
  opacity: .65;
}

.empty-card {
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.routine-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) 98px 92px 128px 82px minmax(180px, 1.3fr);
  min-height: 34px;
  align-items: center;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.routine-row:first-child {
  border-top: 0;
}

.routine-row > div {
  min-width: 0;
  padding: 6px 8px;
  border-left: 1px solid var(--line);
  font-size: 13px;
}

.routine-row > div:first-child {
  border-left: 0;
}

.routine-row-head {
  background: #f4f6f4;
  color: var(--muted);
  font-weight: 700;
  cursor: default;
}

.routine-row.active,
.routine-row:not(.routine-row-head):hover {
  background: #f7fbfb;
}

.routine-title-cell {
  font-weight: 700;
}

.routine-note-cell {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.add-routine-form,
.routine-events-panel {
  margin-top: 10px;
}

.compact-timeline {
  max-height: 430px;
}

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

.event-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: start;
}

.event-row .date {
  color: var(--accent-3);
  font-weight: 700;
  font-size: 13px;
}

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

.mini-button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
  background: white;
  color: var(--ink);
}

.mini-button.danger {
  border-color: rgba(180, 86, 58, .65);
  color: var(--accent-2);
}

.mini-button.cancel-sync {
  border-color: rgba(185, 115, 38, .6);
  color: #985f18;
  background: #fffaf0;
}

.mini-button:disabled {
  cursor: not-allowed;
  opacity: .42;
  color: var(--muted);
  border-color: rgba(118, 128, 140, .35);
  background: #f2f4f5;
}

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

@media (min-width: 901px) and (max-width: 1180px) {
  .calendar-layout { grid-template-columns: minmax(0, 1.35fr) minmax(285px, .85fr); }
  .master-calendar-layout { grid-template-columns: minmax(0, 1.35fr) minmax(285px, .85fr); }
}

.sync-locked .event-summary strong,
.sync-locked .event-summary small {
  color: #718072;
}

.event-row.synced {
  border-color: rgba(45, 122, 72, .45);
  background: #f5fbf7;
}

.event-row.past {
  background: #faf7f3;
}

.hint {
  color: var(--muted);
  line-height: 1.7;
}

.log {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.log .ok {
  color: var(--ok);
}

.log .warn {
  color: var(--warn);
}

.creation-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 24px;
}

.creation-steps span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: #f4f5f6;
  color: var(--muted);
  font-weight: 700;
}

.creation-steps span.active { background: #e5f2eb; color: #2f765c; }
.creation-steps span.done { background: #edf1ef; color: #5c6d64; }
.creation-steps small { font-size: 12px; font-weight: 600; }

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

.creation-type-card {
  display: grid;
  min-height: 180px;
  align-content: center;
  gap: 12px;
  padding: 28px;
  background: white;
  color: var(--ink);
  text-align: left;
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.creation-type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.creation-type-card strong { font-size: 20px; }
.creation-type-card span { color: var(--muted); font-weight: 500; line-height: 1.6; }

.creation-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, .5fr);
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}

.creation-form-main,
.creation-form-aside,
.creation-review {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  border-radius: 20px;
  background: white;
  box-shadow: var(--soft-shadow);
}

.creation-form label,
.template-controls label,
.template-item-editor label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.creation-form input,
.creation-form select,
.creation-form textarea,
.template-controls input,
.template-controls select,
.template-controls textarea,
.template-item-editor input,
.template-item-editor textarea {
  width: 100%;
}

input[type="color"] { min-height: 44px; padding: 4px; }
.curated-color-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 2px; }
.curated-color-choice { display: block; flex: 0 0 auto; cursor: pointer; }
.curated-color-choice input { position: absolute; width: 1px !important; height: 1px; min-height: 1px; opacity: 0; pointer-events: none; }
.curated-color-choice span { display: block; width: 24px; height: 24px; border: 3px solid white; border-radius: 50%; background: var(--choice-color); box-shadow: 0 0 0 1px rgba(70, 76, 83, .13); transition: transform .15s ease, box-shadow .15s ease; }
.curated-color-choice:hover span { transform: translateY(-1px); }
.curated-color-choice input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--choice-color), 0 5px 12px color-mix(in srgb, var(--choice-color) 26%, transparent); transform: scale(1.06); }

.workbench-dialog-overlay { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: rgba(31, 36, 42, .28); backdrop-filter: blur(9px); }
.workbench-dialog { display: grid; justify-items: center; width: min(420px, calc(100vw - 38px)); padding: 24px; border: 1px solid rgba(255, 255, 255, .82); border-radius: 20px; background: rgba(255, 255, 255, .96); box-shadow: 0 24px 70px rgba(27, 32, 38, .22), inset 0 1px 0 #fff; text-align: center; }
.workbench-dialog-mark { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 10px; border-radius: 50%; background: #eef4f1; color: #4d7e6d; font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.workbench-dialog h2 { margin: 0; font-size: 18px; }
.workbench-dialog p { margin: 11px 0 20px; color: var(--muted); white-space: pre-line; line-height: 1.7; }
.workbench-dialog-actions { display: flex; justify-content: center; gap: 10px; width: 100%; }
.workbench-dialog-actions button { min-width: 94px; }
.creation-color-preview { display: grid; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.creation-color-preview span { display: block; height: 52px; border-radius: 14px; background: var(--preview-color); }
.creation-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; }
.creation-review { max-width: 1050px; margin: 0 auto 18px; }
.creation-review-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.creation-review-head strong { font-size: 18px; }
.creation-review-head p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.creation-swatch { width: 34px; height: 34px; border-radius: 50%; }
.creation-preview-weekdays,
.creation-preview-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.creation-preview-weekdays span { padding: 8px; color: var(--muted); font-size: 11px; text-align: center; }
.creation-preview-day { min-height: 86px; padding: 7px; border-top: 1px solid rgba(218, 224, 230, .75); }
.creation-preview-day > span { color: var(--muted); font-size: 11px; }
.creation-preview-day div { display: grid; gap: 3px; margin-top: 6px; }
.creation-preview-day small { overflow: hidden; padding: 3px 5px; border-radius: 5px; background: #e9f0f8; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

.template-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  background: white;
  box-shadow: var(--soft-shadow);
}
.template-card > div:first-child { display: grid; grid-template-columns: auto 1fr; gap: 7px 10px; align-items: center; }
.template-card p { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.55; }
.template-color-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--template-color); }
.template-card-meta,
.template-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.template-card-meta span { padding: 5px 9px; border-radius: 999px; background: #f2f4f5; color: var(--muted); font-size: 11px; }
.template-card-main-actions { display: flex; align-items: center; gap: 8px; margin-right: 6px; }
.template-card-trash-button { display: grid; width: 36px; min-width: 36px; height: 38px; min-height: 38px; padding: 0; place-items: center; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.template-card-trash-button img { width: 34px; height: 34px; object-fit: contain; filter: none; transition: transform .16s ease; }
.template-card-trash-button:hover { border: 0; background: transparent; box-shadow: none; transform: none; }
.template-card-trash-button:hover img { filter: none; transform: translateY(-2px); }
.template-card-trash-button:focus { outline: none; }
.template-card-trash-button:focus-visible { outline: 2px solid #5a8fd8; outline-offset: 2px; border-radius: 7px; }
.template-trash-fab { position: fixed; right: 42px; bottom: 34px; z-index: 35; display: grid; width: 64px; height: 68px; min-height: 68px; padding: 0; place-items: center; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.template-trash-fab:hover { border: 0; background: transparent; box-shadow: none; transform: none; }
.template-trash-fab img { width: 64px; height: 64px; object-fit: contain; filter: none; transition: transform .18s ease; }
.template-trash-fab:hover img { filter: none; transform: translateY(-3px) scale(1.02); }
.template-trash-fab:focus { outline: none; }
.template-trash-fab:focus-visible { outline: 2px solid #5a8fd8; outline-offset: 3px; border-radius: 9px; }
.trash-clear-status { margin-top: 7px; color: #39725a; font-size: 12px; }

.template-editor-layout {
  display: grid;
  grid-template-columns: minmax(215px, .7fr) minmax(0, 1.7fr) minmax(260px, .8fr);
  gap: 14px;
  align-items: start;
}
.template-controls { display: grid; gap: 12px; }
.template-controls .item { display: grid; gap: 11px; }
.template-canvas,
.template-day-panel { padding: 14px; border-radius: 18px; background: white; box-shadow: var(--soft-shadow); }
.template-day-panel { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.relative-calendar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.relative-calendar-head span { color: var(--muted); font-size: 11px; }
.relative-calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); color: var(--muted); font-size: 10px; text-align: center; }
.relative-calendar-weekdays span { padding: 0 4px 7px; }
.relative-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); user-select: none; -webkit-user-select: none; }
.relative-day { min-height: 112px; padding: 8px; border-top: 1px solid rgba(218, 224, 230, .8); background: #fff; cursor: pointer; transition: background .15s ease; }
.relative-day:hover { background: #f6f8f7; }
.relative-day.selected { outline: 2px solid rgba(86, 154, 116, .6); outline-offset: -2px; background: #f3faf6; }
.relative-day.anchor { background: #edf7f1; }
.relative-day-label { display: block; min-height: 22px; color: #347257; font-size: 9.5px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.relative-day.range-selected,
.relative-day.range-selecting { background: rgba(90, 143, 216, .1); box-shadow: inset 0 0 0 1px rgba(90, 143, 216, .32); }
.relative-day-items { display: grid; gap: 4px; }
.relative-day-items span { overflow: hidden; padding: 4px 5px; border-radius: 5px; background: #e8eff8; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; cursor: grab; transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.relative-day-items span:hover, .relative-day-items span:focus-visible { z-index: 2; box-shadow: 0 3px 7px rgba(40, 54, 45, .1); filter: brightness(1.01); transform: translateY(-1px); }
.relative-day-items span.multi-selected { background: #cfe0f5; box-shadow: inset 0 0 0 2px rgba(65, 111, 170, .55); color: #234d7e; }
.relative-day-items small { color: var(--muted); font-size: 10px; }
.template-day-panel { display: grid; gap: 6px; }
.template-day-panel > p { color: var(--muted); font-size: 11px; }
.template-agenda-list { display: grid; gap: 8px; margin-top: 8px; }
.template-agenda-card { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: center; padding: 9px; border-radius: 8px; background: color-mix(in srgb, var(--template-item-color, #5a8fd8) 18%, white); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.template-agenda-card:hover, .template-agenda-card:focus-visible { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(49, 62, 78, .09); }
.template-agenda-card.multi-selected { background: color-mix(in srgb, var(--template-item-color, #5a8fd8) 30%, white); box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--template-item-color, #5a8fd8) 72%, transparent); }
.template-agenda-card strong { display: block; font-size: 12px; }
.template-agenda-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.template-drag-handle { color: #87919b; cursor: grab; }
.template-drag-handle:focus { outline: none; }
.template-drag-handle:focus-visible { outline: 2px solid color-mix(in srgb, var(--template-item-color, #5a8fd8) 68%, #3f7bb6); outline-offset: 2px; border-radius: 4px; }
.template-agenda-summary { display: grid; gap: 3px; min-width: 0; padding: 0; background: transparent; color: var(--ink); box-shadow: none; text-align: left; }
.template-agenda-summary:hover { box-shadow: none; transform: none; }
.template-agenda-expanded { grid-column: 2; display: grid; gap: 9px; color: var(--muted); font-size: 11px; line-height: 1.55; animation: expand-event .18s ease-out; }
.template-agenda-expanded p { margin: 0; }
.template-card-actions { justify-content: flex-end; }
.template-agenda-card > .template-card-actions, .template-agenda-expanded > .template-card-actions { justify-content: flex-start; }
.template-item-editor { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--template-item-color, #5a8fd8) 18%, white); }
.template-item-editor .button-row { justify-content: flex-start; }
.template-item-editor .button-row .mini-button { width: auto; min-height: 28px; padding: 5px 9px; }
.template-batch-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.relative-range-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.relative-day-select { min-width: 0; }
.relative-day-select .glass-select-trigger { min-height: 34px; padding-right: 24px; font-size: 12px; }
.relative-day-select .glass-select-option { min-height: 30px; padding: 0 8px; font-size: 12px; }
.relative-stepper-control { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: white; }
.relative-stepper-control input { min-width: 0; border: 0; border-radius: 0; padding: 0 4px; text-align: center; font-size: 11px; }
.relative-step-button { min-width: 0; min-height: 34px; padding: 0; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; }
.relative-step-button:hover { background: #f3f5f4; box-shadow: none; transform: none; }
.field-invalid input, .field-invalid textarea, .field-invalid select, .field-invalid .glass-select-trigger, .field-invalid .relative-stepper-control, .weekday-frequency.field-invalid { border-color: #d65f5f !important; background: #fff8f8; }
.field-error-message { color: #b84747 !important; font-size: 10px !important; line-height: 1.35; }
.batch-feedback { margin: 0; padding: 8px 10px; border-radius: 9px; background: #fff5eb; color: #9b632a; font-size: 11px; line-height: 1.45; }
.weekday-frequency.single-day { opacity: .58; }
.calendar-day.range-selected, .calendar-day.range-selecting { background: rgba(90, 143, 216, .1); box-shadow: inset 0 0 0 1px rgba(90, 143, 216, .32); }
.calendar-grid.is-marquee-selecting .calendar-day:hover { background: transparent; box-shadow: none; }
.calendar-grid.is-marquee-selecting .calendar-day.range-selecting:hover { background: rgba(90, 143, 216, .1); box-shadow: inset 0 0 0 1px rgba(90, 143, 216, .32); }
.calendar-event-chip.multi-selected,
.calendar-event-chip.multi-selected:hover,
.calendar-event-chip.multi-selected:focus-visible { background: color-mix(in srgb, var(--project-color) 30%, white); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--project-color) 72%, transparent); color: color-mix(in srgb, var(--project-color) 72%, #233044); }
#templateBatchForm input:not([type="checkbox"]),
#templateBatchForm textarea,
#templateBatchForm .glass-select-trigger,
#templateBatchForm .glass-picker-trigger,
.template-item-editor input,
.template-item-editor textarea,
.template-item-editor .glass-picker-trigger { background: #fff; font-size: 12px; line-height: 1.35; }
.template-marquee { position: fixed; z-index: 210; border: 1px solid rgba(65, 111, 170, .72); border-radius: 6px; background: rgba(90, 143, 216, .14); pointer-events: none; }
.template-context-menu { position: fixed; z-index: 230; display: grid; min-width: 190px; gap: 2px; padding: 6px; border: 1px solid rgba(255, 255, 255, .8); border-radius: 13px; background: rgba(250, 251, 251, .94); box-shadow: 0 14px 34px rgba(28, 31, 36, .17); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.template-context-menu button { display: flex; min-height: 32px; padding: 0 9px; align-items: center; justify-content: space-between; border-radius: 8px; background: transparent; color: var(--ink); box-shadow: none; font-size: 12px; text-align: left; }
.template-context-menu button:hover:not(:disabled) { background: rgba(90, 143, 216, .1); box-shadow: none; transform: none; }
.template-context-menu button.danger { color: #a74848; }
.template-context-menu button span { margin-left: 20px; color: var(--muted); font-size: 10px; }

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 20px;
  }

  .top-grid,
  .split,
  .project-grid,
  .master-calendar-layout,
  .detail-grid,
  .execution-layout,
  .calendar-layout,
  .project-summary-strip,
  .stage-body,
  .task-dashboard,
  .form-grid-2,
  .form-grid-3,
  .routine-summary,
  .routine-grid {
    grid-template-columns: 1fr;
  }

  .creation-type-grid,
  .template-grid,
  .creation-form,
  .template-editor-layout,
  .creation-steps,
  .calendar-tools-grid {
    grid-template-columns: 1fr;
  }

  .creation-actions { grid-column: 1; }
  .template-day-panel { position: static; max-height: none; overflow: visible; }
  .project-calendar-sidebar { position: static; max-height: none; overflow: visible; }
  .relative-day { min-height: 82px; }

  main {
    padding: 14px;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .calendar-layout > .day-detail,
  .master-day-detail {
    align-self: auto;
    min-height: 0;
  }

  .agenda-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .stage-head,
  .stage-event {
    grid-template-columns: 1fr;
  }

  .stage-head {
    display: grid;
  }

  .stage-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf1ee;
  --muted: #a6aea8;
  --line: #303732;
  --paper: #111412;
  --panel: #1c211e;
  --surface-raised: #1c211e;
  --surface-soft: #222824;
  --surface-muted: #171b18;
  --surface-hover: rgba(104, 139, 117, .14);
  --surface-glass: rgba(34, 40, 36, .9);
  --topbar-surface: rgba(17, 20, 18, .9);
  --input-surface: #202622;
  --primary-bg: #edf1ee;
  --primary-fg: #171a18;
  --secondary-bg: #252b27;
  --secondary-fg: #edf1ee;
  --soft-inset: rgba(255, 255, 255, .045);
  --overlay: rgba(3, 7, 5, .62);
  --tooltip-surface: rgba(31, 37, 33, .92);
  --danger-surface: rgba(169, 68, 79, .14);
  --accent: #72c39a;
  --accent-2: #d18168;
  --accent-3: #aa94df;
  --ok: #7cc69a;
  --warn: #dfaa6c;
  --shadow: 0 20px 48px rgba(0, 0, 0, .28);
  --soft-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] body { background: var(--paper); }
html[data-theme="dark"] .sidebar { border-right-color: var(--line); }
html[data-theme="dark"] .topbar { border-bottom-color: var(--line); }
html[data-theme="dark"] .band { box-shadow: 0 10px 26px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .025); }
html[data-theme="dark"] button { box-shadow: 0 5px 14px rgba(0, 0, 0, .18); }
html[data-theme="dark"] button.secondary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 5px 13px rgba(0, 0, 0, .13); }
html[data-theme="dark"] .round-tool,
html[data-theme="dark"] .appearance-trigger { color: var(--muted); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 6px 16px rgba(0, 0, 0, .17); }
html[data-theme="dark"] .top-search { color: var(--muted); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 7px 18px rgba(0, 0, 0, .17); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #737d76; }

html[data-theme="dark"] .item,
html[data-theme="dark"] .project,
html[data-theme="dark"] .event-row,
html[data-theme="dark"] .calendar-tool-card,
html[data-theme="dark"] .project-calendar,
html[data-theme="dark"] .day-detail,
html[data-theme="dark"] .stage-panel,
html[data-theme="dark"] .stage-meta span,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .routine-table,
html[data-theme="dark"] .task-lane,
html[data-theme="dark"] .mini-link,
html[data-theme="dark"] .task-card,
html[data-theme="dark"] .compact-task,
html[data-theme="dark"] .status-select,
html[data-theme="dark"] .empty-card,
html[data-theme="dark"] .mini-button,
html[data-theme="dark"] .creation-type-card,
html[data-theme="dark"] .creation-form-main,
html[data-theme="dark"] .creation-form-aside,
html[data-theme="dark"] .creation-review,
html[data-theme="dark"] .template-card,
html[data-theme="dark"] .template-canvas,
html[data-theme="dark"] .template-day-panel,
html[data-theme="dark"] .relative-stepper-control { background: var(--surface-raised); }

html[data-theme="dark"] .item,
html[data-theme="dark"] .project,
html[data-theme="dark"] .event-row,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .task-lane,
html[data-theme="dark"] .compact-task { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 7px 18px rgba(0, 0, 0, .14); }

html[data-theme="dark"] .nav a:hover { border-color: #38423b; }
html[data-theme="dark"] .badge { background: rgba(98, 180, 135, .16); color: #8cd0aa; }
html[data-theme="dark"] .stage-head,
html[data-theme="dark"] .routine-row-head,
html[data-theme="dark"] .creation-steps span,
html[data-theme="dark"] .template-card-meta span { background: #222824; }
html[data-theme="dark"] .stage-event { background: #1d231f; }
html[data-theme="dark"] .stage-event.synced { background: rgba(63, 130, 88, .13); }
html[data-theme="dark"] .stage-event.past { background: rgba(137, 101, 65, .1); }
html[data-theme="dark"] .routine-row.active,
html[data-theme="dark"] .routine-row:not(.routine-row-head):hover { background: rgba(98, 180, 135, .1); }

html[data-theme="dark"] .project-calendar,
html[data-theme="dark"] .day-detail { background: var(--surface-glass); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 10px 28px rgba(0, 0, 0, .18); }
html[data-theme="dark"] .calendar-weekdays span,
html[data-theme="dark"] .calendar-day { border-color: var(--line); }
html[data-theme="dark"] .calendar-day:hover { background: rgba(91, 143, 108, .1); box-shadow: inset 0 0 0 1px rgba(107, 174, 127, .3); }
html[data-theme="dark"] .calendar-day.selected { background: rgba(91, 143, 108, .15); box-shadow: inset 0 0 0 2px rgba(118, 190, 141, .62); }
html[data-theme="dark"] .calendar-day.camp-start { background: rgba(173, 108, 68, .11); }
html[data-theme="dark"] .calendar-day.muted-day { background: rgba(255, 255, 255, .014); color: #68716b; }
html[data-theme="dark"] .calendar-day.muted-day:hover { background: rgba(255, 255, 255, .025); }
html[data-theme="dark"] .calendar-lunar { color: #98a29b; }
html[data-theme="dark"] .calendar-day.muted-day .calendar-lunar { color: #68716b; }
html[data-theme="dark"] .calendar-solar-term { background: rgba(204, 153, 62, .17); color: #dcb66f; }
html[data-theme="dark"] .calendar-more { color: #87918a; }
html[data-theme="dark"] .master-chip,
html[data-theme="dark"] .agenda-card,
html[data-theme="dark"] .agenda-editor { background: color-mix(in srgb, var(--project-color) 24%, var(--surface-raised)); color: #dce4de; }
html[data-theme="dark"] .agenda-card:hover { background: color-mix(in srgb, var(--project-color) 30%, var(--surface-raised)); box-shadow: 0 5px 12px rgba(0, 0, 0, .18); }
html[data-theme="dark"] .agenda-card.multi-selected { background: color-mix(in srgb, var(--project-color) 36%, var(--surface-raised)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--project-color) 68%, transparent); }
html[data-theme="dark"] .agenda-card.done,
html[data-theme="dark"] .agenda-card.done:hover { background: color-mix(in srgb, var(--project-color) 8%, var(--surface-raised)); }
html[data-theme="dark"] .agenda-summary small { color: #aeb8b1; }
html[data-theme="dark"] .agenda-sort-handle:hover { background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .calendar-event-chip.multi-selected,
html[data-theme="dark"] .calendar-event-chip.multi-selected:hover,
html[data-theme="dark"] .calendar-event-chip.multi-selected:focus-visible { background: color-mix(in srgb, var(--project-color) 36%, var(--surface-raised)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--project-color) 74%, transparent); color: #f0f4f1; }

html[data-theme="dark"] .info-tooltip,
html[data-theme="dark"] .template-context-menu,
html[data-theme="dark"] .appearance-menu { border-color: #3a433d; background: var(--tooltip-surface); box-shadow: 0 18px 42px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .035); }
html[data-theme="dark"] .info-tooltip span { color: #b2bbb5; }
html[data-theme="dark"] .info-tooltip p { color: #e2e8e3; }
html[data-theme="dark"] .template-context-menu button:hover:not(:disabled) { background: rgba(100, 146, 117, .15); }

html[data-theme="dark"] .glass-select-trigger,
html[data-theme="dark"] .glass-picker-trigger { border-color: #39423c; background: rgba(34, 40, 36, .86); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 7px 18px rgba(0, 0, 0, .16); }
html[data-theme="dark"] .glass-select-trigger:hover,
html[data-theme="dark"] #masterEventForm .glass-select-trigger:hover,
html[data-theme="dark"] #masterEventForm .glass-picker-trigger:hover,
html[data-theme="dark"] #projectEventForm .glass-select-trigger:hover,
html[data-theme="dark"] #projectEventForm .glass-picker-trigger:hover,
html[data-theme="dark"] label:has(#projectStartDate) .glass-picker-trigger:hover { background: #29302b; }
html[data-theme="dark"] .glass-select-menu,
html[data-theme="dark"] .glass-picker-menu { border-color: #3b453e; background: rgba(31, 37, 33, .97); box-shadow: 0 18px 38px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .035); }
html[data-theme="dark"] .glass-select-option:hover,
html[data-theme="dark"] .glass-select-option:focus-visible,
html[data-theme="dark"] .glass-picker-day:hover:not(:disabled),
html[data-theme="dark"] .glass-time-option:hover,
html[data-theme="dark"] .glass-picker-nav { background: rgba(255, 255, 255, .065); }
html[data-theme="dark"] .glass-select-option.selected,
html[data-theme="dark"] .glass-picker-day.selected,
html[data-theme="dark"] .glass-time-option.selected { color: #8fd0aa; }

html[data-theme="dark"] .weekday-chip input:checked + span {
  background: color-mix(in srgb, var(--frequency-color, var(--accent)) 34%, transparent);
  color: color-mix(in srgb, var(--frequency-color, var(--accent)) 62%, #f2f5f3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--frequency-color, var(--accent)) 58%, transparent);
}
html[data-theme="dark"] .weekday-chip:hover span { background: color-mix(in srgb, var(--frequency-color, var(--accent)) 16%, transparent); }

html[data-theme="dark"] .task-card.priority-urgent-important,
html[data-theme="dark"] .compact-task.priority-urgent-important { background: rgba(224, 47, 69, .11); }
html[data-theme="dark"] .task-card.priority-important,
html[data-theme="dark"] .compact-task.priority-important { background: rgba(79, 111, 220, .12); }
html[data-theme="dark"] .task-card.priority-urgent,
html[data-theme="dark"] .compact-task.priority-urgent { background: rgba(217, 154, 31, .11); }
html[data-theme="dark"] .task-card.priority-low,
html[data-theme="dark"] .compact-task.priority-low { background: rgba(133, 141, 153, .1); }
html[data-theme="dark"] .color-dot.selected::after { box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 3px rgba(255, 255, 255, .18); }

html[data-theme="dark"] .creation-steps span.active { background: rgba(98, 180, 135, .17); color: #91cfac; }
html[data-theme="dark"] .creation-steps span.done { background: #222824; color: #a4aea7; }
html[data-theme="dark"] .curated-color-choice span { border-color: var(--surface-raised); }
html[data-theme="dark"] .curated-color-choice input:checked + span { box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 4px var(--choice-color), 0 5px 12px color-mix(in srgb, var(--choice-color) 22%, transparent); }
html[data-theme="dark"] .creation-preview-day { border-color: var(--line); }
html[data-theme="dark"] .creation-preview-day small { background: rgba(90, 143, 216, .16); }

html[data-theme="dark"] .relative-day { border-color: var(--line); background: #1b201d; }
html[data-theme="dark"] .relative-day:hover { background: #222824; }
html[data-theme="dark"] .relative-day.selected { background: rgba(91, 143, 108, .14); }
html[data-theme="dark"] .relative-day.anchor { background: rgba(74, 137, 94, .16); }
html[data-theme="dark"] .relative-day-label { color: #85c6a2; }
html[data-theme="dark"] .relative-day-items span { background: rgba(90, 143, 216, .17); color: #dbe6f4; }
html[data-theme="dark"] .relative-day-items span.multi-selected { background: rgba(90, 143, 216, .3); box-shadow: inset 0 0 0 2px rgba(109, 160, 226, .62); color: #edf4fc; }
html[data-theme="dark"] .template-agenda-card,
html[data-theme="dark"] .template-item-editor { background: color-mix(in srgb, var(--template-item-color, #5a8fd8) 24%, var(--surface-raised)); }
html[data-theme="dark"] .agenda-card.drag-as-chip,
html[data-theme="dark"] .template-agenda-card.drag-as-chip,
html[data-theme="dark"] .calendar-event-chip.drag-as-card,
html[data-theme="dark"] .relative-day-items > span.drag-as-card,
html[data-theme="dark"] .template-agenda-list > span.drag-as-card { background: color-mix(in srgb, var(--project-color, var(--template-item-color, #5a8fd8)) 28%, var(--surface-raised)); color: #e6ece8; }
html[data-theme="dark"] .agenda-card.drag-as-chip .agenda-summary,
html[data-theme="dark"] .template-agenda-card.drag-as-chip .template-agenda-summary { color: #e6ece8; }
html[data-theme="dark"] .template-agenda-card.multi-selected { background: color-mix(in srgb, var(--template-item-color, #5a8fd8) 36%, var(--surface-raised)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--template-item-color, #5a8fd8) 72%, transparent); }
html[data-theme="dark"] .relative-step-button:hover { background: rgba(255, 255, 255, .06); }

html[data-theme="dark"] .workbench-dialog-overlay { background: var(--overlay); }
html[data-theme="dark"] .workbench-dialog { border-color: #3a433d; background: #202622; box-shadow: 0 26px 76px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .035); }
html[data-theme="dark"] .workbench-dialog-mark { background: rgba(98, 180, 135, .14); color: #91c9aa; }
html[data-theme="dark"] .field-invalid input,
html[data-theme="dark"] .field-invalid textarea,
html[data-theme="dark"] .field-invalid select,
html[data-theme="dark"] .field-invalid .glass-select-trigger,
html[data-theme="dark"] .field-invalid .relative-stepper-control,
html[data-theme="dark"] .weekday-frequency.field-invalid { background: rgba(178, 67, 74, .12); }
html[data-theme="dark"] .batch-feedback { background: rgba(185, 115, 38, .13); color: #e0ad77; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
