:root {
  --background: #f4f1ea;
  --foreground: #17201b;
  --muted: #66736c;
  --line: #ddd6ca;
  --surface: #fffdfa;
  --ink: #17201b;
  --green: #2f7d57;
  --green-dark: #1f5f42;
  --blue: #2d6cdf;
  --clay: #b66548;
  --amber: #d89f35;
  --rose: #c65f7c;
  --shadow: 0 18px 50px rgba(37, 45, 39, 0.12);
  --input-bg: #fffdfa;
  --chip-bg: #eef2e9;
  --hover-bg: #f1eee7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(120deg, rgba(47, 125, 87, 0.08), transparent 34%),
    linear-gradient(240deg, rgba(198, 95, 124, 0.08), transparent 36%),
    var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
}

body[data-theme="kitty"] {
  --background: #fffaf5;
  --foreground: #2a1b18;
  --muted: #7a6862;
  --line: #eadbd2;
  --surface: #fffdf9;
  --ink: #2a1b18;
  --green: #5f91c8;
  --green-dark: #3f6f9e;
  --blue: #5f91c8;
  --clay: #a24d52;
  --amber: #eadb7d;
  --rose: #dc5d68;
  --input-bg: #fffaf6;
  --chip-bg: #edf4fb;
  --hover-bg: #eef4fb;
  --shadow: 0 18px 44px rgba(52, 36, 31, 0.1);
  background:
    linear-gradient(135deg, rgba(234, 219, 125, 0.12), transparent 30%),
    linear-gradient(240deg, rgba(95, 145, 200, 0.08), transparent 34%),
    var(--background);
}

body[data-theme="kitty"]::before,
body[data-theme="kitty"]::after {
  display: none;
}

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

button {
  cursor: pointer;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.8);
  padding: 24px;
  backdrop-filter: blur(18px);
}

body[data-theme="kitty"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(255, 248, 244, 0.86)),
    var(--surface);
}

body[data-theme="kitty"] .sidebar::after {
  display: none;
}

.brand,
.nav-list a,
.metric span,
.footer-note,
.task,
.panel-heading,
.finance-summary {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  -webkit-app-region: drag;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fffdfa;
  font-size: 20px;
}

body[data-theme="kitty"] .brand-mark {
  background:
    #fffdf9 url("./assets/kitty/kitty-head.png") center 52% / 105% auto no-repeat;
  border: 2px solid rgba(42, 27, 24, 0.14);
  box-shadow: inset 0 0 0 2px rgba(255, 253, 249, 0.86);
  color: transparent;
  overflow: hidden;
}

body[data-theme="kitty"] .brand-mark::before,
body[data-theme="kitty"] .brand-mark::after {
  display: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small,
.metric small,
.focus-card small,
.focus-card span,
.footer-note,
.task span,
.entry span,
.entry strong,
.note span,
.link-card span,
.finance-summary small {
  color: var(--muted);
  font-size: 12px;
}

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

.nav-list a {
  gap: 10px;
  min-height: 42px;
  border-radius: 8px;
  color: var(--muted);
  padding: 0 12px;
  text-decoration: none;
}

.nav-list a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.nav-list a:hover,
.nav-list a.active {
  background: color-mix(in srgb, var(--green) 14%, white);
  color: var(--green-dark);
}

body[data-theme="kitty"] .nav-list a:hover,
body[data-theme="kitty"] .nav-list a.active {
  background: rgba(95, 145, 200, 0.12);
  color: #3f6f9e;
}

body[data-theme="kitty"] .nav-list a.active::before {
  background: #dc5d68;
}

.theme-picker {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.theme-picker select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--foreground);
  padding: 8px 10px;
}

.mini-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.focus-card small,
.focus-card span {
  display: block;
}

.focus-card strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--green-dark);
  font-size: 36px;
  line-height: 1;
}

body[data-theme="kitty"] .focus-card {
  position: relative;
  overflow: visible;
}

body[data-theme="kitty"] .focus-card::after {
  position: absolute;
  top: -25px;
  right: -9px;
  width: 76px;
  height: 47px;
  background: transparent url("./assets/kitty/bow-sticker.png") center / contain no-repeat;
  content: "";
  filter: drop-shadow(0 8px 10px rgba(42, 27, 24, 0.12));
  pointer-events: none;
  transform: rotate(18deg);
  transform-origin: 64% 48%;
}

.workspace {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 28px;
}

body[data-theme="kitty"] .workspace::before,
body[data-theme="kitty"] .workspace::after {
  display: none;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 22px;
  max-width: 1320px;
}

body[data-theme="kitty"] .topbar::after {
  position: absolute;
  left: 0;
  bottom: -12px;
  width: min(500px, 70vw);
  height: 4px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(95, 145, 200, 0.66) 0,
      rgba(95, 145, 200, 0.66) 26px,
      #fffdf9 26px,
      #fffdf9 39px,
      rgba(220, 93, 104, 0.42) 39px,
      rgba(220, 93, 104, 0.42) 52px,
      #fffdf9 52px,
      #fffdf9 66px
    );
  content: "";
  opacity: 0.5;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(380px, 100%);
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 0 14px;
}

.search-box input,
.inline-form input,
.inline-form select,
.entry-form input,
.entry-form select,
.entry-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--foreground);
  outline: none;
}

.search-box input {
  border: 0;
  background: transparent;
  padding: 0;
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1320px;
  margin: 0 auto 16px;
}

.metric,
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.9);
  box-shadow: var(--shadow);
}

body[data-theme="kitty"] .metric,
body[data-theme="kitty"] .panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(255, 250, 246, 0.94)),
    var(--surface);
}

.metric {
  min-height: 126px;
  padding: 18px;
}

.metric > * {
  position: relative;
  z-index: 1;
}

.metric span {
  gap: 8px;
}

.metric span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.metric strong {
  display: block;
  margin: 14px 0 4px;
  overflow-wrap: anywhere;
  font-size: 30px;
  line-height: 1;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
  overflow: visible;
}

.panel {
  min-width: 0;
  min-height: 430px;
  overflow: hidden;
  padding: 20px;
}

body[data-theme="kitty"] .panel {
  overflow: visible;
}

.panel > * {
  position: relative;
  z-index: 2;
}

body[data-theme="kitty"] .panel::before,
body[data-theme="kitty"] .panel::after {
  position: absolute;
  display: none;
  background: transparent center / contain no-repeat;
  content: "";
  pointer-events: none;
  z-index: 1;
}

body[data-theme="kitty"] .panel:nth-child(1)::after,
body[data-theme="kitty"] .panel:nth-child(4)::after,
body[data-theme="kitty"] .panel:nth-child(6)::after {
  display: block;
  right: -12px;
  top: -39px;
  width: 98px;
  height: 61px;
  background-image: url("./assets/kitty/bow-sticker.png");
  filter: drop-shadow(0 9px 11px rgba(42, 27, 24, 0.12));
  transform: rotate(18deg);
  transform-origin: 64% 48%;
}

body[data-theme="kitty"] .panel:nth-child(4)::after {
  right: -10px;
  top: -35px;
  width: 92px;
  height: 57px;
  transform: rotate(16deg);
}

body[data-theme="kitty"] .panel:nth-child(6)::after {
  right: -14px;
  top: -36px;
  width: 94px;
  height: 58px;
  transform: rotate(20deg);
}

body[data-theme="kitty"] .panel:nth-child(2)::before,
body[data-theme="kitty"] .panel:nth-child(5)::before {
  display: block;
  right: -8px;
  bottom: -10px;
  width: 44px;
  height: 88px;
  background-image: url("./assets/kitty/kitty-milk.png");
  filter: drop-shadow(0 8px 10px rgba(42, 27, 24, 0.1));
  transform: rotate(7deg);
}

body[data-theme="kitty"] .panel:nth-child(5)::before {
  right: 18px;
  bottom: -16px;
  width: 48px;
  height: 96px;
  transform: rotate(-5deg);
}

body[data-theme="kitty"] .panel:nth-child(3)::before {
  display: block;
  left: 18px;
  bottom: -18px;
  width: 92px;
  height: 78px;
  background-image: url("./assets/kitty/cheese-sticker.png");
  filter: drop-shadow(0 8px 10px rgba(42, 27, 24, 0.1));
  transform: rotate(-9deg);
}

.diary-panel,
.finance-panel {
  min-height: 520px;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 14%, white);
  color: var(--green-dark);
  font-weight: 800;
}

body[data-theme="kitty"] .panel-icon {
  display: none;
}

.entry-form,
.inline-form {
  display: grid;
  gap: 10px;
}

.entry-form textarea {
  min-height: 110px;
  resize: vertical;
}

.entry-form.compact textarea {
  min-height: 74px;
}

.entry-form input,
.entry-form select,
.entry-form textarea,
.inline-form input,
.inline-form select {
  min-height: 42px;
  padding: 10px 12px;
}

.form-row,
.split,
.finance-row {
  display: grid;
  gap: 10px;
}

.split {
  grid-template-columns: minmax(0, 1fr) 120px;
}

.triple {
  grid-template-columns: minmax(0, 1fr) 138px 120px;
}

.finance-row {
  grid-template-columns: 138px 86px minmax(0, 1fr) 118px;
}

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

.primary-button,
.icon-button,
.ghost-button,
.check-button,
.jump-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
}

.primary-button {
  gap: 8px;
  min-height: 42px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--green-dark);
}

body[data-theme="kitty"] .primary-button {
  background: #5f91c8;
  box-shadow: inset 0 -2px 0 rgba(42, 27, 24, 0.08);
}

body[data-theme="kitty"] .primary-button:hover {
  background: #3f6f9e;
}

.icon-button,
.ghost-button,
.check-button,
.jump-button {
  min-width: 42px;
  height: 42px;
  color: var(--green-dark);
}

.icon-button,
.jump-button {
  background: color-mix(in srgb, var(--green) 14%, white);
}

.ghost-button,
.check-button {
  background: transparent;
}

.ghost-button:hover,
.check-button:hover,
.jump-button:hover {
  background: var(--hover-bg);
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) 138px 96px 42px;
}

.section-toggle {
  min-height: 38px;
  width: 100%;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 10%, white);
  color: var(--green-dark);
  font-weight: 700;
}

body[data-theme="kitty"] .section-toggle {
  background: rgba(95, 145, 200, 0.11);
  color: #3f6f9e;
}

body[data-theme="kitty"] .section-toggle:hover {
  background: rgba(95, 145, 200, 0.17);
}

.section-toggle:hover {
  background: color-mix(in srgb, var(--green) 16%, white);
}

.task-list,
.entry-list,
.note-grid,
.link-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.timeline-groups,
.day-groups,
.day-items {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.month-group,
.day-group {
  min-width: 0;
  border: 1px solid #ece5da;
  border-radius: 8px;
  background: color-mix(in srgb, var(--input-bg) 86%, white);
  overflow: hidden;
}

.month-group[open] {
  background: color-mix(in srgb, var(--input-bg) 94%, white);
}

.group-summary,
.day-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  list-style: none;
  cursor: pointer;
}

.group-summary {
  padding: 12px 14px;
}

.day-summary {
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.group-summary::-webkit-details-marker,
.day-summary::-webkit-details-marker {
  display: none;
}

.group-summary::before,
.day-summary::before {
  align-self: center;
  justify-self: end;
  grid-column: 1;
  grid-row: 1 / span 2;
  color: var(--green-dark);
  content: "›";
  font-size: 22px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.month-group:not([open]) > .group-summary::before,
.day-group:not([open]) > .day-summary::before {
  transform: rotate(0deg);
}

.group-summary strong,
.day-summary strong,
.group-summary small,
.day-summary small {
  display: block;
  min-width: 0;
  padding-right: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-summary strong {
  font-size: 15px;
}

.day-summary strong {
  font-size: 14px;
}

.group-summary small,
.day-summary small {
  color: var(--muted);
  font-size: 12px;
}

.day-groups {
  border-top: 1px solid #ece5da;
  padding: 10px;
}

.day-group {
  background: color-mix(in srgb, var(--surface) 92%, white);
}

.day-items {
  padding: 0 10px 10px;
}

.compact-empty {
  background: transparent;
  padding: 12px;
}

.task {
  gap: 10px;
  min-height: 58px;
  border: 1px solid #ece5da;
  border-radius: 8px;
  background: var(--input-bg);
  padding: 8px;
}

.task > div {
  min-width: 0;
  flex: 1;
}

.task strong,
.task span {
  display: block;
}

.task strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.task.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.entry,
.note,
.link-card {
  border: 1px solid #ece5da;
  border-radius: 8px;
  background: var(--input-bg);
  padding: 14px;
}

.record-card,
.ledger-card,
.link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.ledger-card {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

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

.entry span,
.entry strong,
.note span,
.link-card span {
  display: inline-flex;
  margin-right: 8px;
}

.entry p,
.note p,
.link-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.entry h3,
.link-card h3 {
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
}

.note-grid,
.link-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.note span,
.link-card span {
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  padding: 4px 8px;
  color: var(--green-dark);
}

.note h3 {
  margin-bottom: 8px;
}

.finance-summary {
  gap: 10px;
  margin-top: 14px;
}

.finance-summary > div {
  flex: 1;
  border: 1px solid #ece5da;
  border-radius: 8px;
  background: var(--input-bg);
  padding: 12px;
}

.finance-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.money.income {
  color: var(--green-dark);
}

.money.expense {
  color: var(--clay);
}

.link-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 8px;
}

.link-url {
  min-width: 0;
  overflow: hidden;
  color: var(--blue);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.month-card {
  min-width: 0;
  border: 1px solid #ece5da;
  border-radius: 8px;
  background: var(--input-bg);
  padding: 12px;
}

.month-card strong,
.month-card small {
  display: block;
}

.month-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.month-card dl {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.month-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.month-card dt,
.month-card dd {
  margin: 0;
  font-size: 12px;
}

.month-card dt {
  color: var(--muted);
}

.month-card dd {
  max-width: 68%;
  overflow: hidden;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-ghost {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 12%, white);
  color: var(--green-dark);
}

.icon-ghost svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-ghost:hover {
  background: var(--hover-bg);
}

.icon-ghost.danger {
  background: color-mix(in srgb, var(--clay) 10%, white);
  color: var(--clay);
}

.icon-ghost.danger:hover {
  background: color-mix(in srgb, var(--clay) 18%, white);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.schedule-open {
  overflow: hidden;
}

.schedule-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(23, 32, 27, 0.22);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.schedule-overlay.is-open {
  display: block;
}

.schedule-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 32, 27, 0.24);
}

body[data-theme="kitty"] .schedule-shell {
  background:
    linear-gradient(135deg, rgba(234, 219, 125, 0.12), transparent 26%),
    linear-gradient(225deg, rgba(95, 145, 200, 0.12), transparent 30%),
    var(--surface);
}

.schedule-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, white);
  padding: 20px;
}

.schedule-panel-head,
.schedule-board-head,
.schedule-action-row,
.course-list-item {
  display: flex;
  align-items: center;
}

.schedule-panel-head,
.schedule-board-head {
  justify-content: space-between;
  gap: 14px;
}

.schedule-panel-head .icon-ghost {
  font-size: 24px;
  line-height: 1;
}

.schedule-empty,
.schedule-controls,
.course-form,
.schedule-name-form,
.schedule-create-form,
.course-list {
  display: grid;
  gap: 10px;
}

.schedule-empty {
  margin-top: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.schedule-empty p,
.form-hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.schedule-create-form {
  grid-template-columns: minmax(0, 1fr);
}

.schedule-create-form .ghost-button {
  width: 100%;
  background: var(--hover-bg);
  color: var(--green-dark);
  font-weight: 700;
}

.schedule-controls input,
.schedule-controls select,
.course-form input,
.course-form select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--foreground);
  padding: 9px 10px;
  outline: none;
}

.course-form input[type="color"] {
  min-width: 56px;
  padding: 4px;
}

.schedule-name-form,
.course-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--input-bg) 88%, white);
  padding: 12px;
}

.schedule-action-row {
  gap: 8px;
}

.schedule-action-row .primary-button,
.schedule-action-row .danger-button {
  flex: 1;
}

.form-section-title {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.course-list {
  padding-bottom: 8px;
}

.course-list-item {
  gap: 10px;
  min-width: 0;
  border: 1px solid #ece5da;
  border-radius: 8px;
  background: var(--input-bg);
  padding: 10px;
}

.course-list-item > div {
  min-width: 0;
  flex: 1;
}

.course-list-item strong,
.course-list-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-list-item small {
  color: var(--muted);
  font-size: 12px;
}

.course-chip {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.schedule-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  padding: 22px;
}

.schedule-board-head {
  margin-bottom: 16px;
}

.schedule-board-head h2 {
  overflow-wrap: anywhere;
}

.schedule-board-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--green-dark);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.schedule-grid-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

body[data-theme="kitty"] .schedule-grid-wrap {
  background: #fbfdff;
}

.schedule-board-empty {
  display: grid;
  height: 100%;
  min-height: 320px;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.schedule-board-empty p {
  margin-bottom: 0;
  color: var(--muted);
}

.schedule-grid {
  display: grid;
  grid-template-columns: 58px minmax(980px, 1fr);
  min-width: 1040px;
}

.schedule-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(138px, 1fr));
}

.schedule-time-axis,
.schedule-day-column {
  min-width: 0;
}

.schedule-day-title {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  min-height: 50px;
  place-content: center;
  border-bottom: 1px solid #dbe4ef;
  background: rgba(248, 251, 255, 0.94);
  text-align: center;
}

body[data-theme="kitty"] .schedule-day-title {
  background: rgba(251, 253, 255, 0.94);
}

.schedule-day-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ghost-title {
  color: var(--muted);
  font-size: 12px;
}

.time-track,
.schedule-day-track {
  position: relative;
  min-height: var(--track-height);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 63px,
      rgba(45, 108, 223, 0.1) 63px,
      rgba(45, 108, 223, 0.1) 64px
    );
}

.time-track {
  border-right: 1px solid #dbe4ef;
  background: #f3f7fc;
}

.schedule-day-track {
  border-right: 1px solid #dbe4ef;
}

.schedule-day-column.is-outside-term .schedule-day-title,
.schedule-day-track.is-outside-term {
  background-color: #f1f3f5;
  color: #9a9a9a;
}

.schedule-day-track.is-outside-term {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(120, 120, 120, 0.035) 0,
    rgba(120, 120, 120, 0.035) 8px,
    transparent 8px,
    transparent 16px
  );
}

.time-label {
  position: absolute;
  right: 8px;
  color: var(--muted);
  font-size: 12px;
  transform: translateY(-7px);
}

.course-block {
  position: absolute;
  right: 6px;
  left: 6px;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23, 32, 27, 0.16);
  padding: 9px 10px;
}

.course-block strong,
.course-block small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-block strong {
  font-size: 13px;
}

.course-block small {
  opacity: 0.86;
  font-size: 11px;
}

.day-empty {
  position: absolute;
  top: 16px;
  left: 50%;
  color: rgba(102, 115, 108, 0.45);
  font-size: 12px;
  transform: translateX(-50%);
}

.is-hidden {
  display: none !important;
}

.collapsible.is-collapsed {
  display: none;
}

.confirm-dialog {
  width: min(360px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 24px 80px rgba(23, 32, 27, 0.24);
  padding: 0;
}

.confirm-dialog::backdrop {
  background: rgba(23, 32, 27, 0.35);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.confirm-dialog h2 {
  font-size: 20px;
}

.confirm-dialog p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.birthday-dialog {
  position: fixed;
  z-index: 300;
  inset: 0;
  width: min(420px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 28px 90px rgba(23, 32, 27, 0.3);
  padding: 0;
}

.birthday-dialog::backdrop {
  background: rgba(23, 32, 27, 0.46);
  backdrop-filter: blur(7px);
}

.birthday-dialog form {
  display: grid;
}

.birthday-art {
  position: relative;
  display: grid;
  min-height: 154px;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    repeating-conic-gradient(from -8deg at 50% 72%, color-mix(in srgb, var(--amber) 24%, transparent) 0 7deg, transparent 7deg 17deg),
    linear-gradient(135deg, color-mix(in srgb, var(--green) 16%, var(--surface)), color-mix(in srgb, var(--rose) 12%, var(--surface)));
}

.birthday-ray {
  position: absolute;
  right: 26px;
  bottom: 20px;
  left: 26px;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--green) 0 32px, transparent 32px 42px, var(--amber) 42px 55px, transparent 55px 66px, var(--blue) 66px 92px, transparent 92px 104px);
  content: "";
  opacity: 0.75;
}

.birthday-date {
  position: relative;
  z-index: 1;
  color: var(--foreground);
  font-family: "Avenir Next Condensed", "Arial Narrow", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 2px 2px 0 color-mix(in srgb, var(--blue) 48%, transparent);
}

.birthday-copy {
  display: grid;
  gap: 12px;
  padding: 26px;
  text-align: center;
}

.birthday-copy .eyebrow,
.birthday-copy h2,
.birthday-copy p {
  margin-bottom: 0;
}

.birthday-copy h2 {
  font-size: 30px;
}

.birthday-copy > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.birthday-copy .primary-button {
  width: 100%;
  margin-top: 4px;
}

body[data-theme="kitty"] .birthday-art {
  background:
    repeating-conic-gradient(from -8deg at 50% 72%, rgba(234, 219, 125, 0.28) 0 7deg, transparent 7deg 17deg),
    linear-gradient(135deg, rgba(237, 244, 251, 0.98), rgba(255, 239, 241, 0.98));
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.secondary-button,
.danger-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.secondary-button {
  background: var(--hover-bg);
  color: var(--foreground);
}

.danger-button {
  background: var(--clay);
  color: #fff;
}

.footer-note {
  gap: 8px;
  max-width: 1320px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 13px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .mini-card {
    margin-top: 0;
  }

  .work-grid,
  .overview,
  .month-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  h1 {
    font-size: 38px;
  }

  .work-grid,
  .overview,
  .note-grid,
  .link-grid,
  .month-overview,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .split,
  .triple,
  .finance-row {
    grid-template-columns: 1fr;
  }

  .panel,
  .diary-panel,
  .finance-panel {
    min-height: auto;
  }

  body[data-theme="kitty"] .panel:nth-child(1)::after,
  body[data-theme="kitty"] .panel:nth-child(4)::after,
  body[data-theme="kitty"] .panel:nth-child(6)::after {
    right: -8px;
    top: -29px;
    width: 74px;
    height: 46px;
  }

  body[data-theme="kitty"] .focus-card::after {
    top: -22px;
    right: -7px;
    width: 68px;
    height: 42px;
  }

  body[data-theme="kitty"] .panel:nth-child(2)::before,
  body[data-theme="kitty"] .panel:nth-child(5)::before {
    right: 10px;
    bottom: -12px;
    width: 38px;
    height: 76px;
  }

  body[data-theme="kitty"] .panel:nth-child(3)::before {
    left: 14px;
    bottom: -12px;
    width: 70px;
    height: 60px;
  }

  .schedule-overlay {
    padding: 0;
  }

  .schedule-shell {
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .schedule-sidebar {
    max-height: 48vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .schedule-board {
    padding: 16px;
  }

  .schedule-board-head {
    display: grid;
    align-items: start;
  }

  .schedule-grid {
    grid-template-columns: 52px minmax(900px, 1fr);
    min-width: 952px;
  }

  .schedule-week {
    grid-template-columns: repeat(7, 128px);
  }
}

/* Integrated capture, calendar, review, finance, and library tools */
.today-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.today-actions .text-button {
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, var(--green));
  border-radius: 7px;
  background: var(--hover-bg);
  color: var(--green-dark);
  padding: 7px 11px;
  font-weight: 700;
}

.topbar-actions {
  grid-template-columns: minmax(260px, 1fr) 42px 42px;
}

.finance-detail-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-tool-row,
.bookmark-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.bookmark-toolbar {
  grid-template-columns: minmax(160px, 1.5fr) minmax(130px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  margin: 14px 0;
}

.bookmark-toolbar input,
.bookmark-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--foreground);
  padding: 8px 10px;
}

.bookmark-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.link-actions {
  grid-template-columns: minmax(0, 1fr) repeat(4, 32px) auto;
}

.link-state.ok { color: var(--green-dark) !important; }
.link-state.broken { color: var(--clay) !important; }

.goal-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 2px solid color-mix(in srgb, var(--green) 38%, var(--line));
  padding-top: 12px;
}

.goal-form {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) repeat(3, minmax(100px, 1fr)) auto;
  gap: 7px;
}

.goal-form input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--foreground);
  padding: 8px 10px;
}

.goal-list { display: grid; gap: 8px; }
.goal-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 10px;
}
.goal-item > div { min-width: 0; }
.goal-item strong, .goal-item small { display: block; }
.goal-item small { margin: 3px 0 7px; color: var(--muted); font-size: 11px; }
.goal-item .progress-track { grid-column: auto; }

.trend-month span { height: var(--bar-height, 4px); }

.relation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.relation-chips button {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 25%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--hover-bg) 75%, var(--surface));
  color: var(--green-dark);
  padding: 4px 7px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-picker {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.relation-picker legend { padding: 0 5px; font-weight: 750; }
.relation-picker p { margin: 0; color: var(--muted); font-size: 12px; }
.relation-picker > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 210px; overflow: auto; }
.relation-picker label { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 7px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.relation-picker label span { color: var(--green-dark); font-size: 10px; font-weight: 750; }

.planner-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(23, 32, 27, .38);
  padding: 22px;
  backdrop-filter: blur(6px);
}
.planner-overlay.is-open { display: grid; }
.planner-open { overflow: hidden; }
.planner-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1240px, calc(100vw - 44px));
  height: min(850px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(23, 32, 27, .28);
}
.planner-head,
.planner-toolbar,
.planner-agenda-head {
  display: flex;
  align-items: center;
}
.planner-head { justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 18px 20px; }
.planner-head h2 { margin: 2px 0 0; font-size: 25px; }
.planner-head-actions { display: flex; align-items: center; gap: 10px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, 42px); border: 1px solid var(--line); border-radius: 7px; padding: 3px; }
.segmented-control button { min-height: 30px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.segmented-control button.is-active { background: var(--green); color: white; }
.planner-toolbar { gap: 8px; border-bottom: 1px solid var(--line); padding: 10px 20px; }
.planner-toolbar > strong { margin-right: auto; }
.planner-filters { display: flex; align-items: center; gap: 10px; }
.planner-filters label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.planner-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 0; }
.planner-board { min-width: 0; overflow: auto; border-right: 1px solid var(--line); padding: 14px; }
.planner-weekdays { display: grid; grid-template-columns: repeat(7, minmax(72px, 1fr)); min-width: 620px; }
.planner-weekdays span { padding: 8px; color: var(--muted); font-size: 11px; font-weight: 750; text-align: center; }
.planner-days { display: grid; grid-template-columns: repeat(7, minmax(72px, 1fr)); min-width: 620px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.planner-day {
  display: grid;
  min-width: 0;
  min-height: 96px;
  align-content: start;
  gap: 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--foreground);
  padding: 9px;
  text-align: left;
}
.planner-days.week .planner-day { min-height: 520px; }
.planner-day:hover, .planner-day.is-selected { background: color-mix(in srgb, var(--green) 8%, var(--surface)); }
.planner-day.is-today > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--green); color: white; }
.planner-day.is-outside { color: color-mix(in srgb, var(--muted) 55%, transparent); background: color-mix(in srgb, var(--surface) 75%, var(--hover-bg)); }
.planner-day > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.event-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.event-dot.course { background: var(--event-color); }
.event-dot.pink { background: var(--rose); }
.event-dot.yellow { background: var(--amber); }
.event-dot.green { background: var(--green-dark); }
.event-dot.muted { opacity: .35; }
.planner-agenda { min-width: 0; overflow: auto; padding: 16px; }
.planner-agenda-head { justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.planner-agenda-head span { font-weight: 800; }
.planner-event { display: grid; width: 100%; min-width: 0; gap: 3px; margin-bottom: 7px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 7px; background: var(--surface); color: var(--foreground); padding: 9px; text-align: left; }
.planner-event.course { border-left-color: var(--event-color); }
.planner-event.pink { border-left-color: var(--rose); }
.planner-event.yellow { border-left-color: var(--amber); }
.planner-event.green { border-left-color: var(--green-dark); }
.planner-event strong, .planner-event small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-event small { color: var(--muted); font-size: 11px; }

.command-dialog,
.review-dialog,
.history-dialog {
  width: min(720px, calc(100vw - 36px));
  max-height: calc(100vh - 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 24px 80px rgba(23, 32, 27, .25);
  padding: 0;
}
.review-dialog { width: min(820px, calc(100vw - 36px)); }
.command-dialog::backdrop, .review-dialog::backdrop, .history-dialog::backdrop { background: rgba(23, 32, 27, .36); backdrop-filter: blur(5px); }
.command-dialog > form, .review-dialog > form, .history-dialog > form { display: grid; max-height: calc(100vh - 46px); overflow: auto; gap: 16px; padding: 20px; }
.quick-capture-fields { display: grid; grid-template-columns: 150px minmax(150px, 1fr); gap: 8px; }
.quick-capture-fields textarea { grid-column: 1 / -1; min-height: 96px; resize: vertical; }
.quick-capture-fields input, .quick-capture-fields select, .quick-capture-fields textarea { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--input-bg); color: var(--foreground); padding: 10px; }
.quick-special-fields { display: contents; }
.quick-capture-fields .primary-button { grid-column: 1 / -1; }
.quick-inbox-section { border-top: 1px solid var(--line); padding-top: 14px; }
.quick-inbox-list { display: grid; gap: 6px; max-height: 250px; overflow: auto; margin-top: 8px; }
.inbox-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 8px 2px; }
.inbox-item strong, .inbox-item small { display: block; }
.inbox-item strong { overflow-wrap: anywhere; }
.inbox-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.review-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.review-metrics > div { border-left: 3px solid var(--green); background: var(--hover-bg); padding: 10px; }
.review-metrics span, .review-metrics strong { display: block; }
.review-metrics span { color: var(--muted); font-size: 11px; }
.review-metrics strong { margin-top: 3px; font-size: 20px; }
.review-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.review-columns section { min-width: 0; border-top: 2px solid color-mix(in srgb, var(--green) 40%, var(--line)); padding-top: 8px; }
.review-columns h3 { margin: 0 0 8px; font-size: 15px; }
.review-columns p { margin: 5px 0; overflow-wrap: anywhere; }
.review-note { display: grid; gap: 6px; }
.review-note textarea { min-height: 120px; border: 1px solid var(--line); border-radius: 7px; background: var(--input-bg); color: var(--foreground); padding: 10px; resize: vertical; }
.history-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.history-toolbar select { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--input-bg); color: var(--foreground); padding: 8px 10px; }
.history-list { display: grid; gap: 7px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.history-item strong, .history-item small { display: block; }
.history-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }

@media (max-width: 1120px) {
  .nav-list { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .finance-detail-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-form button { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topbar-actions { grid-template-columns: minmax(0, 1fr) 42px 42px; }
  .nav-list { grid-template-columns: repeat(9, minmax(54px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .today-dashboard .section-title-row { display: grid; grid-template-columns: 1fr; align-items: start; }
  .today-actions { justify-content: stretch; }
  .today-actions .text-button { flex: 1 1 calc(50% - 7px); }
  .finance-detail-row, .finance-tool-row, .bookmark-toolbar, .goal-form, .relation-picker > div, .review-metrics, .review-columns { grid-template-columns: 1fr; }
  .goal-form button { grid-column: auto; }
  .link-actions { grid-template-columns: minmax(0, 1fr) repeat(4, 32px); }
  .link-actions .record-actions { grid-column: 1 / -1; justify-self: end; }
  .planner-overlay { padding: 8px; }
  .planner-shell { width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .planner-head { padding: 12px; }
  .planner-toolbar { display: grid; grid-template-columns: 34px auto 34px minmax(0, 1fr); padding: 9px 12px; }
  .planner-filters { grid-column: 1 / -1; overflow-x: auto; }
  .planner-layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 230px; }
  .planner-board { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .planner-agenda { padding: 12px; }
  .quick-capture-fields { grid-template-columns: 1fr; }
  .quick-capture-fields textarea, .quick-capture-fields .primary-button { grid-column: auto; }
  .review-dialog .dialog-actions { display: grid; grid-template-columns: repeat(2, 1fr); }
  .review-dialog .dialog-actions .primary-button { grid-column: 1 / -1; }
}

/* Workbench 2.0 additions */
[hidden] {
  display: none !important;
}

.topbar-actions,
.form-action-row,
.record-toolbar,
.record-actions,
.settings-actions,
.backup-row,
.dialog-head,
.section-title-row,
.today-column-head,
.insight-title,
.budget-item > div:first-child,
.account-list > div {
  display: flex;
  align-items: center;
}

.topbar-actions {
  width: min(440px, 100%);
  gap: 8px;
}

.topbar-actions .search-box {
  width: auto;
  flex: 1;
}

.icon-button.subtle {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.icon-button.subtle svg,
.sidebar-command svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar-command {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
}

.sidebar-command:hover {
  background: var(--hover-bg);
  color: var(--green-dark);
}

.today-dashboard,
.search-center {
  max-width: 1320px;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.today-dashboard {
  padding: 18px;
}

.section-title-row,
.today-column-head,
.insight-title,
.dialog-head,
.account-list > div {
  justify-content: space-between;
  gap: 12px;
}

.section-title-row {
  margin-bottom: 14px;
}

.section-title-row h2 {
  font-size: 22px;
}

.text-button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--hover-bg);
  color: var(--green-dark);
  padding: 0 12px;
  font-weight: 700;
}

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

.today-column {
  min-width: 0;
  border-top: 2px solid color-mix(in srgb, var(--green) 45%, var(--line));
  padding: 12px 4px 0;
}

.today-column-head {
  margin-bottom: 8px;
}

.today-column-head span,
.insight-title small {
  color: var(--muted);
  font-size: 12px;
}

.today-task,
.today-course {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  padding: 7px 6px;
  text-align: left;
}

.today-task:hover,
.today-course:hover {
  background: var(--hover-bg);
}

.today-task strong,
.today-task small,
.today-course strong,
.today-course small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-task small,
.today-course small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.today-course > span:first-child {
  width: 9px;
  height: 9px;
  margin: 5px;
  border-radius: 3px;
  background: var(--course-color);
}

.today-snapshot > div:not(.today-column-head) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
}

.today-snapshot a {
  display: inline-block;
  margin: 10px 6px 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.search-center {
  position: relative;
  z-index: 8;
  max-height: min(560px, 68vh);
  overflow: auto;
  padding: 12px;
}

.search-filter-row {
  position: sticky;
  top: -12px;
  z-index: 2;
  display: grid;
  grid-template-columns: 150px 150px 150px 32px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 0 10px;
}

.search-filter-row input,
.search-filter-row select,
.budget-form input,
.settings-layout input,
.settings-layout select,
.edit-fields input,
.edit-fields select,
.edit-fields textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--foreground);
  padding: 9px 10px;
}

.search-result-list {
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.search-result {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--foreground);
  padding: 9px 10px;
  text-align: left;
}

.search-result:hover {
  background: var(--hover-bg);
}

.search-result > span {
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--green-dark);
  padding: 4px 7px;
  font-size: 11px;
  text-align: center;
}

.search-result div,
.search-result strong,
.search-result p {
  min-width: 0;
}

.search-result strong,
.search-result p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.search-result time {
  color: var(--muted);
  font-size: 12px;
}

.task-row {
  grid-template-columns: 138px 110px minmax(100px, 1fr) 104px;
}

.form-action-row {
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.form-action-row .primary-button {
  min-width: 150px;
  margin-left: auto;
  padding: 0 16px;
}

.attachment-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-dark);
  padding: 0 12px;
}

.attachment-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-toolbar {
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.record-toolbar .section-toggle {
  width: auto;
  flex: 1;
  margin-top: 0;
}

.record-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.record-actions {
  justify-content: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.record-actions .icon-ghost {
  width: 29px;
  height: 29px;
}

.record-actions .icon-ghost.is-active {
  background: color-mix(in srgb, var(--amber) 24%, white);
  color: #8a6419;
}

.record-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.record-kicker > span,
.record-kicker > strong {
  margin: 0;
}

.task {
  align-items: flex-start;
}

.task > .task-main {
  min-width: 0;
  flex: 1;
}

.task > .record-actions {
  flex: 0 0 auto;
}

.task.high-priority {
  border-left: 3px solid var(--rose);
}

.is-archived {
  opacity: 0.58;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.attachment-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  margin: 0 !important;
  border: 1px solid var(--line);
  border-radius: 6px !important;
  background: var(--surface) !important;
  padding: 0 !important;
}

.attachment-chip button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  padding: 5px 7px;
  font-size: 11px;
}

.attachment-chip button:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.link-actions {
  grid-template-columns: minmax(0, 1fr) 32px auto;
}

.finance-summary {
  align-items: stretch;
}

.budget-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.finance-insights {
  margin-top: 12px;
}

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

.finance-insight-grid > section {
  min-width: 0;
  border-top: 2px solid color-mix(in srgb, var(--green) 42%, var(--line));
  padding-top: 10px;
}

.budget-list,
.account-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.budget-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
}

.budget-item.spending-item {
  grid-template-columns: minmax(0, 1fr);
}

.budget-item > div:first-child {
  grid-column: 1;
  justify-content: space-between;
  gap: 6px;
}

.budget-item small,
.account-list span {
  color: var(--muted);
  font-size: 11px;
}

.budget-item .icon-ghost {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
}

.progress-track {
  grid-column: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hover-bg);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 5px;
  height: 96px;
  margin-top: 7px;
}

.trend-chart > div {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 4px;
  height: 100%;
}

.trend-chart span {
  width: 100%;
  max-width: 18px;
  border-radius: 4px 4px 1px 1px;
  background: color-mix(in srgb, var(--green) 72%, white);
}

.trend-chart small {
  color: var(--muted);
  font-size: 10px;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 0;
  border: 0;
  padding: 0;
}

.weekday-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.weekday-picker label {
  position: relative;
  display: grid;
  min-width: 0;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.weekday-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.weekday-picker label:has(input:checked) {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, white);
  color: var(--green-dark);
  font-weight: 800;
}

.course-block {
  cursor: grab;
}

.course-block.is-dragging {
  opacity: 0.35;
}

.schedule-day-track:has(.course-block.is-dragging) {
  background-color: color-mix(in srgb, var(--green) 6%, transparent);
}

.edit-dialog,
.data-dialog {
  width: min(680px, calc(100vw - 40px));
  max-height: calc(100vh - 54px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 24px 80px rgba(23, 32, 27, 0.24);
  padding: 0;
}

.data-dialog {
  width: min(760px, calc(100vw - 40px));
}

.edit-dialog::backdrop,
.data-dialog::backdrop {
  background: rgba(23, 32, 27, 0.35);
  backdrop-filter: blur(5px);
}

.edit-dialog > form,
.data-dialog > form {
  display: grid;
  max-height: calc(100vh - 56px);
  overflow: auto;
  gap: 16px;
  padding: 20px;
}

.dialog-head {
  position: sticky;
  top: -20px;
  z-index: 2;
  background: var(--surface);
  padding: 3px 0 10px;
}

.dialog-head h2 {
  font-size: 22px;
}

.edit-fields,
.settings-layout {
  display: grid;
  gap: 12px;
}

.edit-fields textarea {
  min-height: 130px;
  resize: vertical;
}

.settings-layout > section {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.settings-layout > section:last-child {
  border-bottom: 0;
}

.settings-layout h3,
.settings-layout p {
  margin-bottom: 0;
}

.settings-layout p,
.dialog-footer,
.settings-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.update-heading,
.update-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.version-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
}

.update-summary {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
  padding: 13px;
}

.update-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 5px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent);
}

.update-summary strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.update-summary p {
  overflow-wrap: anywhere;
}

.update-summary[data-status="available"] .update-mark,
.update-summary[data-status="downloaded"] .update-mark {
  background: var(--green-dark);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-dark) 14%, transparent);
}

.update-summary[data-status="error"] .update-mark {
  background: var(--clay);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--clay) 14%, transparent);
}

.update-summary[data-status="checking"] .update-mark,
.update-summary[data-status="downloading"] .update-mark {
  animation: update-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes update-pulse {
  to { opacity: 0.35; transform: scale(0.75); }
}

.update-progress {
  display: grid;
  gap: 6px;
}

.update-progress[hidden] {
  display: none;
}

.update-progress-meta,
.update-progress small {
  color: var(--muted);
  font-size: 12px;
}

.update-progress progress {
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
}

.update-progress progress::-webkit-progress-bar {
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
}

.update-progress progress::-webkit-progress-value {
  border-radius: inherit;
  background: var(--blue);
}

.update-notes {
  border-left: 2px solid var(--blue);
  padding-left: 10px;
}

.settings-actions,
.backup-row {
  flex-wrap: wrap;
  gap: 8px;
}

.backup-row select {
  min-width: 200px;
  flex: 1;
}

.toggle-row {
  display: flex;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 8px;
}

.toggle-row input {
  width: auto;
  min-height: auto;
}

.settings-status {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--green-dark);
}

.settings-status.is-error,
.lock-card [data-unlock-error] {
  color: var(--clay);
}

.dialog-footer {
  text-align: center;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--background);
  padding: 24px;
}

.lock-card {
  display: grid;
  width: min(360px, 100%);
  gap: 12px;
  text-align: center;
}

.lock-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
}

.lock-card h1 {
  font-size: 30px;
  line-height: 1.1;
}

.lock-card p {
  margin-bottom: 4px;
  color: var(--muted);
}

.lock-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  padding: 10px 12px;
}

.undo-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(420px, calc(100vw - 40px));
  border: 1px solid color-mix(in srgb, var(--foreground) 20%, transparent);
  border-radius: 8px;
  background: var(--foreground);
  color: var(--surface);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.22);
  padding: 12px 14px;
}

.undo-toast button {
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
}

.search-highlight {
  animation: search-pulse 1.5s ease;
}

@keyframes search-pulse {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 30%, transparent); }
}

.fatal-error {
  margin: 0;
  padding: 32px;
  color: #a33;
  white-space: pre-wrap;
}

@media (max-width: 1120px) {
  .nav-list {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .sidebar-command {
    justify-self: start;
  }

  .today-grid,
  .finance-insight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar-actions,
  .search-filter-row,
  .today-grid,
  .finance-insight-grid,
  .task-row,
  .budget-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
  }

  .search-filter-row {
    position: static;
  }

  .form-action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-action-row .primary-button {
    width: 100%;
    margin-left: 0;
  }

  .record-actions {
    flex-wrap: wrap;
  }

  .finance-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-result {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .search-result time {
    grid-column: 2;
  }

  .settings-actions,
  .backup-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .backup-row select {
    min-width: 0;
  }

  .undo-toast {
    right: 14px;
    bottom: 14px;
  }
}

/* Visual refinement and first-use guide */
:root {
  --shadow: 0 10px 30px rgba(28, 39, 33, 0.075);
  --shadow-soft: 0 4px 14px rgba(28, 39, 33, 0.055);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

body {
  background: var(--background);
}

body[data-theme="kitty"] {
  --shadow: 0 10px 28px rgba(74, 48, 40, 0.075);
  --shadow-soft: 0 4px 14px rgba(74, 48, 40, 0.055);
  --focus-ring: 0 0 0 3px rgba(95, 145, 200, 0.18);
  background: var(--background);
}

.shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  gap: 18px;
  padding: 22px 18px;
}

.brand {
  padding: 2px 6px 8px;
}

.brand-mark {
  box-shadow: var(--shadow-soft);
}

.brand strong {
  font-size: 17px;
}

.nav-list {
  gap: 4px;
}

.nav-list a {
  gap: 11px;
  min-height: 43px;
  border: 1px solid transparent;
  padding: 0 11px;
  font-weight: 550;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-list a::before {
  display: none;
}

.nav-list a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-list a:hover {
  transform: translateX(2px);
}

.nav-list a.active {
  border-color: color-mix(in srgb, var(--green) 15%, var(--line));
  box-shadow: inset 3px 0 0 var(--green);
}

body[data-theme="kitty"] .nav-list a.active {
  border-color: rgba(95, 145, 200, 0.18);
  box-shadow: inset 3px 0 0 #dc5d68;
}

.theme-picker,
.sidebar-command {
  margin-inline: 6px;
}

.theme-picker select,
.sidebar-command {
  box-shadow: var(--shadow-soft);
}

.mini-card {
  margin-inline: 6px;
  box-shadow: var(--shadow-soft);
}

.workspace {
  padding: 30px 30px 34px;
}

.topbar {
  align-items: flex-end;
  margin-bottom: 26px;
}

h1 {
  font-size: clamp(36px, 4.1vw, 52px);
  line-height: 1.02;
}

.topbar .eyebrow {
  margin-bottom: 10px;
}

.search-box,
.icon-button.subtle {
  box-shadow: var(--shadow-soft);
}

.search-box:focus-within {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
  box-shadow: var(--focus-ring), var(--shadow-soft);
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line)) !important;
  box-shadow: var(--focus-ring);
}

.today-dashboard {
  border-color: color-mix(in srgb, var(--green) 18%, var(--line));
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--green) 7%, var(--surface)), var(--surface) 48%);
  box-shadow: var(--shadow);
  padding: 20px;
}

body[data-theme="kitty"] .today-dashboard {
  border-color: rgba(95, 145, 200, 0.18);
  background:
    linear-gradient(100deg, rgba(237, 244, 251, 0.74), rgba(255, 253, 249, 0.96) 52%);
}

.today-column {
  border-top-width: 1px;
  padding: 13px 4px 0;
}

.today-column-head strong,
.insight-title strong {
  font-size: 14px;
}

.overview {
  gap: 10px;
  margin-bottom: 18px;
}

.metric,
.panel {
  border-color: color-mix(in srgb, var(--line) 84%, transparent);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: var(--shadow);
}

.metric {
  --metric-accent: var(--green);
  min-height: 116px;
  overflow: hidden;
  padding: 17px 18px;
}

.metric::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--metric-accent);
  content: "";
}

.metric:nth-child(2) { --metric-accent: var(--amber); }
.metric:nth-child(3) { --metric-accent: var(--rose); }
.metric:nth-child(4) { --metric-accent: var(--blue); }

.metric span::before {
  background: var(--metric-accent);
}

.metric strong {
  margin-top: 12px;
  font-size: 28px;
}

.work-grid {
  gap: 18px;
}

.panel {
  min-height: 400px;
  padding: 22px;
}

.diary-panel,
.finance-panel {
  min-height: 500px;
}

.panel-heading {
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 14px;
}

.panel-heading::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: color-mix(in srgb, var(--line) 78%, transparent);
  content: "";
}

.panel-heading .eyebrow {
  margin-bottom: 6px;
}

.panel-heading h2 {
  font-size: 23px;
}

.entry-form {
  gap: 11px;
}

.entry-form input,
.entry-form select,
.entry-form textarea,
.inline-form input,
.inline-form select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button,
.secondary-button,
.danger-button,
.section-toggle,
.attachment-button,
.text-button,
.icon-button,
.icon-ghost,
.sidebar-command {
  transition: transform 0.14s ease, background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.attachment-button:hover,
.text-button:hover,
.sidebar-command:hover {
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.attachment-button:active,
.text-button:active,
.sidebar-command:active {
  transform: translateY(0);
}

.primary-button {
  box-shadow: 0 4px 10px color-mix(in srgb, var(--green) 20%, transparent);
}

.section-toggle {
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.empty {
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--hover-bg) 52%, transparent);
  padding: 18px;
}

.record-card,
.link-card,
.task,
.course-list-item {
  box-shadow: 0 2px 7px rgba(28, 39, 33, 0.035);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.record-card:hover,
.link-card:hover,
.task:hover,
.course-list-item:hover {
  border-color: color-mix(in srgb, var(--green) 22%, var(--line));
  box-shadow: var(--shadow-soft);
}

.finance-summary > div {
  border-top: 2px solid color-mix(in srgb, var(--green) 36%, var(--line));
}

.finance-summary > div:nth-child(2) {
  border-top-color: color-mix(in srgb, var(--clay) 48%, var(--line));
}

.finance-summary > div:nth-child(3) {
  border-top-color: color-mix(in srgb, var(--amber) 58%, var(--line));
}

.search-center {
  box-shadow: 0 18px 52px rgba(28, 39, 33, 0.14);
}

.onboarding-dialog {
  width: min(780px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 28px 90px rgba(23, 32, 27, 0.28);
  padding: 0;
}

.onboarding-dialog::backdrop {
  background: rgba(23, 32, 27, 0.42);
  backdrop-filter: blur(7px);
}

.onboarding-dialog form {
  display: grid;
  min-height: 500px;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.onboarding-head,
.onboarding-footer,
.onboarding-actions {
  display: flex;
  align-items: center;
}

.onboarding-head,
.onboarding-footer {
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
}

.onboarding-head {
  border-bottom: 1px solid var(--line);
}

.onboarding-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.onboarding-skip {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.onboarding-skip:hover {
  color: var(--foreground);
}

.onboarding-body {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  min-height: 0;
}

.onboarding-art {
  display: grid;
  min-height: 330px;
  place-items: center;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--green) 13%, var(--surface)), color-mix(in srgb, var(--amber) 8%, var(--surface)));
  padding: 30px;
}

body[data-theme="kitty"] .onboarding-art {
  background:
    linear-gradient(145deg, rgba(237, 244, 251, 0.98), rgba(255, 245, 244, 0.96));
}

.onboarding-art svg {
  width: min(260px, 100%);
  fill: none;
  stroke: var(--green-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 12px 16px rgba(28, 39, 33, 0.08));
}

body[data-theme="kitty"] .onboarding-art svg {
  stroke: #3f6f9e;
}

.onboarding-copy {
  align-self: center;
  padding: 36px 38px;
}

.onboarding-copy h2 {
  margin-bottom: 14px;
  font-size: 30px;
  line-height: 1.18;
}

.onboarding-copy > p:not(.eyebrow) {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.onboarding-copy ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-copy li {
  position: relative;
  padding-left: 24px;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.55;
}

.onboarding-copy li::before {
  position: absolute;
  top: 4px;
  left: 0;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 15%, white);
  color: var(--green-dark);
  content: "✓";
  font-size: 10px;
  font-weight: 900;
}

.onboarding-footer {
  border-top: 1px solid var(--line);
}

.onboarding-dots {
  display: flex;
  gap: 6px;
}

.onboarding-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 28%, transparent);
  transition: width 0.2s ease, background 0.2s ease;
}

.onboarding-dots span.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--green);
}

.onboarding-actions {
  gap: 8px;
}

.onboarding-actions .primary-button,
.onboarding-actions .secondary-button {
  min-width: 92px;
  padding: 0 16px;
}

.onboarding-actions button:disabled {
  cursor: default;
  opacity: 0.35;
  transform: none;
}

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

  .nav-list a {
    justify-content: center;
    gap: 7px;
    padding-inline: 6px;
  }

  .nav-list a:hover {
    transform: translateY(-1px);
  }

  .nav-list a.active {
    box-shadow: inset 0 -3px 0 var(--green);
  }

  body[data-theme="kitty"] .nav-list a.active {
    box-shadow: inset 0 -3px 0 #dc5d68;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 22px 18px 28px;
  }

  .nav-list a {
    display: grid;
    min-height: 58px;
    place-content: center;
    gap: 5px;
    text-align: center;
  }

  .nav-list a svg {
    width: 17px;
    height: 17px;
    margin: 0 auto;
  }

  .nav-list a span {
    font-size: 12px;
  }

  .today-dashboard,
  .panel {
    padding: 18px;
  }

  .onboarding-dialog {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
  }

  .onboarding-dialog form {
    min-height: 0;
    max-height: calc(100vh - 30px);
    overflow: auto;
  }

  .onboarding-body {
    grid-template-columns: 1fr;
  }

  .onboarding-art {
    min-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }

  .onboarding-art svg {
    width: 180px;
    height: 145px;
  }

  .onboarding-copy {
    padding: 24px 22px;
  }

  .onboarding-copy h2 {
    font-size: 24px;
  }

  .onboarding-head,
  .onboarding-footer {
    padding: 14px 16px;
  }

  .onboarding-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface);
  }
}

/* Decorative layout and responsive form corrections */
body[data-theme="kitty"] .brand-mark {
  background-position: 50% 44%;
  background-size: auto 98%;
}

body[data-theme="kitty"] .today-dashboard {
  position: relative;
  overflow: hidden;
}

body[data-theme="kitty"] .today-dashboard::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    rgba(95, 145, 200, 0.68) 0 22px,
    transparent 22px 31px,
    rgba(220, 93, 104, 0.4) 31px 40px,
    transparent 40px 50px,
    rgba(234, 219, 125, 0.72) 50px 59px,
    transparent 59px 70px
  );
  content: "";
  opacity: 0.58;
  pointer-events: none;
}

body[data-theme="kitty"] .panel-heading::after {
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(95, 145, 200, 0.54) 0 18px,
    transparent 18px 27px,
    rgba(220, 93, 104, 0.32) 27px 36px,
    transparent 36px 46px,
    rgba(234, 219, 125, 0.58) 46px 55px,
    transparent 55px 65px
  );
}

body[data-theme="kitty"] .overview {
  margin-bottom: 38px;
}

body[data-theme="kitty"] .work-grid {
  column-gap: 20px;
  row-gap: 48px;
}

body[data-theme="kitty"] .panel::before,
body[data-theme="kitty"] .panel::after {
  display: none;
}

body[data-theme="kitty"] .panel.decor-bow::after,
body[data-theme="kitty"] .panel.decor-milk::before,
body[data-theme="kitty"] .panel.decor-cheese::before {
  display: block;
  filter: drop-shadow(0 8px 10px rgba(42, 27, 24, 0.11));
}

body[data-theme="kitty"] .panel.decor-bow::after {
  top: -29px;
  right: 16px;
  width: 84px;
  height: 52px;
  background-image: url("./assets/kitty/bow-sticker.png");
  transform: rotate(17deg);
  transform-origin: 66% 52%;
}

body[data-theme="kitty"] .panel.decor-bow-health::after {
  right: 22px;
  transform: rotate(14deg);
}

body[data-theme="kitty"] .panel.decor-bow-links::after {
  right: 14px;
  transform: rotate(20deg);
}

body[data-theme="kitty"] .panel.decor-milk::before {
  right: 18px;
  bottom: -10px;
  width: 40px;
  height: 80px;
  background-image: url("./assets/kitty/kitty-milk.png");
  transform: rotate(5deg);
}

body[data-theme="kitty"] .panel.decor-milk-tasks::before {
  right: auto;
  left: 18px;
  transform: rotate(-5deg);
}

body[data-theme="kitty"] .panel.decor-milk-finance::before {
  right: 24px;
  transform: rotate(-5deg);
}

body[data-theme="kitty"] .panel.decor-milk-finance {
  padding-bottom: 88px;
}

body[data-theme="kitty"] .panel.decor-cheese::before {
  bottom: -10px;
  right: 18px;
  left: auto;
  width: 78px;
  height: 66px;
  background-image: url("./assets/kitty/cheese-sticker.png");
  transform: rotate(-8deg);
}

body[data-theme="kitty"] .panel.decor-cheese {
  padding-bottom: 76px;
}

body[data-theme="kitty"] .footer-note {
  margin-top: 30px;
}

.trend-chart {
  align-items: stretch;
  gap: 4px;
}

.trend-chart > .trend-month {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 18px;
  align-content: stretch;
  align-items: end;
  gap: 3px;
  min-width: 0;
}

.trend-month span {
  align-self: end;
  height: var(--bar-height);
}

.trend-month small {
  display: block;
  width: 100%;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
}

.entry-form input,
.entry-form select,
.entry-form textarea,
.budget-form input,
.budget-form button {
  min-width: 0;
}

.task-row {
  grid-template-columns:
    minmax(0, 1.25fr)
    minmax(0, 0.9fr)
    minmax(0, 1fr)
    minmax(0, 0.9fr);
}

@media (max-width: 1120px) {
  .task-row,
  .finance-row,
  .triple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .triple > :last-child {
    grid-column: 1 / -1;
  }

  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-action-row {
    flex-wrap: wrap;
  }

  .form-action-row .attachment-status {
    flex: 1 1 40px;
  }

  .form-action-row .primary-button {
    min-width: 132px;
  }

  .finance-panel .finance-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-panel .finance-insight-grid > section:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 761px) and (max-width: 1400px) {
  .bookmark-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bookmark-toolbar label {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .task-row,
  .finance-row,
  .triple,
  .split,
  .finance-panel .finance-insight-grid {
    grid-template-columns: 1fr;
  }

  .triple > :last-child,
  .finance-panel .finance-insight-grid > section:last-child {
    grid-column: auto;
  }

  body[data-theme="kitty"] .overview {
    margin-bottom: 34px;
  }

  body[data-theme="kitty"] .work-grid {
    row-gap: 44px;
  }

  body[data-theme="kitty"] .panel.decor-bow::after {
    top: -25px;
    right: 12px;
    width: 72px;
    height: 45px;
  }

  body[data-theme="kitty"] .panel.decor-milk::before {
    right: 14px;
    bottom: -8px;
    width: 34px;
    height: 68px;
  }

  body[data-theme="kitty"] .panel.decor-milk-tasks::before {
    right: auto;
    left: 14px;
  }

  body[data-theme="kitty"] .panel.decor-cheese::before {
    bottom: -8px;
    right: 14px;
    left: auto;
    width: 66px;
    height: 56px;
  }

  body[data-theme="kitty"] .panel.decor-milk-finance {
    padding-bottom: 76px;
  }

  body[data-theme="kitty"] .panel.decor-milk-tasks {
    padding-bottom: 72px;
  }

  body[data-theme="kitty"] .panel.decor-cheese {
    padding-bottom: 68px;
  }
}

/* Week-aware schedule controls and editable option fields */
.schedule-board {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.schedule-board-head-actions {
  display: grid;
  min-width: 0;
  justify-items: end;
  gap: 8px;
}

.schedule-week-switcher {
  display: grid;
  grid-template-columns: 32px minmax(172px, 1fr) 32px auto;
  align-items: center;
  gap: 6px;
}

.schedule-week-switcher select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--foreground);
  padding: 6px 9px;
}

.schedule-week-switcher .icon-ghost {
  width: 32px;
  height: 32px;
}

.schedule-week-switcher .secondary-button {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.schedule-week-note {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--green));
  border-radius: 8px;
  background: color-mix(in srgb, var(--chip-bg) 56%, var(--surface));
  padding: 10px 12px;
}

.schedule-week-note > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.schedule-week-note small {
  color: var(--muted);
  font-size: 12px;
}

.schedule-week-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.schedule-week-note textarea {
  min-width: 0;
  min-height: 54px;
  max-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--foreground);
  padding: 9px 10px;
  font: inherit;
  line-height: 1.45;
}

.schedule-week-note-row .secondary-button {
  min-height: 40px;
  padding: 8px 12px;
}

.week-range-field {
  display: grid;
  gap: 6px;
}

.editable-combobox {
  position: relative;
  width: 100%;
  min-width: 0;
}

.editable-combobox > input {
  width: 100%;
  padding-right: 42px !important;
}

.editable-combobox-toggle {
  position: absolute;
  z-index: 2;
  top: 1px;
  right: 1px;
  bottom: 1px;
  display: grid;
  width: 38px;
  place-items: center;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 0 7px 7px 0;
  background: color-mix(in srgb, var(--input-bg) 90%, var(--hover-bg));
  color: var(--muted);
  padding: 0;
}

.editable-combobox-toggle:hover,
.editable-combobox.is-open .editable-combobox-toggle {
  background: var(--hover-bg);
  color: var(--green-dark);
}

.editable-combobox-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.editable-combobox-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(30, 25, 23, 0.16);
  padding: 4px;
}

.editable-combobox-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  padding: 7px 9px;
  text-align: left;
}

.editable-combobox-menu button:hover,
.editable-combobox-menu button:focus-visible {
  background: var(--hover-bg);
  color: var(--green-dark);
  outline: none;
}

@media (max-width: 760px) {
  .schedule-board-head-actions {
    width: 100%;
    justify-items: stretch;
  }

  .schedule-board-head-actions > [data-schedule-status] {
    justify-self: start;
  }

  .schedule-week-switcher {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
  }

  .schedule-week-switcher .secondary-button {
    grid-column: 1 / -1;
  }

  .schedule-week-note > div:first-child {
    display: grid;
    gap: 2px;
  }

  .schedule-week-note-row {
    grid-template-columns: 1fr;
  }

  .schedule-week-note-row .secondary-button {
    width: 100%;
  }
}

/* Final responsive overrides for the expanded navigation and tool row. */
@media (max-width: 1120px) {
  .nav-list { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar-actions { grid-template-columns: minmax(0, 1fr) 42px 42px; }
  .nav-list { grid-template-columns: repeat(9, minmax(54px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .today-dashboard .section-title-row { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; align-items: start; }
  .today-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; min-width: 0; max-width: 100%; }
  .today-actions .text-button { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .planner-weekdays,
  .planner-days { min-width: 350px; grid-template-columns: repeat(7, minmax(46px, 1fr)); }
  .planner-day { min-height: 88px; padding: 6px; }
}

/* Spider-Man: Brand New Day theme */
.spider-wordmark {
  display: none;
}

body[data-theme="spider"] {
  --background: #070a11;
  --foreground: #f7f8fc;
  --muted: #aeb8cb;
  --line: #2a3858;
  --surface: #101827;
  --ink: #f7f8fc;
  --green: #d91d31;
  --green-dark: #ff5261;
  --blue: #3679df;
  --clay: #bd3544;
  --amber: #ffd340;
  --rose: #f13a50;
  --input-bg: #0b1321;
  --chip-bg: #172743;
  --hover-bg: #1a2944;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 5px 16px rgba(0, 0, 0, 0.25);
  --focus-ring: 0 0 0 3px rgba(255, 211, 64, 0.2);
  color-scheme: dark;
  background-color: var(--background);
  background-image:
    linear-gradient(135deg, transparent 0 48%, rgba(54, 121, 223, 0.035) 48% 51%, transparent 51%),
    linear-gradient(45deg, transparent 0 48%, rgba(217, 29, 49, 0.025) 48% 51%, transparent 51%);
  background-size: 42px 42px;
}

body[data-theme="spider"] .shell {
  background: transparent;
}

body[data-theme="spider"] .sidebar {
  border-color: #2a3858;
  background: rgba(7, 10, 17, 0.97);
  box-shadow: inset -3px 0 0 #c91c30;
}

body[data-theme="spider"] .brand-mark {
  overflow: hidden;
  border: 2px solid #ff4b5d;
  border-radius: 48% 48% 44% 44%;
  background: #d91d31;
  box-shadow:
    inset 0 -8px 0 rgba(54, 121, 223, 0.26),
    0 0 0 2px #071121,
    var(--shadow-soft);
  color: transparent;
  transform: rotate(-4deg);
}

body[data-theme="spider"] .brand-mark::before,
body[data-theme="spider"] .brand-mark::after {
  position: absolute;
  top: 9px;
  width: 10px;
  height: 21px;
  background: #f7f8fc;
  clip-path: polygon(50% 0, 100% 18%, 72% 100%, 0 78%);
  content: "";
  filter: drop-shadow(0 0 1px #071121);
}

body[data-theme="spider"] .brand-mark::before {
  left: 8px;
}

body[data-theme="spider"] .brand-mark::after {
  right: 8px;
  transform: scaleX(-1);
}

body[data-theme="spider"] .brand strong,
body[data-theme="spider"] h1,
body[data-theme="spider"] h2,
body[data-theme="spider"] h3 {
  color: #f7f8fc;
}

body[data-theme="spider"] h1 {
  font-family: "Avenir Next Condensed", "Arial Narrow", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 900;
  text-shadow: 2px 2px 0 #153b79, 4px 4px 0 rgba(217, 29, 49, 0.3);
}

body[data-theme="spider"] .workspace::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  width: min(430px, 48vw);
  aspect-ratio: 1;
  background:
    repeating-radial-gradient(circle at 100% 0, transparent 0 47px, rgba(247, 248, 252, 0.11) 48px 49px, transparent 50px 91px),
    repeating-conic-gradient(from 180deg at 100% 0, rgba(247, 248, 252, 0.12) 0 0.7deg, transparent 0.8deg 15deg);
  content: "";
  opacity: 0.55;
  pointer-events: none;
}

body[data-theme="spider"] .workspace > * {
  position: relative;
  z-index: 1;
}

body[data-theme="spider"] .spider-wordmark {
  display: block;
  width: 64px;
  height: 23px;
  flex: 0 0 64px;
  overflow: hidden;
  margin: 0;
}

body[data-theme="spider"] .spider-wordmark img {
  display: block;
  width: 64px;
  height: auto;
}

body[data-theme="spider"] .nav-list a {
  color: #aeb8cb;
}

body[data-theme="spider"] .nav-list a:hover {
  border-color: rgba(54, 121, 223, 0.48);
  background: #121f36;
  color: #ffffff;
}

body[data-theme="spider"] .nav-list a.active {
  border-color: rgba(255, 82, 97, 0.58);
  background: linear-gradient(100deg, rgba(217, 29, 49, 0.86), rgba(24, 49, 88, 0.86));
  box-shadow: inset 3px 0 0 #ffd340;
  color: #ffffff;
}

body[data-theme="spider"] .theme-picker select,
body[data-theme="spider"] .sidebar-command,
body[data-theme="spider"] .mini-card,
body[data-theme="spider"] .search-box,
body[data-theme="spider"] .icon-button.subtle {
  border-color: #2a3858;
  background: rgba(15, 24, 40, 0.94);
  color: var(--foreground);
}

body[data-theme="spider"] .focus-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid #ffd340;
}

body[data-theme="spider"] .focus-card::after {
  position: absolute;
  top: -38px;
  right: -38px;
  width: 112px;
  aspect-ratio: 1;
  border: 1px solid rgba(247, 248, 252, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 12px transparent,
    0 0 0 13px rgba(247, 248, 252, 0.1),
    0 0 0 26px transparent,
    0 0 0 27px rgba(247, 248, 252, 0.08);
  content: "";
  pointer-events: none;
}

body[data-theme="spider"] .eyebrow {
  color: #ffd340;
}

body[data-theme="spider"] .today-dashboard,
body[data-theme="spider"] .search-center,
body[data-theme="spider"] .metric,
body[data-theme="spider"] .panel {
  border-color: #2a3858;
  background: rgba(15, 23, 38, 0.96);
  box-shadow: var(--shadow);
}

body[data-theme="spider"] .today-dashboard {
  overflow: hidden;
  border-top: 3px solid #d91d31;
  background:
    linear-gradient(110deg, rgba(20, 34, 58, 0.98), rgba(13, 19, 32, 0.98) 58%, rgba(37, 15, 26, 0.98));
}

body[data-theme="spider"] .today-dashboard::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 3px;
  background: repeating-linear-gradient(90deg, #d91d31 0 34px, #3679df 34px 68px, #ffd340 68px 75px, transparent 75px 84px);
  content: "";
  opacity: 0.9;
  pointer-events: none;
}

body[data-theme="spider"] .today-dashboard > * {
  position: relative;
  z-index: 1;
}

body[data-theme="spider"] .today-column {
  border-top-color: rgba(54, 121, 223, 0.7);
}

body[data-theme="spider"] .metric {
  background: linear-gradient(145deg, rgba(18, 29, 49, 0.98), rgba(12, 18, 30, 0.98));
}

body[data-theme="spider"] .metric::after {
  background: var(--metric-accent);
}

body[data-theme="spider"] .metric:nth-child(1) { --metric-accent: #3679df; }
body[data-theme="spider"] .metric:nth-child(2) { --metric-accent: #ffd340; }
body[data-theme="spider"] .metric:nth-child(3) { --metric-accent: #d91d31; }
body[data-theme="spider"] .metric:nth-child(4) { --metric-accent: #6fa1ef; }

body[data-theme="spider"] .panel {
  border-top: 3px solid #3679df;
  background: linear-gradient(160deg, rgba(18, 27, 44, 0.99), rgba(11, 17, 29, 0.99));
}

body[data-theme="spider"] .panel:nth-child(2),
body[data-theme="spider"] .panel:nth-child(4),
body[data-theme="spider"] .panel:nth-child(6) {
  border-top-color: #d91d31;
}

body[data-theme="spider"] .panel:nth-child(3) {
  border-top-color: #ffd340;
}

body[data-theme="spider"] .panel::before {
  position: absolute;
  z-index: 0;
  top: -62px;
  right: -62px;
  display: block;
  width: 155px;
  aspect-ratio: 1;
  background:
    repeating-radial-gradient(circle at 100% 0, transparent 0 21px, rgba(247, 248, 252, 0.1) 22px 23px, transparent 24px 41px),
    repeating-conic-gradient(from 180deg at 100% 0, rgba(247, 248, 252, 0.11) 0 0.8deg, transparent 0.9deg 20deg);
  content: "";
  pointer-events: none;
}

body[data-theme="spider"] .panel-heading::after {
  height: 2px;
  background: repeating-linear-gradient(90deg, #3679df 0 26px, transparent 26px 35px, #d91d31 35px 46px, transparent 46px 55px, #ffd340 55px 63px, transparent 63px 74px);
  opacity: 0.72;
}

body[data-theme="spider"] .panel-icon {
  display: none;
}

body[data-theme="spider"] input,
body[data-theme="spider"] select,
body[data-theme="spider"] textarea,
body[data-theme="spider"] .schedule-controls input,
body[data-theme="spider"] .schedule-controls select,
body[data-theme="spider"] .course-form input,
body[data-theme="spider"] .course-form select {
  border-color: #2a3858;
  background: #0b1321;
  color: #f7f8fc;
}

body[data-theme="spider"] input::placeholder,
body[data-theme="spider"] textarea::placeholder {
  color: #7f8ba2;
}

body[data-theme="spider"] .primary-button {
  background: #d91d31;
  box-shadow: inset 0 -3px 0 #8e1020;
  color: #ffffff;
}

body[data-theme="spider"] .primary-button:hover {
  background: #ef3145;
}

body[data-theme="spider"] .secondary-button,
body[data-theme="spider"] .text-button,
body[data-theme="spider"] .section-toggle,
body[data-theme="spider"] .schedule-create-form .ghost-button {
  border-color: #31578f;
  background: #162743;
  color: #d9e8ff;
}

body[data-theme="spider"] .secondary-button:hover,
body[data-theme="spider"] .text-button:hover,
body[data-theme="spider"] .section-toggle:hover,
body[data-theme="spider"] .schedule-create-form .ghost-button:hover {
  background: #203a63;
  color: #ffffff;
}

body[data-theme="spider"] .icon-button,
body[data-theme="spider"] .jump-button,
body[data-theme="spider"] .icon-ghost:hover,
body[data-theme="spider"] .check-button:hover {
  background: #162743;
  color: #d9e8ff;
}

body[data-theme="spider"] .month-group,
body[data-theme="spider"] .day-summary,
body[data-theme="spider"] .schedule-name-form,
body[data-theme="spider"] .course-form,
body[data-theme="spider"] .course-list-item,
body[data-theme="spider"] .editable-combobox-menu,
body[data-theme="spider"] .planner-day,
body[data-theme="spider"] .planner-event,
body[data-theme="spider"] .review-metrics > div {
  border-color: #2a3858;
  background: #0d1626;
  color: #f7f8fc;
}

body[data-theme="spider"] .schedule-overlay,
body[data-theme="spider"] .planner-overlay {
  background: rgba(2, 5, 10, 0.76);
}

body[data-theme="spider"] .schedule-shell,
body[data-theme="spider"] .planner-shell,
body[data-theme="spider"] .edit-dialog,
body[data-theme="spider"] .data-dialog,
body[data-theme="spider"] .command-dialog,
body[data-theme="spider"] .review-dialog,
body[data-theme="spider"] .history-dialog,
body[data-theme="spider"] .confirm-dialog,
body[data-theme="spider"] .birthday-dialog,
body[data-theme="spider"] .onboarding-dialog {
  border-color: #35486f;
  background: #101827;
  color: #f7f8fc;
}

body[data-theme="spider"] .schedule-sidebar {
  border-color: #2a3858;
  background: #0a111e;
}

body[data-theme="spider"] .schedule-grid-wrap {
  border-color: #2a3858;
  background: #080e19;
}

body[data-theme="spider"] .schedule-day-title {
  border-color: #2a3858;
  background: rgba(13, 22, 38, 0.96);
}

body[data-theme="spider"] .time-track,
body[data-theme="spider"] .schedule-day-track {
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, rgba(54, 121, 223, 0.2) 63px, rgba(54, 121, 223, 0.2) 64px);
}

body[data-theme="spider"] .schedule-day-column,
body[data-theme="spider"] .time-axis-labels {
  border-color: #2a3858;
}

body[data-theme="spider"] .onboarding-art {
  background: linear-gradient(145deg, #14294c, #35131d);
}

body[data-theme="spider"] .birthday-art {
  background:
    repeating-conic-gradient(from -8deg at 50% 72%, rgba(255, 211, 64, 0.22) 0 7deg, transparent 7deg 17deg),
    linear-gradient(135deg, #14294c, #35131d);
}

body[data-theme="spider"] .onboarding-art svg {
  stroke: #ffd340;
}

body[data-theme="spider"] .footer-note {
  color: #8f9ab0;
}

@media (max-width: 1120px) {
  body[data-theme="spider"] .sidebar {
    box-shadow: inset 0 -3px 0 #c91c30;
  }

  body[data-theme="spider"] .nav-list a.active {
    box-shadow: inset 0 -3px 0 #ffd340;
  }
}

@media (max-width: 760px) {
  body[data-theme="spider"] .workspace::before {
    width: 320px;
    opacity: 0.38;
  }
}

/* Compact overview cards and full-screen module workspaces */
.work-grid > .panel:not(.is-module-expanded) {
  min-height: 274px;
  cursor: pointer;
  overflow: visible;
}

.work-grid > .panel:not(.is-module-expanded) > :not(.panel-heading):not(.panel-overview):not(.panel-quick-form) {
  display: none !important;
}

.work-grid > .panel:not(.is-module-expanded) .panel-heading {
  margin-bottom: 14px;
}

.panel-overview {
  display: grid;
  width: 100%;
  min-height: 90px;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 16px;
  border: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--green) 5%, var(--surface));
  color: var(--foreground);
  padding: 14px 15px;
  text-align: left;
}

.panel-overview:hover {
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
}

.panel-overview:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 34%, transparent);
  outline-offset: 2px;
}

.panel-overview-copy {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 8px;
}

.panel-overview-number {
  color: var(--green-dark);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.panel-overview-label {
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
}

.panel-overview-copy small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-open-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--green) 20%, var(--line));
  border-radius: 7px;
  background: var(--surface);
  color: var(--green-dark);
}

.panel-open-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.panel-quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  margin-top: 10px;
}

.panel-quick-form.panel-quick-finance {
  grid-template-columns: minmax(76px, 0.55fr) minmax(110px, 1.45fr) 40px;
}

.panel-quick-form input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--foreground);
  outline: none;
  padding: 8px 11px;
}

.panel-quick-form input:focus {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
  box-shadow: var(--focus-ring);
}

.panel-quick-form button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-size: 23px;
  line-height: 1;
}

.panel-quick-form button:hover {
  background: var(--green-dark);
}

.module-open {
  overflow: hidden;
}

.module-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  background: rgba(23, 32, 27, 0.34);
  padding: 14px;
  backdrop-filter: blur(9px);
}

.module-overlay.is-open {
  display: block;
}

.module-shell {
  --module-inner-width: 1200px;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--background);
  box-shadow: 0 28px 90px rgba(23, 32, 27, 0.3);
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 18px 24px;
  padding-left: max(24px, calc((100% - var(--module-inner-width)) / 2));
}

.module-head h2 {
  font-size: 28px;
}

.module-head p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-head .icon-button {
  flex: 0 0 auto;
  font-size: 25px;
  line-height: 1;
}

.module-content {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
}

.module-content > .panel.is-module-expanded {
  width: min(var(--module-inner-width), 100%);
  min-height: 0;
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  padding: 0 0 40px;
}

.module-content > .panel.is-module-expanded::before,
.module-content > .panel.is-module-expanded::after {
  display: none !important;
}

.module-content > .panel.is-module-expanded > .panel-overview {
  display: none;
}

.module-content > .panel.is-module-expanded > .panel-quick-form {
  display: none;
}

.module-content > .panel.is-module-expanded > .panel-heading {
  margin-bottom: 22px;
}

.module-content > .panel.is-module-expanded > .panel-heading,
.module-content > .panel.is-module-expanded > .entry-form,
.module-content > .panel.is-module-expanded > .budget-form,
.module-content > .panel.is-module-expanded > .bookmark-toolbar,
.module-content > .panel.is-module-expanded > .finance-summary,
.module-content > .panel.is-module-expanded > .finance-insights,
.module-content > .panel.is-module-expanded > .record-toolbar,
.module-content > .panel.is-module-expanded > .section-toggle,
.module-content > .panel.is-module-expanded > [data-list] {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.module-content > .panel.is-module-expanded > .section-toggle {
  display: block;
}

.module-content > .panel.is-module-expanded .triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-content > .panel.is-module-expanded .finance-row {
  grid-template-columns:
    minmax(150px, 1.1fr)
    minmax(120px, 0.8fr)
    minmax(150px, 1fr)
    minmax(150px, 1.1fr);
}

.module-content > .panel.is-module-expanded .task-row {
  grid-template-columns:
    minmax(160px, 0.8fr)
    minmax(240px, 1.4fr)
    minmax(150px, 0.8fr);
}

.module-content > .panel.is-module-expanded .task-time-row {
  grid-template-columns:
    minmax(160px, 0.8fr)
    minmax(160px, 0.8fr)
    minmax(220px, 1.4fr);
}

.module-content > .panel.is-module-expanded .bookmark-toolbar {
  grid-template-columns: minmax(180px, 1.45fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.module-content > .panel.is-module-expanded .note-grid > .empty,
.module-content > .panel.is-module-expanded .link-grid > .empty {
  grid-column: 1 / -1;
}

.module-content > .panel.is-module-expanded .collapsible.is-collapsed {
  display: grid;
}

.compact-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.compact-field > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row {
  grid-template-columns: 150px minmax(160px, 1fr) 120px;
  align-items: end;
}

.task-time-row {
  grid-template-columns: 150px 150px minmax(180px, 1fr);
  align-items: end;
}

body[data-theme="kitty"] .panel-overview {
  background: rgba(237, 244, 251, 0.64);
}

body[data-theme="kitty"] .panel-overview:hover {
  background: rgba(237, 244, 251, 0.94);
}

body[data-theme="kitty"] .module-shell {
  background:
    linear-gradient(135deg, rgba(234, 219, 125, 0.1), transparent 28%),
    linear-gradient(225deg, rgba(95, 145, 200, 0.1), transparent 30%),
    var(--background);
}

body[data-theme="spider"] .panel-overview {
  border: 1px solid #263957;
  background: #0d1727;
  color: #f7f8fc;
}

body[data-theme="spider"] .panel-overview:hover {
  background: #142440;
}

body[data-theme="spider"] .panel-quick-form button {
  background: #d91d31;
  box-shadow: inset 0 -2px 0 #8e1020;
}

body[data-theme="spider"] .panel-quick-form button:hover {
  background: #ef3145;
}

body[data-theme="spider"] .panel-overview-number,
body[data-theme="spider"] .panel-open-icon {
  color: #ffd340;
}

body[data-theme="spider"] .panel-open-icon {
  border-color: #31578f;
  background: #101c31;
}

body[data-theme="spider"] .module-overlay {
  background: rgba(2, 5, 10, 0.78);
}

body[data-theme="spider"] .module-shell,
body[data-theme="spider"] .module-head {
  border-color: #35486f;
  background: #080e19;
  color: #f7f8fc;
}

body[data-theme="spider"] .module-head {
  background: #101827;
}

@media (max-width: 980px) {
  .module-content > .panel.is-module-expanded .task-row {
    grid-template-columns: 140px minmax(140px, 1fr) 110px;
  }

  .module-content > .panel.is-module-expanded .task-time-row,
  .module-content > .panel.is-module-expanded .triple,
  .module-content > .panel.is-module-expanded .finance-row,
  .module-content > .panel.is-module-expanded .bookmark-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-content > .panel.is-module-expanded .task-time-row .compact-field:last-child,
  .module-content > .panel.is-module-expanded .triple > :last-child {
    grid-column: 1 / -1;
  }

  .module-content > .panel.is-module-expanded .bookmark-toolbar label {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .module-overlay {
    padding: 0;
  }

  .module-shell {
    border: 0;
    border-radius: 0;
  }

  .module-head {
    align-items: flex-start;
    padding: 15px 16px;
  }

  .module-head h2 {
    font-size: 23px;
  }

  .module-head p:last-child {
    display: none;
  }

  .module-content {
    padding: 16px;
  }

  .work-grid > .panel:not(.is-module-expanded) {
    min-height: 258px;
  }

  .module-content > .panel.is-module-expanded .task-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-content > .panel.is-module-expanded .task-row .compact-field:last-child {
    grid-column: 1 / -1;
  }

  .module-content > .panel.is-module-expanded .task-time-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-content > .panel.is-module-expanded .task-time-row .compact-field:last-child {
    grid-column: 1 / -1;
  }

  .module-content > .panel.is-module-expanded .triple,
  .module-content > .panel.is-module-expanded .finance-row,
  .module-content > .panel.is-module-expanded .bookmark-toolbar {
    grid-template-columns: 1fr;
  }

  .module-content > .panel.is-module-expanded .triple > :last-child {
    grid-column: auto;
  }
}
