:root {
  color-scheme: light;
  --ink: #1a2b2b;
  --muted: #647676;
  --line: rgba(31, 69, 69, 0.13);
  --soft-line: rgba(31, 69, 69, 0.08);
  --glass: rgba(247, 252, 252, 0.84);
  --native-glass: rgba(246,252,251,.48);
  --paper: rgba(255, 255, 255, 0.65);
  --teal: #1d7773;
  --teal-dark: #125b58;
  --mint: #d9efeb;
  --highlight-bg: rgba(217,239,235,.38);
  --accent-rgb: 29,119,115;
  --coral: #e56b56;
  --blue: #5b7fa3;
  --sand: #b68a57;
  --shadow: 0 24px 80px rgba(23, 52, 52, 0.2);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="pink"] { --teal: #e36488; --teal-dark: #db5a66; --mint: rgba(227,100,136,.17); --highlight-bg: rgba(227,100,136,.16); --accent-rgb: 227,100,136; --glass: rgba(255,247,251,.86); --native-glass: rgba(255,242,248,.48); }
:root[data-theme="yellow"] { --teal: #9b7425; --teal-dark: #745315; --mint: #f8edc8; --highlight-bg: rgba(248,237,200,.55); --accent-rgb: 155,116,37; --glass: rgba(255,252,239,.87); --native-glass: rgba(255,250,230,.48); }
:root[data-theme="blue"] { --teal: #4b7faa; --teal-dark: #2d608c; --mint: #dcecf8; --highlight-bg: rgba(220,236,248,.5); --accent-rgb: 75,127,170; --glass: rgba(246,250,255,.86); --native-glass: rgba(239,248,255,.48); }

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  color: var(--ink);
  background: #dfe9e8;
  overflow: hidden;
}

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

.desktop-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: #dbe7e6;
  background-image:
    linear-gradient(rgba(255,255,255,.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.34) 1px, transparent 1px);
  background-size: 72px 72px;
}

.desktop-stage::before,
.desktop-stage::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.68);
  background: rgba(255,255,255,.18);
  box-shadow: 0 18px 48px rgba(43, 77, 75, .08);
  backdrop-filter: blur(8px);
}

.desktop-stage::before {
  width: 36vw;
  height: 28vh;
  left: 8vw;
  top: 17vh;
}

.desktop-stage::after {
  width: 29vw;
  height: 21vh;
  left: 22vw;
  bottom: 12vh;
}

.ambient-copy {
  position: absolute;
  left: clamp(32px, 7vw, 104px);
  top: clamp(38px, 9vh, 100px);
  z-index: 1;
  color: rgba(23, 63, 61, .48);
}

.ambient-copy span {
  display: block;
  margin-bottom: 12px;
  font-size: .72rem;
  letter-spacing: .22em;
}

.ambient-copy strong {
  font-family: ui-serif, "Songti SC", STSong, serif;
  font-size: clamp(1.9rem, 4vw, 4.4rem);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -.04em;
}

.hot-edge {
  position: fixed;
  z-index: 10;
  right: 0;
  top: 34%;
  width: 36px;
  min-height: 142px;
  border: 1px solid rgba(255,255,255,.72);
  border-right: 0;
  border-radius: 16px 0 0 16px;
  background: rgba(246,252,251,.8);
  box-shadow: -8px 12px 30px rgba(36,75,72,.14);
  backdrop-filter: blur(20px);
  cursor: pointer;
  color: var(--teal-dark);
  transition: opacity .2s ease, transform .2s ease;
}

.hot-edge span {
  display: block;
  margin: auto;
  writing-mode: vertical-rl;
  letter-spacing: .24em;
  font-size: .8rem;
}

.hot-edge b {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin: 11px auto 0;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: .7rem;
}

.todo-shell {
  position: fixed;
  z-index: 20;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(920px, calc(100vw - 48px));
  transform: translateX(calc(100% + 30px));
  transition: transform .38s cubic-bezier(.2,.8,.2,1);
}

.todo-shell.is-open { transform: translateX(0); }

.shell-inner {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 26px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(118%);
  -webkit-backdrop-filter: blur(30px) saturate(118%);
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 26px 18px;
  border-bottom: 1px solid var(--soft-line);
}

.appearance-panel {
  position: absolute;
  z-index: 50;
  top: 65px;
  right: 20px;
  width: min(310px, calc(100vw - 40px));
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 18px 48px rgba(23,52,52,.22);
}
.appearance-panel[hidden] { display: none; }
.appearance-panel h2 { margin: 0 0 13px; font-size: .95rem; }
.appearance-label { display: block; margin: 12px 0 7px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.appearance-label output { float: right; color: var(--teal-dark); }
.theme-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.theme-option { display: grid; justify-items: center; gap: 5px; padding: 8px 3px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; font-size: .73rem; }
.theme-option[aria-pressed="true"] { border-color: var(--teal); color: var(--teal-dark); background: var(--mint); }
.theme-option i { width: 20px; height: 20px; border-radius: 50%; background: var(--theme-swatch); }
.theme-option[data-theme="green"] { --theme-swatch: #1d7773; }
.theme-option[data-theme="pink"] { --theme-swatch: #e36488; }
.theme-option[data-theme="yellow"] { --theme-swatch: #d9af45; }
.theme-option[data-theme="blue"] { --theme-swatch: #4b7faa; }
.custom-color-row { display: flex; gap: 6px; margin-top: 7px; }
.custom-color-row button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; font-size: .73rem; }
#customColorButton { flex: 1; }
#customColorButton[aria-pressed="true"] { border-color: var(--teal); background: var(--mint); color: var(--teal-dark); }
#customColorSwatch { flex: none; width: 17px; height: 17px; border-radius: 50%; background: #1d7773; border: 1px solid rgba(0,0,0,.13); }
#customColorHex { margin-left: auto; color: var(--muted); font-size: .67rem; }
#eyedropperButton { flex: none; }
#opacitySlider { width: 100%; accent-color: var(--teal); cursor: pointer; }
#edgeLabelInput { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline-color: var(--teal); background: white; }
#edgeLabelInput[aria-invalid="true"] { border-color: #bb3c48; }
.appearance-hint { margin: 6px 0 0; color: var(--muted); font-size: .69rem; }
.auto-height-option { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: .77rem; cursor: pointer; }
.auto-height-option input { accent-color: var(--teal); }
.edge-label-row { display: flex; gap: 7px; }
.edge-label-row #edgeLabelInput { min-width: 0; }
.edge-label-save { flex: none; padding: 0 12px; border: 0; border-radius: 9px; background: var(--teal); color: white; cursor: pointer; font-weight: 600; }
.edge-label-save:hover { background: var(--teal-dark); }
.appearance-error { min-height: 1em; margin: 6px 0 0; color: #bb3c48; font-size: .69rem; }

.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand > div { min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: white;
  background: var(--teal);
  font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb),.22);
}

.brand h1 { margin: 0; font-size: 1.18rem; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.22; }
.brand p { margin: 3px 0 0; font-size: .78rem; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 9px; flex: none; }

.focus-count {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 650;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 1.05rem;
}

.icon-button:hover,
.icon-button[aria-pressed="true"] { background: white; color: var(--teal); }
.mode-button { width: auto; min-width: 49px; padding: 0 8px; font-size: .73rem; font-weight: 650; white-space: nowrap; }

.top-nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 26px;
}

.view-tabs,
.category-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-tabs {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.38);
}

.view-tab,
.category-pill {
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.view-tab {
  padding: 7px 15px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 620;
}

.view-tab.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(35,67,65,.08);
}

.category-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .78rem;
}

.category-pill:hover,
.category-pill.is-active { background: rgba(var(--accent-rgb),.1); color: var(--teal-dark); }

.quick-add {
  margin: 0 26px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.7);
  box-shadow: 0 9px 28px rgba(36,75,72,.08);
}

.quick-add:focus-within { border-color: rgba(var(--accent-rgb),.42); box-shadow: 0 10px 30px rgba(var(--accent-rgb),.12); }

.quick-add-main { display: flex; align-items: center; gap: 10px; padding: 11px 12px 9px 15px; }
.add-symbol { color: var(--teal); font-size: 1.35rem; }
.task-input-wrap { position: relative; flex: 1; min-width: 0; }

#taskTitle {
  width: 100%;
  min-height: 35px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: .98rem;
}

#taskTitle::placeholder { color: #8b9a99; }

.add-button {
  min-width: 82px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--teal);
  cursor: pointer;
  font-size: .84rem;
  font-weight: 680;
}

.add-button:hover { background: var(--teal-dark); }

.suggestions {
  display: none;
  position: absolute;
  z-index: 40;
  top: 39px;
  left: -30px;
  right: -82px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 38px rgba(35,64,63,.16);
}

.suggestions.is-visible { display: block; }

.suggestion {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-size: .84rem;
}

.suggestion:hover,
.suggestion.is-active { background: var(--mint); color: var(--teal-dark); }

.quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px 12px 10px 45px;
  border-top: 1px solid var(--soft-line);
}

.compact-field {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  padding: 0 8px;
  border-right: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: .74rem;
}

.compact-field:last-child { border-right: 0; }

.compact-field input,
.compact-field select {
  max-width: 126px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: .76rem;
}

.repeat-field { display: none; }
.repeat-field.is-visible { display: flex; }
.reminder-detail { display: none; flex-wrap: wrap; gap: 4px; }
.reminder-detail.is-visible { display: flex; }
.custom-lead { display: none; }
.custom-lead.is-visible { display: flex; }
.custom-lead input { width: 56px; }

.smart-parse {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  margin-left: auto;
  padding: 0 8px;
  border-radius: 8px;
  color: #728382;
  font-size: .7rem;
  white-space: nowrap;
}

.smart-parse b { color: var(--teal); font-size: .82rem; }
.smart-parse.has-result { background: rgba(var(--accent-rgb),.08); color: var(--teal-dark); }

.workspace { min-height: 0; overflow: auto; padding: 0 26px 20px; scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb),.25) transparent; }
.view-panel { display: none; }
.view-panel.is-active { display: block; }

.day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "overdue tomorrow" "today dayafter";
  gap: 10px;
}
.day-column.is-overdue { grid-area: overdue; }
.day-column.is-today { grid-area: today; }
.day-column.is-tomorrow { grid-area: tomorrow; }
.day-column.is-day-after { grid-area: dayafter; }

.day-column {
  min-height: 310px;
  padding: 13px;
  border-left: 1px solid var(--line);
  background: rgba(255,255,255,.26);
}

.day-column:first-child { border-left: 0; }
.day-column.is-today { background: var(--highlight-bg); }

.day-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 50px;
  margin-bottom: 11px;
}

.day-name { display: block; margin-bottom: 4px; font-size: .88rem; font-weight: 720; }
.day-date { font-size: .74rem; color: var(--muted); }

.day-badge {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb),.1);
  color: var(--teal-dark);
  font-size: .7rem;
  font-weight: 700;
}

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

.task-row {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255,255,255,.7);
  transition: transform .16s ease, border-color .16s ease, opacity .16s ease;
}

.task-row:hover { transform: translateY(-1px); border-color: var(--line); }
.task-row.is-done { opacity: .52; }
.task-row.is-done .task-title { text-decoration: line-through; }

.check-button {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  margin-top: 1px;
  border: 1.5px solid #8ca5a3;
  border-radius: 6px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: .7rem;
}

.is-done .check-button { border-color: var(--teal); background: var(--teal); }
.task-copy { min-width: 0; }
.task-title { display: block; line-height: 1.35; font-size: .82rem; overflow-wrap: anywhere; }

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  color: var(--muted);
  font-size: .67rem;
}

.category-dot { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--blue); }
.category-dot.life { background: var(--coral); }
.category-dot.personal { background: var(--sand); }

.delete-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9aabaa;
  cursor: pointer;
  opacity: 0;
}

.task-actions { display: flex; align-items: center; gap: 2px; }
.reminder-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(var(--accent-rgb),.08);
  color: var(--teal);
  cursor: pointer;
  font-size: .85rem;
}
.reminder-button.is-off { background: transparent; color: #a4b1b0; }
.reminder-button:hover { background: rgba(var(--accent-rgb),.16); }

.task-row:hover .delete-button,
.delete-button:focus { opacity: 1; }
.delete-button:hover { background: rgba(229,107,86,.1); color: var(--coral); }

.empty-state {
  padding: 24px 5px;
  color: #8a9998;
  text-align: center;
  font-size: .75rem;
  line-height: 1.5;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.overview-column {
  min-height: 390px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.42);
}

.long-column { background: var(--highlight-bg); }
.column-heading { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--teal); font-size: .62rem; letter-spacing: .16em; }
.column-heading h2 { margin: 0; font-size: 1rem; }
.column-count { display: grid; place-items: center; min-width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: .76rem; }
.column-note { margin: 8px 0 15px; color: var(--muted); font-size: .74rem; }
.overview-list { display: grid; gap: 8px; }
.overview-list .task-row { grid-template-columns: 21px minmax(0, 1fr) auto; padding: 11px; }

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 26px;
  border-top: 1px solid var(--soft-line);
  color: #7b8d8c;
  font-size: .68rem;
}

.app-footer button { border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: inherit; }
.app-footer button.is-muted { color: var(--coral); }
kbd { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-right: 3px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.55); font-family: inherit; font-size: .64rem; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 18px);
  padding: 10px 15px;
  border-radius: 11px;
  background: #173c3a;
  color: white;
  font-size: .8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .todo-shell { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .top-nav { align-items: flex-start; flex-direction: column; gap: 10px; }
  .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-column.is-today { border-left: 0; }
}

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

@media (max-width: 560px) {
  body { overflow: auto; }
  .ambient-copy, .hot-edge { display: none; }
  .todo-shell { position: relative; inset: auto; width: 100%; min-height: 100vh; transform: none; }
  .shell-inner { min-height: 100vh; border: 0; border-radius: 0; }
  .app-header, .top-nav { padding-left: 16px; padding-right: 16px; }
  .quick-add { margin-left: 16px; margin-right: 16px; }
  .workspace { padding-left: 16px; padding-right: 16px; }
  .category-tabs { max-width: 100%; overflow-x: auto; }
  .day-grid { grid-template-columns: 1fr; grid-template-areas: "overdue" "today" "tomorrow" "dayafter"; }
  .day-column { min-height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .day-column:first-child { border-top: 0; }
  .quick-options { padding-left: 12px; }
  .smart-parse { width: 100%; margin-left: 0; }
  .app-footer { padding: 9px 16px; }
  .app-footer span:first-child { display: none; }
}

@media (pointer: coarse) {
  .todo-shell { transform: none; }
  .hot-edge { display: none; }
}

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