:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #edf3ff;
  background: #02040a;
  --muted: #a8b5c9;
  --dim: #8897ae;
  --blue: #78bbff;
  --line: #1b2638;
  --sidebar-width: 188px;
  --rail-width: clamp(288px, 26.25vw, 400px);
  --page-edge: clamp(13px, 1.8vw, 28px);
  --grid-gap: 15px;
  --radius: 13px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #9acbff; outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--muted); font-size: .79rem; line-height: 1.5; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 9px 13px;
  color: #edf4ff;
  border-radius: 7px;
  background: #143b73;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 29px 8px 18px;
  border-right: 1px solid #142031;
  background: linear-gradient(171deg, #03060d, #050912 65%, #02050b);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  margin: 0 0 45px 24px;
  color: #f3f7ff;
  font-size: 1.25rem;
  font-weight: 550;
  letter-spacing: .085em;
  white-space: nowrap;
}

.brand .icon {
  width: 31px;
  height: 31px;
  color: #8bcdff;
  stroke-width: 1.05;
  filter: drop-shadow(0 0 6px #268affcd);
}

.side-nav { display: grid; gap: 7px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 49px;
  padding: 8px 13px 8px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #acb7cb;
  font-size: .86rem;
}

.side-nav a:hover { color: #edf6ff; background: #091324; }
.side-nav a[aria-current="page"] {
  color: #94c8ff;
  border-left-color: #4ba0ff;
  background: linear-gradient(100deg, #102547, #07101f);
}
.side-nav a[aria-current="page"] .icon { filter: drop-shadow(0 0 7px #368aff); }

.storage-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: auto 7px 0;
  padding: 11px 8px;
  border: 1px solid #151f30;
  border-radius: 10px;
  background: #050b17;
}
.storage-note .icon { width: 16px; height: 16px; color: var(--blue); }
.storage-note strong, .storage-note span { display: block; }
.storage-note strong { font-size: .7rem; font-weight: 600; }
.storage-note span { margin-top: 3px; color: var(--dim); font-size: .64rem; }

.workspace { min-width: 0; }

.topbar, .command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-width);
  gap: var(--grid-gap);
  max-width: 1770px;
  margin-inline: auto;
  padding-inline: var(--page-edge);
}
.topbar { align-items: center; min-height: 75px; }
.mobile-brand { display: none; }
.toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 13px; }
.toolbar-date { display: grid; gap: 3px; justify-items: end; white-space: nowrap; font-size: .75rem; }
.toolbar-date time:first-child { color: var(--muted); }
.toolbar-date time:last-child { color: #8ebcff; font-variant-numeric: tabular-nums; }

.search-trigger {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-self: center;
  width: min(100%, 361px);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #192235;
  border-radius: 9px;
  color: var(--muted);
  background: #050910bc;
  text-align: left;
  font-size: .76rem;
}
.search-trigger:hover { color: #e6f2ff; border-color: #335987; }
.search-trigger .icon { width: 17px; height: 17px; color: #9badc6; }
.search-trigger kbd { margin-left: auto; color: var(--dim); font: inherit; font-size: .68rem; white-space: nowrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .78rem;
  font-weight: 630;
  white-space: nowrap;
}
.button .icon { width: 16px; height: 16px; }
.primary { color: #f3f8ff; background: linear-gradient(145deg, #1c5bd0, #113577); border-color: #4d8bdf; box-shadow: 0 0 16px #135cd244; }
.primary:hover { background: #1e54bf; border-color: #9bc8ff; }
.secondary { color: #e0e9fb; background: #111c30; border-color: #293956; }
.secondary:hover { background: #182641; }

.command-grid { align-items: start; padding-bottom: 18px; }
.galaxy-column, .command-rail { min-width: 0; }
.command-rail { display: grid; gap: 13px; margin-top: 15px; }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #070e1b, #040912 72%);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  min-height: 55px;
  margin: 0 17px;
  border-bottom: 1px solid var(--line);
}
.section-heading { display: flex; align-items: center; gap: 9px; }
.section-heading .icon { width: 19px; height: 19px; color: #b4c4da; }
.section-heading h2 { font-size: .79rem; font-weight: 570; letter-spacing: .02em; text-transform: uppercase; }
.summary .panel-header, .upcoming .panel-header { justify-content: flex-start; }

.summary-rows { display: grid; gap: 15px; padding: 15px 17px 17px; }
.summary-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; }
.metric-mark {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: #e0efff;
  background: linear-gradient(140deg, #306cfc, #1240bf);
  box-shadow: 0 0 10px #1859f340;
}
.metric-mark .icon { width: 13px; height: 13px; stroke-width: 2; }
.summary-row:last-child .metric-mark { color: #5aaaff; background: #092043; }
.summary-metric { min-width: 0; }
.summary-metric > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 19px; margin-bottom: 8px; }
.summary-metric label { color: #c9d4e5; font-size: .75rem; }
.summary-metric strong { font-size: .75rem; font-weight: 560; white-space: nowrap; }

progress {
  display: block;
  width: 100%;
  height: 5px;
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: #1b263c;
  accent-color: #4a97ff;
}
progress::-webkit-progress-bar { border-radius: 10px; background: #1b263c; }
progress::-webkit-progress-value { border-radius: 10px; background: linear-gradient(90deg, #2655f5, #46a4ff); }
progress::-moz-progress-bar { border-radius: 10px; background: linear-gradient(90deg, #2655f5, #46a4ff); }

.task-count {
  min-width: 19px;
  padding: 2px 5px;
  border: 1px solid #253c5a;
  border-radius: 9px;
  color: #aac6ef;
  background: #0b182e;
  text-align: center;
  font-size: .65rem;
}
.task-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 11px 17px 5px; }
.filters { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #23314a; border-radius: 8px; background: #050a13; }
.filters button { padding: 5px 9px; border: 0; border-radius: 5px; color: var(--muted); background: none; font-size: .69rem; font-weight: 600; }
.filters button:hover { color: #fff; }
.filters button[aria-pressed="true"] { background: #152e51; color: #c5deff; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--blue);
  font-size: .75rem;
}
.text-link:hover { color: #cdeaff; }
.text-link .icon { width: 14px; height: 14px; }

.task-list, .upcoming-list, .finder-results, .check-history ul { list-style: none; margin: 0; padding: 0; }
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content 32px;
  align-items: center;
  gap: 7px;
  min-height: 57px;
  padding: 8px 13px 8px 17px;
}
.task-row + .task-row { border-top: 1px solid #142036; }
.task-row:hover { background: #101a2d; }
.task-toggle { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 34px; }
.task-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.task-checkbox {
  display: grid;
  place-items: center;
  flex: none;
  width: 19px;
  height: 19px;
  border: 1px solid #4b6489;
  border-radius: 5px;
  color: transparent;
  background: #081222;
}
.task-toggle input:focus-visible + .task-checkbox { outline: 2px solid #93c8ff; outline-offset: 3px; }
.task-toggle input:checked + .task-checkbox { color: #e9f4ff; border-color: #548de9; background: #245acc; }
.task-checkbox .icon { width: 14px; height: 14px; stroke-width: 2; }
.task-name { overflow-wrap: anywhere; font-size: .77rem; }
.completed .task-name { text-decoration: line-through; color: var(--dim); }
.task-date { grid-column: 2; max-width: 102px; padding: 4px 6px; border-radius: 6px; color: #abc9f4; background: #10203b; font-size: .65rem; text-align: right; }
.task-date.past-due { color: #ffc0ac; background: #362126; }
.task-edit { grid-column: 3; }

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}
.icon-button:hover { border-color: #314766; color: #e4efff; background: #15243e; }
.icon-button .icon, .panel-header .panel-add .icon { width: 16px; height: 16px; }
.panel-add { color: #9bc8ff; }

.empty-state { display: grid; justify-items: center; gap: 6px; min-height: 159px; padding: 17px 13px; text-align: center; align-content: center; }
.empty-icon { display: grid; place-items: center; width: 35px; height: 35px; margin-bottom: 2px; border: 1px solid #233d66; border-radius: 9px; color: #82baff; background: #0d1c35; }
.empty-icon .icon { width: 18px; height: 18px; }
.empty-state #empty-title { font-size: .8rem; font-weight: 620; }
.empty-state #empty-description { color: var(--muted); font-size: .72rem; }
.panel-footer { margin-inline: 17px; padding: 12px 0; border-top: 1px solid var(--line); }
.panel-footer .text-link { display: flex; justify-content: space-between; }
.overdue-link { color: #ffc0ac; }
.panel-footer .overdue-link { justify-content: flex-start; gap: 7px; }

.upcoming-empty { padding: 19px 17px; color: var(--muted); font-size: .75rem; }
.upcoming-list { padding-inline: 17px; }
.upcoming-list li { display: grid; gap: 3px; position: relative; padding: 12px 0 12px 16px; font-size: .77rem; overflow-wrap: anywhere; }
.upcoming-list li + li { border-top: 1px solid #152035; }
.upcoming-list li::before { content: ""; position: absolute; left: 3px; top: 18px; width: 5px; height: 5px; border-radius: 50%; background: #489bff; box-shadow: 0 0 8px #2f7feb; }
.upcoming-list time { color: var(--muted); font-size: .68rem; }

.dock {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  width: min(670px, 92%);
  min-height: 73px;
  margin: 18px 3px 0 auto;
  padding: 5px 12px;
  border: 1px solid #182336;
  border-radius: 999px;
  background: #040914ed;
}
.dock a { display: grid; justify-items: center; align-content: center; min-height: 49px; gap: 4px; border-radius: 20px; color: #b1bfd4; font-size: .68rem; }
.dock a .icon { width: 22px; height: 22px; }
.dock a:hover { color: #e1efff; }
.dock a[aria-current="page"] { color: #77baff; }
.dock a[aria-current="page"] .icon { filter: drop-shadow(0 0 5px #1c70ff); }
.dock-add {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 51px;
  height: 51px;
  border: 1px solid #2968cb;
  border-radius: 50%;
  color: #eef7ff;
  background: radial-gradient(circle, #255bbf, #081d47 65%);
  box-shadow: 0 0 0 5px #0d1e4090, 0 0 25px #19499e55;
}
.dock-add:hover { border-color: #9accff; background: radial-gradient(circle, #346fe1, #0a2461 65%); }
.dock-add .icon { width: 29px; height: 29px; stroke-width: 1.65; filter: drop-shadow(0 0 4px #70baff); }

dialog {
  width: min(467px, calc(100% - 30px));
  padding: 20px;
  color: inherit;
  border: 1px solid #2a4269;
  border-radius: var(--radius);
  background: #081120;
  box-shadow: 0 24px 90px #000b;
}
dialog::backdrop { background: #01040ccd; }
.dialog-heading { display: flex; align-items: center; margin-bottom: 17px; gap: 10px; }
.dialog-heading h2 { font-size: 1rem; }
.dialog-heading .icon-button { margin-left: auto; }
.section-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #9bc7ff; background: #102342; }
.section-icon .icon { width: 18px; height: 18px; }
form { display: grid; gap: 9px; }
form label { min-width: 0; color: #dfeaff; font-size: .78rem; font-weight: 560; }
form label span { margin-left: 3px; color: var(--muted); font-size: .66rem; font-weight: 450; }
form input, #finder-query {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #304669;
  border-radius: 8px;
  background: #040b17;
  color: #f0f5ff;
  font-size: .87rem;
}
form input:disabled { opacity: .5; }
form input::placeholder, #finder-query::placeholder { color: var(--dim); }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 9px; margin-top: 4px; }
form label input { margin-top: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.finder-results { display: grid; gap: 4px; margin-top: 9px; max-height: min(48vh, 355px); overflow: auto; }
.finder-results a { display: flex; align-items: center; gap: 8px; min-height: 43px; padding: 7px; border-radius: 7px; font-size: .82rem; }
.finder-results a:hover, .finder-results a:focus-visible { background: #142646; }
.finder-results a:focus-visible { outline-offset: -2px; }
.finder-results a .icon { width: 16px; height: 16px; color: var(--blue); }
.finder-results small { margin-left: auto; color: var(--muted); }
#finder-empty { margin-top: 11px; }

.error { color: #ffc0ac; font-size: .79rem; line-height: 1.5; }
.page-error { padding: 10px; border: 1px solid #61404a; border-radius: 9px; background: #241722; }
.announcement {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 5;
  padding: 10px 14px;
  border: 1px solid #345786;
  border-radius: 9px;
  color: #e1efff;
  background: #112341;
  box-shadow: 0 6px 24px #0007;
  font-size: .81rem;
  pointer-events: none;
}
.announcement:empty { opacity: 0; }

@media (max-width: 1230px) {
  :root { --sidebar-width: 156px; }
  .brand { margin-left: 15px; }
  .side-nav a { gap: 8px; padding-left: 12px; }
}

@media (max-width: 1070px) {
  :root { --sidebar-width: 68px; --grid-gap: 12px; }
  .brand { margin-left: 10px; }
  .side-nav a { justify-content: center; padding-inline: 0; }
  .sidebar .brand span, .side-nav a span, .storage-note div { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .storage-note { justify-content: center; padding-inline: 0; }
}

@media (max-width: 925px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .command-grid { grid-template-columns: minmax(0, 1fr); }
  .command-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: 5px; }
  .command-rail .upcoming, .command-rail .page-error { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  html { scroll-padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .layout { display: block; }
  .sidebar { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; min-height: 61px; }
  .mobile-brand { display: inline-flex; align-self: center; margin: 0; gap: 5px; font-size: .95rem; }
  .mobile-brand .icon { width: 25px; height: 25px; }
  .search-trigger { grid-column: 2; justify-self: end; justify-content: center; width: 35px; min-height: 35px; padding: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .toolbar { gap: 7px; }
  .toolbar-date { font-size: .63rem; }
  .toolbar .button { min-height: 35px; padding-inline: 8px; font-size: .71rem; }
  .toolbar .button .icon { width: 13px; height: 13px; }
  .command-grid { gap: 11px; padding-bottom: calc(89px + env(safe-area-inset-bottom)); }
  .command-rail { grid-template-columns: minmax(0, 1fr); }
  .dock {
    position: fixed;
    left: 50%;
    bottom: calc(9px + env(safe-area-inset-bottom));
    z-index: 4;
    width: min(93%, 459px);
    min-height: 62px;
    gap: 3px;
    margin: 0;
    padding: 5px 8px;
    transform: translateX(-50%);
    box-shadow: 0 5px 22px #000b;
  }
  .dock a { min-height: 44px; font-size: .6rem; }
  .dock a .icon { width: 19px; height: 19px; }
  .dock-add { width: 42px; height: 42px; }
  .dock-add .icon { width: 24px; height: 24px; }
  .announcement { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 345px) {
  .toolbar-date time:first-child { display: none; }
  .search-trigger { min-height: 30px; width: 30px; }
  .field-pair { grid-template-columns: minmax(0, 1fr); }
}

.sample-toggle {
  min-height: 33px;
  padding-inline: 9px;
  border-color: #263b57;
  color: #c0d4f1;
  background: #0a1426;
}
.sample-toggle:hover { border-color: #6699cf; }
.sample-toggle[aria-pressed="true"] {
  border-color: #446b9d;
  color: #a3d4ff;
  background: #102b4e;
}

@media (max-width: 650px) {
  .sample-toggle { max-width: 62px; min-height: 35px; padding-inline: 5px; font-size: .62rem; white-space: normal; line-height: 1.15; }
}
@media (max-width: 395px) {
  .toolbar-date { display: none; }
}
@media (max-width: 345px) {
  .toolbar .sample-toggle { max-width: 49px; padding-inline: 4px; font-size: .58rem; }
  .mobile-brand { font-size: .84rem; }
  .topbar { gap: 5px; }
}

@media (min-width: 926px) {
  .workspace {
    --header-height: clamp(53px, 8dvh, 75px);
    display: grid;
    grid-template-rows: var(--header-height) minmax(0, 1fr);
    height: 100dvh;
  }
  .topbar, .command-grid { width: 100%; }
  .topbar { min-height: 0; }
  .galaxy-column {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    height: 100%;
  }
  .command-grid { min-height: 0; padding-bottom: clamp(7px, 1.65dvh, 18px); }
  .command-rail {
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 8px);
    min-height: 0;
    margin-top: 8px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .command-rail > * { flex-shrink: 0; }
  .task-list { max-height: min(27dvh, 330px); overflow: auto; scrollbar-width: thin; }
  .dock { margin-top: 4px; justify-self: center; margin-inline: auto; min-height: clamp(55px, 7.15dvh, 73px); }
  .dock-add { width: clamp(38px, 5.4dvh, 51px); height: clamp(38px, 5.4dvh, 51px); }
}

@media (min-width: 926px) and (max-height: 825px) {
  .command-rail { gap: 8px; }
  .panel-header { min-height: 44px; }
  .summary-rows { gap: 10px; padding-block: 11px; }
  .task-controls { padding-top: 7px; }
  .task-row { min-height: 46px; padding-block: 4px; }
  .empty-state { min-height: 121px; padding-block: 10px; }
  .upcoming-empty, .upcoming-list li, .panel-footer { padding-block: 9px; }
}
