/* ==========================================================================
   UCaaS Academy — styles
   Brand colors come from organization branding (--primary, --accent).
   ========================================================================== */
:root {
  --primary: #2453ff;
  --accent: #00b39b;
  --ink: #141a2b;
  --ink-2: #4a5468;
  --muted: #6b7489;
  --line: #e4e8f0;
  --bg: #f6f7fb;
  --card: #fff;
  --ok: #0a8a5f;
  --warn: #b7791f;
  --err: #c2372f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 26, 43, .05), 0 4px 16px rgba(20, 26, 43, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
code { font-family: var(--mono); font-size: .88em; background: #eef1f7; padding: .1em .35em; border-radius: 5px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; flex: 1; }
.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin-bottom: .3rem; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.back { display: inline-block; margin-bottom: 1rem; font-size: .92rem; }
.section-title { margin-top: 2rem; }

/* --- Buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; font-size: .95rem;
  padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none !important; transition: .15s; }
.btn:hover { border-color: #c9d0de; background: #fafbfd; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent); filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; margin: .6rem 0; }
.icon-btn { border: 1px solid transparent; background: transparent; border-radius: 7px; padding: .2rem .45rem; cursor: pointer; font-size: .95rem; color: var(--ink-2); }
.icon-btn:hover:not(:disabled) { background: #eef1f7; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { background: #fde8e7; }
.link { color: var(--primary); font-weight: 600; }

/* --- Header / footer ---------------------------------------------------- */
.demo-bar { background: #fff8e1; color: #6b4d00; border-bottom: 1px solid #f3e1a5; font-size: .85rem; padding: .45rem 1rem; text-align: center; }
.demo-bar button { font: inherit; font-size: .8rem; margin-left: .5rem; border: 1px solid #e2c766; background: #fff; border-radius: 6px; cursor: pointer; padding: .1rem .5rem; }
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.25rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none !important; }
.brand img { height: 32px; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff; font-weight: 800; }
.mainnav { display: flex; gap: .3rem; flex: 1; }
.mainnav a { padding: .4rem .75rem; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: .95rem; text-decoration: none; }
.mainnav a:hover, .mainnav a.active { background: #eef1fb; color: var(--primary); }
.usernav { display: flex; gap: .5rem; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .5rem; border-radius: 9px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: #f0f2f8; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem; }
.uname { font-weight: 600; font-size: .92rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 180px; padding: .35rem; display: flex; flex-direction: column; }
.menu-pop a, .menu-pop button { padding: .5rem .7rem; border-radius: 8px; color: var(--ink); text-align: left; font: inherit; font-size: .92rem; background: none; border: 0; cursor: pointer; text-decoration: none; }
.menu-pop a:hover, .menu-pop button:hover { background: #f2f4f9; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; background: #fff; }

/* --- Cards / grid ------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(20, 26, 43, .1); }
.cover { position: relative; height: 112px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); display: grid; place-items: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-icon { font-size: 2.6rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.cover .pill { position: absolute; top: .6rem; right: .6rem; }
.card-body { padding: 1rem 1.15rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.card-body h3 { margin: 0 0 .2rem; }
.card-body p { margin: 0 0 .4rem; font-size: .93rem; }
.meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .83rem; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: .7rem; display: flex; justify-content: space-between; align-items: center; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .18rem .55rem; border-radius: 99px; background: #eef1fb; color: var(--primary); }
.pill-ok { background: #e3f6ee; color: var(--ok); }
.pill-draft { background: #fff3d6; color: #8a5a00; }
.bar { height: 7px; border-radius: 99px; background: #e8ebf3; overflow: hidden; margin: .4rem 0; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: inherit; transition: width .4s; }

/* --- Home --------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; padding: 2.5rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
.hero-cta { display: flex; gap: .7rem; margin: 1.3rem 0; flex-wrap: wrap; }
.hero-points { display: flex; gap: 1.3rem; flex-wrap: wrap; padding: 0; list-style: none; color: var(--ink-2); font-size: .92rem; }
.hero-points li::before { content: '✓ '; color: var(--accent); font-weight: 800; }
.hero-art { display: grid; place-items: center; }
.hero-phone { width: 220px; padding: 18px; border-radius: 22px; background: linear-gradient(160deg, #2b3245, #161b28); box-shadow: 0 30px 60px rgba(20,26,43,.25); transform: rotate(-6deg); }
.hp-screen { height: 110px; border-radius: 10px; background: linear-gradient(160deg, var(--primary), color-mix(in srgb, var(--primary) 50%, #000)); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.hp-screen div { height: 9px; border-radius: 4px; background: rgba(255,255,255,.55); }
.hp-screen div:nth-child(1) { width: 60%; } .hp-screen div:nth-child(2) { width: 85%; background: rgba(255,255,255,.3); } .hp-screen div:nth-child(3) { width: 40%; background: var(--accent); }
.hp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hp-keys i { height: 22px; border-radius: 7px; background: #3a4258; }
.catalog-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters input, .filters select { font: inherit; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 220px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chip { font: inherit; font-size: .88rem; font-weight: 600; padding: .35rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --- Course page -------------------------------------------------------- */
.course-hero { display: flex; gap: 1.4rem; align-items: center; padding: 1.6rem; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); margin-bottom: 1.8rem; }
.course-hero .kicker, .course-hero .lead, .course-hero .meta { color: rgba(255,255,255,.88); }
.course-hero .cover-icon { font-size: 3.6rem; }
.course-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.side { position: sticky; top: 80px; }
.big-pct { font-size: 2.4rem; font-weight: 800; }
.side-row { font-size: .9rem; margin: .5rem 0; }
.side-row.ok { color: var(--ok); font-weight: 600; }
.syllabus { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.syllabus li + li { border-top: 1px solid var(--line); }
.syllabus a { display: flex; gap: .9rem; align-items: center; padding: .85rem 1rem; color: var(--ink); text-decoration: none; }
.syllabus a:hover { background: #f8f9fc; }
.syl-title { flex: 1; font-weight: 600; }
.tick { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #eef1f7; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
li.done .tick { background: var(--ok); color: #fff; }

/* --- Lesson ------------------------------------------------------------- */
.lesson-layout { display: grid; grid-template-columns: 270px 1fr; gap: 2rem; align-items: start; }
.lesson-nav { position: sticky; top: 80px; }
.lesson-nav ol { list-style: none; padding: 0; margin: .8rem 0 0; }
.lesson-nav li a { display: flex; gap: .6rem; align-items: center; padding: .5rem .55rem; border-radius: 9px; color: var(--ink-2); font-size: .92rem; text-decoration: none; }
.lesson-nav li a:hover { background: #eef1f7; }
.lesson-nav li.current a { background: #fff; box-shadow: var(--shadow); color: var(--ink); font-weight: 700; }
.lesson-nav .tick { width: 24px; height: 24px; font-size: .75rem; }
.lesson { min-width: 0; }
#blocks > .block { margin: 1.2rem 0; }
.prose { font-size: 1.03rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 .9em; }
.prose li { margin: .25em 0; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.table-wrap.card { padding: 0; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; background: #fff; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f8fc; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.prose table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f9fafc; }
.callout { display: flex; gap: .8rem; padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid; }
.callout .prose p:last-child { margin: 0; }
.callout-tip { background: #effaf6; border-color: #c4eadb; }
.callout-info { background: #eff3ff; border-color: #cdd8fb; }
.callout-warn { background: #fff7e8; border-color: #f2d9a6; }
.callout-icon { font-size: 1.3rem; }
figure { margin: 0; } figure img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
figcaption { font-size: .88rem; color: var(--muted); margin-top: .4rem; }
.video { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.check { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; padding: 1rem 1.1rem; }
.check-kicker { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.check-q { font-weight: 600; margin: .3rem 0 .7rem; }
.check-opts { display: flex; flex-direction: column; gap: .45rem; }
.check-opt { font: inherit; text-align: left; padding: .6rem .8rem; border-radius: 9px; border: 1px solid var(--line); background: #fafbfd; cursor: pointer; }
.check-opt:hover { border-color: var(--primary); }
.check-opt.right { background: #e3f6ee; border-color: var(--ok); }
.check-opt.wrong { background: #fde8e7; border-color: var(--err); }
.check-fb { margin-top: .6rem; font-size: .93rem; }
.lesson-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.foot-right { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* --- Simulator shell ---------------------------------------------------- */
.sim { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; box-shadow: var(--shadow); outline: none; }
.sim:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.sim.is-done { border-color: #bfe6d5; }
.sim-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.sim-head h4 { margin: 0; font-size: 1.1rem; }
.sim-kicker { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.sim-progress { min-width: 130px; text-align: right; font-size: .8rem; color: var(--muted); }
.sim-intro { margin: .5rem 0 0; color: var(--ink-2); }
.sim-instruction { margin: .8rem 0; padding: .75rem 1rem; background: #f3f6ff; border-radius: 10px; font-size: 1.02rem; min-height: 3rem; }
.sim.is-done .sim-instruction { background: #e9f8f1; }
.step-no { display: inline-block; font-size: .75rem; font-weight: 800; background: var(--primary); color: #fff; border-radius: 6px; padding: .1rem .45rem; margin-right: .4rem; vertical-align: 2px; }
.sim-stage { display: flex; justify-content: safe center; padding: .5rem 0; overflow-x: auto; }
.sim-feedback { min-height: 1.6rem; font-size: .93rem; margin: .4rem 0; }
.sim-feedback.warn { color: var(--warn); } .sim-feedback.ok { color: var(--ok); font-weight: 600; } .sim-feedback.info { color: var(--ink-2); }
.sim-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.sim-tip { margin-left: auto; font-size: .78rem; color: var(--muted); }
.sim-error { padding: 1rem; background: #fde8e7; border-radius: 10px; color: var(--err); }

/* --- Phone -------------------------------------------------------------- */
.phone { display: flex; align-items: stretch; gap: 0; user-select: none; --key: #3a3f49; --key-hi: #4a505c; --key-fg: #e9ecf2; }
.phone button { font-family: var(--font); cursor: pointer; }
.handset { width: 62px; border: 0; border-radius: 30px 10px 10px 30px; background: linear-gradient(90deg, color-mix(in srgb, var(--body) 80%, #000), var(--body)); position: relative; margin-right: -4px; box-shadow: inset -2px 0 0 rgba(255,255,255,.06); }
.handset span { position: absolute; left: 50%; top: 10%; bottom: 10%; width: 16px; transform: translateX(-50%); border-radius: 10px; background: rgba(255,255,255,.06); }
.handset:hover { filter: brightness(1.25); }
.phone-body { background: linear-gradient(170deg, color-mix(in srgb, var(--body) 85%, #fff), var(--body)); border-radius: 16px 22px 22px 16px; padding: 12px 16px 14px; width: 470px; position: relative; box-shadow: 0 14px 34px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08); }
.brandbar { display: flex; justify-content: space-between; align-items: center; color: rgba(255,255,255,.55); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.mwi { width: 22px; height: 6px; border-radius: 4px; background: #555; }
.mwi.on { background: #ff3b30; box-shadow: 0 0 10px #ff3b30; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.phone-top { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; }
.linekeys { display: flex; flex-direction: column; justify-content: space-around; padding: 24px 0 22px; gap: 4px; }
.lk { width: 22px; height: 15px; border-radius: 4px; border: 0; background: var(--key); box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.lk:hover { background: var(--key-hi); }
.screen { background: var(--scr-bg); color: var(--scr-fg); border-radius: 6px; height: 196px; display: flex; flex-direction: column; overflow: hidden; border: 3px solid #0a0c10; font-size: 12px; }
.scr-status { display: flex; justify-content: space-between; padding: 3px 8px; height: 22px; background: color-mix(in srgb, var(--scr-fg) 12%, var(--scr-bg)); font-weight: 600; font-size: 11px; }
.scr-main { flex: 1; display: grid; grid-template-columns: auto 1fr auto; min-height: 0; }
.scr-labels { display: flex; flex-direction: column; justify-content: space-around; font-size: 10px; max-width: 62px; }
.scr-labels span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 5px; opacity: .85; }
.scr-labels.right { text-align: right; }
.scr-center { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 4px 6px; gap: 2px; min-width: 0; }
.scr-line { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scr-line.big { font-size: 16px; font-weight: 700; }
.scr-soft { display: grid; grid-template-columns: repeat(4, 1fr); height: 22px; border-top: 1px solid color-mix(in srgb, var(--scr-fg) 25%, transparent); }
.scr-soft span { text-align: center; font-size: 10.5px; font-weight: 600; line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.scr-soft span + span { border-left: 1px solid color-mix(in srgb, var(--scr-fg) 18%, transparent); }
.softkeys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 34px 0; }
.sk { height: 14px; border-radius: 4px; border: 0; background: var(--key); box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.sk:hover { background: var(--key-hi); }
.phone-mid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 12px 0 8px; }
.cluster { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cluster.col { flex-direction: column; justify-content: flex-start; }
.pk { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 38px; border-radius: 8px; border: 0; background: var(--key); color: var(--key-fg); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); padding: 2px 4px; }
.pk:hover { background: var(--key-hi); }
.pk-icon { font-size: 13px; line-height: 1; }
.pk-label { font-size: 8.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; margin-top: 2px; opacity: .9; }
.pk-red { background: #b3261e; } .pk-red:hover { background: #cf3027; }
.pk-speaker, .pk-headset, .pk-mute { background: color-mix(in srgb, var(--key) 70%, var(--accent)); }
.navring { position: relative; width: 104px; height: 104px; border-radius: 50%; background: var(--key); box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); }
.nk { position: absolute; border: 0; background: transparent; color: var(--key-fg); font-size: 11px; width: 34px; height: 34px; border-radius: 50%; }
.nk:hover { background: rgba(255,255,255,.1); }
.nk-up { top: 2px; left: 35px; } .nk-down { bottom: 2px; left: 35px; } .nk-left { left: 2px; top: 35px; } .nk-right { right: 2px; top: 35px; }
.nk-ok { left: 27px; top: 27px; width: 50px; height: 50px; background: var(--key-hi); font-weight: 700; font-size: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.phone-bottom { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.keypad { display: grid; grid-template-columns: repeat(3, 58px); gap: 6px; }
.kp { height: 36px; border-radius: 8px; border: 0; background: #e9ebef; color: #16181d; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.kp:hover { background: #fff; }
.kp b { font-size: 15px; } .kp small { font-size: 7.5px; letter-spacing: .06em; color: #666; margin-top: 2px; min-height: 8px; }
.volume { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 10px; }
.volume .pk { min-width: 40px; height: 22px; } .volume .pk-label { display: none; }
.vol-bar { width: 120px; height: 6px; border-radius: 3px; background: var(--key); }
.model-tag { position: absolute; right: 16px; bottom: 6px; font-size: 9px; color: rgba(255,255,255,.35); letter-spacing: .1em; }
.phone .pressed { transform: translateY(1px); filter: brightness(1.4); }
.phone .pulse { animation: pulse 0.7s ease-in-out 3; outline: 3px solid #ffd60a; outline-offset: 2px; z-index: 2; position: relative; }
.phone .nk.pulse { position: absolute; }
@keyframes pulse { 50% { outline-color: transparent; transform: scale(1.08); } }
.picked-key { outline: 3px solid #34c759 !important; outline-offset: 2px; }

/* --- Hotspot ------------------------------------------------------------ */
.hs-stage, .hs-edit { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); cursor: crosshair; line-height: 0; background: #f2f4f8; }
.hs-stage img, .hs-edit img { width: 100%; display: block; user-select: none; }
.hs-box { position: absolute; border: 3px solid #ffd60a; border-radius: 8px; background: rgba(255, 214, 10, .18); pointer-events: none; }
.hs-box.pulse { animation: hspulse .8s ease-in-out 3; }
@keyframes hspulse { 50% { box-shadow: 0 0 0 8px rgba(255, 214, 10, .35); } }
.hs-click { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid var(--primary); pointer-events: none; animation: ping .4s ease-out; }
@keyframes ping { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.hs-edit .hs-box { border-color: #34c759; background: rgba(52, 199, 89, .2); }
.pad { padding: 1rem; line-height: 1.4; }

/* --- Quiz --------------------------------------------------------------- */
.quiz-wrap { max-width: 780px; margin: 0 auto; }
.q { margin: 0 0 1rem; border: 1px solid var(--line); }
.q legend { font-weight: 700; font-size: 1.05rem; padding: 0; display: flex; gap: .6rem; float: left; width: 100%; margin-bottom: .6rem; }
.q legend + * { clear: both; }
.qn { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .8rem; }
.q-opts { display: flex; flex-direction: column; gap: .45rem; clear: both; }
.q-opt { display: flex; gap: .65rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fafbfd; }
.q-opt:hover { border-color: var(--primary); }
.q-opt input { width: 18px; height: 18px; accent-color: var(--primary); }
.q-result { font-weight: 700; margin-top: .5rem; }
.q-right { border-color: #9fd9bf; } .q-right .q-result { color: var(--ok); }
.q-wrong { border-color: #f1b3ae; } .q-wrong .q-result { color: var(--err); }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; }
.result { text-align: center; padding: 2rem; }
.result .row { justify-content: center; }
.result-score { font-size: 3.2rem; font-weight: 800; }
.result.pass .result-score { color: var(--ok); } .result.fail .result-score { color: var(--warn); }

/* --- Dashboard / stats -------------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.stat { display: flex; flex-direction: column; padding: 1rem 1.2rem; }
.stat b { font-size: 1.9rem; } .stat span { color: var(--muted); font-size: .88rem; }

/* --- Forms -------------------------------------------------------------- */
.auth { display: grid; place-items: center; padding: 2rem 0; }
.auth-card { width: 100%; max-width: 440px; padding: 2rem; }
.form { display: flex; flex-direction: column; gap: .85rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  font: inherit; font-weight: 400; font-size: .95rem; padding: .55rem .75rem; border: 1px solid #d4d9e5; border-radius: 9px; background: #fff; width: 100%; }
.form input[type=color] { padding: .2rem; height: 40px; }
.form textarea { resize: vertical; font-family: var(--mono); font-size: .88rem; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.form .switch { flex-direction: row; align-items: center; gap: .55rem; font-weight: 500; }
.form .switch input { width: 18px; height: 18px; accent-color: var(--primary); }
.hint { font-weight: 400; font-size: .8rem; color: var(--muted); margin: 0; }
.form-error { color: var(--err); font-size: .9rem; min-height: 0; }
.form-error:empty { display: none; }
.form-links { display: flex; justify-content: space-between; font-size: .9rem; }
.persona { border: 1px solid #d4d9e5; border-radius: 10px; padding: .6rem .9rem; display: flex; flex-direction: column; gap: .3rem; }
.persona legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.persona label { flex-direction: row; font-weight: 400; align-items: center; gap: .5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.input-row { display: flex; gap: .4rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.narrow { max-width: 640px; }

/* --- Admin -------------------------------------------------------------- */
.admin-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.3rem; }
.admin-tabs a { padding: .6rem .9rem; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.admin-tabs a.active { color: var(--primary); border-color: var(--primary); }
.editor-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; align-items: start; }
.editor-grid > div { display: flex; flex-direction: column; gap: 1.2rem; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.card-title-row h3 { margin: 0; }
.admin-list { list-style: none; padding: 0; margin: 0; counter-reset: l; }
.admin-list li { display: flex; align-items: center; gap: .3rem; padding: .55rem 0; border-top: 1px solid var(--line); counter-increment: l; }
.admin-list li::before { content: counter(l); color: var(--muted); font-size: .8rem; width: 1.4rem; }
.danger-zone { border-color: #f3c5c1; }
.lesson-meta { margin-bottom: 1rem; }
.block-editor { margin-bottom: 1rem; padding: 0; }
.be-head { display: flex; align-items: center; gap: .3rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); background: #fafbfd; border-radius: var(--radius) var(--radius) 0 0; }
.be-head select { font: inherit; font-size: .85rem; padding: .25rem .4rem; border-radius: 7px; border: 1px solid var(--line); }
.be-body { padding: 1rem; }
.steps { display: flex; flex-direction: column; gap: .7rem; }
.card-inset { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; background: #fbfcfe; display: flex; flex-direction: column; gap: .6rem; }
.step-head { display: flex; align-items: center; gap: .3rem; }
details summary { cursor: pointer; font-weight: 600; font-size: .88rem; margin-bottom: .4rem; }
.add-block { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; position: sticky; bottom: 1rem; }
.add-block > span { font-weight: 700; margin-right: .3rem; }
.q-edit { margin-bottom: 1rem; padding: 0; }
.q-edit .form { padding: 1rem; }
.opts { display: flex; flex-direction: column; gap: .4rem; }
.opt-row { display: flex; gap: .5rem; align-items: center; }
.opt-row input[type=radio], .opt-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; }
.quiz-settings { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-bottom: 1rem; }
.quiz-settings label:not(.switch) { flex-direction: row; align-items: center; }
.quiz-settings input[type=number] { width: 90px !important; }
.json { width: 100%; font-family: var(--mono); font-size: .85rem; border: 1px solid var(--line); border-radius: 10px; padding: .8rem; }
.modal { border: 0; border-radius: 18px; padding: 1.6rem; max-width: 560px; width: calc(100% - 2rem); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal.wide { max-width: 980px; }
.modal::backdrop { background: rgba(15, 20, 35, .55); }
.modal-x { position: absolute; top: .7rem; right: .9rem; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.modal .picker { display: flex; justify-content: center; margin: 1rem 0; overflow-x: auto; }
.preview-body > .block { margin: 1rem 0; }

/* --- Certificate -------------------------------------------------------- */
.cert-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: .6rem; }
.certificate { background: #fff; padding: 18px; border-radius: 6px; box-shadow: var(--shadow); max-width: 960px; margin: 0 auto; aspect-ratio: 1.414; }
.cert-inner { height: 100%; border: 3px double color-mix(in srgb, var(--primary) 70%, #000); padding: 3rem 3.5rem; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: .5rem;
  background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--primary) 7%, #fff), #fff 60%); }
.cert-org { font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); display: flex; gap: .6rem; align-items: center; justify-content: center; }
.cert-org img { height: 36px; }
.cert-kicker { font-family: Georgia, "Times New Roman", serif; font-size: 2.3rem; margin: .6rem 0 1rem; }
.cert-small { color: var(--muted); margin: 0; }
.cert-name { font-family: Georgia, "Times New Roman", serif; font-size: 2.6rem; font-style: italic; border-bottom: 1px solid var(--line); display: inline-block; margin: .3rem auto .6rem; padding: 0 2rem .3rem; }
.cert-course { font-size: 1.5rem; font-weight: 700; margin: .3rem 0 .6rem; }
.cert-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem; margin-top: 2.2rem; }
.sig { font-weight: 700; border-top: 1px solid var(--ink); padding-top: .4rem; }
.seal { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #fff; background: radial-gradient(circle, var(--accent), color-mix(in srgb, var(--accent) 60%, #000)); box-shadow: 0 0 0 5px #fff, 0 0 0 7px var(--accent); }

/* --- Misc --------------------------------------------------------------- */
.empty { text-align: center; padding: 4rem 1rem; }
.loading { display: grid; place-items: center; padding: 5rem; }
.spinner { width: 34px; height: 34px; border: 3px solid #dfe3ee; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; bottom: 1.2rem; right: 1.2rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .93rem; transition: .4s; max-width: 360px; }
.toast-ok { background: var(--ok); } .toast-error { background: var(--err); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .hero, .course-layout, .lesson-layout, .editor-grid, .two-col { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .side, .lesson-nav { position: static; }
  .uname { display: none; }
  .site-header { gap: .7rem; flex-wrap: wrap; }
}
@media (max-width: 440px) {
  .phone { zoom: .58 !important; }
  .sim { padding: .8rem; }
}
@media (max-width: 560px) {
  .phone { zoom: .75; }
  .grid-2 { grid-template-columns: 1fr; }
  .sim-tip { display: none; }
}

/* --- Print (certificates) ---------------------------------------------- */
@media print {
  @page { size: landscape; margin: 0; }
  body { background: #fff; }
  .site-header, .site-footer, .demo-bar, .no-print, #toasts { display: none !important; }
  .container { padding: 0; max-width: none; }
  .certificate { box-shadow: none; max-width: none; width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --- Photo-mode phones (real device photo + mapped buttons) ------------ */
.phone.phone-photo { display: block; position: relative; width: 100%; max-width: 640px; line-height: 0; }
.phone-photo > img { width: 100%; display: block; user-select: none; border-radius: 12px; }
.pp-screen { position: absolute; overflow: hidden; border-radius: 3px; background: var(--scr-bg); }
.pp-screen .screen { position: absolute; top: 0; left: 0; transform-origin: 0 0; border: 0; border-radius: 0; line-height: 1.3; }
.pk-hot { position: absolute; border: 2px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; padding: 0; }
.pk-hot:hover { border-color: rgba(255, 214, 10, .85); background: rgba(255, 214, 10, .15); }
.phone-photo .pk-hot.pressed { background: rgba(255, 255, 255, .35); transform: none; filter: none; }
.phone-photo .pk-hot.pulse { position: absolute; outline: 3px solid #ffd60a; outline-offset: 1px; background: rgba(255, 214, 10, .3); transform: none; }
.phone-photo .pk-hot.picked-key { background: rgba(52, 199, 89, .3); }
@media (max-width: 560px) { .phone.phone-photo { zoom: 1 !important; } }

/* --- Admin: phone photo calibration ------------------------------------ */
.cal-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.2rem; align-items: start; }
.cal-stage { position: relative; line-height: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: crosshair; background: #f2f4f8; user-select: none; }
.cal-stage img { width: 100%; display: block; pointer-events: none; }
.cal-box { position: absolute; border: 2px solid rgba(36, 83, 255, .8); background: rgba(36, 83, 255, .12); border-radius: 5px; pointer-events: none; }
.cal-box span { position: absolute; left: 1px; top: 1px; font: 600 9px/1.2 var(--font); background: rgba(36, 83, 255, .85); color: #fff; padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.cal-box.current { border-color: #34c759; background: rgba(52, 199, 89, .25); }
.cal-box.current span { background: #34c759; }
.cal-box.screen-box { border-color: #ff9f0a; background: rgba(255, 159, 10, .15); }
.cal-list { max-height: 640px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cal-item { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: 8px; cursor: pointer; font-size: .9rem; border: 1px solid transparent; background: none; font-family: inherit; text-align: left; width: 100%; }
.cal-item:hover { background: #f2f4f9; }
.cal-item.active { border-color: #34c759; background: #eefaf2; }
.cal-item .dot { width: 9px; height: 9px; border-radius: 50%; background: #d4d9e5; flex: none; }
.cal-item.done .dot { background: var(--ok); }
.cal-item code { margin-left: auto; font-size: .75rem; }
.cal-item.needed:not(.done) { color: var(--warn); }
@media (max-width: 900px) { .cal-grid { grid-template-columns: 1fr; } }
