/* DVC Banking and Borrowing Calculator (/dvc-banking-borrowing). Mark, Oct 15 2026.
   House style: navy #203864 accent, gold #C9A84C small accents, cream #FAF7F2 surface, 2px radius. */
.bbp, #bbc {
    --surface-0: #FAF7F2; --surface-1: #F3EEE4; --surface-2: #FFFFFF;
    --text-primary: #1B1B1B; --text-secondary: #555; --text-muted: #888;
    --text-accent: #203864; --bg-accent: #E6EBF3; --border-accent: #203864; --fill-accent: #203864; --on-accent: #FFFFFF;
    --gold: #C9A84C;
    --text-success: #15803d; --bg-success: #EAF5EE; --text-warning: #8A6D1F; --text-danger: #A32D2D; --bg-danger: #FCEBEB;
    --border: rgba(0,0,0,.12); --border-strong: rgba(0,0,0,.22); --radius: 2px;
}

/* Page frame */
.bbp { background: var(--surface-0); font-family: 'Jost', sans-serif; color: var(--text-primary); }
.bbp-wrap { max-width: 1000px; margin: 0 auto; padding: 40px 24px 56px; }
.bbp h1, .bbp h2 { font-family: 'Cormorant Garamond', serif; color: #203864; font-weight: 600; }
.bbp h1 { font-size: 40px; line-height: 1.15; margin: 0 0 10px; }
.bbp h1::after { content: ''; display: block; width: 64px; height: 2px; background: var(--gold); margin-top: 12px; }
.bbp-intro { font-size: 17px; line-height: 1.6; color: var(--text-secondary); margin: 0 0 24px; max-width: 760px; }
.bbp-calc { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 20px; }
.bbp-explain { margin-top: 40px; }
.bbp-explain h2 { font-size: 28px; margin: 28px 0 8px; }
.bbp-explain p, .bbp-explain li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); }
.bbp-explain ul { padding-left: 20px; margin: 0; list-style: disc; }

/* Calculator (prototype styles, house radius) */
#bbc { font-family: 'Jost', sans-serif; color: var(--text-primary); }
#bbc .g { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
#bbc .f label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
#bbc .f input, #bbc .f select { width: 100%; height: 36px; border: 0.5px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px; background: #fff; font-family: inherit; }
#bbc .ptw { border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 6px; }
#bbc .pt { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
#bbc .pt th { font-weight: 500; font-size: 13px; color: var(--text-secondary); background: var(--surface-1); padding: 8px 6px; text-align: center; border-bottom: 0.5px solid var(--border); }
#bbc .pt td { padding: 6px; text-align: center; border-bottom: 0.5px solid var(--border); transition: background .4s, color .4s; }
#bbc .pt tr:last-child td { border-bottom: none; }
#bbc .pt .yr { text-align: left; padding-left: 12px; }
#bbc .pt td.hot { background: var(--bg-accent); color: var(--text-accent); font-weight: 500; }
#bbc .pt input { width: 72px; max-width: 100%; text-align: center; height: 32px; border: 0.5px solid var(--border-strong); border-radius: var(--radius); font-family: inherit; }
#bbc .err, .bb-side .err { font-size: 13px; color: var(--text-danger); }
#bbc .banner, .bb-side .banner { margin: 12px 0; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
#bbc .banner.ok, .bb-side .banner.ok { background: var(--bg-success); color: var(--text-success); }
#bbc .banner.bad, .bb-side .banner.bad { background: var(--bg-danger); color: var(--text-danger); }
#bbc #hd { position: absolute; top: 8px; height: 48px; padding: 0 22px; border-radius: 24px; background: var(--fill-accent); color: var(--on-accent); display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; white-space: nowrap; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; z-index: 3; }
#bbc #hd:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--gold); }
#bbc #hd.drag { cursor: grabbing; }

/* Coin stacks (approved Oct 15 2026): Version 1 layout, bigger Version 2 coins */
#bbc { --coin-step: 7; }
#bbc .want, .bb-side .want { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-0); border: 0.5px solid var(--border); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 10px 12px; margin: 4px 0 12px; }
#bbc .want label, .bb-side .want label { font-weight: 500; color: #203864; font-size: 15px; }
#bbc .want input, .bb-side .want input { width: 110px; height: 36px; border: 0.5px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px; font-family: inherit; font-size: 16px; }
#bbc .want span, .bb-side .want span { font-size: 14px; color: var(--text-secondary); flex: 1 1 260px; }
#bbc .want span b, #bbc .ro b, .bb-side .want span b, .bb-side .ro b { color: #203864; }
#bbc .ro, .bb-side .ro { font-size: 15px; color: var(--text-secondary); min-height: 24px; }
#bbc .ro .big, .bb-side .ro .big { font-size: 22px; color: #203864; font-weight: 600; }
#bbc .stage { position: relative; height: 300px; margin: 0 10px; }
#bbc .spot { position: absolute; bottom: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
#bbc .spot[data-y] { transition: opacity .25s; }
#bbc .spot.trip { z-index: 2; }
#bbc .spot .pl { order: -2; margin: 0 0 1px; font-size: 12px; color: var(--text-secondary); text-align: center; }
#bbc .spot .pl b { color: #203864; font-size: 15px; }
#bbc .spot .pl .exp { display: block; font-size: 11px; color: var(--text-danger); white-space: nowrap; }
#bbc .spot .pl .exp:empty { display: none; }
#bbc .spot .cnt { order: -1; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: #203864; }
#bbc .pile { display: flex; flex-direction: column-reverse; align-items: center; padding-top: 8px; }
#bbc .spot.trip .pile { min-height: 40px; min-width: 80px; border: 1.5px dashed #203864; border-radius: var(--radius); background: var(--bg-accent); padding: 12px 8px 4px; }
#bbc .tw { position: relative; display: flex; align-items: flex-end; gap: 12px; }
/* "Stays in your account" column on the RIGHT of the trip stack (Mark, Oct 15 2026) */
#bbc .keep { display: flex; flex-direction: column; align-items: center; }
#bbc .keep .kl { order: -1; font-size: 11px; line-height: 1.25; color: var(--text-secondary); text-align: center; margin-bottom: 4px; white-space: nowrap; }
#bbc .keep .kl b { display: block; font-size: 13px; color: #203864; }
#bbc .keep .pile { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 12px 6px 4px; min-width: 76px; opacity: .85; }
#bbc .marks { position: absolute; left: 100%; bottom: 0; margin-left: 8px; display: flex; flex-direction: column-reverse; white-space: nowrap; }
#bbc .marks.flip { left: auto; right: 100%; margin: 0 8px 0 0; text-align: right; }
#bbc .marks div { border-left: 3px solid var(--c); padding-left: 7px; font-size: 12px; color: var(--text-secondary); display: flex; flex-direction: column; justify-content: center; overflow: hidden; line-height: 1.2; }
#bbc .marks.flip div { border-left: none; border-right: 3px solid var(--c); padding: 0 7px 0 0; }
#bbc .marks div b { color: var(--text-primary); font-size: 14px; }
#bbc .cs { width: 64px; height: 16px; border-radius: 50%; margin-top: -9px; flex: none; position: relative;
    background: radial-gradient(ellipse at 50% 35%, rgba(255,255,255,.45), rgba(255,255,255,0) 60%), var(--c);
    box-shadow: 0 3px 0 var(--e), 0 3px 0 1px rgba(0,0,0,.12); }
#bbc .coin-new { animation: bbcDrop .45s ease-out both; }
@keyframes bbcDrop { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: none; } }
#bbc .sl { position: relative; margin: 8px 10px 4px; user-select: none; -webkit-user-select: none; }
#bbc .bands { position: relative; height: 28px; }
#bbc .band { position: absolute; top: 0; height: 28px; display: flex; align-items: center; padding-left: 10px; font-size: 12px; color: var(--text-secondary); border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); overflow: hidden; white-space: nowrap; transition: background .25s; }
#bbc .band.on { background: var(--bg-accent) !important; color: #203864; font-weight: 600; }
#bbc .today { position: absolute; top: 0; height: 28px; border-left: 1px dashed var(--text-primary); }
#bbc .ticks { position: relative; height: 40px; }
#bbc .tick { position: absolute; top: 0; font-size: 11px; line-height: 1.25; white-space: nowrap; }
#bbc .tick::before { content: ''; position: absolute; top: -28px; left: 0; height: 32px; border-left: 2px solid currentColor; }
#bbc .tick span { display: block; padding-top: 6px; }
#bbc .tick.dep { color: var(--text-success); }
#bbc .tick.bank { color: var(--text-warning); transform: translateX(-50%); }
#bbc .tick.gone { color: var(--text-danger); transform: translateX(-50%); }
#bbc .track { position: relative; height: 60px; cursor: pointer; touch-action: none; }
#bbc .rail { position: absolute; top: 28px; left: 0; right: 0; height: 4px; background: var(--border-strong); border-radius: 2px; }
#bbc .mlist { display: none; }
#bbc .unit { font-size: 12px; color: var(--text-muted); margin: 4px 10px 0; }
#bbc .fine { font-size: 12px; color: var(--text-muted); margin-top: 1rem; }

/* Listing page: third view next to Chart and Table, full width of the section (Mark, Oct 15 2026, desktop) */
.bb-inline { flex: 1 1 auto; min-width: 0; padding: 8px 10px 8px; background: #fff; border: 0.5px solid rgba(0,0,0,.12); border-radius: 2px; font-family: 'Jost', sans-serif;
    --surface-0: #FAF7F2; --surface-1: #F3EEE4; --surface-2: #FFFFFF; --text-primary: #1B1B1B; --text-secondary: #555; --text-muted: #888;
    --text-accent: #203864; --bg-accent: #E6EBF3; --border-accent: #203864; --fill-accent: #203864; --on-accent: #FFFFFF; --gold: #C9A84C;
    --text-success: #15803d; --bg-success: #EAF5EE; --text-warning: #8A6D1F; --text-danger: #A32D2D; --bg-danger: #FCEBEB;
    --border: rgba(0,0,0,.12); --border-strong: rgba(0,0,0,.22); --radius: 2px; }
.bb-inline[hidden], .bb-side[hidden] { display: none; }
.bb-inline { margin: 6px 12px 0; }
.bb-side { flex: 1 1 45%; min-width: 240px; font-family: 'Jost', sans-serif; display: flex; flex-direction: column; justify-content: center;
    --text-primary: #1B1B1B; --text-secondary: #555; --gold: #C9A84C; --surface-0: #FAF7F2; --border: rgba(0,0,0,.12); --border-strong: rgba(0,0,0,.22); --radius: 2px;
    --text-success: #15803d; --bg-success: #EAF5EE; --text-danger: #A32D2D; --bg-danger: #FCEBEB; }
.bb-side .banner { margin: 0 0 8px; padding: 8px 12px; font-size: 13px; }
.bb-side .want { margin: 0 0 8px; padding: 8px 10px; }
.bb-side .ro { font-size: 14px; }
.bb-side .ro .big { font-size: 18px; }
/* Boxes the listing fixes stay hidden even though their own rules set a display */
#bbc [hidden] { display: none !important; }
.bb-inline .bb-more { display: inline-block; margin-top: 6px; font-size: 13px; color: #203864; }
#bbBtn { color: #203864; }
#bbBtn.bb-on { background: #203864; color: #fff; }
.bb-dim { background: #fff !important; color: #1f2937 !important; }

/* Phones: the table fits at 375px with no sideways page scroll */
@media (max-width: 520px) {
    .bbp-wrap { padding: 24px 16px 40px; }
    .bbp h1 { font-size: 30px; }
    .bbp-calc { padding: 12px; }
    #bbc .pt { font-size: 12px; }
    #bbc .pt th { font-size: 10px; padding: 6px 1px; }
    #bbc .pt td { padding: 5px 1px; }
    #bbc .pt .yr { padding-left: 6px; }
    #bbc .pt input { height: 28px; font-size: 12px; padding: 0; }
    #bbc #hd { padding: 0 14px; font-size: 14px; height: 44px; }
    #bbc { --coin-step: 6; }
    #bbc .cs { width: 46px; height: 13px; margin-top: -7px; }
    #bbc .stage { height: 260px; }
    #bbc .marks { display: none; }
    #bbc .mlist { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 10px 0; font-size: 13px; color: var(--text-secondary); }
    #bbc .mlist span { border-left: 3px solid var(--c); padding-left: 6px; }
    #bbc .mlist b { color: var(--text-primary); }
    #bbc .tick.bank span, #bbc .tick.gone span { padding-top: 18px; }
}
