:root {
  color-scheme: dark;
  --bg: #111215;
  --panel: #181a1e;
  --raised: #1e2025;
  --line: #2b2e34;
  --text: #eceee9;
  --muted: #9b9fa7;
  --accent: #bce4b6;
  --accent-ink: #18321e;
  --red: #efa599;
  --blue: #a7c7f3;
  --gold: #e5cc91;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 14px;
  color: inherit;
  font-size: 0.875rem;
  transition: background 0.15s;
}
button:hover {
  background: #2c3035;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover {
  background: #d3edcf;
}
button.quiet {
  background: transparent;
  border-color: transparent;
}
button.icon {
  padding: 7px;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
}
svg {
  width: 19px;
  height: 19px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.9rem;
  letter-spacing: -0.05em;
  font-weight: 600;
  margin-bottom: 8px;
}
h2 {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.65;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 0.8rem;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 30px 18px 20px;
  display: flex;
  flex-direction: column;
  background: #131518;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.brand img {
  width: 32px;
  height: 32px;
}
.tagline {
  margin: 12px 12px 35px;
  font-size: 0.8rem;
  color: var(--muted);
}
.nav {
  display: grid;
  gap: 5px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  text-align: left;
  color: var(--muted);
  font-size: 0.92rem;
}
.nav button.selected {
  background: #252c25;
  color: var(--accent);
}
.nav button:hover {
  background: #202328;
}
.nav .count {
  margin-left: auto;
  font-size: 0.78rem;
}
.side-quests {
  padding: 30px 13px;
}
.side-quest {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 17px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: var(--quest-color, var(--accent));
}
.sidebar-bottom {
  margin-top: auto;
}
.local-label {
  border-top: 1px solid var(--line);
  padding: 18px 13px 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}
.local-label strong {
  color: var(--accent);
  font-weight: 500;
}
.workspace {
  min-width: 0;
  padding: 34px 40px 36px;
  max-width: 1880px;
  width: 100%;
  margin: auto;
  align-self: start;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.topbar .eyebrow {
  margin-bottom: 12px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.date-control {
  display: flex;
  align-items: center;
  gap: 4px;
}
.date-control input {
  width: 145px;
}
.daily-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.85fr);
  gap: 30px;
}
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 30px;
  background: linear-gradient(110deg, #1d231e, #181a1e);
}
.summary > div {
  padding: 21px;
  border-right: 1px solid var(--line);
}
.summary > div:last-child {
  border: 0;
}
.metric {
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  margin-top: 8px;
}
.metric small {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 13px;
  gap: 12px;
}
.section-head h2 {
  margin: 0;
}
.task-list {
  display: grid;
  gap: 9px;
}
.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
  min-width: 0;
}
.task.running {
  border-color: #6c9269;
  background: #1d271f;
}
.task.done .task-title {
  text-decoration: line-through;
  color: var(--muted);
}
.task-main {
  min-width: 0;
  flex: 1;
}
.task-title {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-size: 0.96rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.task-title:hover {
  background: none;
  color: var(--accent);
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 8px;
}
.check {
  width: 20px;
  height: 20px;
  border: 1px solid #555c62;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  margin-top: 2px;
  flex-shrink: 0;
}
.check.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.check svg {
  width: 14px;
  height: 14px;
}
.task-controls {
  display: flex;
  gap: 2px;
  align-items: center;
}
.task-controls .icon {
  min-width: 27px;
  padding: 3px;
}
.task-controls svg {
  width: 15px;
  height: 15px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 3px 6px;
  background: #ffffff07;
}
.overdue {
  color: var(--red);
}
.inline-add {
  width: 100%;
  margin: 12px 0;
  display: flex;
  gap: 8px;
}
.inline-add input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px dashed #45494f;
}
.empty {
  border: 1px dashed #3b4146;
  border-radius: 12px;
  padding: 35px 28px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.empty svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  margin-bottom: 15px;
}
.empty h3 {
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.empty p {
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.empty.compact {
  padding: 20px;
  font-size: 0.85rem;
}
.intro {
  background: linear-gradient(130deg, #233226, #1b211f);
  border: 1px solid #3d5140;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 24px;
}
.intro h2 {
  color: var(--accent);
  font-size: 1.35rem;
  margin-bottom: 10px;
}
.intro p {
  color: #c1ccbf;
  font-size: 0.9rem;
  margin-bottom: 15px;
}
.timeline-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.timeline-heading {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.timeline-heading h2 {
  margin: 0 0 10px;
}
.legend {
  display: flex;
  gap: 15px;
  font-size: 0.75rem;
  color: var(--muted);
  align-items: center;
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: #5376a1;
  border-radius: 2px;
  margin-right: 5px;
}
.legend .logged {
  background: #65865f;
}
.calendar-scroll {
  max-height: 670px;
  overflow: auto;
}
.calendar-body {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 12px 12px 18px 4px;
}
.hour-labels {
  position: relative;
}
.hour-label {
  position: absolute;
  right: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  transform: translateY(-6px);
}
.day-track {
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--line);
}
.hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #2b2e35;
  pointer-events: none;
}
.event {
  position: absolute;
  border: 1px solid #455d7a;
  border-left: 3px solid #88b0e3;
  border-radius: 5px;
  background: #243248;
  padding: 5px 7px;
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.4;
  min-height: 20px;
}
.event.logged {
  background: #263b2b;
  border-color: #4c6850;
  border-left-color: var(--accent);
}
.event.free {
  opacity: 0.6;
  border-style: dashed;
}
.event-title {
  font-weight: 500;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.event-time {
  font-size: 0.68rem;
  color: #bbcada;
  white-space: nowrap;
}
.now-line {
  height: 1px;
  background: var(--red);
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: none;
}
.now-line:before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}
.all-day {
  padding: 8px 16px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--line);
  background: #223047;
  color: var(--blue);
}
.sync-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}
.sync-line button {
  font-size: 0.75rem;
  padding: 3px 7px;
}
.sync-line.error {
  color: var(--red);
}
.calendar-note {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
}
.next-event {
  margin-top: 18px;
  border: 1px solid #3a4e68;
  background: #1c2736;
  border-radius: 10px;
  padding: 15px;
  font-size: 0.86rem;
}
.next-event strong {
  display: block;
  color: var(--blue);
  font-size: 0.75rem;
  margin-bottom: 7px;
}
.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  gap: 10px;
  overflow: auto;
  padding-bottom: 12px;
}
.week-day {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #15171b;
  min-height: 420px;
  padding: 12px;
}
.week-day.current {
  border-color: #65865f;
}
.week-day header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.week-day.current header {
  color: var(--accent);
}
.week-day .task {
  padding: 12px 8px;
  margin-bottom: 8px;
  gap: 7px;
}
.week-day .task-controls {
  flex-direction: column;
}
.week-day .task-title {
  font-size: 0.85rem;
}
.day-busy {
  font-size: 0.75rem;
  background: #243248;
  color: var(--blue);
  padding: 9px;
  border-radius: 5px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.week-calendar {
  display: grid;
  grid-template-columns: 46px repeat(7, minmax(125px, 1fr));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px;
}
.week-calendar .day-track {
  margin-top: 12px;
}
.week-column-head {
  text-align: center;
  font-size: 0.82rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.week-column-head.current {
  color: var(--accent);
}
.week-calendar .hour-labels {
  margin-top: 12px;
}
.week-all-day {
  font-size: 0.7rem;
  color: var(--blue);
  padding: 4px;
  line-height: 1.4;
  min-height: 22px;
}
.focus-page {
  max-width: 760px;
  margin: 6vh auto 0;
  text-align: center;
}
.focus-page h1 {
  font-size: 2.5rem;
  line-height: 1.3;
  margin: 26px 0;
  overflow-wrap: anywhere;
}
.focus-quest {
  color: var(--accent);
  font-size: 0.9rem;
}
.focus-timer {
  font-size: 5rem;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  margin: 30px 0 5px;
}
.focus-page .actions {
  justify-content: center;
  margin: 30px 0;
}
.focus-page button {
  padding: 13px 24px;
}
.focus-page textarea {
  text-align: left;
  min-height: 150px;
  margin-top: 25px;
  background: transparent;
}
.focus-hint {
  margin: 25px 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.quest-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  background: var(--panel);
}
.quest-card h2 {
  margin: 15px 0 10px;
}
.quest-card p {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: pre-wrap;
}
.progress {
  height: 5px;
  background: #30333a;
  border-radius: 10px;
  overflow: hidden;
  margin: 18px 0 8px;
}
.progress span {
  height: 100%;
  display: block;
  background: var(--quest-color, var(--accent));
  max-width: 100%;
}
.review-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 20px;
}
.bar-chart {
  display: flex;
  height: 180px;
  align-items: end;
  gap: 15px;
  margin-top: 30px;
}
.bar-item {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 8px;
}
.bar {
  border-radius: 5px 5px 0 0;
  background: var(--accent);
  min-height: 2px;
}
.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 20px;
  gap: 12px;
}
.reflection label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 20px;
}
.reflection textarea {
  min-height: 86px;
  margin-top: 8px;
}
.settings {
  max-width: 850px;
}
.setting-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child {
  border: 0;
}
.setting-row h3 {
  margin: 0 0 8px;
}
.setting-row p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 12px;
}
.setting-row select {
  max-width: 100%;
  width: 100%;
  margin-bottom: 12px;
}
input,
select,
textarea {
  background: #121418;
  border: 1px solid #3b3f47;
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 0.9rem;
  min-width: 0;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9b9fa7 50%),
    linear-gradient(135deg, #9b9fa7 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
input[type="color"] {
  padding: 4px;
  min-height: 42px;
  width: 60px;
}
textarea {
  resize: vertical;
  width: 100%;
  line-height: 1.6;
}
dialog {
  background: #1b1e23;
  color: var(--text);
  border: 1px solid #41464f;
  border-radius: 15px;
  padding: 28px;
  width: min(540px, calc(100% - 32px));
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 100px #0007;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 1.3rem;
}
dialog label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 17px 0 7px;
}
dialog input:not([type="color"]),
dialog select {
  width: 100%;
}
dialog .two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 25px;
}
.footer-tip {
  margin-top: 32px;
  color: #777e86;
  font-size: 0.78rem;
  line-height: 1.7;
}
kbd {
  font-size: 0.72rem;
  border: 1px solid #3c4147;
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #d5e8d1;
  color: #15351e;
  box-shadow: 0 10px 40px #0005;
  padding: 13px 22px;
  border-radius: 9px;
  z-index: 10;
  font-size: 0.88rem;
  max-width: 90%;
  display: none;
}
#toast.show {
  display: block;
}
#toast.error {
  background: #efc6bf;
  color: #541f16;
}
.save-error {
  position: sticky;
  top: 0;
  padding: 14px 22px;
  background: #582c27;
  color: #ffe7e1;
  z-index: 8;
  line-height: 1.6;
  font-size: 0.9rem;
}
.save-error button {
  margin-left: 10px;
}
.loading {
  padding: 70px;
  color: var(--muted);
}
.search-box {
  width: 100%;
  margin: 0 0 20px;
}
.inbox-header {
  display: flex;
  gap: 10px;
}
.inbox-header .search-box {
  flex: 1;
}
.completed-title {
  margin-top: 30px;
}
.source-link {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spinner {
  animation: spin 1.5s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1600px) {
  .workspace {
    padding: 42px 60px;
  }
  .daily-layout {
    gap: 44px;
  }
  .calendar-scroll {
    max-height: 780px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .workspace {
    padding: 26px 24px;
  }
  .daily-layout {
    grid-template-columns: 1fr;
  }
  .calendar-scroll {
    max-height: 500px;
  }
  .topbar {
    align-items: flex-start;
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
  .side-quests {
    padding-left: 8px;
  }
}
@media (max-width: 650px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 0;
  }
  .tagline,
  .side-quests,
  .sidebar-bottom,
  .local-label {
    display: none;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    margin-top: 16px;
    gap: 4px;
  }
  .nav button {
    padding: 9px;
    font-size: 0.8rem;
    white-space: nowrap;
    gap: 6px;
  }
  .nav button svg {
    width: 16px;
  }
  .nav .count {
    display: none;
  }
  .workspace {
    padding: 24px 16px;
  }
  .topbar {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 1.6rem;
  }
  .daily-layout {
    display: block;
  }
  .timeline-panel {
    margin-top: 28px;
  }
  .summary > div {
    padding: 16px 10px;
  }
  .metric {
    font-size: 1.3rem;
  }
  .summary .tiny {
    font-size: 0.72rem;
  }
  .focus-page h1 {
    font-size: 1.8rem;
  }
  .focus-timer {
    font-size: 4rem;
  }
  .task-controls .order {
    display: none;
  }
  .review-grid {
    display: block;
  }
  .panel {
    padding: 20px;
  }
  .date-control input {
    width: 135px;
  }
  .topbar .actions {
    gap: 6px;
  }
}
