:root {
  --paper: #fbf7f4 !important;
  --paper-bright: #fbf7f4 !important;
  --ink: #232323 !important;
  --muted: #685d54 !important;
  --line: #685d54 !important;
  --line-soft: rgba(104, 93, 84, 0.24) !important;
  --brand: #685d54 !important;
  --brand-2: #232323 !important;
  --warn: #232323 !important;
  --card: #e5ded2 !important;
  --accent-a: #a39382 !important;
  --accent-b: #685d54 !important;
  --accent-c: #e5ded2 !important;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--paper);
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Newsreader", serif;
  letter-spacing: -0.01em;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(104, 93, 84, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 93, 84, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

.bg-band {
  position: fixed;
  inset: 0 0 auto 0;
  height: 240px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(163, 147, 130, 0.26), transparent 34%),
    radial-gradient(circle at top right, rgba(229, 222, 210, 0.7), transparent 40%),
    linear-gradient(180deg, rgba(229, 222, 210, 0.78), rgba(229, 222, 210, 0));
}

.connection-banner {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(35, 35, 35, 0.12);
}

.connection-banner.is-offline {
  color: #fff;
  background: var(--brand-2);
}

.connection-banner.is-online {
  color: #fff;
  background: #2d6a4f;
}

.connection-banner.is-sync {
  color: #fff;
  background: #1f5f8b;
}

.sync-queue-chip {
  position: fixed;
  right: 12px;
  top: calc(48px + env(safe-area-inset-top));
  z-index: 61;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--accent-a);
  color: var(--brand-2);
  border: 1px solid var(--line);
}

.build-stamp {
  position: fixed;
  left: 10px;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 62;
  border-radius: 6px;
  border: 1px dashed var(--line);
  background: var(--paper-bright);
  color: var(--muted);
  font-size: 0.64rem;
  font-family: "JetBrains Mono", monospace;
  padding: 3px 6px;
}

/* Fixed Top Navigation */
.top-nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 12px;
  box-shadow: 0 2px 8px rgba(35, 35, 35, 0.08);
}

.nav-container {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-item {
  position: relative;
}

.nav-spacer {
  flex: 1;
}

.top-datetime {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 186px;
}

.top-date,
.top-time {
  font-family: "JetBrains Mono", monospace;
  line-height: 1.2;
}

.top-date {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: capitalize;
}

.top-time {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

.nav-icon:hover {
  background: var(--line-soft);
  transform: scale(1.05);
}

.nav-icon:active {
  transform: scale(0.95);
}

.icon {
  width: 20px;
  height: 20px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(35, 35, 35, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu a,
.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: var(--line-soft);
  color: var(--brand-2);
}

.dropdown-menu a:first-child {
  border-radius: 10px 10px 0 0;
}

.dropdown-menu a:last-child,
.dropdown-menu button:last-child {
  border-radius: 0 0 10px 10px;
}

.logout-btn {
  color: #c41e3a;
  font-weight: 600;
}

.logout-btn:hover {
  background: rgba(196, 30, 58, 0.1);
}

/* Adjust main content for fixed top nav */
.app-shell {
  margin-top: calc(72px + env(safe-area-inset-top));
}

.bottom-nav {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 4px 24px rgba(35,35,35,0.07);
}

.nav-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.64rem;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 7px 0 3px 0;
  background: transparent;
  position: relative;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.nav-pill .nav-icon {
  font-size: 1.35rem;
  display: block;
  margin-bottom: 0px;
  line-height: 1.1;
}

.nav-pill .nav-label {
  font-size: 0.62rem;
  font-family: "JetBrains Mono", monospace;
  margin-top: 0px;
  letter-spacing: 0.03em;
}

.nav-pill.is-active {
  color: var(--brand-2);
  background: transparent;
  border-color: transparent;
}

.nav-pill .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  margin: 0 auto 0.1em auto;
  transition: background 0.18s, box-shadow 0.18s;
}

.nav-pill.is-active .nav-icon {
  background: var(--accent-a);
  box-shadow: 0 2px 12px rgba(163,147,130,0.13);
  color: var(--brand-2);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.app-shell.has-header-art .page-head,
.app-shell.has-header-art .page-header {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 18px;
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background-image:
    linear-gradient(180deg, rgba(20, 28, 24, 0.08) 0%, rgba(20, 28, 24, 0.48) 100%),
    var(--page-header-image);
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 34px rgba(26, 35, 28, 0.18);
}

.app-shell.has-header-art .page-head > *,
.app-shell.has-header-art .page-header > * {
  position: relative;
  z-index: 1;
}

.app-shell.has-header-art .page-head h1,
.app-shell.has-header-art .page-header h1,
.app-shell.has-header-art .page-head h2,
.app-shell.has-header-art .page-header h2,
.app-shell.has-header-art .page-head h3,
.app-shell.has-header-art .page-header h3,
.app-shell.has-header-art .page-head p,
.app-shell.has-header-art .page-header p,
.app-shell.has-header-art .page-head .kicker,
.app-shell.has-header-art .page-header .kicker {
  color: #f8f5ef;
  text-shadow: 0 1px 12px rgba(16, 20, 18, 0.3);
}

.app-shell.has-header-art .page-head .btn-mini,
.app-shell.has-header-art .page-header .btn-mini,
.app-shell.has-header-art .page-head .btn,
.app-shell.has-header-art .page-header .btn {
  background: rgba(248, 245, 239, 0.88);
  color: var(--ink);
  border-color: rgba(248, 245, 239, 0.7);
}

.top-utility-nav {
  position: sticky;
  top: calc(4px + env(safe-area-inset-top));
  z-index: 55;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-bright) 90%, transparent);
  backdrop-filter: blur(6px);
}

.top-utility-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.utility-link {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--paper-bright);
}

.utility-link.is-active {
  background: var(--brand);
  color: var(--paper);
  border-color: var(--brand);
}

.utility-signout-form {
  margin: 0;
}
.kicker {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  font-weight: 700;
}

.subtle,
.empty {
  color: var(--muted);
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.daily-plan-board {
  border-style: solid;
}

.daily-plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.daily-plan-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

.daily-plan-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.daily-plan-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper-bright);
  padding: 10px;
}

.daily-plan-card h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.daily-plan-table-wrap {
  overflow-x: auto;
}

.daily-plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.daily-plan-table th,
.daily-plan-table td {
  border: 1px solid var(--line-soft);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.daily-plan-table th {
  background: var(--card);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.daily-plan-table .time-col {
  font-family: "JetBrains Mono", monospace;
  width: 96px;
  white-space: nowrap;
}

.daily-plan-mini-input,
.daily-plan-block-input,
.daily-plan-lane-select {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: var(--paper-bright);
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 0.76rem;
  color: var(--text);
}

.daily-plan-actions-col {
  min-width: 140px;
}

.daily-plan-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
}

.daily-plan-inline-form:last-child {
  margin-bottom: 0;
}

.daily-plan-add-row {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: 110px 1fr 110px auto;
  align-items: center;
}

.daily-plan-table tr.is-done {
  opacity: 0.7;
}

.daily-plan-table tr.is-done td {
  text-decoration: line-through;
}

@media (max-width: 760px) {
  .daily-plan-add-row {
    grid-template-columns: 1fr;
  }

  .daily-plan-inline-form {
    flex-wrap: wrap;
  }
}

.lane-focus {
  background: rgba(61, 107, 179, 0.12);
}

.lane-admin {
  background: rgba(127, 127, 127, 0.12);
}

.lane-health {
  background: rgba(79, 143, 91, 0.12);
}

.lane-home {
  background: rgba(209, 161, 33, 0.12);
}

.lane-winddown {
  background: rgba(127, 91, 167, 0.12);
}

.clock-chip {
  border: 2px solid var(--line);
  background: var(--card);
  padding: 8px 10px;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.82rem;
}

.panel,
.card,
.auth-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  position: relative;
  overflow: hidden;
}

.panel {
  padding: 14px;
  margin-bottom: 12px;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.panel-top a {
  color: var(--brand);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.card-grid {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.two-up {
  grid-template-columns: 1fr 1fr;
}

.card {
  padding: 12px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.habit-planner-panel {
  overflow: hidden;
}

.habit-planner-add {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
  align-items: end;
}

.habit-sheet-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.habit-sheet-title h4 {
  font-size: 0.95rem;
}

.habit-sheet-title p {
  margin: 0;
  font-size: 0.68rem;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.habit-year-sheet,
.habit-week-sheet,
.habit-monthly-sheet,
.habit-review-sheet {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper-bright) 94%, var(--accent-c));
  padding: 10px;
}

.habit-year-sheet {
  margin-bottom: 12px;
}

.habit-year-scroll {
  overflow-x: auto;
}

.habit-year-table,
.habit-week-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", monospace;
}

.habit-year-table {
  min-width: 980px;
}

.habit-week-table {
  min-width: 520px;
}

.habit-year-table th,
.habit-year-table td,
.habit-week-table th,
.habit-week-table td {
  border: 1px solid var(--line-soft);
  text-align: center;
  padding: 6px;
  font-size: 0.67rem;
}

.habit-year-table th,
.habit-week-table th {
  background: color-mix(in srgb, var(--card) 72%, var(--paper-bright));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.habit-label {
  text-align: left;
  min-width: 155px;
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
  font-size: 0.8rem;
}

.day-dot-col {
  width: 26px;
}

.day-dot-col.is-today,
.week-day-col.is-today {
  background: color-mix(in srgb, var(--accent-a) 40%, var(--paper-bright));
}

.day-dot-cell {
  padding: 4px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
}

.dot.is-filled {
  background: var(--accent-b);
}

.completion-rate {
  font-weight: 800;
  min-width: 52px;
}

.week-check-cell {
  background: var(--paper);
}

.week-check-cell.is-checked {
  background: color-mix(in srgb, var(--accent-a) 38%, var(--paper-bright));
}

.habit-planner-lower {
  display: grid;
  grid-template-columns: 2.1fr 1.2fr 1fr;
  gap: 10px;
}

.habit-monthly-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.habit-monthly-list li {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
  background: var(--paper-bright);
}

.habit-monthly-list strong {
  display: block;
  font-size: 0.8rem;
}

.habit-monthly-list small {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.mini-progress {
  margin-top: 7px;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--card) 60%, transparent);
  overflow: hidden;
}

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

.habit-review-cards {
  display: grid;
  gap: 8px;
}

.habit-review-cards article {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
  background: var(--paper-bright);
}

.habit-review-cards span {
  display: block;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.habit-review-cards strong {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
}

.habit-sheet-summary {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.habit-summary-chip {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: color-mix(in srgb, var(--paper-bright) 86%, var(--accent-c));
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.habit-summary-chip strong {
  font-size: 0.77rem;
}

@media (max-width: 980px) {
  .habit-planner-add {
    grid-template-columns: 1fr;
  }

  .habit-planner-lower {
    grid-template-columns: 1fr;
  }
}

.journal-template-panel {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-bright) 90%, var(--card)) 0%, var(--card) 56%, var(--paper-bright) 100%);
}

.journal-template-head {
  border-bottom: 1px dashed var(--line-soft);
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.journal-template-head p {
  margin: 4px 0 0;
}

.journal-meta-grid {
  grid-template-columns: 1fr 1.4fr;
}

.journal-prompt-block {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--paper-bright) 88%, var(--accent-c));
  display: grid;
  gap: 8px;
}

.gratitude-block {
  box-shadow: inset 0 0 0 1px rgba(47, 116, 128, 0.14);
}

.shadow-block {
  box-shadow: inset 0 0 0 1px rgba(179, 54, 47, 0.14);
}

.journal-block-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  color: var(--muted);
  font-weight: 700;
}

.journal-prompt-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 600;
}

.journal-history {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
}

.journal-entry-body {
  margin-top: 4px;
  white-space: pre-line;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .journal-meta-grid {
    grid-template-columns: 1fr;
  }
}

.card h2 {
  margin-top: 8px;
  font-size: 1.35rem;
}

.accent-orange { box-shadow: inset 0 -4px 0 rgba(217, 95, 53, 0.34); }
.accent-rose { box-shadow: inset 0 -4px 0 rgba(179, 54, 47, 0.28); }
.accent-teal { box-shadow: inset 0 -4px 0 rgba(47, 116, 128, 0.33); }
.accent-sky { box-shadow: inset 0 -4px 0 rgba(15, 61, 62, 0.3); }
.accent-green { box-shadow: inset 0 -4px 0 rgba(45, 106, 79, 0.35); }
.accent-lime { box-shadow: inset 0 -4px 0 rgba(76, 148, 95, 0.32); }

.card-container {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.card-total {
  border-top: 1px dashed var(--line-soft);
  padding-top: 12px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.card-total p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.card-total strong {
  color: var(--ink);
  font-weight: 700;
}

.strategy-container {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.strategy-intro {
  margin: 0 0 16px 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.strategy-list {
  list-style: decimal inside;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.strategy-list li {
  margin: 0;
  padding: 0;
}

.strategy-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px;
  background: rgba(163, 147, 130, 0.08);
  border-radius: 6px;
  border-left: 3px solid var(--brand);
}

.strategy-item strong {
  display: block;
  margin-bottom: 4px;
}

.strategy-amount {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.strategy-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.strategy-balance .label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.strategy-balance .amount {
  font-size: 1.1rem;
  font-weight: 700;
}

.text-success {
  color: #2d6a4f;
}

.text-danger {
  color: #c41e3a;
}

.text-warning {
  color: #d95f35;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
  padding-bottom: 0;
  margin-bottom: 0;
}

.collapsible-header:hover {
  opacity: 0.8;
}

.collapsible-header h1,
.collapsible-header h2,
.collapsible-header h3 {
  margin: 0;
  flex: 1;
}

.collapsible-title {
  flex: 1;
}

.collapse-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.9rem;
  margin-left: 12px;
  flex-shrink: 0;
}

.collapsible-panel[data-collapsed="true"] .collapse-icon {
  transform: rotate(-90deg);
}

.panel {
  transition: box-shadow 0.2s ease;
}

.collapsible-panel {
  overflow: hidden;
}

.collapsible-panel > .panel-top {
  max-height: 10000px;
  overflow: visible;
  opacity: 1;
  margin-bottom: 16px;
}

.collapsible-panel > :not(.panel-top) {
  max-height: 10000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  opacity: 1;
  margin-bottom: var(--margin-default, 16px);
}

.collapsible-panel[data-collapsed="true"] > :not(.panel-top) {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
}

.collapsible-panel h3 {
  margin: 0;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-top h1,
.panel-top h2,
.panel-top h3 {
  margin: 0;
  flex: 1;
}

.card-container,
.strategy-container {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.collapsible-panel[data-collapsed="true"] .card-container,
.collapsible-panel[data-collapsed="true"] .strategy-container {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.collapsible-content {
  max-height: 10000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.collapsible-panel[data-collapsed="true"] .collapsible-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.row-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 7px 0;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line-soft);
}

.row-kv.final {
  border-bottom: 0;
  margin-top: 10px;
}

.weather-widget {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--paper-bright)), color-mix(in srgb, var(--paper-bright) 90%, white));
}

.weather-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weather-widget-kicker {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
}

.weather-widget-icon {
  font-size: 1.8rem;
  animation: weather-bounce 3s ease-in-out infinite;
}

@keyframes weather-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.weather-widget-condition {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.weather-widget-temp {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1;
}

.weather-widget-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weather-widget-meta span {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-bright) 84%, transparent);
  border: 1px solid var(--line-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.widget-stat-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.widget-stat-list p {
  margin: 0;
}

.field {
  display: grid;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
}

.field span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--paper-bright);
  border-radius: 8px;
  padding: 10px 9px;
  font-size: 0.93rem;
  color: var(--ink);
  font-family: "Bricolage Grotesque", sans-serif;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(163, 147, 130, 0.35);
  outline-offset: 1px;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.stack-gap {
  display: grid;
  gap: 10px;
}

.inline-fields {
  display: grid;
  gap: 10px;
}

.btn-primary,
.btn-ghost,
.btn-mini {
  border-radius: 8px;
  padding: 10px 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-primary {
  background: var(--brand);
  border: 2px solid var(--line);
  color: var(--paper);
}

.btn-primary:hover { background: var(--brand-2); }

.btn-ghost {
  background: var(--paper-bright);
  border: 2px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-mini {
  border: 2px solid var(--line);
  background: var(--paper-bright);
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-mini.danger {
  background: rgba(104, 93, 84, 0.16);
  color: var(--warn);
}

.bottom-nav {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}

.nav-pill {
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.64rem;
  border: 2px solid transparent;
  border-radius: 7px;
  padding: 8px 4px;
}

.life-list li {
  align-items: flex-start;
}

.stack-title {
  margin-top: 14px;
}

.section-header-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
  position: sticky;
  top: 8px;
  z-index: 12;
  padding: 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-bright) 88%, transparent);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(6px);
}

.menu-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.menu-pill.is-active {
  background: var(--brand);
  color: var(--paper);
  border-color: var(--brand);
}

.nav-pill.is-active {
  color: var(--paper);
  background: var(--brand);
  border-color: var(--line);
}

.compact-list,
.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.compact-list li,
.task-item {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-bright);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.compact-list li p,
.task-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.task-item.is-done { opacity: 0.68; }

.task-item.is-overdue {
  box-shadow: inset 0 -4px 0 rgba(104, 93, 84, 0.26);
}

.task-actions {
  display: grid;
  gap: 6px;
}

.queue-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.queue-sheet-panel {
  overflow: visible;
}

.queue-tools-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.queue-filter-form {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  align-items: end;
}

.queue-sheet-panel .queue-filter-form .field span,
.queue-sheet-panel .queue-bulk-form .field span {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.queue-sheet-panel .queue-filter-form input,
.queue-sheet-panel .queue-filter-form select,
.queue-sheet-panel .queue-bulk-form input,
.queue-sheet-panel .queue-bulk-form select {
  font-size: 0.66rem;
  padding: 4px 6px;
  min-height: 26px;
}

.queue-filter-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.queue-import-export {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.queue-import-form {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.queue-import-form input[type="file"] {
  font-size: 0.66rem;
}

.queue-bulk-form {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: end;
  margin-bottom: 6px;
}

.queue-sheet-panel .btn-mini,
.queue-sheet-panel .btn-ghost {
  font-size: 0.64rem;
  padding: 5px 7px;
  min-height: 26px;
}

.autosave-indicator {
  color: var(--muted);
  font-size: 0.74rem;
  min-height: 1rem;
}

.autosave-indicator.is-error {
  color: #b14848;
}

.queue-sheet-panel .queue-table-wrap {
  overflow-x: auto;
}

.queue-scroll-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1240px;
  font-size: 0.75rem;
}

.queue-table th,
.queue-table td {
  border: 1px solid var(--line-soft);
  padding: 8px;
  vertical-align: top;
  text-align: left;
}

.queue-table thead th {
  background: var(--paper-bright);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.queue-table th.sticky-col,
.queue-table td.sticky-col {
  position: sticky;
  background: var(--paper-bright);
}

.queue-table .sticky-select {
  left: 0;
  z-index: 4;
  width: 40px;
  min-width: 40px;
  text-align: center;
}

.queue-table .sticky-name {
  left: 40px;
  z-index: 4;
  min-width: 220px;
}

.queue-table .sticky-actions {
  right: 0;
  z-index: 4;
  min-width: 122px;
}

.queue-table tbody td.sticky-col {
  background: var(--card);
}

.queue-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--paper-bright) 88%, transparent);
}

.queue-table tbody tr.row-overdue {
  box-shadow: inset 0 -3px 0 rgba(104, 93, 84, 0.25);
}

.queue-table tbody tr.row-complete {
  opacity: 0.7;
}

.status-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.row-edit-form {
  margin-bottom: 6px;
}

.queue-cell-input {
  width: 100%;
  min-width: 108px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.72rem;
}

.queue-cell-textarea {
  min-height: 48px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  resize: vertical;
}

.queue-cell-input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-color: var(--brand);
}

.queue-cell-input.is-invalid-date {
  border-color: #b14848;
  outline: 2px solid rgba(177, 72, 72, 0.2);
}

.sheet-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sheet-sort:hover {
  text-decoration: underline;
}

.sheet-sort.is-active {
  color: var(--brand);
}

.status-select {
  min-width: 150px;
  font-size: 0.72rem;
}

.calendar-toolbar-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.life-calendar-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.life-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 860px;
  gap: 6px;
}

.life-calendar-weekday {
  background: color-mix(in srgb, var(--paper-bright) 92%, transparent);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 5px 6px;
  text-align: center;
}

.life-calendar-day {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--card);
  min-height: 102px;
  padding: 6px;
}

.life-calendar-day header {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.life-calendar-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.life-calendar-day-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
}


.life-calendar-bank-left {
  font-size: 0.56rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--ink);
  background: none;
  border-radius: 4px;
  padding: 0 6px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-block;
  border: none;
  margin-left: 2px;
}


.life-calendar-bank-left.is-ok {
  background: #d0f5e2;
  border: 1.5px solid #2f7480;
}

.life-calendar-bank-left.is-low {
  background: #fff7d6;
  border: 1.5px solid #b6831f;
}

.life-calendar-bank-left.is-negative {
  background: #ffe0e0;
  border: 1.5px solid #b14848;
}

.life-calendar-day.is-outside {
  opacity: 0.45;
}

.life-calendar-day.is-today {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--line-soft));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent) inset;
}

.life-calendar-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.life-calendar-events li {
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.62rem;
  background: var(--paper-bright);
  border: 1px solid var(--line-soft);
}

.life-calendar-events li strong {
  display: block;
  font-size: 0.62rem;
  line-height: 1.2;
}

.life-calendar-events li span {
  display: block;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
}

.life-calendar-events li p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.life-calendar-events .event-task {
  border-left: 3px solid #2f7480;
}

.life-calendar-events .event-block {
  border-left: 3px solid #d95f35;
}

.life-calendar-events .event-gift {
  border-left: 3px solid #b3362f;
}

.life-calendar-events .event-finance {
  border-left: 3px solid #d1a121;
}

@media (max-width: 900px) {
  .queue-bulk-form {
    align-items: stretch;
  }

  .queue-bulk-form .field {
    min-width: 140px;
    flex: 1 1 150px;
  }

  .life-calendar-grid {
    min-width: 0;
    gap: 2px;
  }

  .life-calendar-weekday {
    font-size: 0.5rem;
    padding: 2px 1px;
  }

  .life-calendar-day {
    min-height: 64px;
    padding: 2px;
    border-radius: 4px;
    overflow-y: auto;
  }

  .life-calendar-day header {
    font-size: 0.5rem;
    margin-bottom: 1px;
  }

  .life-calendar-day-num {
    font-size: 0.5rem;
  }

  .life-calendar-bank-left {
    font-size: 0.44rem;
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .life-calendar-events {
    gap: 1px;
  }

  .life-calendar-events li {
    padding: 1px 2px;
    border-radius: 3px;
    font-size: 0.48rem;
  }

  .life-calendar-events li strong {
    font-size: 0.46rem;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .life-calendar-events li:nth-child(n + 3) {
    display: none;
  }

  .life-calendar-events li span {
    display: none;
  }

  .life-calendar-events li p {
    display: none;
  }
}

.auth-wrap {
  min-height: 92dvh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(460px, 100%);
  padding: 20px;
}

.cozyos-splash {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper-bright);
  padding: 10px;
  margin-bottom: 12px;
}

.cozyos-splash-logo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.cozyos-splash-tagline {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0.02em;
}

.logout-form {
  margin-top: 8px;
}

@media (min-width: 760px) {
  .inline-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-card {
    padding: 26px;
  }

  .cozyos-splash {
    padding: 12px;
  }
}

/* Life OS Navigation Tabs */
.lifeos-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--paper-bright);
  border-bottom: 2px solid var(--accent-a);
  margin: -1rem -1rem 1rem -1rem;
  border-radius: 0 0 8px 8px;
  align-items: center;
}

.lifeos-nav-item {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line-soft);
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.lifeos-nav-item:hover {
  background: var(--paper-bright);
  border-color: var(--accent-a);
  color: var(--accent-a);
}

.lifeos-nav-item.is-active {
  background: var(--accent-a);
  color: var(--ink);
  border-color: var(--accent-a);
}

/* Life OS Container and Module Styles */
.lifeos-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.lifeos-header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--accent-a);
  padding-bottom: 1.5rem;
}

.lifeos-header h1 {
  font-size: 2rem;
  color: var(--accent-b);
  margin-bottom: 0.5rem;
}

.lifeos-header p {
  color: var(--muted);
  font-size: 1rem;
  margin: 0;
}

.lifeos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.lifeos-module {
  background: var(--card);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--line-soft);
  box-shadow: 0 2px 8px rgba(35, 35, 35, 0.1);
}

.lifeos-module h2 {
  color: var(--accent-b);
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-a);
}

.lifeos-module h3 {
  color: var(--ink);
  margin: 0.5rem 0;
}

.lifeos-module h4 {
  color: var(--accent-b);
  margin: 1rem 0 0.5rem 0;
}

/* Form Styling */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Button Styles */
.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--brand);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--brand-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(35, 35, 35, 0.24);
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: var(--warn);
  color: var(--paper);
}

.btn-danger:hover {
  background: var(--brand);
}

/* Card Layouts */
.card {
  background: var(--paper-bright);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  margin-bottom: 1rem;
}

/* Utility Classes */
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
  background: var(--paper);
  border-radius: 8px;
}

/* ── Finance Section ── */
.finance-chart-wrap {
  max-width: 320px;
  margin: 1rem auto;
}

.finance-cat-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 6px;
}

.finance-cat-list li {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.cat-label {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-bar-wrap {
  background: var(--line-soft);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.cat-bar {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.cat-amount {
  text-align: right;
  font-weight: 600;
  color: var(--ink);
}

.expense-amt {
  font-weight: 700;
  color: var(--brand-2);
  font-size: 0.9rem;
  white-space: nowrap;
  align-self: center;
}

.income-amt {
  font-weight: 700;
  color: var(--brand);
  font-size: 0.9rem;
  white-space: nowrap;
  align-self: center;
}

/* Rollover bar */
.rollover-bar {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1.5px solid var(--line-soft);
}
.rollover-positive {
  background: rgba(45, 106, 79, 0.1);
  color: #2d6a4f;
  border-color: rgba(45, 106, 79, 0.3);
}
.rollover-negative {
  background: rgba(196, 30, 58, 0.08);
  color: #c41e3a;
  border-color: rgba(196, 30, 58, 0.25);
}
.panel-flat {
  background: transparent;
  border: none;
  padding: 0 0 4px 0;
  box-shadow: none;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-paid {
  background: rgba(45, 106, 79, 0.15);
  color: #2d6a4f;
}
.badge-open {
  background: rgba(104, 93, 84, 0.12);
  color: var(--muted);
}

/* Paid item row styling */
.item-paid {
  opacity: 0.6;
}
.item-paid strong {
  text-decoration: line-through;
}

/* Card sub-label */
.card-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 4px 0 0 0;
}

/* Danger text */
.text-danger {
  color: #c41e3a;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  align-self: center;
}

.badge-open {
  background: rgba(163, 147, 130, 0.18);
  color: var(--brand);
  border: 1px solid var(--accent-a);
}

.badge-paid {
  background: rgba(163, 147, 130, 0.12);
  color: var(--brand-2);
  border: 1px solid var(--line);
}

.bill-urgent .badge-open {
  background: rgba(104, 93, 84, 0.22);
  color: var(--brand-2);
  border-color: var(--brand-2);
}

.stat-big {
  font-weight: 800;
  font-size: 1.1rem;
}

.stat-big.accent-sky { color: var(--brand); }
.stat-big.accent-orange { color: var(--accent-a); }
.stat-big.accent-rose { color: var(--brand-2); }

.task-actions form {
  margin: 0;
}

.task-actions input[type="number"] {
  width: 120px;
  padding: 0.36rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

/* Life OS Super Navigation */
.lifeos-supernav {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper-bright);
  margin-bottom: 12px;
  overflow: hidden;
}

.lifeos-supernav-toggle {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(90deg, rgba(163, 147, 130, 0.2), rgba(104, 93, 84, 0.12));
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.lifeos-supernav-shortcuts {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px dashed var(--line-soft);
}

.lifeos-supernav-shortcut {
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--paper-bright);
}

.lifeos-supernav-panel {
  display: none;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px;
}

.lifeos-supernav-panel.is-open {
  display: grid;
}

.lifeos-supernav-group {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--card);
}

.lifeos-supernav-group.is-current {
  border-color: rgba(163, 147, 130, 0.7);
  box-shadow: inset 0 -2px 0 rgba(163, 147, 130, 0.3);
}

.lifeos-supernav-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.lifeos-supernav-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.83rem;
}

.lifeos-supernav-caret {
  border: 1px solid var(--line-soft);
  background: var(--paper-bright);
  border-radius: 6px;
  width: 28px;
  height: 24px;
  cursor: pointer;
}

.lifeos-supernav-group.is-expanded .lifeos-supernav-caret {
  background: rgba(163, 147, 130, 0.2);
}

.lifeos-supernav-drop {
  display: none;
  border-top: 1px dashed var(--line-soft);
  padding: 8px 10px;
}

.lifeos-supernav-group.is-expanded .lifeos-supernav-drop {
  display: block;
}

.lifeos-supernav-sub {
  margin-bottom: 7px;
}

.lifeos-supernav-sub:last-child {
  margin-bottom: 0;
}

.lifeos-supernav-sub-link,
.lifeos-supernav-topic-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
}

.lifeos-supernav-sub-link {
  font-weight: 700;
}

.lifeos-supernav-sub-link.is-current,
.lifeos-supernav-topic-link.is-current {
  color: var(--brand);
}

.lifeos-supernav-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.lifeos-supernav-topic-link {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--paper-bright);
}

/* Section filters */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.filter-chips.nested {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
}

.chip {
  text-decoration: none;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--paper-bright);
}

.chip.is-active {
  background: rgba(163, 147, 130, 0.18);
  border-color: rgba(163, 147, 130, 0.65);
  color: var(--brand);
  font-weight: 700;
}

.metrics-chart-wrap {
  width: 100%;
  max-width: 460px;
  margin: 8px auto 0;
}

.metrics-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.metrics-summary-chip {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--paper-bright);
  padding: 6px 10px;
  font-size: 0.76rem;
}

.metrics-summary-chip span {
  color: var(--muted);
  margin-right: 6px;
}

.drag-handle {
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  font-weight: 700;
  user-select: none;
}

[data-draggable-item] {
  cursor: grab;
}

[data-draggable-item].is-dragging {
  opacity: 0.6;
  box-shadow: 0 10px 24px rgba(26, 35, 28, 0.12);
}

@media (min-width: 920px) {
  .lifeos-supernav-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lifeos-supernav-panel.is-open {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 402px) {
  .app-shell {
    padding: 12px 10px 20px;
  }

  .app-shell.has-nav {
    padding-bottom: 108px;
  }

  .page-head {
    gap: 8px;
    margin-bottom: 12px;
  }

  .page-head h1 {
    font-size: 1.34rem;
  }

  .clock-chip {
    font-size: 0.74rem;
    padding: 7px 8px;
  }

  .top-datetime {
    min-width: 114px;
    padding: 6px 8px;
  }

  .top-date {
    display: none;
  }

  .top-time {
    font-size: 0.76rem;
  }

  .panel,
  .card {
    padding: 10px;
  }

  .two-up {
    grid-template-columns: 1fr;
  }

  .card h2 {
    font-size: 1.2rem;
  }

  .bottom-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .nav-pill {
    font-size: 0.6rem;
    padding: 7px 2px;
  }

  .btn-primary,
  .btn-ghost,
  .btn-mini {
    font-size: 0.67rem;
    padding: 9px 9px;
  }

  .lifeos-supernav-shortcuts {
    flex-wrap: wrap;
  }

  .lifeos-supernav-shortcut {
    font-size: 0.69rem;
    padding: 3px 8px;
  }

  .chip {
    font-size: 0.71rem;
    padding: 3px 8px;
  }

  .metrics-chart-wrap {
    max-width: 100%;
  }

  .metrics-summary-chip {
    font-size: 0.72rem;
  }
}
