:root {
  --bg: #15121b; --card: #211c2a; --card2: #2b2436; --line: #3a3147;
  --text: #f3eef7; --muted: #a99db8; --gold: #e9b949; --pink: #ec6f9f; --green: #5fd49b; --red: #ff6b6b;
  --tap: 60px; --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body { overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
#app { min-height: 100%; display: flex; flex-direction: column; }
.boot { margin: auto; color: var(--gold); font-size: 28px; font-weight: 800; letter-spacing: .5px; }

/* layout */
.screen { flex: 1; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 92px); }
.screen.nonav { padding-bottom: calc(var(--safe-b) + 16px); }
.grow { flex: 1; }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 44px; }
.top h1 { font-size: 24px; margin: 0; flex: 1; }
.top .x { width: 48px; height: 48px; border-radius: 50%; background: var(--card); font-size: 22px; }
h2 { font-size: 18px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: none; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }
.bottom { margin-top: auto; padding-top: 12px; }

/* cards */
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; }
.card.hi { background: linear-gradient(135deg, #2e2340, #23202c); border: 1px solid #4a3b5c; }
.big { font-size: 40px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.mid { font-size: 26px; font-weight: 750; }
.lbl { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.gold { color: var(--gold); } .pink { color: var(--pink); } .green { color: var(--green); } .red { color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.banner { background: #3b2d14; color: #ffd98a; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 15px; display: flex; gap: 10px; align-items: center; }
.banner button { color: var(--gold); font-weight: 700; padding: 8px; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--tap);
  border-radius: var(--r); background: var(--card2); font-weight: 700; font-size: 18px; padding: 0 16px; }
.btn.primary { background: var(--gold); color: #1b1408; }
.btn.pink { background: var(--pink); color: #1d0a12; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: #4a1f25; color: #ffb3b3; }
.btn.small { min-height: 48px; font-size: 16px; }
.btn:disabled { opacity: .4; }
.link { color: var(--gold); font-weight: 600; padding: 12px 4px; min-height: 44px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; min-height: 56px; border-radius: 14px; background: var(--card2); font-weight: 700; font-size: 17px; border: 2px solid transparent; }
.seg.sm button { font-size: 15px; min-height: 50px; padding: 0 4px; }
.seg button.on { border-color: var(--gold); background: #3a2f1a; color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--card2); font-weight: 600; font-size: 15px; border: 2px solid transparent; }
.chip.on { border-color: var(--gold); color: var(--gold); background: #3a2f1a; }

/* forms */
label.f { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 15px; }
input.in, select.in, textarea.in { width: 100%; min-height: 54px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 18px; outline: none; }
input.in:focus, textarea.in:focus { border-color: var(--gold); }
textarea.in { min-height: 96px; resize: vertical; }
.code-in { letter-spacing: 10px; text-align: center; font-size: 30px; font-weight: 800; }
.err { color: var(--red); min-height: 22px; font-size: 15px; margin-top: 6px; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-around;
  padding: 6px 6px calc(var(--safe-b) + 6px); background: rgba(21, 18, 27, .96); border-top: 1px solid var(--line); z-index: 5; }
.nav button { flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); gap: 2px; }
.nav button .i { font-size: 22px; }
.nav button.on { color: var(--gold); }
.nav button.log { flex: 1.2; }
.nav button.log .i { width: 58px; height: 58px; border-radius: 50%; background: var(--gold); color: #1b1408; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; margin-top: -22px; box-shadow: 0 4px 16px rgba(233, 185, 73, .35); }

/* sync pill */
.pill { font-size: 13px; padding: 6px 10px; border-radius: 14px; background: var(--card); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--green); } .pill.warn { color: var(--gold); } .pill.bad { color: var(--red); }

/* log screen */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--r); min-height: 82px; padding: 10px 14px; text-align: left; border: 2px solid transparent; display: flex; flex-direction: column; justify-content: center; }
.tile .v { font-size: 30px; font-weight: 800; }
.tile .v.ph { color: #5d526b; }
.tile.on { border-color: var(--gold); }
.tile .hint { font-size: 12px; color: var(--muted); }
.preview { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 4px; }
.keypad { position: fixed; left: 0; right: 0; bottom: 0; background: #1b1722; border-top: 1px solid var(--line); padding: 8px 10px calc(var(--safe-b) + 10px); z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 58px; border-radius: 14px; background: var(--card2); font-size: 26px; font-weight: 700; }
.keypad .next { grid-column: span 3; background: var(--gold); color: #1b1408; font-size: 19px; }
.keypad .kl { grid-column: span 3; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 15px; padding: 0 4px; min-height: 28px; }

/* tonight */
.tonight-btns { display: flex; flex-direction: column; gap: 12px; flex: 1; margin-top: 10px; }
.tbig { flex: 1; min-height: 110px; border-radius: 24px; font-size: 34px; font-weight: 900; letter-spacing: 1px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tbig small { font-size: 15px; font-weight: 600; opacity: .8; letter-spacing: 0; }
.tbig.sale { background: var(--gold); color: #1b1408; }
.tbig.talk { background: #3c3150; }
.tbig.keep { background: var(--pink); color: #1d0a12; }
.ring { height: 10px; background: var(--card2); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.ring > div { height: 100%; background: var(--green); }

/* book */
.guy { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; width: 100%; text-align: left; min-height: 64px; }
.guy .av { width: 42px; height: 42px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--gold); flex: none; }
.guy .nm { font-weight: 700; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: var(--card2); color: var(--muted); font-weight: 700; }
.badge.loyal { color: var(--gold); } .badge.regular { color: var(--green); } .badge.overdue { color: var(--pink); } .badge.out { color: #7d708c; }

/* bars */
.bar { display: grid; grid-template-columns: 46px 1fr 92px; gap: 8px; align-items: center; margin: 6px 0; font-size: 15px; }
.bar .b { height: 22px; background: var(--card2); border-radius: 6px; overflow: hidden; }
.bar .b > div { height: 100%; background: linear-gradient(90deg, #b48a2e, var(--gold)); }

/* sheets */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 30; display: flex; align-items: flex-end; }
.sheet { background: #1d1925; width: 100%; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(var(--safe-b) + 16px); }
.sheet h3 { margin: 0 0 10px; font-size: 21px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.pinpad button { min-height: 64px; border-radius: 16px; background: var(--card2); font-size: 28px; font-weight: 700; }
.dots { display: flex; gap: 14px; justify-content: center; margin: 12px 0; min-height: 22px; }
.dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.dots span.f { background: var(--gold); border-color: var(--gold); }

/* install guide */
.guide { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--r); padding: 12px; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #1b1408; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.step svg { flex: none; }

#toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 100px); transform: translateX(-50%); background: #33294a; color: var(--text); padding: 12px 18px; border-radius: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; }
.list-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.list-line:last-child { border-bottom: 0; }
.toggle { display: flex; justify-content: space-between; align-items: center; min-height: 56px; width: 100%; text-align: left; gap: 12px; }
.toggle .sw { width: 52px; height: 32px; border-radius: 16px; background: var(--card2); position: relative; flex: none; }
.toggle .sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #776a88; transition: .15s; }
.toggle.on .sw { background: #5b4718; } .toggle.on .sw::after { left: 23px; background: var(--gold); }

/* ---------- Income statement (paper look on screen, clean on print) ---------- */
.paper { position: relative; overflow: hidden; background: #fbfaf7; color: #1d1a22; border-radius: 10px; padding: 18px 14px 20px; font-size: 13px; line-height: 1.35; }
.paper .st-h { font-size: 22px; font-weight: 800; }
.paper .st-sub { color: #6b6474; margin-bottom: 10px; }
.paper table { border-collapse: collapse; width: 100%; }
.paper .st-meta td { padding: 2px 0; vertical-align: top; } .paper .st-meta td:first-child { color: #6b6474; width: 78px; }
.paper .st-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.paper .st-sum div { border: 1px solid #ddd8e2; border-radius: 8px; padding: 8px; }
.paper .st-sum span { display: block; color: #6b6474; font-size: 11px; } .paper .st-sum b { font-size: 17px; } .paper .st-sum em { display: block; font-style: normal; font-size: 11px; color: #6b6474; }
.paper .st-t { font-weight: 800; margin: 14px 0 4px; }
.paper .st-tab th { text-align: left; font-size: 10.5px; color: #6b6474; font-weight: 700; border-bottom: 1px solid #cfc8d6; padding: 4px 4px 4px 0; }
.paper .st-tab td { padding: 4px 4px 4px 0; border-bottom: 1px solid #ece8f0; white-space: nowrap; }
.paper .st-rows { font-size: 11px; } .paper .st-ed { color: #9a5b00; font-size: 10px; }
.paper .st-scroll { overflow-x: auto; }
.paper .st-empty { color: #6b6474; margin: 16px 0; }
.paper .st-foot { margin-top: 16px; font-size: 11.5px; color: #3a3542; }
.paper .st-sign { display: flex; gap: 18px; margin-top: 26px; font-size: 11px; color: #6b6474; }
.paper .st-sign div { flex: 1; } .paper .st-sign div:first-child { flex: 2; }
.paper .st-sign span { display: block; border-bottom: 1px solid #1d1a22; height: 26px; margin-bottom: 3px; }
.paper .st-wm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 900; color: rgba(200, 30, 60, .13); transform: rotate(-30deg); pointer-events: none; letter-spacing: 8px; }
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; color: #000; height: auto; }
  #sheet-root, #toast, .nav, .noprint, .banner, .pband { display: none !important; }
  #app, .screen { display: block !important; padding: 0 !important; min-height: 0 !important; }
  .paper { border-radius: 0; padding: 0; background: #fff; font-size: 10.5pt; overflow: visible; }
  .paper .st-scroll { overflow: visible; }
  .paper .st-rows { font-size: 9pt; }
  .paper tr { break-inside: avoid; }
  .paper .st-wm { position: fixed; }
  .paper .st-sum { grid-template-columns: repeat(4, 1fr); }
}

/* v5.3: practice band, sale types, confidence words */
.pband { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; background: #4a2140; color: #ffd0e6; border-radius: 0 0 12px 12px; padding: 6px 10px; margin: -6px 0 10px; font-size: 13px; box-sizing: border-box; }
.pband span { flex: 1; }
.pband button { color: #ffd0e6; font-weight: 700; font-size: 13px; padding: 6px 8px; min-height: 36px; border: 1px solid rgba(255, 208, 230, .35); border-radius: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.catrow { border-top: 1px solid rgba(255, 255, 255, .08); padding: 8px 0 4px; }
.catname { font-weight: 700; margin-bottom: 6px; }
.cat3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.cat3 label { display: block; font-size: 13px; color: var(--muted); }
.cat3 label span { display: block; margin-bottom: 4px; }
.cat3 .in { width: 100%; min-width: 0; }
.catedit { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.catedit .in { flex: 1; min-width: 0; }
.catedit .chip { min-width: 44px; padding: 0 10px; }
.conf { font-weight: 700; }
.conf.c0 { color: var(--muted); } .conf.c1 { color: #ffd98a; } .conf.c2 { color: var(--green); } .conf.c3 { color: var(--gold); }
.aimsg + .aimsg { border-top: 1px solid var(--card2); margin-top: 6px; }
.wkrow .chip { padding: 6px 10px; min-height: 0; }
.bubble { max-width: 86%; padding: 8px 12px; border-radius: 14px; margin: 6px 0; }
.bubble.me { margin-left: auto; background: var(--card2); }
.bubble.them { margin-right: auto; background: var(--card); border: 1px solid var(--gold); }

/* ---------- career playbooks (7.2.0) ---------- */
@font-face { font-family: PbSerif; font-weight: 600; src: url(fonts/pb-serif.woff2) format('woff2'); font-display: swap; }
.pb-debut { --pb: #ebb9bb; --pb2: #f6dcc9; } .pb-confidante { --pb: #d6b06a; --pb2: #6cc0b3; }
.pb-professional { --pb: #e4d1a6; --pb2: #c7b07f; } .pb-househost { --pb: #dcae5c; --pb2: #e07a92; }
.pbname { font-family: PbSerif, Georgia, serif; font-size: 22px; color: var(--pb, var(--gold)); }
.pbhome { border-left: 3px solid var(--pb, var(--gold)); }
.pbq { width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); padding: 0 14px; margin-bottom: 10px; font-size: 17px; }
.pblvl { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; background: var(--card); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; border-left: 3px solid var(--pb); }
.pblvl.mine { background: linear-gradient(135deg, #2e2340, #23202c); }
.pblock { color: var(--muted); }
.pbtoc { padding: 4px 6px; }
.pbrow, .pbhit { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); min-height: 52px; }
.pbhit { display: block; }
.pbrow:last-child, .pbhit:last-child { border-bottom: 0; }
.pbn { color: var(--pb, var(--gold)); font-size: 14px; width: 24px; }
.pbread { padding-bottom: calc(var(--safe-b) + 110px); }
.pbkick { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--pb); font-weight: 700; }
.pbh1 { font-family: PbSerif, Georgia, serif; font-weight: 600; font-size: 34px; line-height: 1.12; margin: 0 0 14px; }
.pbbody { font-size: 19px; line-height: 1.62; color: #efe8f3; }
.pbbody p { margin: 0 0 14px; }
.pbbody .lead { font-size: 20px; }
.pbbody h3 { font-family: PbSerif, Georgia, serif; font-weight: 600; font-style: italic; font-size: 25px; color: var(--pb2); margin: 26px 0 10px; }
.pbbody ul { padding-left: 20px; margin: 0 0 14px; } .pbbody li { margin: 0 0 9px; }
.pbbody ol.num { list-style: none; padding: 0; margin: 0 0 14px; }
.pbbody ol.num li { display: flex; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pbbody ol.num .n { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--pb); color: var(--pb); display: flex; align-items: center; justify-content: center; font-size: 15px; margin-top: 2px; }
.pbbody dl { margin: 0 0 14px; } .pbbody dl .row { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pbbody dt { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--pb); font-weight: 700; margin-bottom: 3px; }
.pbbody dd { margin: 0; }
.pbbody .q { font-family: PbSerif, Georgia, serif; font-style: italic; font-size: 21px; color: var(--pb2); border-left: 3px solid var(--pb); padding-left: 14px; }
.pbbody .box, .pbbody .card, .pbbody .move { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin: 0 0 14px; }
.pbbody .box.drill { border: 1px solid var(--pb); } .pbbody .box.warn { border: 1px solid var(--pb2); }
.pbbody .bt, .pbbody .mt, .pbbody .cn { font-family: PbSerif, Georgia, serif; font-weight: 600; font-size: 24px; color: var(--pb2); margin-bottom: 6px; }
.pbbody .kick, .pbbody .cs { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--pb); font-weight: 700; }
.pbbody .move { border-top: 2px solid var(--line); }
.pbbody .fill { display: block; padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.pbbody .tag { display: inline-block; font-size: 10.5px; letter-spacing: .06em; font-weight: 800; padding: 1px 6px; border-radius: 8px; vertical-align: 2px; white-space: nowrap; }
.pbbody .t-r { background: #1f3a2a; color: #9fe0b3; } .pbbody .t-oi { background: #173638; color: #8fd9d2; } .pbbody .t-m { background: #1d2a45; color: #a9c1f2; }
.pbbody .t-ai { background: #2e2147; color: #cbb3f5; } .pbbody .t-u { background: #47271a; color: #f3b48d; } .pbbody .t-ex { background: #45391a; color: #f0d38b; }
.pbbody sup.cite a { color: var(--pb); font-weight: 800; padding: 0 3px; font-size: 13px; }
.pbbody .u { border-radius: 6px; transition: background .2s; }
.pbbody .u.on { background: rgba(233, 185, 73, .2); box-shadow: 0 0 0 3px rgba(233, 185, 73, .2); }
.pbbody .flash { background: rgba(236, 111, 159, .25); }
.pbbody ol.srcs { list-style: none; padding: 0; } .pbbody ol.srcs li { display: flex; gap: 8px; font-size: 14px; line-height: 1.4; padding: 8px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.pbbody ol.srcs .sn { flex: none; width: 24px; color: var(--pb); font-weight: 800; } .pbbody ol.srcs a { color: var(--muted); font-size: 12px; }
.pbnext { margin: 10px 0; } .pbnext .btn { font-size: 14px; }
.pbplayer { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 8px 12px calc(var(--safe-b) + 8px); background: rgba(21, 18, 27, .97); border-top: 1px solid var(--line); z-index: 20; }
.pbplayer button { flex: 1; min-height: 56px; border-radius: 14px; background: var(--card); font-size: 17px; font-weight: 700; color: var(--text); }
.pbplayer .pbplay { flex: 1.4; background: var(--gold); color: #1b1408; font-size: 22px; }
.pbmore { color: var(--gold); font-size: 14px; }

a.btn { text-decoration: none; }
a.btn:not(.primary):not(.pink) { color: var(--text); }
