*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0a0e14;
  --surface: rgba(10, 14, 22, 0.9);
  --panel: rgba(16, 22, 34, 0.95);
  --line: rgba(120, 150, 200, 0.15);
  --text: #e8eef8;
  --muted: #8b93a8;
  --mint: #3dd598;
  --blue: #5b9cf5;
  --warn: #fbbf77;
  --bad: #f87171;
  --input-bg: #090c11;
  --shade: rgba(0, 0, 0, 0.5);
  --sans: "Sora", system-ui, sans-serif;
  font-family: var(--sans);
}

html[data-theme="light"] {
  --bg: #e8eaf1;
  --surface: rgba(255, 255, 255, 0.88);
  --panel: #ffffff;
  --line: rgba(20, 40, 80, 0.12);
  --text: #121620;
  --muted: #5a6478;
  --mint: #0d7c52;
  --blue: #1e54b7;
  --warn: #b45309;
  --bad: #c93535;
  --input-bg: #f8f9fc;
  --shade: rgba(80, 100, 140, 0.12);
}

body {
  margin: 0;
  background: radial-gradient(ellipse 70% 50% at 10% -10%, rgba(61, 213, 152, 0.06), transparent), var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

html[data-theme="light"] body {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(30, 84, 183, 0.08), transparent), var(--bg);
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/** Wordmark accent: same green in light & dark themes */
.brand-name-w {
  color: #36b37e;
}

.mono {
  font-family: ui-monospace, monospace;
}

.small {
  font-size: 0.82rem;
}

.layout {
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2rem);
  padding-bottom: max(clamp(1rem, 3vw, 2rem), clamp(7.5rem, 24vh, 13rem));
  display: grid;
  place-items: center;
}

.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 70% 20%, rgba(91, 156, 245, 0.07), transparent 40%);
}

.login-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 24px 64px var(--shade);
}


.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-switch-track {
  position: relative;
  width: 3.55rem;
  height: 1.46rem;
  border-radius: 999px;
  background: rgba(139, 147, 168, 0.25);
  border: 1px solid var(--line);
  transition: background 0.15s ease;
  overflow: hidden;
}

.theme-switch-icons {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.3rem;
  pointer-events: none;
}

.theme-icon {
  flex-shrink: 0;
  width: 0.84rem;
  height: 0.84rem;
  stroke: currentColor;
  stroke-width: 2.35;
  color: var(--muted);
  opacity: 0.4;
  transition:
    opacity 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease;
}

/* Slide left / unchecked = LIGHT theme · sun prominent, moon dark (“night option”) */
.theme-switch input:not(:checked) + .theme-switch-track .theme-icon-sun {
  opacity: 1;
  color: #d97706;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.45));
}

.theme-switch input:not(:checked) + .theme-switch-track .theme-icon-moon {
  opacity: 0.95;
  color: var(--text);
}

/* Slide right / checked = DARK theme · moon bright, sun warm cue for “switch to light” */
.theme-switch input:checked + .theme-switch-track .theme-icon-moon {
  opacity: 1;
  color: var(--text);
}

.theme-switch input:checked + .theme-switch-track .theme-icon-sun {
  opacity: 0.92;
  color: #fcd34d;
}

.theme-switch-thumb {
  display: block;
  position: absolute;
  top: 50%;
  left: 3px;
  width: 1.12rem;
  height: 1.12rem;
  margin-top: -0.56rem;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 1px 3px var(--shade);
  transition:
    left 0.22s ease,
    background 0.15s ease;
  z-index: 2;
}

.theme-switch input:checked + .theme-switch-track {
  background: rgba(91, 156, 245, 0.28);
  border-color: rgba(91, 156, 245, 0.35);
}

.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
  left: calc(100% - 3px - 1.12rem);
}

.theme-switch-corner {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.inline-with-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-switch:focus-within .theme-switch-track {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.edit-banner:not(.hidden) {
  border-left: 3px solid var(--blue);
}

#edit-banner-label {
  color: var(--text);
}

.edit-banner.hidden {
  display: none !important;
}

/* Flex only where the element is NOT a table cell — display:flex on <td>
   breaks table column layout and misaligns headers vs body across all columns. */
li .actions-cell,
span.actions-cell {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-mini {
  font-size: 0.72rem;
  padding: 0.3rem 0.45rem;
}

.login-brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.app-mark {
  display: block;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: none;
  width: auto;
  height: auto;
  object-fit: contain;
  background: transparent;
}

.login-brand .app-mark {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.09);
}

html[data-theme="dark"] .login-brand .app-mark {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.42);
}

.login-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.login-tagline {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--muted);
  margin: 0.25rem 0 0;
  font-weight: 500;
}

#login-title {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.login-lede {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.login-msg {
  min-height: 1.25em;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
}

.login-msg.ready {
  color: var(--mint);
}

.login-msg.err {
  color: var(--bad);
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
}

html[data-theme="light"] .btn:not(.primary):not(.gsi-btn) {
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .btn.primary {
  background: rgba(13, 124, 82, 0.12);
}

.btn:disabled {
  opacity: 0.35;
}

.btn.primary {
  background: rgba(61, 213, 152, 0.12);
  border-color: rgba(61, 213, 152, 0.35);
  color: var(--mint);
}

.btn.ghost {
  background: rgba(91, 156, 245, 0.1);
  border-color: rgba(91, 156, 245, 0.25);
  color: var(--blue);
}

.btn.outline {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.gsi-btn {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  border-radius: 12px !important;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  font-family: Roboto, system-ui, sans-serif;
  font-weight: 500;
}

html[data-theme="light"] .gsi-btn {
  background: #ffffff;
}

html[data-theme="dark"] .gsi-btn {
  background: #1c2128;
  color: #eef;
}

.gsi-btn-lg {
  width: 100%;
}

.login-back-btn {
  width: 100%;
  margin-top: 0.75rem;
}

.offline-banner {
  margin: 0 1.25rem 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(91, 156, 245, 0.28);
  background: rgba(91, 156, 245, 0.11);
}

html[data-theme="light"] .offline-banner {
  background: rgba(30, 84, 183, 0.07);
  border-color: rgba(30, 84, 183, 0.2);
}

.offline-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
}

.offline-banner-copy {
  flex: 1 1 16rem;
  min-width: min(100%, 14rem);
}

.offline-banner-copy p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 44rem;
  color: var(--text);
}

.offline-banner-copy p + p {
  margin-top: 0.5rem;
}

.offline-banner-actions {
  flex-shrink: 0;
  align-self: center;
}

.gsi-banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: Roboto, system-ui, sans-serif;
  font-weight: 500;
  min-height: 42px;
  padding: 0.45rem 1rem;
}

.gsi-banner-btn .gsi-logo {
  flex-shrink: 0;
}

.gsi-logo {
  width: 22px;
  height: 22px;
}

.foot-login {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  background: linear-gradient(to top, var(--surface) 60%, rgb(255 255 255 / 0));
  backdrop-filter: blur(6px);
}

html[data-theme="dark"] .foot-login {
  background: linear-gradient(to top, var(--surface) 55%, transparent);
}

.foot-login-tagline {
  margin: 0 0 0.35rem;
  font-weight: 500;
  color: var(--muted);
}

.foot-login-copy {
  margin: 0 auto;
  max-width: min(44rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

@media (max-width: 560px) {
  .foot-login-copy {
    text-align: center;
    max-height: min(28vh, 12rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
  }
}

.copyright-notice {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.47;
  color: var(--muted);
}

.copyright-notice strong {
  color: var(--text);
}

.copyright-notice-strict {
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.sidebar-copyright-abbr {
  display: none;
  text-align: center;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) .sidebar-footer {
  padding-top: 0.65rem;
  border-top-width: 0;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) .sidebar-footer .sidebar-copyright-abbr {
  display: block;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) .sidebar-footer .sidebar-copyright-body {
  display: none;
}

.sidebar-copyright-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-footer .copyright-notice {
  font-size: 0.58rem;
  line-height: 1.45;
}

.sidebar-footer .copyright-notice strong {
  display: inline;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sprite-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.22s ease;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  position: relative;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: nowrap;
  min-height: 0;
}

.sidebar-brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: min(3.375rem, calc(100% - 3.35rem));
  aspect-ratio: 1;
  height: auto;
  min-width: 2rem;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}

.sidebar-brand-mark .app-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) .sidebar-brand-mark {
  display: none;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) .sidebar-head {
  justify-content: center;
}

.sidebar-rail-toggle {
  display: grid;
  place-items: center;
  width: 2.85rem;
  height: 2.85rem;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid rgba(91, 156, 245, 0.18);
  border-radius: 12px;
  background: rgba(91, 156, 245, 0.07);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.14s ease;
}

.sidebar-rail-toggle:hover {
  background: rgba(91, 156, 245, 0.14);
  border-color: rgba(91, 156, 245, 0.32);
  color: var(--text);
}

.sidebar-rail-toggle:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px rgba(91, 156, 245, 0.45);
}

html[data-theme="light"] .sidebar-rail-toggle {
  background: rgba(30, 84, 183, 0.06);
  border-color: rgba(30, 84, 183, 0.14);
}

html[data-theme="light"] .sidebar-rail-toggle:hover {
  background: rgba(30, 84, 183, 0.11);
  border-color: rgba(30, 84, 183, 0.24);
}

.sidebar-rail-toggle svg {
  grid-area: 1 / 1;
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.sidebar-rail-toggle .sidebar-chevron--expand {
  display: none;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) .sidebar-rail-toggle .sidebar-chevron--expand {
  display: block;
}

.app-shell.sidebar-collapsed:not(.mobile-nav-open) .sidebar-rail-toggle .sidebar-chevron--collapse {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-rail-toggle {
    display: none;
  }

  .sidebar-head {
    margin-bottom: 0.85rem;
    min-height: 0;
    justify-content: flex-start;
  }

  .sidebar-brand-mark {
    width: min(2.625rem, calc(85vw - 3rem));
    aspect-ratio: 1;
    height: auto;
    min-width: 2rem;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed:not(.mobile-nav-open) {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(272px, 88vw);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    box-shadow: 8px 0 32px var(--shade);
    pointer-events: none;
  }

  .app-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }

  .app-shell.mobile-nav-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 35;
    pointer-events: auto;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    font-size: 0;
    color: transparent;
  }

  .stage {
    min-width: 0;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
  }
}

@media (min-width: 769px) {
  .btn-mobile-menu {
    display: none !important;
  }

  .topbar {
    flex-wrap: nowrap;
  }
}

.btn-mobile-menu {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem !important;
  margin-right: 0.35rem;
  font-weight: 700 !important;
}

.nav-links-secondary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-sidebar-divider {
  flex-shrink: 0;
  border: none;
  border-top: 1px solid var(--line);
  margin: 0.4rem 0.55rem;
  opacity: 0.9;
}

.sidebar-collapsed:not(.mobile-nav-open) .nav-sidebar-divider {
  margin-left: 0.38rem;
  margin-right: 0.38rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  font: inherit;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  position: relative;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-btn.active {
  background: rgba(91, 156, 245, 0.12);
  color: var(--blue);
}

html[data-theme="light"] .nav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.stage {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.nav-btn svg.nav-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
  display: block;
  opacity: 0.92;
  stroke-width: 1.5;
}

.nav-btn.active svg.nav-icon {
  opacity: 1;
}

.nav-label {
  min-width: 0;
}

.sidebar-collapsed:not(.mobile-nav-open) .nav-btn {
  justify-content: center;
  padding: 0.4rem;
  text-align: center;
  font-size: 0;
}

.sidebar-collapsed:not(.mobile-nav-open) .nav-btn .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  min-width: 0;
}

.topbar-brand-lines {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.14;
  min-width: 0;
}

.topbar-brand-title {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.topbar-brand-tag {
  font-size: 0.66rem;
  font-weight: 500;
  max-width: 12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .topbar-brand-tag {
    display: none;
  }
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.wallet-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.wallet-save-indicator__dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--mint);
}

.wallet-save-indicator--clean {
  color: var(--mint);
}

.wallet-save-indicator--dirty .wallet-save-indicator__dot {
  background: var(--warn);
}

.wallet-save-indicator--dirty {
  border-color: rgba(251, 191, 119, 0.45);
  color: var(--warn);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0 !important;
  border-radius: 10px;
}

.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.btn-mobile-menu svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

/* Month picker · closed state styled; open menu is still native per browser */
.filter-month-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.22rem;
  max-width: 100%;
  flex-shrink: 1;
}

.filter-month-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

#filter-month {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  min-width: min(13.5rem, 100%);
  padding: 0.42rem 2.35rem 0.42rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.58rem center;
  background-size: 0.92rem;
  color: var(--text);
  font: inherit;
  font-size: 0.815rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.05) inset,
    0 1px 2px rgb(0 0 0 / 0.08);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

html[data-theme="light"] #filter-month {
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.92) inset,
    0 1px 2px rgb(15 23 42 / 0.06);
}

#filter-month:hover {
  border-color: rgba(91, 156, 245, 0.45);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.06) inset,
    0 3px 10px rgb(91 156 245 / 0.12),
    0 1px 2px rgb(0 0 0 / 0.06);
}

html[data-theme="light"] #filter-month:hover {
  border-color: rgba(30, 84, 183, 0.35);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.92) inset,
    0 3px 10px rgb(30 84 183 / 0.08);
}

#filter-month:focus {
  outline: none;
}

#filter-month:focus-visible {
  outline: 2px solid rgba(91, 156, 245, 0.55);
  outline-offset: 2px;
  border-color: rgba(91, 156, 245, 0.55);
}

html[data-theme="light"] #filter-month:focus-visible {
  outline-color: rgba(30, 84, 183, 0.45);
  border-color: rgba(30, 84, 183, 0.4);
}

/* Options: improves some WebKit/Chromium dropdowns where supported */
#filter-month option {
  padding: 0.5rem 0.65rem;
  font-weight: 500;
  background: var(--panel);
  color: var(--text);
}

.user-chip-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: min(200px, 46vw);
}

.nav-avatar-wrap {
  flex-shrink: 0;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(91, 156, 245, 0.14);
  border: 1px solid var(--line);
}

.nav-avatar.lg {
  width: 72px;
  height: 72px;
}

.nav-avatar.preview {
  border-radius: 16px;
}

.nav-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-letter {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--mint);
}

.nav-avatar.lg .avatar-letter {
  font-size: 1.45rem;
}

.nav-display-name {
  font-weight: 600;
  font-size: 0.83rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sync-msg {
  margin: 0;
  padding: 0 1.25rem 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.sync-msg.ok {
  color: var(--mint);
}

.sync-msg.err {
  color: var(--bad);
  white-space: pre-line;
}

.validation-modal {
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--txt);
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.28);
}

.validation-modal::backdrop {
  background: rgb(0 0 0 / 0.45);
  backdrop-filter: blur(2px);
}

.validation-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1.15rem;
}

.validation-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bad);
}

.validation-modal-content {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--txt);
}

.validation-modal-text {
  margin: 0;
}

.validation-modal-issues {
  margin: 0;
  padding-left: 1.2rem;
  list-style-type: disc;
}

.validation-modal-issues li + li {
  margin-top: 0.35rem;
}

.validation-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.validation-modal-actions .btn {
  min-width: 5rem;
}

.drive-scope-modal {
  max-width: min(28rem, calc(100vw - 2rem));
}

.drive-scope-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.drive-scope-modal-lead {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.52;
  color: var(--text);
}

.drive-scope-modal-consent-tip {
  margin: -0.15rem 0 0;
}

.drive-scope-modal-quote {
  margin: 0;
  padding: 0.62rem 0.85rem 0.62rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(91, 156, 245, 0.08);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text);
}

.drive-scope-modal-quote li {
  margin: 0;
}

html[data-theme="light"] .drive-scope-modal-quote {
  background: rgba(30, 84, 183, 0.07);
}

.drive-scope-modal-warning {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.52;
  color: var(--text);
}

.drive-scope-modal-steps {
  margin: 0;
}

.drive-scope-modal-ok {
  background: transparent !important;
  border: 1px solid var(--mint) !important;
  color: var(--mint) !important;
}

.drive-scope-modal-ok:hover {
  background: rgba(61, 213, 152, 0.12) !important;
}

html[data-theme="light"] .drive-scope-modal-ok:hover {
  background: rgba(13, 124, 82, 0.12) !important;
}

.sign-out-modal-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1.15rem;
}

.sign-out-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--txt);
}

.sign-out-modal-desc {
  margin: 0;
  line-height: 1.45;
  max-width: 24rem;
}

.sign-out-modal-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sign-out-modal-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(4px);
}

.sign-out-modal-loading.hidden {
  display: none !important;
}

.sign-out-modal-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem;
}

.sign-out-modal-loading-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.drive-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(0 0 0 / 0.14);
  backdrop-filter: blur(2px);
}

.drive-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.35rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 32px var(--shade);
}

.drive-loading-spinner {
  width: 1.65rem;
  height: 1.65rem;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: drive-loading-spin 0.7s linear infinite;
}

@keyframes drive-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.drive-loading-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.sync-hint {
  margin: -0.35rem 0 0;
  padding: 0 1.25rem 0.45rem;
  font-size: 0.74rem;
  line-height: 1.35;
  max-width: 52rem;
}

.panels {
  padding: 1rem 1.25rem 2rem;
  flex: 1;
}


.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.panel-head .panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--blue);
}

.panel-head-hint {
  margin: -0.35rem 0 1rem;
  max-width: 42rem;
}

.monthly-summary-panel .monthly-summary-root {
  max-width: 100%;
}

.monthly-summary-details {
  margin-bottom: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.monthly-summary-details > summary {
  cursor: pointer;
  padding: 0.65rem 0.95rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  user-select: none;
}

.monthly-summary-details > summary::-webkit-details-marker {
  display: none;
}

.monthly-summary-sum-line::before {
  content: "";
  flex: 0 0 0;
  margin-inline-end: -0.2rem;
  border: solid transparent;
  border-width: 0.28rem 0 0.28rem 0.4rem;
  border-left-color: var(--muted);
  transform: rotate(0deg);
  transition: transform 120ms ease;
}

.monthly-summary-details[open] > summary.monthly-summary-sum-line::before {
  transform: rotate(90deg);
}

.monthly-summary-sum-title {
  flex: 1 1 10rem;
  min-width: 0;
  color: var(--text);
}

.monthly-summary-sum-iso {
  font-size: 0.78rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.12);
  color: var(--muted);
}

.monthly-summary-sum-meta {
  flex: 1 1 100%;
  margin-left: 1.5rem;
}

@media (min-width: 720px) {
  .monthly-summary-sum-meta {
    flex: 0 1 auto;
    margin-left: 0;
  }
}

.monthly-summary-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.monthly-summary-table-wrap {
  overflow-x: auto;
  padding: 0.5rem 0.75rem 0.75rem;
}

.monthly-sum-total td {
  border-top: 2px solid var(--line);
  background: rgba(91, 156, 245, 0.06);
}

.btn-dl {
  font-size: 0.76rem !important;
  padding: 0.32rem 0.55rem !important;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--blue);
}

.panel .lede {
  margin-bottom: 0.85rem;
  max-width: 56rem;
}

.hint {
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem;
}

.stat .lbl {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat .num {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat.alt .num {
  color: var(--mint);
}

.stat.accent .num {
  color: var(--warn);
}

.grid-2-dashboard {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .grid-2-dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .span-2 {
    grid-column: 1 / -1;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.05rem;
}

.card h3 {
  margin: 0 0 0.85rem;
  font-size: 0.94rem;
  font-weight: 600;
}

.breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.breakdown-list li:last-child {
  border-bottom: none;
}

.mini-bar-chart {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.bar-chart-empty {
  margin: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) 1fr auto;
  gap: 0.35rem 0.55rem;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 0.42rem;
}

.bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.bar-track {
  height: 0.5rem;
  background: rgba(120, 150, 200, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 156, 245, 0.85), rgba(61, 213, 152, 0.75));
  min-width: 4px;
  transition: width 0.22s ease;
}

.bar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 0;
  font-size: 0.71rem;
  line-height: 1.2;
}

.tiny-pct {
  font-size: 0.64rem;
  color: var(--muted);
}

.dash-cat-lede {
  margin: -0.15rem 0 0.6rem;
  max-width: 28rem;
}

.dash-src-lede {
  margin: -0.15rem 0 0.6rem;
  max-width: 28rem;
}

.breakdown-amount-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
  text-align: right;
}

.breakdown-spent {
  font-weight: 600;
}

.breakdown-list li.tier-warn .breakdown-spent {
  color: var(--warn);
}

.breakdown-list li.tier-over .breakdown-spent {
  color: var(--bad);
}

.breakdown-list li.tier-income-surplus .breakdown-spent {
  color: var(--mint);
}

.breakdown-budget-line {
  font-size: 0.66rem;
  max-width: 12rem;
  line-height: 1.25;
}

.budget-chart-hint {
  margin: 0.55rem 0 0;
  line-height: 1.38;
}

.budget-vs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.69rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.budget-vs-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.budget-vs-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.budget-vs-dot--used {
  background: linear-gradient(145deg, rgba(61, 213, 152, 0.95), rgba(91, 156, 245, 0.88));
}

.budget-vs-dot--remain {
  background: rgba(120, 150, 200, 0.22);
  border: 1px solid rgba(120, 150, 200, 0.28);
  box-sizing: border-box;
}

.budget-vs-dot--over {
  background: linear-gradient(145deg, var(--bad), #fb923c);
}

.budget-vs-row {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-bottom: 0.85rem;
  padding: 0.58rem 0.72rem;
  border-radius: 12px;
  background: rgba(91, 156, 245, 0.05);
  border: 1px solid rgba(91, 156, 245, 0.12);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.budget-vs-row:last-of-type {
  margin-bottom: 0.35rem;
}

.budget-vs-row--over {
  background: color-mix(in srgb, var(--bad) 9%, transparent);
  border-color: color-mix(in srgb, var(--bad) 42%, var(--line));
}

.budget-vs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.budget-vs-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.budget-vs-chip {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.budget-vs-chip--ok {
  color: var(--mint);
  background: color-mix(in srgb, var(--mint) 16%, transparent);
}

.budget-vs-chip--warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 22%, transparent);
}

.budget-vs-chip--over {
  color: #fff;
  background: linear-gradient(135deg, var(--bad), #ea580c);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.budget-vs-composite {
  display: flex;
  width: 100%;
  height: 0.58rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(120, 150, 200, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.budget-vs-composite--overpulse {
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 1px color-mix(in srgb, var(--bad) 35%, transparent);
}

.budget-vs-seg {
  height: 100%;
  min-width: 0;
  transition: flex-basis 0.24s ease;
}

.budget-vs-seg--used {
  background: linear-gradient(90deg, rgba(61, 213, 152, 0.92), rgba(91, 156, 245, 0.88));
}

.budget-vs-seg--remain {
  background: rgba(120, 150, 200, 0.16);
}

.budget-vs-seg--over {
  background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 92%, #000), #fb7185);
}

.budget-vs-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  font-size: 0.73rem;
  color: var(--muted);
}

.budget-vs-amount .mono {
  color: var(--text);
}

.budget-vs-slash {
  opacity: 0.45;
  font-weight: 400;
}

.budget-vs-over-note {
  color: var(--bad);
  font-weight: 600;
  font-size: 0.72rem;
}

.income-expect-chart .budget-vs-row.income-expect-row {
  background: rgba(61, 213, 152, 0.06);
  border-color: color-mix(in srgb, var(--mint) 22%, transparent);
}

.income-expect-chart .budget-vs-row.income-expect-row.income-expect-row--surplus {
  background: color-mix(in srgb, var(--mint) 12%, transparent);
  border-color: color-mix(in srgb, var(--mint) 40%, var(--line));
}

.income-expect-seg--actual {
  background: linear-gradient(90deg, rgba(91, 156, 245, 0.88), rgba(61, 213, 152, 0.85));
}

.income-expect-seg--gap {
  background: rgba(120, 150, 200, 0.16);
}

.income-expect-seg--surplus {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--mint) 94%, rgb(15, 81, 50)),
    #4ade80
  );
}

.income-expect-composite--surpluspulse {
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 1px color-mix(in srgb, var(--mint) 35%, transparent);
}

.income-expect-chip--surplus {
  color: #fff;
  background: linear-gradient(135deg, var(--mint), #15803d);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.income-expect-chip--building {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.income-expect-surplus-note {
  color: var(--mint);
  font-weight: 600;
  font-size: 0.72rem;
}

.income-expect-dot--actual {
  background: linear-gradient(145deg, rgba(91, 156, 245, 0.92), rgba(61, 213, 152, 0.88));
}

.income-expect-dot--gap {
  background: rgba(120, 150, 200, 0.22);
  border: 1px solid rgba(120, 150, 200, 0.28);
  box-sizing: border-box;
}

.income-expect-dot--surplus {
  background: linear-gradient(145deg, var(--mint), #22c55e);
}

.budget-share-subhead {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 1.1rem 0 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.budget-share-subhead-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.suggestion-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  line-height: 1.48;
}

.suggestion-list li {
  margin-bottom: 0.35rem;
}

.suggestion-list li:last-child {
  margin-bottom: 0;
}

.insight-card h3 {
  margin-bottom: 0.5rem;
}

.dash-insights {
  margin-bottom: 1.1rem;
}

.panel-inline-insights {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 720px) {
  .panel-inline-insights {
    grid-template-columns: 1fr 1fr;
  }
}

.mini-card-title {
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
}

.insights-strip:empty {
  display: none;
}

.insights-strip {
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(91, 156, 245, 0.08);
  border: 1px solid rgba(91, 156, 245, 0.22);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

html[data-theme="light"] .insights-strip {
  background: rgba(30, 84, 183, 0.06);
  border-color: rgba(30, 84, 183, 0.15);
}

.form-row,
.form-stack .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.form-stack .form-row-title-full {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 0.55rem;
}

.form-stack .form-row-title-full input {
  width: 100%;
  min-width: 0;
}
.form-row input:not([type="submit"]),
.form-row select,
.form-stack input:not([type="submit"]),
.form-stack select {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
}

.form-row input[placeholder*="Transaction"],
.form-row input[placeholder*="Name"],
.form-stack input[id^="sub-name"],
.form-stack input[id="acc-name"],
.form-stack input[id="tf-memo"] {
  flex: 1;
  min-width: 140px;
}

.inline {
  font-size: 0.76rem;
  color: var(--muted);
}

.inline.full select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  min-width: 160px;
}

.overflow {
  overflow-x: auto;
  margin-top: 0.5rem;
}

table.data {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8rem;
}

table.data > colgroup[data-ledger-colgroup] col {
  min-width: 0;
}

table.data th,
table.data td {
  padding: 0.48rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  word-break: break-word;
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.data th.actions-th {
  text-align: center;
}

button.th-sort-btn {
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.3rem;
  text-align: inherit;
}

.num-col button.th-sort-btn {
  justify-content: flex-end;
  width: 100%;
}

button.th-sort-btn:hover {
  color: var(--text);
}

.sort-ind {
  flex-shrink: 0;
  opacity: 0.75;
  font-size: 0.65rem;
  letter-spacing: 0;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data th.num-col,
table.data td.num-col {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: nowrap;
}

/* Action column: remain real table cells; keep buttons inline in one chip */
table.data td.actions-cell {
  vertical-align: middle;
  white-space: nowrap;
  text-align: center;
}

table.data td.actions-cell > .btn {
  vertical-align: middle;
}

.mini {
  font-size: 0.72rem;
  color: var(--muted);
}

.btn-icon {
  padding: 0.2rem 0.35rem;
  font-size: 0.74rem;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-icon:hover:not(:disabled) {
  color: var(--bad);
}

.cat-split {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .cat-split {
    grid-template-columns: 1fr 1fr;
  }
}

.cat-pie-root {
  margin: 0.65rem 0 0.85rem;
}

.cat-pie-block {
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.cat-pie-heading {
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.cat-pie-empty {
  margin: 0;
}

.cat-pie-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
}

.cat-pie-body svg {
  flex-shrink: 0;
}

.pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 10rem;
}

.pie-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--line);
}

.pie-legend li:last-child {
  border-bottom: none;
}

.pie-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.pie-legend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.pie-legend-meta {
  flex-shrink: 0;
  font-size: 0.72rem;
  text-align: right;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.82rem;
}

.import-upload-card .import-upload-head {
  margin-bottom: 0.85rem;
}

.import-upload-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue);
}

.import-upload-sub {
  margin: 0;
  line-height: 1.45;
  max-width: 42rem;
}

.import-format-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  max-width: 44rem;
  line-height: 1.55;
}

.import-format-list li + li {
  margin-top: 0.3rem;
}

.mono-tiny {
  font-family: ui-monospace, monospace;
  font-size: 0.78em;
}

.import-drop-zone {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  padding: 1.05rem 1rem;
}

.import-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}

@media (min-width: 560px) {
  .import-drop-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.import-file-pick-btn {
  cursor: pointer;
  font-weight: 600;
}

.import-file-pick-btn:focus-within {
  outline: 2px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 2px;
}

.import-file-hint {
  margin: 0;
  font-size: 0.82rem;
  flex: 1;
  min-width: 12rem;
  line-height: 1.4;
}

.import-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.95rem;
}

.import-save-note {
  margin: 0.85rem 0 0;
  max-width: 42rem;
  line-height: 1.42;
}

.tiny {
  font-size: 0.76rem;
}

.import-result-shell {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .import-result-shell {
  background: rgba(255, 255, 255, 0.55);
}

.import-result-shell[hidden] {
  display: none !important;
}

.import-result-heading {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mint);
}

.import-result-shell.import-result-warn .import-result-heading {
  color: var(--warn);
}

.import-result-list {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.import-result-list li + li {
  margin-top: 0.35rem;
}

code {
  font-family: ui-monospace, monospace;
  font-size: 0.86em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.subs-form .form-row {
  align-items: flex-end;
}

.subs-panel-hint {
  margin: -0.15rem 0 0.75rem;
  max-width: 52rem;
  line-height: 1.42;
}

.subs-panel-table-title {
  margin: 1.15rem 0 0.25rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--blue);
}

.subs-panel-table-lede {
  margin: 0 0 0.65rem;
  max-width: 52rem;
  line-height: 1.4;
}

.subs-status-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.subs-status-pill.subs-status-active {
  background: rgba(61, 213, 152, 0.16);
  border-color: color-mix(in srgb, var(--mint) 35%, transparent);
  color: var(--mint);
}

.subs-status-pill.subs-status-paused {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  color: var(--warn);
}

.subs-status-pill.subs-status-completed {
  background: rgba(120, 130, 150, 0.18);
  border-color: color-mix(in srgb, var(--muted) 45%, transparent);
  color: var(--muted);
}

.subs-status-pill.subs-status-other {
  background: rgba(80, 120, 200, 0.16);
  border-color: color-mix(in srgb, var(--blue) 35%, transparent);
  color: var(--blue);
}

html[data-theme="light"] .subs-status-pill.subs-status-active {
  background: rgba(13, 124, 82, 0.14);
}

.subs-completed-details {
  margin-top: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

[data-theme="light"] .subs-completed-details {
  background: rgba(255, 255, 255, 0.45);
}

.subs-completed-details.subs-completed-empty {
  opacity: 0.92;
}

.subs-completed-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  padding: 0.75rem 0.95rem;
  font-size: 0.88rem;
  user-select: none;
}

.subs-completed-summary::-webkit-details-marker {
  display: none;
}

.subs-completed-summary-strong {
  font-weight: 600;
}

.subs-completed-summary::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  margin-bottom: 0.05rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  opacity: 0.75;
  vertical-align: middle;
}

.subs-completed-details[open] > .subs-completed-summary::before {
  transform: rotate(45deg);
  margin-bottom: 0;
}

.subs-completed-table-wrap {
  padding: 0 0.65rem 0.85rem;
}

.subs-date-field {
  flex-direction: column;
  align-items: stretch;
  gap: 0.22rem;
}

.subs-date-field .subs-date-lbl {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
}

.req-star {
  color: var(--bad);
}

.subs-form-row-2 label.inline.full select {
  min-width: min(14rem, 100%);
}

.acc-active-label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.acc-active-label input {
  width: auto;
}

.account-status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.account-status-pill.is-active {
  background: rgba(61, 213, 152, 0.14);
  color: var(--mint);
}

.account-status-pill.is-inactive {
  background: rgba(120, 130, 150, 0.16);
  color: var(--muted);
}

.account-row-inactive:not(:hover) td {
  opacity: 0.78;
}

html[data-theme="light"] .account-status-pill.is-active {
  background: rgba(13, 124, 82, 0.12);
}

.settings-card {
  max-width: 38rem;
  margin-bottom: 1rem;
}

.instructions-card {
  max-width: 52rem;
  margin-bottom: 0.75rem;
}

.instructions-panel .instructions-card:last-of-type {
  margin-bottom: 0;
}

.instructions-card h3.instructions-card-title {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.instructions-card > p {
  margin: 0;
}

.instructions-card > p + p {
  margin-top: 0.65rem;
}

.instructions-bullet-list {
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
}

.instructions-bullet-list li {
  margin-bottom: 0.4rem;
}

.instructions-bullet-list li:last-child {
  margin-bottom: 0;
}

.instructions-footnote {
  margin-top: 0.85rem !important;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.instructions-card code {
  font-size: 0.86em;
}

/* Contact & about */
.contact-layout {
  display: grid;
  gap: 1rem;
  max-width: 56rem;
  align-items: start;
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

.contact-about-card .contact-about-lede,
.contact-about-card .contact-values,
.contact-about-card .contact-about-foot {
  margin: 0;
}

.contact-about-lede {
  font-size: 0.89rem;
  line-height: 1.52;
}

.contact-about-card .contact-about-lede {
  margin-top: 1rem;
}

.contact-values {
  list-style: none;
  padding: 0;
  margin-top: 0.95rem !important;
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  font-size: 0.84rem;
  line-height: 1.48;
  color: var(--text);
}

.contact-value-title {
  font-weight: 600;
  color: var(--text);
}

.contact-about-foot {
  margin-top: 1rem !important;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem !important;
  line-height: 1.45;
}

.contact-brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-brand-logo {
  width: 3.75rem;
  height: 3.75rem;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px var(--shade);
}

.contact-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact-brand-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.contact-brand-tag {
  margin: 0.22rem 0 0 !important;
}

.contact-form-heading {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.contact-direct-email {
  margin: -0.2rem 0 0 !important;
  line-height: 1.45;
}

.contact-inbox-link {
  color: var(--blue);
  text-decoration: none;
}

.contact-inbox-link:hover {
  text-decoration: underline;
}

.contact-form-intro {
  margin: 0 0 1rem;
  line-height: 1.45;
}

.contact-require-signin {
  margin: -0.15rem 0 1rem;
  padding: 0.72rem 0.95rem;
  border-radius: 10px;
  border: 1px dashed var(--line);
  line-height: 1.45;
}

.contact-form-fields {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.contact-form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.82rem;
  min-width: 0;
}

.contact-field-label {
  font-weight: 600;
  color: var(--text);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.48rem 0.62rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 0;
}

.contact-form textarea {
  line-height: 1.48;
}

.contact-form-actions {
  margin-top: 1rem;
}

.contact-form-privacy {
  margin: 0.75rem 0 0 !important;
  line-height: 1.45;
  font-size: 0.76rem !important;
}

.contact-panel .panel-head-hint code {
  font-size: 0.78rem;
}

.settings-profile-block .tight {
  margin: 0 0 0.55rem;
}

.settings-avatar-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.settings-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.btn-file-wrap {
  display: inline-flex;
  align-items: center;
}

.settings-form-bottom {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.settings-grid {
  display: grid;
  gap: 0.95rem;
}

@media (min-width: 620px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .settings-grid .field-block.span-full {
    grid-column: 1 / -1;
  }
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field-block .lbl {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.field-block input,
.field-block select {
  width: 100%;
  max-width: 100%;
  padding: 0.48rem 0.58rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
}

.field-block input[readonly] {
  opacity: 0.82;
}

.hint-block {
  display: block;
  margin-top: 0.3rem;
  line-height: 1.35;
}

@media (max-width: 768px) {
  .panels {
    padding: 0.75rem 1rem 1.5rem;
  }

  .file-label-wrap {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }

  .user-chip-wrap {
    max-width: min(170px, 52vw);
  }
}
