/* HomeBase — a light banking site inside a TiraOS window.
   Prefix is hb- but not .hb, .hb-nav, or .hb-page: those belong to the Handbook. */
.hb-app {
  --hb-accent: #f97316;
  --hb-accent-d: #ea580c;
  --hb-ink: #431407;
  --hb-text: #7c2d12;
  --hb-muted: #78716c;
  --hb-line: #fed7aa;
  --hb-bg: #fff7ed;
  --hb-neg: #b91c1c;
  --hb-pos: #166534;
  flex: 1;
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--hb-bg);
  color: var(--hb-ink);
  font: 14px/1.5 var(--sans);
}
.hb-app h1, .hb-app h2, .hb-app h3, .hb-app p { margin: 0; }
.hb-app h1 { font-size: 28px; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.hb-app h2 { font-size: 20px; letter-spacing: -.02em; }
.hb-app h3 { font-size: 16px; line-height: 1.3; }
.hb-app button, .hb-app input { font-family: inherit; }

.hb-chrome, .hb-top, .hb-main { min-width: 0; }
.hb-chrome { display: flex; align-items: center; gap: 12px; padding: 7px 12px; background: #ffedd5; border-bottom: 1px solid #fdba74; flex: none; }
.hb-dots { display: flex; gap: 6px; flex: none; }
.hb-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.hb-dots i:nth-child(1) { background: #ff5f57; }
.hb-dots i:nth-child(2) { background: #febc2e; }
.hb-dots i:nth-child(3) { background: #28c840; }
.hb-url { flex: 1; min-width: 0; background: #fff; border-radius: 16px; padding: 5px 14px; font: 12px var(--mono); color: #44403c; display: flex; gap: 8px; align-items: center; overflow: hidden; white-space: nowrap; }
.hb-lock { display: grid; place-items: center; color: #a8a29e; flex: none; }
.hb-lock svg { display: block; }

.hb-top { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px 14px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--hb-line); min-height: 54px; flex: none; }
.hb-brand { display: flex; align-items: center; gap: 8px; flex: none; font-weight: 600; font-size: 20px; letter-spacing: -.03em; color: var(--hb-ink); }
.hb-brand b { font-weight: 800; }
.hb-glyph { display: grid; place-items: center; width: 26px; height: 26px; }
.hb-glyph svg { display: block; }
.hb-tabs { display: flex; gap: 2px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.hb-tabs::-webkit-scrollbar { display: none; }
.hb-tabs button { flex: none; background: none; border: 0; border-bottom: 3px solid transparent; height: 48px; padding: 0 12px; font: 600 13.5px var(--sans); color: var(--hb-muted); cursor: pointer; white-space: nowrap; }
.hb-tabs button:hover { color: var(--hb-ink); }
.hb-tabs button.on { color: var(--hb-ink); border-bottom-color: var(--hb-accent); }
.hb-pill { margin-left: auto; flex: none; display: flex; align-items: baseline; gap: 8px; background: #fff7ed; border: 1px solid var(--hb-line); color: var(--hb-ink); border-radius: 999px; padding: 6px 12px 6px 14px; font-size: 12.5px; }
.hb-pill b { font-size: 15px; color: var(--hb-accent-d); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hb-pill b::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px #16a34a22; vertical-align: 1px; }
.hb-pill b.hb-neg { color: var(--hb-neg); }
.hb-pill b.hb-neg::before { background: var(--hb-neg); box-shadow: 0 0 0 3px #b91c1c22; }

.hb-main { flex: 1; min-height: 0; overflow: auto; padding: 20px 22px 32px; scrollbar-color: #fdba74 transparent; }
.hb-main::-webkit-scrollbar-thumb { background-color: #fdba74; }
.hb-main > * { min-width: 0; }

.hb-kicker { font: 700 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hb-accent-d); }
.hb-muted, .hb-meta, .hb-note, .hb-now { color: var(--hb-muted); }
.hb-head p, .hb-note { margin-top: 4px; color: var(--hb-text); }
.hb-stack, .hb-overview { display: flex; flex-direction: column; gap: 14px; }
.hb-neg { color: var(--hb-neg); }
.hb-pos { color: var(--hb-pos); }

.hb-card { background: #fff; border: 1px solid var(--hb-line); border-radius: 12px; padding: 16px; box-shadow: 0 8px 24px #4314070e; min-width: 0; }
.hb-cards, .hb-options, .hb-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 14px;
}
.hb-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.hb-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 92px), 1fr)); gap: 8px 12px; margin: 8px 0 12px; }
.hb-cards > *, .hb-options > * { min-width: 0; }

.hb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; max-width: 100%; padding: 8px 16px; border-radius: 999px; border: 1px solid #fdba74; background: #fff; color: var(--hb-ink); font: 600 13.5px/1.3 var(--sans); cursor: pointer; text-align: center; }
.hb-btn:hover:not(:disabled) { background: #fff7ed; border-color: var(--hb-accent); }
.hb-btn:focus-visible, .hb-tabs button:focus-visible, .hb-choice:focus-visible, .hb-filter:focus-visible, .hb-switch input:focus-visible + i { outline: 2px solid var(--hb-accent-d); outline-offset: 2px; }
.hb-btn.hb-primary { background: var(--hb-accent-d); border-color: var(--hb-accent-d); color: #fff; }
.hb-btn.hb-primary:hover:not(:disabled) { background: #c2410c; border-color: #c2410c; }
.hb-btn:disabled { background: #f5f5f4; color: #a8a29e; border-color: #e7e5e4; cursor: default; }

.hb-hello { position: relative; overflow: hidden; border: 1px solid var(--hb-line); border-radius: 16px; padding: 22px 24px; background: radial-gradient(420px 160px at 100% 0%, #fed7aa 0%, transparent 70%), linear-gradient(180deg, #fff, #fff7ed); }
.hb-balance-k { margin-top: 14px; font-size: 12.5px; color: var(--hb-muted); }
.hb-balance { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hb-figure { margin: 6px 0 2px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hb-card-act, .hb-pay { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%; }
.hb-card-act { margin-top: 12px; }
.hb-hint, .hb-error { font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.hb-card > .hb-error { margin-top: 8px; }
.hb-hint { color: #9a3412; }
.hb-error { color: var(--hb-neg); }

.hb-bar { height: 10px; border-radius: 99px; background: #ffedd5; overflow: hidden; }
.hb-bar i { display: block; height: 100%; width: 0; background: var(--hb-accent); border-radius: 99px; }
.hb-bar i.hb-over { background: var(--hb-neg); }
.hb-metrics span { display: block; color: var(--hb-muted); font-size: 12px; }
.hb-metrics b { font-size: 15px; font-variant-numeric: tabular-nums; }

.hb-auto { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.hb-auto-copy { min-width: 0; }
.hb-auto-copy b { display: block; font-size: 15px; }
.hb-auto-copy span { display: block; margin-top: 2px; color: var(--hb-text); font-size: 13.5px; }
.hb-switch { position: relative; width: 44px; height: 26px; flex: none; }
.hb-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.hb-switch i { display: block; height: 100%; border-radius: 99px; background: #d6d3d1; transition: background .15s; }
.hb-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .15s; }
.hb-switch input:checked + i { background: var(--hb-accent); }
.hb-switch input:checked + i::after { transform: translateX(18px); }

.hb-sec-h, .hb-st-h, .hb-cat-h, .hb-st-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hb-sec-h { justify-content: space-between; margin-bottom: 4px; }
.hb-sec-h h2 { font-size: 16px; }
.hb-lines { min-width: 0; overflow-x: auto; }
.hb-line { display: grid; grid-template-columns: 4.8rem minmax(0, 1fr) auto; gap: 8px 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid #ffedd5; min-width: 0; }
.hb-when { color: var(--hb-muted); font-variant-numeric: tabular-nums; }
.hb-what { overflow-wrap: anywhere; }
.hb-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.hb-st-h { justify-content: space-between; }
.hb-meta { margin-top: 4px; font-size: 13px; }
.hb-items { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.hb-items li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; min-width: 0; }
.hb-items li > span:first-child { min-width: 0; }
.hb-items .hb-muted { display: block; font-size: 12.5px; }
.hb-st-foot { justify-content: space-between; align-items: flex-end; margin-top: 4px; padding-top: 12px; border-top: 1px solid #ffedd5; }
.hb-total span { display: block; font-size: 12px; color: var(--hb-muted); }
.hb-total b { font-size: 18px; font-variant-numeric: tabular-nums; }
.hb-pay { align-items: flex-end; margin-left: auto; }
.hb-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font: 700 11px var(--sans); letter-spacing: .02em; flex: none; }
.hb-due { background: #ffedd5; color: #c2410c; }
.hb-paid { background: #dcfce7; color: var(--hb-pos); }
.hb-late { background: #fee2e2; color: var(--hb-neg); }
.hb-optional { background: #f5f5f4; color: #57534e; }

.hb-cat-h { margin-bottom: 8px; }
.hb-now { margin-left: auto; font-size: 13px; overflow-wrap: anywhere; }
.hb-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; min-height: 100%; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid #fed7aa; background: #fff; color: var(--hb-ink); cursor: pointer; }
.hb-choice:hover { border-color: var(--hb-accent); background: #fffaf5; }
.hb-choice.on { border-color: var(--hb-accent); background: #fff7ed; box-shadow: 0 0 0 1px var(--hb-accent); }
.hb-choice .hb-muted { font-size: 12.5px; }
.hb-price { margin-top: auto; padding-top: 8px; font-weight: 800; color: #c2410c; font-variant-numeric: tabular-nums; }

.hb-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-filter { border: 1px solid #fed7aa; background: #fff; color: var(--hb-text); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--sans); cursor: pointer; }
.hb-filter:hover { border-color: var(--hb-accent); }
.hb-filter.on { background: #c2410c; border-color: #c2410c; color: #fff; }
.hb-sheet { width: 100%; max-width: 100%; overflow-x: auto; }
.hb-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hb-table th, .hb-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ffedd5; vertical-align: top; }
.hb-table th { font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--hb-muted); }
.hb-table td:nth-child(2) { overflow-wrap: anywhere; }
.hb-table .hb-num { text-align: right; white-space: nowrap; font-weight: 700; }

.hb-empty { max-width: 440px; margin: 48px auto; text-align: center; background: #fff; border: 1px solid var(--hb-line); border-radius: 12px; padding: 36px 24px; box-shadow: 0 8px 24px #4314070e; color: var(--hb-text); }

@container win (max-width: 640px) {
  .hb-main { padding: 14px 12px 28px; }
  .hb-hello { padding: 16px; }
  .hb-balance { font-size: 32px; }
  .hb-brand { font-size: 17px; }
  .hb-st-foot { align-items: flex-start; }
  .hb-pay { margin-left: 0; align-items: flex-start; }
}
@container win (max-width: 640px) {
  .hb-top { flex-wrap: wrap; padding: 4px 10px 0; }
  .hb-tabs { order: 3; flex: 1 0 100%; }
  .hb-tabs button { height: 42px; padding: 0 10px; }
  .hb-pill { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-switch i, .hb-switch i::after, .hb-bar i { transition: none; }
}

/* plan pictures and perks */
.hb-choice { padding: 0 0 12px; overflow: hidden; }
.hb-choice > :not(.hb-pic) { margin-left: 12px; margin-right: 12px; }
.hb-pic { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #fde7d2; margin-bottom: 6px; transition: transform .25s ease; }
.hb-choice:not(:disabled):hover .hb-pic { transform: scale(1.03); }
.hb-perk { font-size: 12.5px; color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 6px 8px; }
.hb-choice.locked { cursor: not-allowed; opacity: .6; }
.hb-choice.locked .hb-pic { filter: grayscale(1); }
.hb-lock-note { font-size: 12px; font-weight: 700; color: var(--hb-muted); }
.hb-perks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.hb-perks li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 13px; color: #166534; }
.hb-perks b { color: var(--hb-ink); }
