/* Live app pieces: small working versions of the app's screens, in place of
   screenshots. They render their final state without JavaScript; live.js
   adds the motion and the interaction (and skips the motion for visitors
   who prefer reduced motion). */
.lv {
  --ink: #17221e;
  --muted: #56665d;
  --line: #e7e2d7;
  --paper: #fbf9f4;
  --forest: #1e4a3c;
  --gold: #f0b91e;
  --good: #2e7d5b;
  --bad: #c0392b;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.lv *,
.lv *::before,
.lv *::after {
  box-sizing: border-box;
}
.lv button {
  font: inherit;
  color: inherit;
}
.lv-display {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.lv-muted {
  color: var(--muted);
}
.lv-ring-track {
  fill: none;
  stroke: #ece6da;
}
.lv-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 100;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* "Try it" cue: only once the piece is live, gone after the first touch. */
.lv-try {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lv-on .lv-try {
  display: block;
}
.lv-used .lv-try {
  opacity: 0;
}

/* Bill */
.lv-bill {
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.lv-bill-amt {
  font-size: 48px;
  line-height: 1;
}
.lv-bill-name {
  font-size: 20px;
  font-weight: 600;
}
.lv-bill .lv-muted {
  font-size: 13px;
  line-height: 1.35;
}
.lv-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 6px;
}
.lv-chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
}
.lv-chip-soft {
  background: #efeae1;
  border-color: #efeae1;
  color: var(--muted);
  font-weight: 600;
}
.lv-saved {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.2s, transform 0.2s;
}
.lv-saved:hover {
  box-shadow: 0 6px 18px rgba(23, 34, 30, 0.08);
}
.lv-saved:active {
  transform: scale(0.98);
}
.lv-saved svg {
  flex: 0 0 auto;
}
.lv-saved-pct {
  font-size: 15px;
}
.lv-saved-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lv-saved-title {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lv-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5f1ea;
  color: var(--good);
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
}
.lv-saved-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Budget */
.lv-budget {
  width: calc(100% - 24px);
  margin: 0 12px;
  padding: 16px;
  border-radius: 22px;
  background: var(--forest);
  color: #fff;
}
.lv-budget-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lv-budget svg {
  flex: 0 0 auto;
}
.lv-budget .lv-ring-track {
  stroke: rgba(255, 255, 255, 0.16);
}
.lv-budget-left {
  font-size: 19px;
  fill: #fff;
}
.lv-budget-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.lv-budget-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.lv-budget-meta {
  white-space: nowrap;
  flex-wrap: wrap;
  row-gap: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}
.lv-budget-chip {
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 600;
}
.lv-budget-spent {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}
.lv-scrub {
  display: none;
  margin-top: 14px;
}
.lv-on .lv-scrub {
  display: block;
}
.lv-scrub label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 4px;
}
.lv-scrub input {
  width: 100%;
  margin: 0;
  accent-color: var(--gold);
  cursor: grab;
}
.lv-scrub input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Debt chart */
.lv-debt {
  padding: 14px 14px 10px;
}
.lv-debt-title {
  margin: 0 0 4px;
  font-size: 17px;
}
.lv-chart {
  position: relative;
  touch-action: pan-y;
  cursor: crosshair;
  border-radius: 8px;
}
.lv-chart:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.lv-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.lv-grid {
  stroke: #ece6da;
  stroke-width: 1;
}
.lv-axis {
  font: 11px Inter, system-ui, sans-serif;
  fill: var(--muted);
}
.lv-obs-area {
  fill: #f6d5d0;
}
.lv-obs-line {
  fill: none;
  stroke: #d2463a;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.lv-target {
  fill: none;
  stroke: #56665d;
  stroke-width: 2;
  stroke-dasharray: 6 5;
}
.lv-today {
  fill: #d2463a;
  stroke: #fff;
  stroke-width: 2;
}
.lv-today-label {
  font: 600 12px Inter, system-ui, sans-serif;
  fill: #c0392b;
}
.lv-target-label {
  font: 600 11px Inter, system-ui, sans-serif;
  fill: var(--muted);
}
.lv-mark line {
  stroke: var(--ink);
  stroke-width: 1.5;
}
.lv-mark circle {
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 2;
}
.lv-tip {
  position: absolute;
  top: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.lv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
}
.lv-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lv-key-obs {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: #f6d5d0;
  border-top: 3px solid #d2463a;
}
.lv-key-target {
  width: 16px;
  border-top: 2px dashed var(--muted);
}

/* Recurring */
.lv-rec {
  padding: 14px;
}
.lv-seg {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.lv-seg button {
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.lv-seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.lv-seg button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}
.lv-rec-card {
  margin-top: 12px;
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: #fff;
}
.lv-rec-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.lv-rec-row div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lv-rec-row div:last-child {
  text-align: right;
}
.lv-rec-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.lv-rec-num {
  font-size: 26px;
}
.lv-in {
  color: var(--good);
}
.lv-out-neg {
  color: var(--bad);
}
.lv-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #dcd4c6;
}
.lv-bar span {
  background: var(--good);
}

/* Inbox */
.lv-inbox {
  padding: 4px 16px;
  border-radius: 22px;
  background: #fff;
}
.lv-item {
  border-bottom: 1px solid var(--line);
}
.lv-item:last-child {
  border-bottom: 0;
}
.lv-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  background: none;
  text-align: left;
}
button.lv-row {
  cursor: pointer;
}
button.lv-row:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 8px;
}
.lv-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fbe3df;
  color: #d2463a;
  transition: background 0.3s, color 0.3s;
}
.lv-icon-plain {
  background: #efeae1;
  color: var(--ink);
}
.lv-row-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lv-row-title {
  font-weight: 600;
  font-size: 15px;
}
.lv-row-sub {
  font-size: 13px;
  color: var(--muted);
}
.lv-row-amt {
  font-size: 19px;
}
.lv-chev {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.25s;
}
[aria-expanded="true"] .lv-chev {
  transform: rotate(90deg);
}
.lv-fix {
  padding: 0 0 14px 52px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lv-fix[hidden] {
  display: none;
}
.lv-fix-note {
  font-size: 12px;
  color: var(--muted);
}
.lv-opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lv-opt:hover {
  border-color: var(--forest);
}
.lv-opt:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.lv-opt strong {
  font-size: 14px;
}
.lv-opt span {
  font-size: 12px;
  color: var(--muted);
}
.lv-confirm {
  display: flex;
  gap: 8px;
}
.lv-btn {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: #fff !important;
  font-weight: 600;
  cursor: pointer;
}
.lv-btn-ghost {
  background: #fff;
  color: var(--ink) !important;
  border-color: var(--line);
}
.lv-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.lv-done .lv-icon {
  background: #e5f1ea;
  color: var(--good);
}
.lv-done .lv-row-title {
  color: var(--good);
}

/* Sharing */
.lv-share {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lv-share fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lv-share legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.lv-opt-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.25s;
}
.lv-opt-card:has(input:checked) {
  border-color: var(--forest);
}
.lv-opt-card:has(input:focus-visible) {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.lv-opt-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lv-radio {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 999px;
  border: 1.5px solid #8a8577;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.lv-radio svg {
  opacity: 0;
  transition: opacity 0.2s;
}
.lv-opt-card:has(input:checked) .lv-radio {
  background: var(--forest);
  border-color: var(--forest);
}
.lv-opt-card:has(input:checked) .lv-radio svg {
  opacity: 1;
}
.lv-opt-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lv-opt-text strong {
  font-size: 16px;
}
.lv-opt-text span {
  font-size: 13px;
  color: var(--muted);
}
.lv-opt-text .lv-until {
  color: var(--good);
  font-weight: 600;
}
.lv-sees {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f3efe6;
  font-size: 13px;
}
.lv-sees-head {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 6px;
}
.lv-tx {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--muted);
  transition: filter 0.35s, opacity 0.35s;
}
.lv-share[data-mode="totals"] .lv-tx {
  filter: blur(5px);
  opacity: 0.45;
}
.lv-sees-note {
  margin-top: 4px;
  color: var(--muted);
}

/* Entry motion: set by live.js only when motion is welcome. */
.lv-enter {
  opacity: 0;
  transform: translateY(10px);
}
.lv-entered {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .lv *,
  .lv *::before,
  .lv *::after {
    transition: none !important;
  }
}

.lv-debt .lv-try {
  display: none;
}
.lv-inbox {
  padding-top: 34px !important;
}
.lv-share {
  padding-top: 40px;
}
