:root {
  --ink: #1a2330;
  --muted: #5c6570;
  --panel: #fbf8f2;
  --panel-solid: #f7f3ea;
  --line: rgba(26, 35, 48, 0.16);
  --line-solid: #cfc6b8;
  --accent: #1e3d34;
  --accent-2: #8a6414;
  --danger: #8f3d3d;
  --radius: 2px;
  --font-display: "Freight Display", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: "Avenir Next", "Segoe UI", "Candara", sans-serif;
  --web-globe: #a8ff2a; /* lime green wireframe globe */
  /* Fixed calendar pane — five week rows, same box for every month. */
  --cal-pane-size: 156px;
  --cal-pane-height: 148px;
  --cal-pane-gap: 0.28rem;
  --cal-day-size: 1.22rem;
  --cal-nav-size: 1.85rem;
  --cal-strip-gap: 0.35rem;
  --cal-pad-x: 0.5rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background: #f4efe4;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f4efe4;
  background-image: linear-gradient(rgba(30, 61, 52, 0.045) 1px, transparent 1px);
  background-size: 100% 32px;
  background-attachment: fixed;
}

body > form#form1 {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

body.ledger-page,
body.ledger-page form#form1 {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body.ledger-page {
  font-size: 13px;
}

body.ledger-page form#form1 {
  min-height: 0;
  flex: 1;
  width: 90vw;
  max-width: 90vw;
  margin-left: auto;
  margin-right: auto;
}

.bg-layer {
  display: none;
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 10, 18, 0.28), rgba(4, 10, 18, 0.55));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(30, 40, 30, 0.06);
}

.brand,
.brand-inline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 0.95;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

.brand-inline {
  font-size: 1.8rem;
  gap: 0.4rem;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 0.85em;
  height: 0.85em;
  object-fit: contain;
  filter: brightness(0);
}

.brand-inline .brand-mark {
  width: 1.55rem;
  height: 1.55rem;
}

.brand-text {
  display: inline-block;
}

.splash-stage,
.center-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.site-footer {
  flex: 0 0 auto;
  margin-top: auto;
  width: 100%;
  text-align: center;
  padding: 0.65rem 1rem 0.9rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #5c6570;
}

.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  color: #3d4754;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.site-footer .footer-brand-mark {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  flex: 0 0 auto;
  filter: brightness(0);
}

.site-footer .footer-link {
  margin: 0;
}

.site-footer a {
  color: #3d4754;
  text-decoration: underline;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #1e3d34;
}

.splash-panel,
.form-panel {
  width: min(520px, 100%);
  padding: 2rem 2.1rem 1.8rem;
  opacity: 0;
  transform: translateY(28px);
}

.splash-panel.is-in,
.form-panel.is-in,
.slide-panel.is-in,
.main-panel.is-in,
.side-panel.is-in,
.top-bar.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(.2,.8,.2,1);
}

.tagline,
.support,
.foot {
  color: var(--muted);
}

.demo-credentials {
  margin: 0.2rem 0 0.4rem;
  color: var(--ink);
  line-height: 1.45;
}

.demo-credentials strong {
  font-weight: 650;
}

.forgot-row {
  margin: 0.35rem 0 0;
  text-align: right;
}

.forgot-row a {
  color: #1e3d34;
  font-size: 0.92rem;
}

.reset-password {
  margin: 0.8rem 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  text-align: center;
  word-break: break-all;
}

.tagline {
  font-size: 1.05rem;
  max-width: 28ch;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0.4rem 0 0.6rem;
}

label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.field,
select,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"] {
  width: 100%;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  padding: 0.72rem 0.9rem;
  font: inherit;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.promo-block {
  margin: 1.15rem 0 0;
}

.promo-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.promo-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  line-height: 0;
}

.promo-frame video {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #061018;
  cursor: pointer;
}

.promo-frame.is-started video {
  object-fit: contain;
  background: #000;
}

.promo-play {
  position: absolute;
  inset: 0;
  margin: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(4, 10, 16, 0.45);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.promo-frame.is-started .promo-play {
  display: none;
}

.promo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem;
  line-height: 1.2;
  background: rgba(4, 10, 16, 0.88);
}

.promo-controls[hidden] {
  display: none;
}

.promo-ctrl {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
}

.promo-ctrl:hover,
.promo-ctrl:focus {
  border-color: var(--accent);
}

.promo-frame:fullscreen,
.promo-frame:-webkit-full-screen {
  max-width: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.promo-frame:fullscreen video,
.promo-frame:-webkit-full-screen video {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  max-height: calc(100% - 2.6rem);
  object-fit: contain;
}

.promo-play-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}

.promo-play-icon::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 13px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #f7f3ea;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #f7f3ea; border-color: var(--accent); font-weight: 650; }
.btn.primary:hover,
.btn.primary:focus { background: #163229; border-color: #163229; color: #f7f3ea; }
.btn.ghost { background: transparent; border-color: rgba(26, 35, 48, 0.4); color: var(--ink); }
.btn.ghost:hover,
.btn.ghost:focus { border-color: #1e3d34; color: #1e3d34; }
.btn.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 650;
}
.btn.danger:hover,
.btn.danger:focus {
  border-color: var(--danger);
  background: rgba(143, 61, 61, 0.12);
}
.btn.compact { padding: 0.45rem 0.8rem; font-size: 0.9rem; }
.btn.full { width: 100%; }

.error, .form-msg {
  color: var(--danger);
  min-height: 1.2rem;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.25rem 0 0.55rem;
}

.captcha-image {
  display: block;
  width: 168px;
  height: 52px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: #0c1824;
}

#txtCaptcha,
.field-captcha {
  text-transform: uppercase;
}

.captcha-timer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.captcha-digits {
  display: inline-block;
  min-width: 4.8rem;
  padding: 0.08rem 0.4rem 0.12rem;
  text-align: center;
  font-family: "Courier New", Courier, "Lucida Console", monospace;
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: 0.12em;
  line-height: 1.1;
  color: #b6ff6a;
  background: #07140f;
  border: 1px solid #1e3d34;
  border-radius: 2px;
  text-shadow: 0 0 8px rgba(182, 255, 106, 0.85);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}

.top-bar {
  margin: 1rem;
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(-16px);
}

.filters {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.filters label { margin: 0; }
.filters select,
.filters .field { width: auto; min-width: 140px; }

.app-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1rem;
  padding: 0 1rem 1rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  transition: grid-template-columns 0.7s ease, column-gap 0.7s ease;
}

.side-panel,
.main-panel {
  padding: 1.1rem 1.2rem 1.3rem;
  opacity: 0;
  transform: translateY(18px);
  min-height: 0;
}

.main-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
}

.side-panel-toggle {
  position: absolute;
  top: calc(0.45rem + 4px);
  left: calc(0.45rem + 4px);
  z-index: 6;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #1e3d34;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.side-panel-toggle:hover,
.side-panel-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 61, 52, 0.25);
}

.side-panel-toggle.is-collapsed {
  background: #8f3d3d;
  border-color: #f7f3ea;
}

.app-grid.is-side-collapsed {
  grid-template-columns: 0px 1fr;
  column-gap: 0;
}

.app-grid.is-side-collapsed > .side-panel {
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  width: 0;
  min-width: 0;
  max-width: 0;
  pointer-events: none;
  border-color: transparent;
}

.calendar-strip.is-size-locked {
  flex-grow: 0;
  flex-shrink: 0;
}

.period-toolbar-aside.is-fill-rest {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
}

.side-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  box-sizing: border-box;
  transition: opacity 0.7s ease, padding 0.7s ease, border-color 0.7s ease;
}

.side-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.side-tab {
  flex: 1 1 auto;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  border-radius: 2px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1.2;
}

.side-tab:hover,
.side-tab:focus {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
}

.side-tab.is-active {
  color: #f7f3ea;
  background: var(--accent);
  border-color: transparent;
}

.side-tab-panels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-tab-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-tab-panel[hidden] {
  display: none !important;
}

.side-tab-panel > .btn.full {
  flex: 0 0 auto;
}

.side-tab-hint {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.period-totals-list li.period-total-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  cursor: pointer;
}

.period-totals-list li.period-total-item.is-current {
  border-color: var(--accent);
  background: rgba(30, 61, 52, 0.08);
}

.period-totals-list .period-date {
  display: block;
  width: 100%;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.period-totals-list .period-figures {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.period-totals-list .period-figures strong {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.plain-list {
  list-style: none;
  margin: 0.6rem 0 1.2rem;
  padding: 0;
}

.plain-list li {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.account-picker {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0.6rem 0 0;
  overflow: hidden;
}

.account-picker[hidden] {
  display: none !important;
}

.account-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.15rem;
}

#recurringList,
.period-totals-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0.6rem 0 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.recur-filter-wrap {
  position: relative;
  margin-top: 0.55rem;
}

.recur-filter-wrap .recur-filter-input {
  width: 100%;
  padding-right: 2.1rem;
}

.recur-filter-clear {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recur-filter-clear:hover,
.recur-filter-clear:focus {
  color: var(--ink);
  background: rgba(30, 61, 52, 0.06);
  outline: none;
}

.recur-filter-clear[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.plain-list li.account-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: default;
  background: transparent;
  border-color: transparent;
}

.plain-list li.account-item:hover {
  background: transparent;
  border-color: transparent;
}

.plain-list li.account-item .account-link {
  flex: 0 1 auto;
  align-self: center;
  min-width: 0;
  max-width: 100%;
  width: fit-content;
  color: var(--accent);
  text-decoration: none;
  font: inherit;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px dotted currentColor;
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
  cursor: pointer;
}

.plain-list li.account-item .account-budget {
  flex: 0 0 auto;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  min-width: 4.5rem;
}

.plain-list li.account-item .account-budget.total-positive {
  color: #1e3d34;
}

.plain-list li.account-item .account-budget.total-negative {
  color: #8f3d3d;
}

.plain-list li.account-item .account-budget.total-zero {
  color: var(--accent-2);
}

.plain-list li.account-item .account-link:hover,
.plain-list li.account-item .account-link:focus {
  color: var(--accent-2);
  outline: none;
}

.plain-list li.account-item.active {
  border-color: transparent;
  background: transparent;
}

.plain-list li.account-item.active .account-link {
  color: var(--ink);
  font-weight: 650;
  border: 1px dotted currentColor;
}

.plain-list li.account-item .account-rename {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
}

.plain-list li.account-item .account-rename-input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0.15rem 0.45rem;
  font: inherit;
  line-height: 1.3;
}

.plain-list li.account-item .account-rename-save {
  flex: 0 0 auto;
  appearance: none;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid #1f8a4c;
  border-radius: 2px;
  background: rgba(31, 138, 76, 0.12);
  color: #1f8a4c;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.plain-list li.account-item .account-rename-save:hover,
.plain-list li.account-item .account-rename-save:focus {
  background: #1f8a4c;
  color: #f7f3ea;
  outline: none;
}

.plain-list li.account-item .account-rename-save:disabled {
  opacity: 0.45;
  cursor: default;
}

.account-select-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.account-select-row .form-select {
  flex: 1 1 auto;
  min-width: 0;
}

/* Selects — paper ledger chrome */
.form-select {
  background-color: #fffdf8;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 2px;
  padding: 0.45rem 2.25rem 0.45rem 0.75rem;
  font: inherit;
  box-shadow: none;
}

.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(30, 61, 52, 0.16);
  background-color: #fffdf8;
  color: var(--ink);
}

.form-select option {
  background: #fffdf8;
  color: var(--ink);
}

.btn-delete-account,
.ledger-grid .btn-delete-entry {
  --delete-rose: #8f3d3d;
  --delete-rose-deep: #6f2e2e;
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid rgba(143, 61, 61, 0.45);
  border-radius: 2px;
  background: rgba(143, 61, 61, 0.08);
  color: var(--delete-rose);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.25);
  appearance: none;
  font: inherit;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.btn-delete-account .delete-icon,
.ledger-grid .btn-delete-entry .delete-icon {
  display: block;
  width: 0.78rem;
  height: 0.78rem;
  pointer-events: none;
}

.btn-delete-account:hover,
.btn-delete-account:focus,
.ledger-grid .btn-delete-entry:hover,
.ledger-grid .btn-delete-entry:focus {
  color: #f7f3ea;
  border-color: #8f3d3d;
  background: #8f3d3d;
  box-shadow: none;
  transform: translateY(-1px);
  outline: none;
}

.btn-delete-account:active,
.ledger-grid .btn-delete-entry:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 2px rgba(255, 123, 123, 0.1);
}

.btn-delete-account:disabled,
.ledger-grid .btn-delete-entry:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.plain-list li.recurring-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.plain-list li.recurring-item:hover {
  border-color: var(--line);
  background: rgba(30, 61, 52, 0.04);
}

.plain-list li.recurring-item .recurring-label {
  flex: 1;
  min-width: 0;
}

.plain-list li.recurring-item .btn-edit-recurring {
  flex: 0 0 auto;
}

.plain-list li.active,
.plain-list li:hover {
  border-color: var(--line);
  background: rgba(30, 61, 52, 0.04);
}

.period-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.calendar-strip {
  display: flex;
  align-items: flex-end;
  gap: var(--cal-strip-gap);
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
  margin-left: 10px;
}

.period-toolbar-aside {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-width: 8rem;
  box-sizing: border-box;
}

.calendar-aside-panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.55rem 0.6rem;
  overflow: auto;
  min-width: 0;
}

.aside-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  margin: 0;
  flex: 0 0 auto;
}

.aside-tab {
  flex: 1 1 0;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  border-radius: 2px;
  padding: 0.35rem 0.4rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 0;
}

.aside-tab:hover,
.aside-tab:focus {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
}

.aside-tab.is-active {
  color: #f7f3ea;
  background: var(--accent);
  border-color: transparent;
}

.aside-tab.has-filter:not(.is-active) {
  border-color: rgba(30, 61, 52, 0.45);
  color: var(--ink);
}

.aside-tab-panels {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.aside-tab-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.aside-tab-panel[hidden] {
  display: none !important;
}

.calendar-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calendar-aside-list li {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  cursor: default;
}

.calendar-aside-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 0;
}

.calendar-aside-actions .calendar-aside-action {
  display: inline-flex;
  align-items: center;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.calendar-aside-action {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: rgba(30, 61, 52, 0.04);
  color: var(--ink);
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.25;
}

.calendar-aside-action:hover,
.calendar-aside-action:focus {
  border-color: rgba(30, 61, 52, 0.35);
  background: rgba(30, 61, 52, 0.08);
  outline: none;
}

.calendar-aside-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.calendar-aside-note .aside-note-icon {
  flex: 0 0 auto;
  color: var(--accent-2);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.calendar-aside-clone {
  margin-top: 0;
}

.clone-day-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: rgba(30, 61, 52, 0.04);
  border: 1px solid transparent;
  min-width: 0;
}

.clone-day-label {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clone-day-label #lblCloneSourceDate {
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
}

.clone-target-date {
  flex: 0 1 150px;
  width: 150px;
  max-width: 150px;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
}

.clone-target-date:focus {
  outline: none;
  border-color: rgba(30, 61, 52, 0.45);
}

.clone-day-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.calendar-aside-batch {
  margin-top: 0;
}

.batch-update-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: rgba(30, 61, 52, 0.04);
  border: 1px solid transparent;
  min-width: 0;
}

.batch-update-label {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
}

.batch-update-field {
  flex: 0 1 200px;
  max-width: 200px;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
}

.batch-update-field:focus {
  outline: none;
  border-color: rgba(30, 61, 52, 0.45);
}

.batch-update-value {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
}

.batch-update-value:focus {
  outline: none;
  border-color: rgba(30, 61, 52, 0.45);
}

.batch-update-status {
  flex: 0 1 200px;
  max-width: 200px;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
  display: none;
}

.batch-update-status:focus {
  outline: none;
  border-color: rgba(30, 61, 52, 0.45);
}

.batch-update-row.is-delete .batch-update-value,
.batch-update-row.is-delete .batch-update-status,
.batch-update-row.is-status .batch-update-value {
  display: none;
}

.batch-update-row.is-status .batch-update-status {
  display: block;
}

.batch-update-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.calendar-aside-query {
  margin-top: 0;
}

.query-dates-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: rgba(30, 61, 52, 0.04);
  border: 1px solid transparent;
  min-width: 0;
}

.query-dates-label {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
}

.query-date-mode {
  flex: 1 1 8rem;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
}

.query-date-mode:focus,
.query-date:focus {
  outline: none;
  border-color: rgba(30, 61, 52, 0.45);
}

.query-dates-range {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0.3rem;
  flex: 1 1 100%;
  min-width: 0;
}

.query-dates-row.is-custom .query-dates-range {
  display: grid;
}

.query-date {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
}

.query-dates-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--muted);
}

.calendar-aside-filter {
  margin-top: 0;
}

.ledger-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 0.45rem;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
  background: rgba(30, 61, 52, 0.04);
  border: 1px solid transparent;
  min-width: 0;
}

.ledger-filter-month {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--ink);
  cursor: pointer;
}

.ledger-filter-month input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.05rem 0 0;
  cursor: pointer;
}

.ledger-filter-wrap {
  position: relative;
  min-width: 0;
}

.ledger-filter-value {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 0.45rem;
}

.ledger-filter-wrap:has(.ledger-filter-clear:not([hidden])) .ledger-filter-value {
  padding-right: 2.1rem;
}

.ledger-filter-value:focus {
  outline: none;
  border-color: rgba(30, 61, 52, 0.45);
}

.ledger-filter-clear {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ledger-filter-clear:hover,
.ledger-filter-clear:focus {
  color: var(--ink);
  background: rgba(30, 61, 52, 0.06);
  outline: none;
}

.ledger-filter-clear[hidden] {
  display: none !important;
}

.ledger-filter-row.is-active {
  border-color: rgba(30, 61, 52, 0.35);
}

.budjet-dialog.batch-value-dialog label {
  display: block;
  margin: 0 0 0.45rem;
}

.budjet-dialog.batch-value-dialog #txtBatchValue {
  width: 100%;
  box-sizing: border-box;
}

/* Popup datepicker: highlight dates that already have pay-date totals. */
.ui-datepicker td.has-pay-date .ui-state-default,
.ui-datepicker td.has-pay-date a.ui-state-default {
  font-weight: 700;
  background: rgba(30, 61, 52, 0.18) !important;
  border-color: rgba(30, 61, 52, 0.5) !important;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Clone / inline popup calendar — dark header and visible prev/next.
   Global `select` styles make month/year light-on-transparent, and the
   jQuery UI icon sprite is not in the repo, so default buttons vanish. */
#ui-datepicker-div.ui-datepicker {
  z-index: 120 !important;
  background: var(--panel-solid);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45rem 0.5rem 0.55rem;
  box-shadow: 0 14px 32px rgba(30, 40, 30, 0.12);
  width: 17.5rem;
}

#ui-datepicker-div .ui-datepicker-header {
  background: rgba(30, 61, 52, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 0.4rem 2.15rem;
  position: relative;
}

#ui-datepicker-div .ui-datepicker-title {
  color: var(--ink);
  font-weight: 650;
  line-height: 1.7;
  margin: 0;
}

#ui-datepicker-div select.ui-datepicker-month,
#ui-datepicker-div select.ui-datepicker-year {
  width: auto;
  max-width: 46%;
  display: inline-block;
  margin: 0 0.12rem;
  padding: 0.18rem 0.3rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
}

#ui-datepicker-div .ui-datepicker-prev,
#ui-datepicker-div .ui-datepicker-next {
  position: absolute;
  top: 0.32rem;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(30, 61, 52, 0.06);
  color: var(--ink);
  text-decoration: none;
  text-indent: 0 !important;
  overflow: hidden;
  cursor: pointer;
}

#ui-datepicker-div .ui-datepicker-prev {
  left: 0.32rem;
}

#ui-datepicker-div .ui-datepicker-next {
  right: 0.32rem;
}

#ui-datepicker-div .ui-datepicker-prev span,
#ui-datepicker-div .ui-datepicker-next span {
  display: none !important;
}

#ui-datepicker-div .ui-datepicker-prev::before,
#ui-datepicker-div .ui-datepicker-next::before {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink);
}

#ui-datepicker-div .ui-datepicker-prev::before {
  content: "‹";
}

#ui-datepicker-div .ui-datepicker-next::before {
  content: "›";
}

#ui-datepicker-div .ui-datepicker-prev:hover,
#ui-datepicker-div .ui-datepicker-next:hover,
#ui-datepicker-div .ui-datepicker-prev.ui-state-hover,
#ui-datepicker-div .ui-datepicker-next.ui-state-hover {
  background: rgba(30, 61, 52, 0.12);
  border-color: rgba(30, 61, 52, 0.45);
  color: var(--ink);
}

#ui-datepicker-div .ui-datepicker-calendar {
  width: 100%;
  margin: 0.35rem 0 0;
}

#ui-datepicker-div .ui-datepicker-calendar th {
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0.25rem 0;
}

#ui-datepicker-div .ui-datepicker-calendar td {
  padding: 1px;
}

#ui-datepicker-div .ui-state-default,
#ui-datepicker-div a.ui-state-default {
  background: rgba(30, 61, 52, 0.04);
  border: 1px solid transparent;
  color: var(--ink);
  text-align: center;
  border-radius: 6px;
}

#ui-datepicker-div .ui-state-hover,
#ui-datepicker-div a.ui-state-hover {
  background: rgba(30, 61, 52, 0.12);
  border-color: rgba(30, 61, 52, 0.28);
  color: var(--ink);
}

#ui-datepicker-div .ui-state-highlight,
#ui-datepicker-div a.ui-state-highlight,
#ui-datepicker-div .ui-datepicker-today .ui-state-default {
  background: rgba(240, 199, 94, 0.2);
  border-color: var(--accent-2);
  color: var(--ink);
}

#ui-datepicker-div .ui-state-active,
#ui-datepicker-div a.ui-state-active {
  background: rgba(30, 61, 52, 0.16);
  border-color: var(--accent);
  color: var(--ink);
}

.account-note-text {
  width: 100%;
  min-height: 14rem;
  resize: both;
  font: inherit;
  line-height: 1.45;
}

.budjet-dialog.account-note-dialog .ui-dialog-content {
  overflow: auto;
}

.budjet-dialog.account-note-dialog label {
  display: block;
  margin: 0 0 0.45rem;
}

.btn-cal-nav {
  flex: 0 0 auto;
  align-self: flex-end;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  line-height: 1;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 2px;
  font-size: 1.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-cal-nav:hover {
  border-color: rgba(30, 61, 52, 0.45);
  background: rgba(30, 61, 52, 0.1);
}

.ledger-calendar {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.28rem var(--cal-pad-x) 0.32rem;
  display: block;
  flex: 0 0 auto;
  width: max-content;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  overflow: visible;
}

/* Three months in one row; middle month is always the focus / highlighted month. */
.ledger-calendar .ui-datepicker,
.ledger-calendar .ui-datepicker.ui-datepicker-inline,
.ledger-calendar .ui-datepicker.ui-datepicker-multi {
  background: transparent;
  border: none;
  color: var(--ink);
  width: max-content !important;
  max-width: none !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--cal-pane-gap);
  box-sizing: border-box;
}

/* jQuery UI clearfix pseudos become flex items and add an extra gap on the left. */
.ledger-calendar .ui-datepicker.ui-helper-clearfix:before,
.ledger-calendar .ui-datepicker.ui-helper-clearfix:after {
  content: none !important;
  display: none !important;
}

.ledger-calendar .ui-datepicker-group,
.ledger-calendar .ui-datepicker-multi .ui-datepicker-group,
.ledger-calendar .ui-datepicker-group-first,
.ledger-calendar .ui-datepicker-group-middle,
.ledger-calendar .ui-datepicker-group-last {
  float: none !important;
  display: flex !important;
  flex-direction: column;
  flex: 0 0 var(--cal-pane-size) !important;
  width: var(--cal-pane-size) !important;
  min-width: var(--cal-pane-size) !important;
  max-width: var(--cal-pane-size) !important;
  height: var(--cal-pane-height) !important;
  min-height: var(--cal-pane-height) !important;
  max-height: var(--cal-pane-height) !important;
  margin: 0 !important;
  padding: 0.12rem 0.22rem 0.16rem;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(26, 35, 48, 0.08);
  border-radius: 8px;
  aspect-ratio: auto;
  overflow: hidden;
}

.ledger-calendar .ui-datepicker-group .ui-datepicker-calendar {
  width: 100% !important;
  height: auto;
  table-layout: fixed;
  font-size: 0.76rem;
  margin: 0 !important;
  flex: 0 0 auto;
  border-collapse: collapse;
}

.ledger-calendar .ui-datepicker-group .ui-datepicker-calendar tr {
  height: auto;
}

.ledger-calendar .ui-datepicker-title {
  font-size: 0.74rem;
  line-height: 1.15;
  margin: 0;
  font-weight: 600;
}

.ledger-calendar .ui-datepicker-group.is-current-month {
  background: rgba(30, 61, 52, 0.08);
  border: 1px solid rgba(30, 61, 52, 0.18);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(30, 61, 52, 0.08);
}

.ledger-calendar .ui-datepicker-group.is-current-month .ui-datepicker-title {
  color: #1e3d34;
}

.ledger-calendar .ui-datepicker-header {
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 0.04rem 0 0.12rem;
  position: relative;
  flex: 0 0 auto;
}

/* No month navigation — strip is fixed around the current month. */
.ledger-calendar .ui-datepicker-prev,
.ledger-calendar .ui-datepicker-next {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

.ledger-calendar .ui-datepicker-group:nth-child(n+4),
.ledger-calendar .ui-datepicker-row-break {
  display: none !important;
}

.ledger-calendar .ui-datepicker th {
  padding: 0.04rem 0 0.08rem;
  font-size: 0.6rem;
  font-weight: 600;
  opacity: 0.75;
  height: auto;
  line-height: 1.1;
}

.ledger-calendar .ui-datepicker td {
  padding: 1px;
  height: var(--cal-day-size);
  vertical-align: middle;
}

/* Months that need a sixth week use a shorter day so all dates stay visible. */
.ledger-calendar .ui-datepicker-group.is-six-week {
  --cal-day-size: 1.02rem;
}

.ledger-calendar .ui-state-default,
.ledger-calendar a.ui-state-default {
  background: rgba(30, 61, 52, 0.03);
  border: 1px solid transparent;
  color: var(--ink);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 100%;
  min-height: var(--cal-day-size);
  line-height: 1;
  padding: 0 !important;
  font-size: 0.76rem;
  border-radius: 4px;
  box-sizing: border-box;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.ledger-calendar td.is-beyond-plan .ui-state-default,
.ledger-calendar td.is-beyond-plan a.ui-state-default,
.ui-datepicker td.is-beyond-plan .ui-state-default,
.ui-datepicker td.is-beyond-plan a.ui-state-default {
  color: rgba(26, 35, 48, 0.28) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  font-weight: 400;
  cursor: not-allowed;
}

.ledger-calendar td.is-beyond-plan:hover .ui-state-default,
.ledger-calendar td.is-beyond-plan:hover a.ui-state-default,
.ui-datepicker td.is-beyond-plan:hover .ui-state-default,
.ui-datepicker td.is-beyond-plan:hover a.ui-state-default {
  color: rgba(26, 35, 48, 0.28) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

.ledger-calendar td:hover .ui-state-default,
.ledger-calendar td:hover a.ui-state-default,
.ledger-calendar .ui-state-hover,
.ledger-calendar a.ui-state-hover {
  background: rgba(176, 137, 72, 0.28) !important;
  border-color: rgba(176, 137, 72, 0.9) !important;
  box-shadow: inset 0 0 0 1px rgba(176, 137, 72, 0.4);
  color: #1a2330 !important;
  cursor: pointer;
}

.ledger-calendar .ui-state-active,
.ledger-calendar a.ui-state-active,
.ledger-calendar td.is-selected .ui-state-default,
.ledger-calendar td.is-selected a.ui-state-default {
  background: rgba(176, 137, 72, 0.42) !important;
  border-color: #b08948 !important;
  box-shadow: inset 3px 0 0 #b08948, inset 0 0 0 1px rgba(176, 137, 72, 0.45);
  color: #1a2330 !important;
  font-weight: 700;
}

/* Entry marks: real entries only (blue). Ghost-only dates are unmarked. */
.ledger-calendar .has-entry .ui-state-default,
.ledger-calendar .has-entry a.ui-state-default,
.ledger-calendar .has-real-entry .ui-state-default,
.ledger-calendar .has-real-entry a.ui-state-default {
  font-weight: 700;
  background: rgba(30, 61, 52, 0.18) !important;
  border-color: rgba(30, 61, 52, 0.5) !important;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.ledger-calendar .has-ghost-entry .ui-state-default,
.ledger-calendar .has-ghost-entry a.ui-state-default {
  font-weight: inherit;
  background: transparent !important;
  border-color: transparent !important;
  border-style: solid !important;
  box-shadow: none !important;
}

/* Selected yellow wins over entry blue (same yellow as flagged ledger rows). */
.ledger-calendar td.is-selected.has-entry .ui-state-default,
.ledger-calendar td.is-selected.has-entry a.ui-state-default,
.ledger-calendar td.is-selected.has-real-entry .ui-state-default,
.ledger-calendar td.is-selected.has-real-entry a.ui-state-default,
.ledger-calendar .has-real-entry .ui-state-active,
.ledger-calendar .has-real-entry a.ui-state-active {
  background: rgba(176, 137, 72, 0.48) !important;
  border-color: #b08948 !important;
  box-shadow: inset 3px 0 0 #b08948, inset 0 -2px 0 rgba(30, 61, 52, 0.55);
  color: #1a2330 !important;
}

.ledger-calendar td.has-entry:hover .ui-state-default,
.ledger-calendar td.has-entry:hover a.ui-state-default,
.ledger-calendar td.has-real-entry:hover .ui-state-default,
.ledger-calendar td.has-real-entry:hover a.ui-state-default {
  background: rgba(176, 137, 72, 0.34) !important;
  border-color: rgba(176, 137, 72, 0.95) !important;
}

/* Today outline wins over entry fill (must come after entry rules). */
.ledger-calendar td.ui-datepicker-today .ui-state-default,
.ledger-calendar td.ui-datepicker-today a.ui-state-default,
.ledger-calendar td.is-today .ui-state-default,
.ledger-calendar td.is-today a.ui-state-default,
.ledger-calendar td.is-today.has-entry .ui-state-default,
.ledger-calendar td.is-today.has-entry a.ui-state-default,
.ledger-calendar td.is-today.has-real-entry .ui-state-default,
.ledger-calendar td.is-today.has-real-entry a.ui-state-default,
.ledger-calendar td.ui-datepicker-today.has-entry .ui-state-default,
.ledger-calendar td.ui-datepicker-today.has-entry a.ui-state-default,
.ledger-calendar td.ui-datepicker-today.has-real-entry .ui-state-default,
.ledger-calendar td.ui-datepicker-today.has-real-entry a.ui-state-default {
  border: 1px solid #1e3d34 !important;
  box-shadow: inset 0 0 0 1px #1e3d34 !important;
}

/* Selected + today: yellow fill with white outline. */
.ledger-calendar td.is-selected.is-today .ui-state-default,
.ledger-calendar td.is-selected.is-today a.ui-state-default,
.ledger-calendar td.is-selected.ui-datepicker-today .ui-state-default,
.ledger-calendar td.is-selected.ui-datepicker-today a.ui-state-default {
  background: rgba(176, 137, 72, 0.48) !important;
  border: 1px solid #1e3d34 !important;
  box-shadow: inset 3px 0 0 #b08948, inset 0 0 0 1px #1e3d34 !important;
  color: #1a2330 !important;
}

.field-cycle {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.35rem 0 0.85rem;
}

.period-cards {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding: 0.8rem 0 0.4rem;
}

.period-card {
  min-width: 180px;
  padding: 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: rgba(30, 61, 52, 0.03);
}

.period-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(30, 61, 52, 0.18);
}

.table-wrap {
  overflow: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  scrollbar-gutter: stable;
}

.period-toolbar,
.period-cards {
  flex: 0 0 auto;
}

.ledger-grid {
  width: 100%;
  max-width: 100%;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.ledger-grid th,
.ledger-grid td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel-solid);
  box-shadow: inset 0 -2px 0 #1e3d34;
  cursor: pointer;
  color: #1e3d34;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
  user-select: none;
}

.ledger-grid thead th[data-sort]:hover,
.ledger-grid thead th.sorted-asc,
.ledger-grid thead th.sorted-desc {
  color: #1e3d34;
}

.ledger-grid thead th:not([data-sort]) {
  cursor: default;
}

.ledger-grid tr.ghost {
  font-style: italic;
}

.ledger-grid tr.ghost > td:not(.col-check) {
  opacity: 0.55;
}

.ledger-grid tr.ghost-draft {
  font-style: normal;
}

.ledger-grid .compact-field {
  min-width: 0;
  width: 100%;
  padding: 0.45rem 0.55rem;
  font-size: 0.92rem;
}

.ledger-grid .ghost-type,
.ledger-grid .ghost-tx,
.ledger-grid .ghost-status,
.ledger-grid .ghost-desc {
  width: 100%;
  min-width: 0;
}

.ledger-grid tr.ghost .ghost-type,
.ledger-grid tr.ghost .ghost-status {
  font-style: normal;
}

.ledger-grid td.col-type,
.ledger-grid td.col-tx,
.ledger-grid td.col-status {
  overflow: visible;
}

.ledger-grid .ghost-select {
  display: block;
  width: 100%;
  min-width: 5.5rem;
  max-width: 100%;
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  pointer-events: auto;
  cursor: pointer;
  font-style: normal;
  opacity: 1;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  line-height: 1.2;
  background-color: #ffffff;
  color: #000000;
  z-index: 2;
  position: relative;
}

.ledger-grid .ghost-select option,
.ledger-grid .ghost-type option,
.ledger-grid .ghost-tx option,
.ledger-grid .ghost-status option {
  background-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

.ledger-grid tr.ghost {
  /* Keep row readable; controls must remain fully interactive. */
}

.ledger-grid tr.ghost .ghost-select,
.ledger-grid tr.ghost .ghost-amount,
.ledger-grid tr.ghost .ghost-desc {
  opacity: 1;
  font-style: normal;
  pointer-events: auto;
}

.ledger-grid .desc-ghost-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.ledger-grid .desc-ghost-hint {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid transparent;
  overflow: hidden;
  white-space: pre;
  pointer-events: none;
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  font-size: 0.92em;
  line-height: normal;
  color: var(--ink);
}

.ledger-grid .desc-ghost-hint[hidden],
.ledger-grid .desc-ghost-tab[hidden] {
  display: none !important;
}

.ledger-grid .desc-ghost-typed,
.ledger-grid .desc-ghost-suffix {
  white-space: pre;
  flex: 0 0 auto;
}

.ledger-grid .desc-ghost-suffix {
  color: rgba(26, 35, 48, 0.42);
}

.ledger-grid .desc-ghost-field.has-suggestion .ghost-desc {
  color: transparent;
  caret-color: var(--ink);
  padding-right: 2.9rem;
}

.ledger-grid .desc-ghost-field.has-suggestion .desc-ghost-hint {
  padding-right: 2.9rem;
}

.ledger-grid .desc-ghost-tab {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  opacity: 0.5;
  margin: 0;
  padding: 0.08rem 0.32rem 0.1rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  font-size: 0.68rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.ledger-grid tr.ghost .cell-display.cycleable {
  font-style: normal;
  opacity: 1;
}

.ledger-grid .cell-display.cycleable {
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  padding: 0.15rem 0.25rem;
}

.ledger-grid .cell-display.cycleable:hover {
  background: rgba(30, 61, 52, 0.06);
  outline: 1px dashed rgba(30, 61, 52, 0.35);
}

.ledger-grid .cell-display.inline-editable {
  cursor: text;
  border-radius: 6px;
  padding: 0.15rem 0.25rem;
}

.ledger-grid .cell-display.inline-editable:hover {
  background: rgba(176, 137, 72, 0.16);
  outline: 1px dashed rgba(138, 100, 20, 0.45);
}

.ledger-grid .ghost-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ledger-grid .action-cell {
  width: 3.5rem;
  white-space: nowrap;
  text-align: center;
}

.ledger-grid .btn-save-ghost {
  min-width: 2rem;
}

.ledger-grid .btn-accept-ghost {
  font-size: 1.05rem;
  font-weight: 700;
}

.ledger-grid .col-check {
  width: 2.35rem;
  text-align: center;
}

.ledger-grid .ghost-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  opacity: 1;
  cursor: help;
  vertical-align: middle;
}

.ledger-grid .ghost-check-img {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.ledger-grid tr.ghost .ghost-check-icon {
  opacity: 1;
}

.ledger-grid .col-edit {
  width: 2.1rem;
  text-align: center;
}

/* Ellipsis on this narrow cell paints a dot between the pencil and the date. */
body.ledger-page .ledger-grid td.col-edit,
body.ledger-page .ledger-grid th.col-edit {
  overflow: visible;
  text-overflow: clip;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

.ledger-grid .btn-edit-entry {
  font-size: 1rem;
}

.ledger-grid .row-check,
.ledger-grid .flag-all-check {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
  vertical-align: middle;
}

.ledger-grid thead .col-check {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.ledger-grid thead .flag-all-check {
  margin: 0;
}

.ledger-grid .col-date {
  width: 7.25rem;
  white-space: nowrap;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.ledger-grid .col-note {
  /* +5px still clipped "Note" by 2px because .th-label keeps a right margin. */
  width: calc(2.6rem + 7px);
  text-align: center;
  white-space: nowrap;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.ledger-grid .col-desc {
  /* With table-layout:fixed, 100% claims leftover space after fixed columns. */
  width: 100%;
  min-width: 12rem;
}

.ledger-grid .col-type {
  width: 7.25rem;
  min-width: 7.25rem;
  white-space: nowrap;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  overflow: visible;
}

.ledger-grid .col-status {
  width: 8.5rem;
  min-width: 8.5rem;
  white-space: nowrap;
  overflow: visible;
}

.ledger-grid .col-amount {
  width: 5.75rem;
  white-space: nowrap;
}

.ledger-grid .col-tx,
.ledger-grid .col-due,
.ledger-grid .col-web,
.ledger-grid .col-note,
.ledger-grid .action-cell {
  text-align: center;
}

.ledger-grid .col-tx {
  width: 5.25rem;
  min-width: 5.25rem;
  white-space: nowrap;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  overflow: visible;
}

.ledger-grid .col-due {
  width: 3.5rem;
  white-space: nowrap;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
}

.ledger-grid .col-web {
  /* Previous 6px plus 5px so "Web" and the sort mark both fit. */
  width: calc(2.75rem + 11px);
  white-space: nowrap;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.ledger-grid .col-tx .cell-display,
.ledger-grid .col-due .cell-display,
.ledger-grid .col-web .cell-display,
.ledger-grid .action-cell .cell-display {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.ledger-grid .col-web .web-globe-link,
.ledger-grid .col-web .web-link {
  margin-left: auto;
  margin-right: auto;
}

.ledger-grid .web-link {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

.ledger-grid .web-globe-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--web-globe, #a8ff2a);
  text-decoration: none;
  filter: drop-shadow(0 0 2px rgba(168, 255, 42, 0.35));
}

.ledger-grid .web-globe-link:hover,
.ledger-grid .web-globe-link:focus {
  color: #d4ff7a;
  outline: none;
  transform: scale(1.08);
}

.ledger-grid .web-globe-icon {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
  object-fit: contain;
  color: inherit;
  overflow: visible;
  /* Keep lime if theme var missing; filter boosts neon wireframe look */
  filter: drop-shadow(0 0 1px var(--web-globe, #a8ff2a));
}

.ledger-grid th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.ledger-grid th .th-label {
  margin-right: 0.25rem;
}

.ledger-grid th .sort-ind {
  color: rgba(30, 61, 52, 0.55);
  font-size: 0.75rem;
}

.ledger-grid th.sorted-asc .sort-ind,
.ledger-grid th.sorted-desc .sort-ind,
.ledger-grid th.sortable:hover .th-label,
.ledger-grid th.sortable:hover .sort-ind {
  color: #1e3d34;
}

.options-section-title {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
  font-family: var(--font-display);
}

.theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0 0.75rem;
}

.theme-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
}

.theme-color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.9rem;
}

.theme-color-field input[type="color"] {
  width: 2.4rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.ledger-grid .web-empty,
.ledger-grid .due-readonly,
.ledger-grid .tx-readonly {
  color: var(--muted);
}

.ledger-grid tr.row-flagged,
.ledger-grid tr.row-selected {
  background: rgba(176, 137, 72, 0.22);
  box-shadow: inset 3px 0 0 #b08948;
}

.ledger-grid tbody tr.row-recurring-insert,
.ledger-grid tbody tr.row-recurring-insert > td {
  background: #f3e2c4;
  background-color: #f3e2c4;
}

.ledger-grid tbody tr.row-recurring-insert:hover,
.ledger-grid tbody tr.row-recurring-insert:hover > td {
  background: #ead3ae;
  background-color: #ead3ae;
}

.ledger-grid tr.row-flagged.ghost {
  background: rgba(176, 137, 72, 0.14);
}

.ledger-grid .cell-value-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.ledger-grid .col-amount,
.ledger-grid .cell-value-wrap.field-amount,
.ledger-grid .inline-edit.edit-amount {
  text-align: right;
  justify-content: flex-end;
}

.ledger-grid .inline-edit.edit-amount {
  width: 100%;
}

.ledger-grid .inline-input.amount-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  max-width: 7.5rem;
  margin-left: auto;
}

.ledger-grid .inline-input.date-input {
  cursor: pointer;
  max-width: 8.5rem;
}

.ledger-grid .cell-display[data-field="amount"] {
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
  text-align: right;
}

.ledger-grid .btn-pencil,
.ledger-grid .btn-check,
.ledger-grid .btn-cycle {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 8px;
  font: inherit;
  line-height: 1;
}

.ledger-grid .btn-pencil.btn-edit-entry {
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

.ledger-grid .btn-pencil:hover,
.ledger-grid .btn-check:hover {
  color: var(--accent);
  border-color: var(--line);
}

.ledger-grid .btn-cycle {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(30, 61, 52, 0.03);
  padding: 0.35rem 0.55rem;
}

.ledger-grid .btn-cycle:hover {
  border-color: var(--accent);
}

.ledger-grid .inline-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.ledger-grid .btn-check {
  color: #1e3d34;
  font-size: 1.05rem;
  font-weight: 700;
}

.ledger-grid tr.ledger-footer td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-bottom: none;
  border-top: 2px solid #1a2330;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  vertical-align: top;
  font-style: normal;
  opacity: 1;
  background: #f7f3ea;
  color: #1a2330;
  box-shadow: none;
}

.ledger-grid tr.ledger-footer .footer-label {
  color: #1e3d34;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.ledger-grid tr.ledger-footer .footer-caption {
  display: block;
  color: #5c6570;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}

.ledger-grid tr.ledger-footer .col-amount,
.ledger-grid tr.ledger-footer .footer-reconciled {
  text-align: right;
}

.ledger-grid tr.ledger-footer strong {
  display: block;
  font-variant-numeric: tabular-nums;
  color: #1a2330;
}

.ledger-grid tr.ledger-footer #footerBudgetTotal.total-positive {
  color: #1e3d34;
}

.ledger-grid tr.ledger-footer #footerBudgetTotal.total-negative {
  color: #8f3d3d;
}

.ledger-grid tr.ledger-footer #footerBudgetTotal.total-zero {
  color: #8a6414;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 92vw);
  height: 100vh;
  padding: 1.4rem 1.3rem;
  z-index: 40;
  transform: translateX(110%);
  opacity: 0.96;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1);
  overflow-y: auto;
}

.slide-panel .form-select {
  width: 100%;
  margin: 0.25rem 0 0.85rem;
}

.slide-panel.is-open {
  transform: translateX(0);
}

.check {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1rem;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn-gear {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(30, 61, 52, 0.04);
  color: var(--ink);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn-gear .gear-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.btn-gear:hover {
  transform: rotate(28deg);
  border-color: var(--accent);
  background: rgba(30, 61, 52, 0.08);
}

.options-form label {
  margin-top: 0;
}

.options-hint {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
}

/* jQuery UI dialog — paper ledger sheet */
.ui-dialog.budjet-dialog {
  background: #fbf8f2;
  background-image: none;
  border: 1px solid rgba(26, 35, 48, 0.16);
  border-radius: 2px;
  color: #1a2330;
  padding: 0;
  box-shadow: 0 18px 40px rgba(30, 40, 30, 0.12);
  overflow: hidden;
}

.ui-dialog.budjet-dialog .ui-dialog-titlebar {
  background: #f7f3ea;
  background-image: none;
  border: none;
  border-bottom: 2px solid #1e3d34;
  color: #1a2330;
  font-family: var(--font-display);
  border-radius: 0;
  padding: 0.85rem 1rem;
}

.ui-dialog.budjet-dialog .ui-dialog-title {
  font-size: 1.35rem;
  font-weight: 500;
  color: #1a2330;
}

.ui-dialog.budjet-dialog .ui-dialog-titlebar-close {
  background: transparent;
  background-image: none;
  border: 1px solid rgba(26, 35, 48, 0.28);
  border-radius: 2px;
  top: 50%;
  right: 0.7rem;
  width: 1.7rem;
  height: 1.7rem;
  margin: -0.85rem 0 0 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  text-indent: 0;
  overflow: hidden;
  color: transparent;
}

.ui-dialog.budjet-dialog .ui-dialog-titlebar-close .ui-icon,
.ui-dialog.budjet-dialog .ui-dialog-titlebar-close .ui-button-icon-space {
  display: none;
}

.ui-dialog.budjet-dialog .ui-dialog-titlebar-close::before {
  content: "\00d7";
  display: block;
  width: 100%;
  height: 1.7rem;
  font-family: Arial, sans-serif;
  font-size: 1.25rem;
  line-height: 1.5rem;
  text-align: center;
  text-indent: 0;
  color: #1a2330;
}

.ui-dialog.budjet-dialog .ui-dialog-content {
  background: transparent;
  background-image: none;
  color: #1a2330;
  padding: 1rem 1.1rem 1.2rem;
}

.ui-dialog.budjet-dialog.forgot-password-dialog .ui-dialog-content .field {
  width: 100%;
  box-sizing: border-box;
}

.ui-dialog.budjet-dialog.forgot-password-dialog #forgotPasswordMessage {
  margin: 0.75rem 0 0;
  min-height: 1.2rem;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane {
  background: #f7f3ea;
  background-image: none;
  border-top: 1px solid rgba(26, 35, 48, 0.12);
  margin: 0;
  padding: 0.7rem 1rem 0.9rem;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
  float: none;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.ui-button {
  margin: 0;
  border-radius: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 650;
  background: #1e3d34 !important;
  background-image: none !important;
  color: #f7f3ea !important;
  border: 1px solid #1e3d34 !important;
  padding: 0.55rem 0.95rem;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.ui-button:hover,
.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.ui-button:focus {
  background: #163229 !important;
  border-color: #163229 !important;
  color: #f7f3ea !important;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.ui-button:last-child:not(:first-child) {
  background: transparent !important;
  color: #1a2330 !important;
  border-color: rgba(26, 35, 48, 0.4) !important;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.ui-button:last-child:not(:first-child):hover,
.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.ui-button:last-child:not(:first-child):focus {
  background: transparent !important;
  color: #1e3d34 !important;
  border-color: #1e3d34 !important;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.btn-dialog-delete {
  background: transparent !important;
  color: #8f3d3d !important;
  border-color: #8f3d3d !important;
}

.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.btn-dialog-delete:hover,
.ui-dialog.budjet-dialog .ui-dialog-buttonpane button.btn-dialog-delete:focus {
  background: #8f3d3d !important;
  border-color: #8f3d3d !important;
  color: #f7f3ea !important;
}

.ui-widget-overlay {
  background: #000;
  opacity: 0.8;
}

.ui-widget-overlay.budjet-overlay-hidden {
  background: transparent;
  opacity: 0;
}

body.ledger-page .top-bar {
  flex: 0 0 auto;
  margin: 0.4rem 0.55rem 0.35rem;
  padding: 0.4rem 0.75rem;
  gap: 0.55rem;
}

body.ledger-page .brand-inline {
  font-size: 1.35rem;
}

body.ledger-page .app-grid {
  gap: 0.5rem;
  padding: 0 0.55rem 0.4rem;
}

body.ledger-page .side-panel,
body.ledger-page .main-panel {
  padding: 0.5rem 0.65rem 0.55rem;
}

body.ledger-page .period-toolbar {
  gap: 0.45rem;
}

body.ledger-page .ledger-grid th,
body.ledger-page .ledger-grid td {
  padding: 0.32rem 0.4rem;
}

body.ledger-page .ledger-grid .compact-field {
  padding: 0.25rem 0.4rem;
  font-size: 0.92em;
}

body.ledger-page .ledger-grid .desc-ghost-hint {
  padding: 0.25rem 0.4rem;
  font-size: 0.92em;
}

body.ledger-page .ledger-grid tr.ledger-footer td {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

body.ledger-page .site-footer {
  padding: 0.3rem 0.6rem 0.4rem;
}

@media (max-width: 900px) {
  body.ledger-page,
  body.ledger-page form#form1 {
    height: auto;
    min-height: 100vh;
  }

  body.ledger-page form#form1 {
    width: 100%;
    max-width: 100%;
  }

  .period-toolbar {
    flex-wrap: wrap;
  }

  .calendar-strip {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    overflow-x: auto;
  }

  .ledger-calendar {
    /* Keep the fixed three-pane width; strip scrolls on small screens. */
    flex: 0 0 auto;
  }

  .period-toolbar-aside {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  .app-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .side-panel {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .main-panel {
    height: auto;
    max-height: none;
    min-height: 60vh;
  }

  .table-wrap {
    min-height: 50vh;
  }

  .top-bar {
    margin: 0.75rem;
  }
}

.ledger-note-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent-2, #8a6414);
  padding: 0.15rem;
  margin: 0;
  cursor: pointer;
  line-height: 0;
  border-radius: 6px;
}

.ledger-note-btn:hover,
.ledger-note-btn:focus {
  outline: none;
  background: rgba(30, 61, 52, 0.08);
  color: var(--accent, #1e3d34);
}

.ledger-note-icon {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.recurring-notes {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  box-sizing: border-box;
}

.recurring-note-view {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  color: var(--ink);
  max-height: 22rem;
  overflow: auto;
}

.form-ok {
  color: var(--accent-2);
  min-height: 1.2rem;
}

body.auth-scroll .center-stage {
  place-items: start center;
  align-content: start;
  overflow: auto;
}

.splash-stack {
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.plan-board {
  width: 100%;
  opacity: 0;
  transform: translateY(28px);
}

.plan-board.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(.2,.8,.2,1);
}

.plan-board-title {
  margin: 0;
  text-align: center;
}

.plan-board-note {
  margin: 0.35rem 0 0.8rem;
  text-align: center;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.plan-card {
  display: block;
  padding: 1rem 1.05rem 1.1rem;
  color: inherit;
  text-decoration: none;
}

.plan-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.55rem;
}

.plan-name-copper::first-letter {
  color: #b8612d;
}

.plan-name-silver::first-letter {
  color: #3f5c73;
}

.plan-name-gold::first-letter {
  color: #8a6414;
}

.plan-price {
  margin: 0.35rem 0;
  font-size: 1.8rem;
  color: var(--accent-2);
}

.plan-price span {
  font-size: 0.9rem;
  color: var(--muted);
}

.plan-card p:last-child {
  margin: 0;
  color: var(--muted);
}

.plan-card:hover,
.plan-card:focus {
  border-color: var(--accent);
}

.register-panel {
  width: min(640px, 100%);
}

.plan-pick {
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 1rem 0 0.2rem;
  padding: 0.7rem 0.9rem 0.85rem;
}

.plan-pick legend {
  padding: 0 0.4rem;
  color: var(--muted);
}

label.plan-option {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.45rem 0;
  color: var(--ink);
  cursor: pointer;
}

.plan-option input {
  margin-top: 0.25rem;
  width: auto;
}

.approval-panel {
  width: min(1360px, 100%);
}

.approval-table-wrap {
  overflow-x: auto;
  margin-top: 0.8rem;
}

.approval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.approval-table th,
.approval-table td {
  text-align: left;
  vertical-align: middle;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.approval-table th {
  color: #1e3d34;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.approval-table .field,
.approval-table select,
.approval-table input[type="date"],
.approval-table input[type="text"],
.approval-table input[type="password"] {
  width: 100%;
  min-width: 8.5rem;
  color-scheme: light;
}

.approval-table input[name^="password_"] {
  min-width: 7.5rem;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.plan-tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent-2);
  font-size: 0.75rem;
}

@media (max-width: 720px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

.plan-mark {
  flex: 0 0 auto;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #111;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18), 0 6px 16px rgba(0, 0, 0, 0.28);
}

.plan-mark-copper {
  background: linear-gradient(145deg, #f6d2b3, #d4894f 55%, #8d4b22);
}

.plan-mark-silver {
  background: linear-gradient(145deg, #ffffff, #d5dde6 55%, #8e9aab);
}

.plan-mark-gold {
  background: linear-gradient(145deg, #fff6cf, #f0c75e 55%, #b8860b);
}

.plan-mark:hover,
.plan-mark:focus {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.plan-current {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.plan-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.plan-dialog-actions .btn {
  width: 100%;
}

#planMonthsWrap[hidden] {
  display: none;
}

.approval-panel .dataTables_wrapper {
  color: var(--ink);
  margin-top: 0.6rem;
}

.approval-panel .dataTables_filter,
.approval-panel .dataTables_info,
.approval-panel .dataTables_paginate {
  color: var(--muted);
  margin: 0.45rem 0;
}

.approval-panel .dataTables_filter input {
  margin-left: 0.4rem;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.35rem 0.55rem;
}

.approval-panel table.dataTable tbody tr,
.approval-panel table.dataTable.display tbody tr.odd,
.approval-panel table.dataTable.stripe tbody tr.odd {
  background-color: #fbf8f2;
}

.approval-panel table.dataTable.display tbody tr.even,
.approval-panel table.dataTable.stripe tbody tr.even {
  background-color: #f7f3ea;
}

.approval-panel table.dataTable.display tbody tr:hover,
.approval-panel table.dataTable.hover tbody tr:hover {
  background-color: rgba(176, 137, 72, 0.16);
}

.approval-panel table.dataTable thead th {
  color: #1e3d34;
  border-bottom: 2px solid #1e3d34;
  background: #f7f3ea;
}

.approval-panel table.compact.dataTable {
  width: 100% !important;
}

.approval-panel table.compact.dataTable thead th,
.approval-panel table.compact.dataTable tbody td {
  padding: 0.35rem 0.4rem;
}

.approval-panel .dataTables_paginate .paginate_button {
  color: var(--ink) !important;
}

.approval-panel .dataTables_paginate .paginate_button.current,
.approval-panel .dataTables_paginate .paginate_button.current:hover {
  color: #f7f3ea !important;
  background: #1e3d34 !important;
  border-color: #1e3d34 !important;
}

body.splash-page {
  color: #1a2330;
  background-color: #f4efe4;
  background-image:
    linear-gradient(rgba(30, 61, 52, 0.045) 1px, transparent 1px);
  background-size: 100% 32px;
  background-attachment: fixed;
}

body.splash-page::before {
  content: "";
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: #1e3d34;
}

body.splash-page::after {
  content: "";
  position: fixed;
  z-index: 3;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #b08948;
}

body.splash-page .bg-layer {
  display: none;
}

body.splash-page form#form1 {
  padding-left: 28px;
}

body.splash-page .splash-stage {
  place-items: start center;
  align-content: start;
  padding: 1.6rem 1.5rem 2.2rem;
}

body.splash-page .splash-stack {
  width: min(1080px, 100%);
  align-items: stretch;
  gap: 2.2rem;
}

body.splash-page .desk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(26, 35, 48, 0.16);
}

body.splash-page .desk-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

body.splash-page .desk-mark {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  filter: brightness(0);
}

body.splash-page .desk-login {
  color: #1a2330;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  border-bottom: 1px solid #b08948;
  padding-bottom: 0.12rem;
}

body.splash-page .desk-login:hover,
body.splash-page .desk-login:focus {
  color: #1e3d34;
}

body.splash-page .splash-panel {
  width: 100%;
  max-width: none;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  transform: none;
}

body.splash-page .desk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 2.4rem;
  align-items: center;
}

body.splash-page .desk-kicker {
  margin: 0 0 0.7rem;
  color: #1e3d34;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

body.splash-page h1 {
  margin: 0;
  color: #1a2330;
  font-size: clamp(2.5rem, 5vw, 4.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.98;
  max-width: 12ch;
}

body.splash-page .desk-copy .tagline {
  margin: 1rem 0 0;
  max-width: 36ch;
  color: #3d4754;
  font-size: 1.05rem;
  line-height: 1.5;
}

body.splash-page .desk-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  color: #3d4754;
  font-size: 0.92rem;
}

body.splash-page .desk-index span {
  display: block;
  color: #8a6414;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

body.splash-page .cta-row {
  margin-top: 1.5rem;
}

body.splash-page .btn {
  border-radius: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 0.78rem 1.15rem;
}

body.splash-page .btn.primary {
  background: #1e3d34;
  color: #f7f3ea;
  border-color: #1e3d34;
}

body.splash-page .btn.ghost {
  background: transparent;
  color: #1a2330;
  border-color: rgba(26, 35, 48, 0.45);
}

body.splash-page .btn.primary:hover,
body.splash-page .btn.primary:focus {
  background: #163229;
}

body.splash-page .btn.ghost:hover,
body.splash-page .btn.ghost:focus {
  border-color: #1e3d34;
  color: #1e3d34;
}

body.splash-page .ledger-sheet {
  background: #fbf8f2;
  border: 1px solid rgba(26, 35, 48, 0.16);
  box-shadow: 0 18px 40px rgba(30, 40, 30, 0.08);
  padding: 1.1rem 1.15rem 0.95rem;
  position: relative;
}

body.splash-page .ledger-sheet::before {
  content: "014";
  position: absolute;
  right: 0.8rem;
  top: 0.35rem;
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 1;
  color: rgba(30, 61, 52, 0.07);
  pointer-events: none;
}

body.splash-page .sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid #1e3d34;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #1e3d34;
}

body.splash-page .sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

body.splash-page .sheet-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c6570;
  padding: 0.35rem 0.3rem;
  border-bottom: 1px solid rgba(26, 35, 48, 0.2);
}

body.splash-page .sheet-table td {
  padding: 0.48rem 0.3rem;
  border-bottom: 1px solid rgba(26, 35, 48, 0.1);
}

body.splash-page .sheet-table th:last-child,
body.splash-page .sheet-table td:last-child {
  text-align: right;
}

body.splash-page .sheet-table .is-credit {
  color: #1e3d34;
}

body.splash-page .sheet-table tfoot td {
  border-bottom: 0;
  border-top: 2px solid #1a2330;
  font-weight: 650;
  padding-top: 0.6rem;
}

body.splash-page .sheet-note {
  margin: 0.7rem 0 0;
  color: #5c6570;
  font-size: 0.78rem;
}

body.splash-page .plan-board {
  opacity: 1;
  transform: none;
}

body.splash-page .plan-board-head {
  text-align: center;
  margin-bottom: 0.9rem;
}

body.splash-page .plan-board-title {
  color: #1a2330;
  font-size: 2rem;
}

body.splash-page .plan-board-note {
  color: #3d4754;
}

body.splash-page .plan-card {
  background: #fbf8f2;
  border: 1px solid rgba(26, 35, 48, 0.14);
  border-radius: 2px;
  box-shadow: none;
  padding: 1.05rem 1.1rem 1.15rem;
  color: #1a2330;
  min-height: 100%;
}

body.splash-page .plan-card:hover,
body.splash-page .plan-card:focus {
  border-color: #1e3d34;
  transform: translateY(-2px);
}

body.splash-page .plan-folio {
  margin: 0 0 0.55rem;
  color: #8a6414;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

body.splash-page .plan-card h3 {
  color: #1a2330;
  font-size: 1.85rem;
}

body.splash-page .plan-price {
  color: #1a2330;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
}

body.splash-page .plan-price span,
body.splash-page .plan-card p:last-child {
  color: #3d4754;
}

body.splash-page .desk-tour {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 1.6rem;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(26, 35, 48, 0.16);
}

body.splash-page .desk-tour h2 {
  margin: 0;
  color: #1a2330;
  font-size: 2rem;
}

body.splash-page .desk-tour .tagline {
  margin: 0.6rem 0 0;
  max-width: 42ch;
  color: #3d4754;
}

body.splash-page .promo-block {
  margin: 0;
}

body.splash-page .promo-frame {
  max-width: none;
  border-radius: 2px;
  border-color: rgba(26, 35, 48, 0.2);
  background: #1a2330;
}

body.splash-page .promo-play {
  color: #f7f3ea;
  background: rgba(26, 35, 48, 0.28);
}

body.splash-page .promo-play-icon {
  background: #1e3d34;
}

body.splash-page .promo-play-icon::after {
  border-color: transparent transparent transparent #f7f3ea;
}

body.splash-page .promo-controls {
  background: #1a2330;
}

body.splash-page .promo-ctrl {
  color: #f7f3ea;
  border-color: rgba(247, 243, 234, 0.35);
}

body.splash-page .site-footer {
  color: #5c6570;
  border-top: 1px solid rgba(26, 35, 48, 0.12);
}

body.splash-page .site-footer .footer-brand,
body.splash-page .site-footer a {
  color: #3d4754;
}

body.splash-page .site-footer .footer-brand-mark {
  filter: brightness(0);
}

@media (max-width: 800px) {
  body.splash-page .desk-hero,
  body.splash-page .desk-tour {
    grid-template-columns: 1fr;
  }

  body.splash-page h1 {
    max-width: none;
  }
}
