/* jcardena Hands-On. The jcardena.com brand (gold, slate, Inter). Assets are local copies: /brand, /fonts, /covers. */

@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* jcardena brand */
  --jc-gold: #c9a227; --jc-gold-light: #e8c547; --jc-gold-dark: #a68519; --jc-gold-ink: #8a6d0b;
  --jc-gold-bg: #fdf6e3; --jc-gold-line: #ecd9a0; --jc-gold-soft: #fffdf5;
  --ink: #0f172a; --text-dark: #1f2937; --text-medium: #4b5563; --text-soft: #64748b; --text-light: #9ca3af;
  --slate: #334155; --slate-dark: #1e293b; --navy: #0b1f33;
  --surface: #ffffff; --page: #f9fafb; --slate-100: #f3f4f6;
  --border: #e5e7eb; --border-2: #e2e8f0; --border-3: #d1d5db;
  --success: #16a34a; --success-bg: #dcfce7; --success-ink: #166534;
  --danger: #dc2626; --danger-bg: #fee2e2; --danger-ink: #991b1b;
  --warn-bg: #fef3c7; --warn-ink: #92400e;
  --sidebar-width: 220px; --topbar-h: 52px;
  --radius: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.05);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html.sb-min { --sidebar-width: 52px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13px; color: var(--text-dark); background: var(--page); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow: hidden; }
/* the jcardena.com gold line on top of every page */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
  background: linear-gradient(90deg, #c9a227 0%, #e8c547 50%, #c9a227 100%); }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--jc-gold-dark); }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3 { color: var(--ink); }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--text-soft); } .small { font-size: 11.5px; } .hidden { display: none !important; }
code { background: var(--jc-gold-bg); color: var(--jc-gold-ink); padding: 1px 6px; border-radius: 4px; font-size: 11.5px; }
*::-webkit-scrollbar { width: 8px; height: 8px; } *::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-3); border-radius: 4px; } *::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===================== sidebar (jcardena.com zone0 sidebar, folds to the 52px rail) ===================== */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; overflow-y: auto; overflow-x: hidden; transition: width .18s ease; }
.sidebar-header { position: relative; overflow: hidden; height: 184px; min-height: 184px; flex-shrink: 0; margin: 10px; border-radius: 20px; background: #cbd5e1; }
.sidebar-photo-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 5%; }
.sidebar-gradient { position: absolute; bottom: 0; left: 0; right: 0; height: 30%; background: linear-gradient(transparent 0%, rgba(15,23,42,.25) 100%); pointer-events: none; }
.sidebar-text-layer { position: absolute; bottom: 7px; left: 12px; right: 12px; background: rgba(255,255,255,.15); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: 5px 10px 6px; text-align: center; z-index: 2; }
.sidebar-name { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -.03em; line-height: 1.1; }
.sidebar-role { font-size: 10px; color: rgba(255,255,255,.8); margin-top: 2px; font-weight: 500; line-height: 1.2; letter-spacing: .02em; }
.sb-mini-logo { display: none; }
.sb-nav { flex: 1; }
.nav-group { padding: 8px 12px 0; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #6b7280; margin-bottom: 4px; padding-left: 8px; font-weight: 600; }
.nav-list { list-style: none; margin: 0 0 10px; padding: 0; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 12px; color: var(--text-medium); font-size: 13px; font-weight: 500; border-radius: var(--radius);
  transition: all .15s ease; margin-bottom: 1px; position: relative; cursor: pointer; }
.nav-link:hover { color: var(--text-dark); background: var(--slate-100); }
.nav-link:hover .nav-icon { stroke: var(--jc-gold-light); }
.nav-link.active { color: var(--jc-gold); background: var(--jc-gold-bg); font-weight: 600; }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--jc-gold); border-radius: 0 2px 2px 0; }
.nav-icon { width: 18px; height: 18px; stroke-width: 1.5; transition: stroke .15s ease; }
.nav-short { display: none; }
.nav-badge { margin-left: auto; background: var(--jc-gold-bg); color: var(--jc-gold); font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.nav-badge:empty { display: none; }
.sb-fold { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; width: calc(100% - 24px); margin: auto 12px 0; padding: 9px 12px;
  border: 0; border-top: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 12px; font-weight: 500; color: var(--text-medium); cursor: pointer; text-align: left; }
.sb-fold:hover { color: var(--text-dark); }
.sb-fold svg, .sb-fold-top svg { width: 16px; height: 16px; stroke-width: 1.6; }
.when-min { display: none; }
.sb-fold-top { position: absolute; top: 16px; right: 16px; z-index: 3; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: rgba(255,255,255,.85);
  color: #334155; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.18); font-family: inherit; }
.sb-fold-top:hover { background: #fff; color: var(--ink); }

/* folded: the 52px rail */
html.sb-min .sidebar-header, html.sb-min .nav-label, html.sb-min .nav-badge, html.sb-min .nav-text { display: none; }
html.sb-min .sb-mini-logo { display: flex; justify-content: center; padding: 8px 0 6px; border-bottom: 1px solid var(--border); }
html.sb-min .sb-mini-logo svg { width: 32px; height: 32px; }
html.sb-min .nav-group { padding: 8px 2px 0; }
html.sb-min .nav-group + .nav-group { border-top: 1px solid var(--slate-100); }
html.sb-min .nav-list { margin-bottom: 4px; }
html.sb-min .nav-link { flex-direction: column; justify-content: center; gap: 3px; padding: 7px 0 6px; font-size: 9px; line-height: 11px; text-align: center; }
html.sb-min .nav-link.active::before { height: 70%; }
html.sb-min .nav-short { display: block; max-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.sb-min .nav-icon { width: 17px; height: 17px; }
html.sb-min .sb-fold { flex-direction: column; justify-content: center; gap: 3px; width: 52px; margin: auto 0 0; padding: 8px 0; font-size: 9px; line-height: 11px; text-align: center; }
html.sb-min .sb-fold .when-max { display: none; }
html.sb-min .when-min { display: block; }
html.sb-min .sb-fold svg, html.sb-min .sb-fold-top svg { transform: scaleX(-1); }
html.sb-min .sb-fold-top { display: none; }

/* app switcher (kept from v1, jcardena colors) */
.app-panel { display: none; position: fixed; left: calc(var(--sidebar-width) + 8px); bottom: 56px; width: 230px; background: #fff; border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.03); padding: 12px; cursor: default; z-index: 300; }
.app-panel.open { display: block; animation: pop .2s cubic-bezier(.34,1.56,.64,1); transform-origin: bottom left; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.panel-title { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-soft); margin-bottom: 8px; }
.switcher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.app-grid-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: var(--radius); color: var(--text-medium); }
.app-grid-item:hover { background: var(--page); color: var(--text-dark); }
.app-grid-item.current { background: var(--jc-gold-bg); color: var(--jc-gold-dark); }
.app-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--slate); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.app-grid-item.current .app-icon { background: var(--jc-gold); }
.app-icon-name { font-size: 10px; font-weight: 600; text-align: center; line-height: 1.2; }

/* ===================== main + topbar ===================== */
.main { margin-left: var(--sidebar-width); height: 100vh; display: flex; flex-direction: column; transition: margin-left .18s ease; min-width: 0; }
.topbar { flex: none; height: var(--topbar-h); padding: 3px 20px 0; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-main { min-width: 0; }
.topbar-title { font-size: 13.5px; color: var(--ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title strong { font-weight: 700; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--text-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--text-soft); } .crumbs a:hover { color: var(--jc-gold-dark); }
.crumbs .sep { color: var(--border-3); }
#crumbBook { display: inline-flex; gap: 6px; min-width: 0; }
#crumbBook span:last-child { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; gap: 12px; align-items: center; flex: none; }
.today { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.view { flex: 1; overflow-y: auto; min-height: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 28px 60px; }
.wrap-narrow { max-width: 920px; }

/* ===================== pills, buttons, inputs ===================== */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill svg { width: 12px; height: 12px; }
.pill-local { background: var(--jc-gold-bg); color: var(--jc-gold-ink); border-color: var(--jc-gold-line); }
.st-published { background: var(--success-bg); color: var(--success-ink); } .st-staged { background: var(--warn-bg); color: var(--warn-ink); }
.st-written { background: #f1f5f9; color: #334155; } .lang { background: #fff; color: var(--slate); border-color: var(--border-3); }
.rv-not_started { background: #f1f5f9; color: var(--text-soft); } .rv-reading { background: var(--jc-gold-bg); color: var(--jc-gold-ink); }
.rv-reviewed_ok { background: var(--success-bg); color: var(--success-ink); } .rv-reviewed_fix { background: var(--danger-bg); color: var(--danger-ink); }

/* primary = the site's slate "book" button; go = the gold-outlined button of the site landings */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-2); background: #fff; color: var(--ink); border-radius: var(--radius);
  padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; transition: transform .15s, box-shadow .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--jc-gold); color: var(--ink); }
.btn-primary { background-color: var(--slate); background-image: linear-gradient(180deg, #475569 0%, #334155 100%); color: #fff; border-color: var(--slate); box-shadow: 0 2px 6px rgba(15,23,42,.14); }
.btn-primary:hover { background-color: var(--slate-dark); background-image: linear-gradient(180deg, #334155 0%, #1e293b 100%); border-color: var(--slate-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(15,23,42,.18); }
.btn-go { border-color: var(--jc-gold); }
.btn-go:hover { background: var(--jc-gold-soft); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn-small { padding: 4px 10px; font-size: 12px; gap: 5px; }
.btn-small svg { width: 14px; height: 14px; }
.icon-btn { border: 1px solid var(--border-2); background: #fff; border-radius: 6px; padding: 5px 7px; cursor: pointer; color: var(--text-dark); display: inline-flex; align-items: center; gap: 5px; font-family: inherit; font-size: 12px; font-weight: 600; }
.icon-btn:hover { border-color: var(--jc-gold); color: var(--jc-gold-dark); }
input, select, textarea { font-family: inherit; font-size: 13px; border: 1px solid var(--border-2); border-radius: var(--radius); padding: 7px 10px; background: #fff; color: var(--text-dark);
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--jc-gold); box-shadow: 0 0 0 3px rgba(201,162,39,.14); }
input::placeholder, textarea::placeholder { color: var(--text-light); }
input[type=checkbox] { accent-color: var(--jc-gold); }
textarea { width: 100%; resize: vertical; line-height: 1.45; }


/* ===================== hero, stats (from 802 library) ===================== */
.lp-hero { background: linear-gradient(135deg, #fffdf5 0%, #fff 55%, #f8fafc 100%); border: 1px solid #efe3bf; border-radius: var(--radius-xl); padding: 28px 32px 26px; margin-bottom: 16px; }
.eb, .k { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--jc-gold-dark); margin: 0 0 8px; }
.lp-hero h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 10px; font-weight: 800; }
.lp-hero h1 span { color: var(--jc-gold); }
.lead { font-size: 15.5px; line-height: 1.6; color: var(--text-medium); margin: 0 0 18px; max-width: 70ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 20px; }
.stats div { background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 12px 16px; text-align: center; }
.stats b { display: block; font-size: 24px; color: var(--ink); line-height: 1.2; font-weight: 700; }
.stats span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.empty { padding: 28px; text-align: center; color: var(--text-soft); }
.bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #c9a227, #e8c547); transition: width .2s; }

/* ===================== Book Labs: home ===================== */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 24px; }
.how > div { background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 14px 16px; }
.how b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); margin-bottom: 4px; }
.how b i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--jc-gold-bg); color: var(--jc-gold-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; border: 1px solid var(--jc-gold-line); }
.how p { margin: 0; color: var(--text-soft); font-size: 12.5px; }
.labcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.labcard { display: grid; grid-template-columns: 120px 1fr; gap: 18px; background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius-xl); padding: 16px; box-shadow: var(--shadow-card); }
.labcard .cv { aspect-ratio: 3/4; border-radius: var(--radius); background: #e2e8f0 center/cover no-repeat; box-shadow: 0 6px 18px rgba(15,23,42,.18); display: block; }
.labcard h3 { font-size: 17px; margin: 2px 0 2px; } .labcard h3 a { color: var(--ink); }
.labcard .m { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
.labcard ul { margin: 6px 0 12px; padding-left: 18px; color: var(--text-medium); font-size: 12.5px; }
.labcard .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.next-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.next-books > div { border: 1px dashed var(--border-3); border-radius: var(--radius-lg); padding: 12px 14px; background: #fff; }
.next-books b { display: block; font-size: 13px; color: var(--ink); } .next-books span { font-size: 12px; color: var(--text-soft); }
.section-h { font-size: 18px; margin: 28px 0 4px; } .section-sub { color: var(--text-soft); margin: 0 0 12px; font-size: 13px; }

/* ===================== Book Labs: book page ===================== */
.bookhead { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: start; }
.bookhead .cv { aspect-ratio: 3/4; border-radius: var(--radius); background: #e2e8f0 center/cover no-repeat; box-shadow: 0 8px 22px rgba(15,23,42,.2); }
.chlist { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.chrow { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 14px 16px; }
.chrow .no { width: 40px; height: 40px; border-radius: 10px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.chrow.ro .no { background: var(--slate-100); color: var(--text-soft); }
.chrow h3 { margin: 0 0 2px; font-size: 14.5px; } .chrow h3 a { color: var(--ink); }
.chrow p { margin: 0; font-size: 12.5px; color: var(--text-soft); }
.chrow .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chrow .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chrow .done { font-size: 11.5px; color: var(--success-ink); font-weight: 600; white-space: nowrap; }
.rules { background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 14px 18px; margin-top: 18px; }
.rules h3 { margin: 0 0 6px; } .rules ul { margin: 0; padding-left: 18px; color: var(--text-medium); font-size: 12.5px; } .rules li { margin: 3px 0; }
.p-run { background: var(--success-bg); color: var(--success-ink); } .p-rec { background: #f1f5f9; color: #334155; } .p-note { background: var(--jc-gold-bg); color: var(--jc-gold-ink); }
.p-extra { background: #eef2ff; color: #3730a3; } .p-ok { background: var(--success-bg); color: var(--success-ink); } .p-bad { background: var(--danger-bg); color: var(--danger-ink); }

/* ===================== Book Labs: the lab (chapter, step by step) ===================== */
.labtop { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.labtop h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.labtop .k { margin-bottom: 4px; }
.prog { min-width: 260px; flex: 1; max-width: 460px; }
.prog .txt { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-soft); margin-bottom: 5px; font-weight: 600; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.dot { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border-3); background: #fff; font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--text-medium); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.dot:hover { border-color: var(--jc-gold); }
.dot.ran { background: var(--success-bg); border-color: #86efac; color: var(--success-ink); }
.dot.seen { background: var(--slate-100); }
.dot.cur { background: var(--navy); border-color: var(--navy); color: #fff; }
.dot.k-recorded, .dot.k-note { border-style: dashed; }
.lab { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.card { background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-card); }
.card + .card { margin-top: 12px; }
.card h2 { font-size: 16.5px; margin: 2px 0 8px; letter-spacing: -.01em; }
.card h4 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); margin: 14px 0 6px; }
.card h4:first-child { margin-top: 0; }
.steptag { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
blockquote.booktext { margin: 0; padding: 10px 14px; border-left: 3px solid var(--jc-gold); background: var(--jc-gold-soft); border-radius: 0 var(--radius) var(--radius) 0; font-size: 13.5px; line-height: 1.6; color: var(--text-dark); }
.notice { margin: 0; padding-left: 0; list-style: none; }
.notice li { position: relative; padding: 5px 0 5px 24px; font-size: 13px; line-height: 1.5; color: var(--text-dark); border-bottom: 1px solid var(--slate-100); }
.notice li:last-child { border-bottom: 0; }
.notice li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--jc-gold); }
.engnote { font-size: 12px; color: var(--text-medium); background: var(--page); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 8px 10px; }
.bookres { font-size: 12.5px; color: var(--text-dark); background: #f8fafc; border: 1px solid var(--border-2); border-radius: var(--radius); padding: 8px 10px; }
details.orig summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-medium); margin-top: 12px; }
details.orig pre { margin: 8px 0 0; }
pre.code, textarea.sql { font-family: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, monospace; font-size: 12.5px; line-height: 1.55; }
pre.code { background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 12px 14px; overflow: auto; max-height: 360px; white-space: pre; }
textarea.sql { width: 100%; min-height: 180px; background: #0f172a; color: #e2e8f0; border: 1px solid #0f172a; border-radius: var(--radius); padding: 12px 14px; tab-size: 2; white-space: pre; overflow: auto; resize: vertical; }
textarea.sql:focus { border-color: var(--jc-gold); box-shadow: 0 0 0 3px rgba(201,162,39,.2); }
.runbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.runbar .sp { flex: 1; }
.runbar .hint { font-size: 11.5px; color: #6b7280; }
.btn-run { background: var(--jc-gold); background-image: linear-gradient(180deg, #d4af37 0%, #c9a227 100%); border-color: var(--jc-gold-dark); color: #1f2937; }
.btn-run:hover { background-image: linear-gradient(180deg, #c9a227 0%, #a68519 100%); color: #111; border-color: var(--jc-gold-dark); transform: translateY(-1px); }
.verdict { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.verdict.ok { background: var(--success-bg); color: var(--success-ink); } .verdict.bad { background: var(--danger-bg); color: var(--danger-ink); }
.verdict.own { background: #fff7ed; color: #9a3412; } .verdict.info { background: var(--page); color: var(--text-medium); border: 1px solid var(--border-2); }
.verdict small { font-weight: 500; }
.blocks { display: flex; flex-direction: column; gap: 8px; }
.blk { border: 1px solid var(--border-2); border-radius: var(--radius); overflow: hidden; }
.blk .bh { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--page); padding: 5px 10px; font-size: 11.5px; color: var(--text-soft); border-bottom: 1px solid var(--border-2); }
.blk .bh code { background: none; color: var(--text-medium); padding: 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70ch; display: block; }
.blk.okline { border-style: dashed; } .blk.okline .bh { border-bottom: 0; background: #fff; }
.blk.err { border-color: #fecaca; } .blk.err .bh { background: var(--danger-bg); color: var(--danger-ink); border-bottom-color: #fecaca; }
.blk.err .em { padding: 7px 10px; font-size: 12.5px; color: var(--danger-ink); font-family: Consolas, monospace; }
.blk.err.expected { border-color: #fde68a; } .blk.err.expected .bh { background: var(--warn-bg); color: var(--warn-ink); border-bottom-color: #fde68a; }
.blk.err.expected .em { color: var(--warn-ink); }
.tbl { overflow: auto; max-height: 320px; }
table.res { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.res th { position: sticky; top: 0; background: #fff; text-align: left; font-weight: 700; color: var(--ink); padding: 6px 10px; border-bottom: 2px solid var(--jc-gold-line); white-space: nowrap; }
table.res td { padding: 5px 10px; border-bottom: 1px solid var(--slate-100); font-family: 'Cascadia Mono', Consolas, monospace; font-size: 12px; white-space: nowrap; }
table.res tr:nth-child(even) td { background: #fcfcfd; }
td.num { text-align: right; } td.null { color: var(--text-light); font-style: italic; }
.norows { padding: 8px 10px; font-size: 12.5px; color: var(--text-soft); font-style: italic; }
.waiting { padding: 26px; text-align: center; color: var(--text-soft); border: 1px dashed var(--border-3); border-radius: var(--radius); font-size: 13px; }
.recorded-box { border: 1px dashed var(--border-3); border-radius: var(--radius); padding: 10px 12px; background: #fff; }
.recorded-box .lbl { font-size: 11px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.stepnav { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.stepnav .mid { display: flex; gap: 8px; }
.labdl { margin-top: 8px; }
.engine-status { font-size: 11.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; }
.engine-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-light); display: inline-block; }
.engine-status.ready i { background: var(--success); } .engine-status.fail i { background: var(--danger); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 12.5px; z-index: 500; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.footer-note { margin-top: 28px; font-size: 11.5px; color: var(--text-soft); text-align: center; }
/* review fixes 2026-11-25: honest verdicts (M5), "book coming soon" (M6), chapter banner (S7), focus ring (S4), header link (S12) */
.verdict.differs, .verdict.standin { align-items: flex-start; background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; font-weight: 500; }
.verdict.differs b, .verdict.standin b { font-weight: 700; }
.verdict .vnote { font-size: 12.5px; font-weight: 400; color: #334155; margin-top: 3px; line-height: 1.5; }
.p-diff { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.soon { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-medium); white-space: normal; }
.soon a { color: var(--jc-gold-ink); text-decoration: underline; }
.chbanner { background: var(--jc-gold-soft); border: 1px solid var(--jc-gold-line); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; font-size: 13px; color: var(--text-dark); }
.chbanner a { color: var(--jc-gold-ink); font-weight: 600; text-decoration: underline; }
.site-link { font-size: 12px; font-weight: 600; color: var(--text-medium); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 4px 10px; white-space: nowrap; }
.site-link:hover { border-color: var(--jc-gold); }
a:focus-visible, button:focus-visible, .btn:focus-visible, [role="button"]:focus-visible, summary:focus-visible { outline: 2px solid var(--jc-gold-ink); outline-offset: 2px; }
.dot[aria-current="step"] { outline: 2px solid var(--jc-gold); outline-offset: 1px; }
.menu-btn { display: none; }

@media (max-width: 1100px) { .lab { grid-template-columns: 1fr; } .labcards { grid-template-columns: 1fr; } .how { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .labcard { grid-template-columns: 1fr; } .bookhead { grid-template-columns: 1fr; } .chrow { grid-template-columns: 1fr; } }
/* Phone (review M2, 2026-11-25): 360 to 430 px. The sidebar becomes a menu over the page (Menu button in the top bar);
   the main column is full width; nothing is wider than the screen; SQL, plans and result tables scroll inside their own box. */
@media (max-width: 720px) {
  html, html.sb-min { --sidebar-width: 260px; }
  .sidebar { width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; z-index: 400; }
  html.sb-open .sidebar { transform: none; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
  .sb-fold, .sb-fold-top { display: none !important; }
  html.sb-min .sidebar-header, html.sb-min .nav-label, html.sb-min .nav-badge, html.sb-min .nav-text { display: revert; }
  .main { margin-left: 0; width: 100%; }
  .app-panel { left: 12px; bottom: 60px; }
  .menu-btn { display: inline-flex; align-items: center; gap: 5px; flex: none; border: 1px solid var(--border-2); background: #fff; border-radius: var(--radius); padding: 6px 9px;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
  .topbar { padding: 3px 10px 0; gap: 8px; }
  .topbar-main { flex: 1; }
  .topbar-title .muted, .engine-status span { display: none; }
  .wrap { padding: 14px 12px 48px; }
  .lp-hero { padding: 18px 16px; }
  .lp-hero h1 { font-size: 26px; }
  .lead { font-size: 14.5px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .labcards, .next-books { grid-template-columns: minmax(0, 1fr); }
  .labcard, .bookhead, .chrow, .how { grid-template-columns: minmax(0, 1fr); }
  .pill { white-space: normal; }
  .labcard .cv { max-width: 140px; }
  .bookhead .cv { max-width: 150px; }
  .chrow .acts { justify-content: flex-start; }
  .btn { white-space: normal; text-align: left; }
  .labtop { display: block; }
  .prog { min-width: 0; max-width: none; margin-top: 10px; }
  .lab, .lab > div, .card, .blk, .blocks, #result { min-width: 0; max-width: 100%; }
  .card { padding: 14px 12px; }
  .stepnav .mid { flex-wrap: wrap; }
  .runbar .hint { display: none; }
  .blk .bh { flex-wrap: wrap; }
  .blk .bh code { max-width: 100%; }
  pre.code, textarea.sql, .tbl { max-width: 100%; }
  .aiurl a { font-size: 12px; }
}

/* ===================== "Set it up with your AI assistant" box + the /ai/<book>[/<chapter>] pages (JC-0120, 2026-11-25) ===================== */
.aibox { margin-top: 18px; border-color: var(--jc-gold-line); background: var(--jc-gold-soft); }
.aibox h2 { font-size: 16px; margin: 0 0 6px; }
.aibox .aisteps { margin: 4px 0 10px; padding-left: 20px; } .aibox .aisteps li { margin: 3px 0; }
.aiurl { margin: 6px 0 10px; } .aiurl a { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; color: var(--jc-gold-ink); }
.aibox .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.aiprompt { margin-top: 10px; } .aiprompt summary { cursor: pointer; font-size: 12px; color: var(--text-soft); }
.aiprompt pre, .aitext { white-space: pre-wrap; word-break: break-word; background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 12px 14px; font: 12px/1.55 ui-monospace, Consolas, monospace; color: var(--text-dark); margin: 8px 0 0; }
.btn.copied { border-color: var(--success); color: var(--success-ink); background: var(--success-bg); }
body.aipage { overflow: auto; }
.aiwrap { max-width: 980px; margin: 0 auto; padding: 26px 22px 60px; }
.aiwrap h1 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 800; }
.aiwrap h1 span { color: var(--jc-gold); }
.ai-note { font-size: 12px; color: var(--text-soft); margin: 0 0 14px; } .ai-note a, .aiwrap .eb a { color: var(--jc-gold-ink); }
