:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --text: #1c2033;
  --muted: #62687d;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-50: #eef0ff;
  --success: #15803d;
  --success-50: #e8f7ee;
  --danger: #dc2626;
  --danger-50: #fdecec;
  --warning: #b45309;
  --warning-50: #fff5e6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 50, 0.05), 0 4px 16px rgba(20, 24, 50, 0.05);
  --nav-w: 232px;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 6px; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 10px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.warn { color: var(--warning); font-weight: 600; }
:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.45); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.view { margin-left: var(--nav-w); padding: 28px 32px 48px; max-width: calc(1180px + var(--nav-w)); }
.topbar { display: none; }

.nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; z-index: 20;
}
.nav a:not(.brand) {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; text-decoration: none;
}
.nav a:not(.brand) svg { width: 20px; height: 20px; flex: none; }
.nav a:not(.brand):hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-50); color: var(--primary); }
.nav-note { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none !important; padding: 4px 8px 16px; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }

@media (max-width: 860px) {
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 15; background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 10px 16px;
  }
  .topbar .brand { padding: 0; }
  .nav {
    inset: auto 0 0 0; width: 100%; height: 64px; flex-direction: row; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border); gap: 0; height: auto;
  }
  .nav .brand, .nav-note { display: none; }
  .nav a:not(.brand) { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; text-align: center; }
  .view { margin-left: 0; padding: 18px 16px 96px; }
  h1 { font-size: 22px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost-danger { color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-50); border-color: #f5b5b5; }
.btn-light { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, 0.26); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 10px 22px; font-size: 15px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; font-weight: 700; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.danger { color: var(--danger); }
.link-btn { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0 4px; }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & common ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-title { font-size: 17px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.grid > .card { margin: 0; }
.grid-sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-head { margin-bottom: 18px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-center { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); padding: 3px 10px; border-radius: 999px; }
.status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.status-draft { background: var(--warning-50); color: var(--warning); }
.status-ready { background: var(--success-50); color: var(--success); }
.status-archived { background: var(--surface-2); color: var(--muted); }
.type-tag { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.label-sm { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 12px 0 4px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.lc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lesson-card h3 a { color: var(--text); }
.lesson-card, .topic-card, .act-card { display: flex; flex-direction: column; }
.lc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.outcomes { margin: 0 0 8px; padding-left: 18px; font-size: 14px; }
.outcomes li { margin-bottom: 4px; }

/* ---------- Hero / dashboard ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #db2777 130%); color: #fff;
  border-radius: 20px; padding: 28px; box-shadow: 0 10px 30px rgba(79, 70, 229, 0.25);
}
.hero h1 { font-size: 30px; }
.hero-sub { opacity: 0.9; max-width: 560px; margin: 0; }
.eyebrow { font-weight: 600; opacity: 0.9; margin-bottom: 4px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat { display: flex; flex-direction: column; margin: 0; color: var(--text); text-decoration: none !important; }
.stat strong { font-size: 28px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 13px; }
.stat:hover { border-color: var(--primary); }
.subject-card { display: flex; flex-direction: column; gap: 4px; margin: 0; border-top: 4px solid var(--c); color: var(--text); text-decoration: none !important; }
.subject-card:hover { border-color: var(--c); }
.pack { align-self: flex-start; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--c); border: 1px solid var(--c); border-radius: 999px; padding: 1px 8px; }
@media (max-width: 520px) {
  .hero { padding: 20px; }
  .hero h1 { font-size: 24px; }
  .hero-actions, .hero-actions .btn { width: 100%; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat strong { font-size: 22px; }
}

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 42px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
input[type="radio"] { width: auto; min-height: 0; accent-color: var(--primary); }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-weight: 800; font-size: 16px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; }
.error { color: var(--danger); font-size: 13px; font-weight: 500; min-height: 0; }
.error:empty { display: none; }
.hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.list-note { margin: 0 0 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.seg-item { flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.seg-item:has(input:checked) { background: var(--surface); box-shadow: var(--shadow); color: var(--primary); }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-actions .btn { flex: 1; }
  .seg { display: flex; }
  .seg-item { flex: 1; justify-content: center; }
}

/* ---------- Filters, tabs, banners ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; }
.filters input { flex: 2 1 200px; }
.filters select { flex: 1 1 150px; width: auto; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-50); color: var(--primary); padding: 4px 6px 4px 12px; border-radius: 999px; font-size: 13px; }
.filter-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-weight: 700; padding: 2px 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.banner { background: var(--primary-50); color: #312e81; border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.banner-success { background: var(--success-50); color: #14532d; }
.banner-error { background: var(--danger-50); color: #7f1d1d; }
.banner-warn { background: var(--warning-50); color: #7c2d12; }
.banner ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- States ---------- */
.state { text-align: center; padding: 48px 20px; color: var(--muted); }
.state h3 { color: var(--text); }
.state-icon { font-size: 40px; margin-bottom: 8px; }
.state-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.state-empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.state-error { background: var(--danger-50); border-radius: var(--radius); }
.state .btn { margin-top: 6px; }

/* ---------- Toasts & modal ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #1c2033; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); font-size: 14px; animation: pop 0.2s ease-out; }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: inherit; opacity: 0.7; cursor: pointer; }
.toast-success { border-left: 5px solid #22c55e; }
.toast-error { border-left: 5px solid #ef4444; }
.toast-info { border-left: 5px solid #818cf8; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 860px) { .toasts { bottom: 84px; left: 16px; right: 16px; max-width: none; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 40, 0.5); display: grid; place-items: center; padding: 16px; z-index: 90; animation: fade 0.15s; }
.modal { background: var(--surface); border-radius: 18px; padding: 22px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.modal-title { font-size: 21px; margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Editor ---------- */
.editor-head { margin-bottom: 16px; }
.back { display: inline-block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.title-input { font-size: 24px; font-weight: 800; border: 1px solid transparent; background: transparent; padding: 6px 8px; margin-left: -8px; width: calc(100% + 8px); }
.title-input:hover { border-color: var(--border); background: var(--surface); }
.editor-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.status-select { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.status-select select { width: auto; min-height: 38px; padding: 6px 10px; }
.spacer { flex: 1; }
.content-bar { margin-bottom: 12px; }
.block { border-left: 4px solid var(--primary); }
.block.has-problem { border-left-color: var(--danger); }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.block-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.minutes { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-weight: 500; color: var(--muted); }
.minutes input { width: 64px; min-height: 34px; padding: 4px 8px; }
.block-tools { margin-left: auto; display: flex; gap: 6px; }
.type-single, .type-classify, .type-reveal { background: #f3e8ff; color: #7c3aed; }
.type-activity { background: #e0f2fe; color: #0369a1; }
.add-block { display: flex; gap: 10px; flex-wrap: wrap; background: var(--surface-2); box-shadow: none; border-style: dashed; }
.add-block select { flex: 1 1 200px; width: auto; }
@media (max-width: 600px) {
  .title-input { font-size: 20px; }
  .editor-toolbar .btn { flex: 1; }
  .spacer { display: none; }
  .block-tools { margin-left: 0; }
  .card { padding: 14px; }
}

/* ---------- Slides ---------- */
.slide { background: var(--surface); border-radius: 16px; position: relative; overflow: hidden; }
.slide-inner { padding: clamp(18px, 4vw, 48px); display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.slide h2 { font-size: clamp(22px, 3.4vw, 40px); font-weight: 800; }
.kicker { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--primary); background: var(--primary-50); padding: 4px 12px; border-radius: 999px; }
.slide-text { white-space: pre-line; font-size: clamp(16px, 2vw, 24px); }
.prompt { font-size: clamp(17px, 2.2vw, 26px); font-weight: 600; white-space: pre-line; }
.outcome { background: var(--success-50); color: #14532d; padding: 12px 16px; border-radius: 12px; font-size: clamp(14px, 1.6vw, 18px); }
.meta-row.big { font-size: clamp(14px, 1.6vw, 18px); }
.slide-intro { background: linear-gradient(135deg, #eef0ff, #fdf2f8); }
.slide-summary { background: linear-gradient(135deg, #e8f7ee, #eef0ff); }
.slide-preview { border: 1px solid var(--border); box-shadow: var(--shadow); }
.preview-list { display: grid; gap: 20px; }
.preview-num { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); font: inherit; font-size: clamp(15px, 1.9vw, 22px); font-weight: 600; cursor: pointer; color: var(--text); transition: 0.15s; }
.opt:hover { border-color: var(--primary); background: var(--primary-50); }
.opt-letter { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; }
.opt.correct { border-color: #22c55e; background: var(--success-50); }
.opt.correct .opt-letter { background: #22c55e; color: #fff; }
.opt.wrong { border-color: #ef4444; background: var(--danger-50); animation: shake 0.3s; }
.opt.wrong .opt-letter { background: #ef4444; color: #fff; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.feedback { font-size: clamp(15px, 1.8vw, 20px); font-weight: 700; min-height: 1.5em; margin: 0; text-align: center; }
.fb-ok { color: var(--success); }
.fb-bad { color: var(--danger); }
@media (max-width: 600px) { .options { grid-template-columns: 1fr; } }

.cls-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 56px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.cls-zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.cls-zone { border: 2px dashed #c7cbe0; border-radius: 14px; padding: 10px; min-height: 120px; cursor: pointer; background: var(--surface); transition: 0.15s; }
.cls-zone:hover { border-color: var(--primary); background: var(--primary-50); }
.zone-label { font-weight: 800; text-align: center; margin-bottom: 8px; font-size: clamp(14px, 1.7vw, 19px); }
.zone-cards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cls-card { padding: 8px 14px; border-radius: 10px; border: 2px solid var(--border); background: #fff; font: inherit; font-weight: 600; font-size: clamp(14px, 1.6vw, 18px); cursor: grab; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.cls-card.selected { border-color: var(--primary); background: var(--primary-50); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25); }
.cls-card.ok { border-color: #22c55e; background: var(--success-50); }
.cls-card.bad { border-color: #ef4444; background: var(--danger-50); }

.hint-box, .answer-box { padding: 14px 18px; border-radius: 12px; font-size: clamp(16px, 2vw, 22px); font-weight: 600; animation: pop 0.2s; }
.hint-box { background: var(--warning-50); color: #7c2d12; }
.answer-box { background: var(--success-50); color: #14532d; }
.fallback { background: var(--warning-50); border-radius: 12px; padding: 12px 16px; }
.fallback ul { margin: 0; padding-left: 20px; }
.fallback li.ok { font-weight: 700; color: var(--success); }

/* ---------- Presentation mode ---------- */
body.presenting { overflow: hidden; }
body.presenting .app { display: none; }
.present { position: fixed; inset: 0; background: #151833; color: #fff; display: flex; flex-direction: column; z-index: 50; }
.pr-top { display: flex; align-items: center; gap: 10px 16px; padding: 10px 16px; flex-wrap: wrap; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.pr-title { font-weight: 700; flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-timer, .pr-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-timer select { width: auto; min-height: 36px; padding: 4px 8px; background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.pr-timer select option { color: #000; }
.pr-time { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 800; min-width: 74px; text-align: center; }
.pr-time.low { color: #fbbf24; }
.pr-time.done { color: #f87171; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.pr-btn, .pr-nav { min-height: 36px; padding: 6px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pr-btn:hover, .pr-nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); }
.pr-exit { border-color: rgba(248, 113, 113, 0.5); }
.pr-kbd { margin-left: 4px; padding: 1px 5px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.12); font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.pr-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; min-height: 0; overflow: auto; }
.slide-present { width: min(100%, calc((100vh - 170px) * 16 / 9)); aspect-ratio: 16 / 9; color: var(--text); overflow-y: auto; }
.pr-bottom { display: flex; align-items: center; gap: 16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, 0.1); }
.pr-nav { min-height: 44px; padding: 8px 20px; font-size: 15px; }
.pr-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.pr-progress { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.pr-bar { width: 100%; height: 4px; background: rgba(255, 255, 255, 0.15); border-radius: 4px; overflow: hidden; }
.pr-bar i { display: block; height: 100%; background: #a5b4fc; transition: width 0.25s; }
@media (max-width: 860px) {
  .slide-present { aspect-ratio: auto; width: 100%; min-height: 100%; }
  .pr-stage { align-items: stretch; padding: 10px; }
  .pr-title { flex-basis: 100%; }
  .pr-btn { font-size: 13px; padding: 6px 10px; }
  .pr-nav { padding: 8px 14px; }
}

.danger-zone { border-color: #f5c2c2; }
