/* VietSCI Slide AI - giao diện theo nhận diện VietSCI (chàm #1800AD · cam #FF6600) */
:root {
  /* Thương hiệu */
  --brand: #1800ad;
  --brand-600: #2a14d6;
  --brand-800: #0c0561;
  --brand-50: #f1efff;
  --brand-100: #e9e8fb;
  --brand-200: #dcdaf7;
  --orange: #ff6600;
  --orange-400: #ff8a3d;
  --orange-50: #fff3eb;
  /* Chữ & nền */
  --ink: #16133d;
  --ink-2: #2b2a3d;
  --ink-3: #6b6a80;
  --ink-4: #9b9ab0;
  --line: #e6e5f0;
  --line-2: #d4d2e8;
  --page: #f7f6fd;
  --card: #ffffff;
  --ok: #14804a;
  --danger: #dc2626;
  /* Nhịp khoảng cách 4 · 8 · 12 · 16 · 20 · 24 · 32 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 19, 61, .06);
  --shadow: 0 1px 2px rgba(22, 19, 61, .05), 0 8px 24px rgba(22, 19, 61, .07);
  --shadow-lg: 0 24px 60px rgba(12, 5, 97, .28);
  --ring: 0 0 0 3px rgba(24, 0, 173, .16);
  /* Inter cho nội dung (đọc tốt ở cỡ nhỏ), Lexend cho tiêu đề & thương hiệu (nét tròn, hiện đại) */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Lexend', 'Inter', system-ui, sans-serif;
  --topbar-h: 68px;
  --panel-w: 408px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  text-rendering: optimizeLegibility;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ============ Topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: var(--panel-w) 1fr auto; align-items: center;
  height: var(--topbar-h); padding: 0 var(--s6) 0 0;
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--s3); padding-left: var(--s6); text-decoration: none; }
/* Logo gốc VietSCI (Viet chàm · SCI cam) + nhãn sản phẩm */
.brand-mark { width: auto; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.brand-row { display: flex; align-items: center; gap: 8px; }
.brand-word { display: block; width: 136px; height: auto; }
.brand-sub {
  padding: 4px 7px 3px; border-radius: 5px; background: var(--orange-50); color: var(--orange);
  font-family: var(--font-display); font-size: 9.5px; font-weight: 700; line-height: 1;
  letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
}
.brand-tag {
  font-family: var(--font-display); font-size: 10.5px; font-weight: 400; line-height: 1;
  letter-spacing: .02em; color: var(--ink-3); white-space: nowrap;
}
.brand-tag b { font-weight: 700; }
.brand-tag .tag-viet { color: var(--brand); }
.brand-tag .tag-sci { color: var(--orange); }
.brand-tag .tag-es { font-weight: 600; color: var(--ink-2); }

.stepper { display: flex; align-items: center; justify-content: center; gap: var(--s3); }
.step { display: flex; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 600; color: var(--ink-4); white-space: nowrap; }
.step i {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-style: normal; font-size: 12px; font-weight: 700;
  background: #fff; border: 1.5px solid var(--line-2); color: var(--ink-3);
}
.step.is-active { color: var(--brand); }
.step.is-active i { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.step.is-done { color: var(--ink-2); }
.step.is-done i { background: var(--orange); border-color: var(--orange); color: #fff; }
.step-sep { width: 36px; height: 1.5px; background: var(--line-2); border-radius: 2px; }

.topbar-right { display: flex; align-items: center; gap: var(--s4); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--brand-50); color: var(--ink-3);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ai { background: #eaf7f0; color: var(--ok); }
.badge.off { background: var(--orange-50); color: #c2410c; }
/* Liên kết vietscies.com: viên thuốc có icon quả địa cầu + mũi tên */
.top-link {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px;
  border: 1px solid var(--line-2); border-radius: 999px; background: #fff;
  font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: border-color .15s, color .15s, box-shadow .15s, background .15s;
}
.top-link .ic:first-child { color: var(--brand); }
.top-link .ic:last-child { color: var(--ink-4); transition: transform .15s, color .15s; }
.top-link:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); box-shadow: 0 4px 12px rgba(24, 0, 173, .12); }
.top-link:hover .ic:last-child { color: var(--orange); transform: translate(2px, -2px); }

/* ============ Bố cục chính ============ */
.app { display: grid; grid-template-columns: var(--panel-w) minmax(0, 1fr); height: calc(100vh - var(--topbar-h)); }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--brand-50); border-right: 1px solid var(--line); }
#form { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); scrollbar-width: thin; }
.panel-actions { padding: var(--s4); background: #fff; border-top: 1px solid var(--line); }
.panel-note { margin: var(--s2) 0 0; text-align: center; font-size: 12px; color: var(--ink-3); }
.workspace { overflow-y: auto; min-width: 0; }
.ws-inner { padding: var(--s6) var(--s8) 64px; max-width: 1180px; margin: 0 auto; }

/* ============ Thẻ cài đặt ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-sm); }
.card-head { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s4); }
.card-no {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 13px;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); min-width: 0; }
.card > .field:last-child, .card > .grid3:last-child .field, .custom-body .field { margin-bottom: 0; }
.field label, .label, .label-row label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.opt { font-weight: 400; color: var(--ink-4); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.count { min-width: 40px; padding: 2px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-weight: 800; text-align: center; }

input:not([type]), input[type=text], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.45; }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%236b6a80' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center / 16px no-repeat;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: #bdb9df; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=color] { width: 100%; height: 40px; padding: 4px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; cursor: pointer; }
input[type=range] { width: 100%; height: 22px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-4); margin-top: -2px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.grid-label { display: grid; grid-template-columns: 168px 1fr; gap: var(--s2); }

.link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.link:hover { color: var(--orange); }
.link.danger:hover { color: var(--danger); }

/* Drop zone */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: var(--s6) var(--s4); margin-bottom: var(--s5);
  border: 1.5px dashed #bdb9df; border-radius: var(--r-lg); background: var(--brand-50);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-100); }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); margin-bottom: 4px; }
.drop-icon svg { width: 22px; height: 22px; }
.drop-main { font-weight: 600; color: var(--ink); word-break: break-word; }
.drop-main u { color: var(--brand); text-underline-offset: 3px; }
.drop-sub { font-size: 12px; color: var(--ink-3); }
.drop.has-file { border-style: solid; border-color: var(--orange-400); background: var(--orange-50); }
.drop.has-file .drop-icon { color: var(--orange); }

/* Ngôn ngữ */
.langs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lang {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 52px; padding: 0 4px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.lang b { font-size: 13px; font-weight: 800; letter-spacing: .04em; color: var(--ink-2); }
.lang span { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.lang:hover { border-color: var(--brand); }
.lang.is-on { border-color: var(--brand); background: var(--brand); box-shadow: 0 6px 14px rgba(24, 0, 173, .22); }
.lang.is-on b, .lang.is-on span { color: #fff; }

/* Toggles */
.toggles { display: flex; gap: var(--s6); flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(22, 19, 61, .25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--brand); }

/* Mẫu slide */
.theme-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s3); }
.theme-filter button {
  height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer;
}
.theme-filter button:hover { color: var(--brand); border-color: var(--brand); }
.theme-filter button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) 10px; }
.theme { min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; border-radius: var(--r); }
.theme-thumb {
  display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(22, 19, 61, .08); outline: 2px solid transparent; outline-offset: 2px;
  transition: outline-color .15s, transform .15s;
}
.theme:hover .theme-thumb { transform: translateY(-2px); }
.theme.is-on .theme-thumb { outline-color: var(--orange); }
.theme-thumb i { position: absolute; display: block; }
.theme-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  padding-top: 6px; min-height: calc(2 * 1.3em + 6px); font-size: 11.5px; font-weight: 600; line-height: 1.3; color: var(--ink-2); word-break: break-word;
}
.theme.is-on .theme-name { color: var(--brand); }
.custom { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.custom summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--brand); list-style: none; }
.custom summary::before { content: '+ '; }
.custom[open] summary::before { content: '− '; }
.custom-body { display: grid; gap: var(--s3); margin-top: var(--s3); }
.custom-body .link { justify-self: start; }

/* Logo */
.logo-row { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s4); padding: var(--s3); border-radius: var(--r); background: var(--brand-50); }
.logo-box {
  flex: none; display: grid; place-items: center; width: 76px; height: 76px; overflow: hidden;
  border-radius: 12px; border: 1.5px dashed #bdb9df; background: #fff; cursor: pointer; transition: border-color .15s;
}
.logo-box:hover { border-color: var(--brand); }
.logo-box img { max-width: 64px; max-height: 64px; object-fit: contain; }
.logo-ph { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 600; color: var(--brand); line-height: 1.1; }
.logo-ph b { font-size: 22px; font-weight: 500; }
.logo-meta { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }
.logo-meta strong { font-size: 13px; }

/* Người thực hiện */
.presenters { display: flex; flex-direction: column; gap: 6px; }
.presenter { display: grid; grid-template-columns: 1fr 104px 40px; gap: 6px; }
.icon-btn {
  display: grid; place-items: center; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: #fff; color: var(--ink-3); font-size: 16px; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ============ Nút ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 40px; padding: 0 var(--s4); border-radius: var(--r); border: 1px solid transparent;
  font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .08s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn.cta { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(255, 102, 0, .28); }
.btn.cta:hover { background: #f05f00; box-shadow: 0 8px 20px rgba(255, 102, 0, .34); }
.btn.cta:disabled { background: #d9d7ea; color: #fff; box-shadow: none; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.big { width: 100%; height: 50px; font-size: 15px; border-radius: 12px; }

/* ============ Khu làm việc ============ */
.ws-toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) var(--s8); background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.ws-info { min-width: 0; flex: 1 1 320px; }
.part { white-space: nowrap; }
.ws-info h1 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-info p { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-3); }
.ws-actions { display: flex; gap: var(--s2); flex: none; margin-left: auto; }

.notice { padding: var(--s3) var(--s4); margin-bottom: var(--s3); border-radius: var(--r); font-size: 13px; background: var(--orange-50); color: #9a3412; border: 1px solid #ffd3b5; }
.notice.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.summary { margin-bottom: var(--s6); padding: var(--s4) var(--s5); background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.summary h3 { margin: 0 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.summary p { margin: 0; color: var(--ink-2); }

/* Trang chào */
.empty { display: flex; flex-direction: column; gap: var(--s6); }
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: var(--s8); align-items: center;
  padding: 44px 40px; border-radius: 22px; color: #fff;
  background:
    radial-gradient(700px 360px at 92% 0%, rgba(255, 102, 0, .26), transparent 60%),
    radial-gradient(520px 380px at 0% 100%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-800) 100%);
  box-shadow: var(--shadow-lg);
}
.eyebrow { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #ffb27a; border: 1px solid rgba(255, 178, 122, .45); background: rgba(255, 255, 255, .04); }
.hero h1 { margin: var(--s4) 0 var(--s3); font-size: clamp(26px, 2.5vw, 36px); line-height: 1.18; letter-spacing: -.02em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--orange-400); }
.hero p { margin: 0 0 var(--s5); font-size: 15px; color: rgba(255, 255, 255, .82); max-width: 520px; }
.hero-langs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.hero-langs li { padding: 5px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }
.hero-preview { min-width: 0; }
.cover-frame { border-radius: 12px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .12); background: #fff; }
.preview-label { margin-top: var(--s3); text-align: center; font-size: 12px; color: rgba(255, 255, 255, .7); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.how article { padding: var(--s5); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.how-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--brand-50); color: var(--brand); margin-bottom: var(--s3); }
.how-ic svg { width: 21px; height: 21px; }
.how article:nth-child(2) .how-ic { background: var(--orange-50); color: var(--orange); }
.how h3 { margin: 0 0 4px; font-size: 15px; }
.how p { margin: 0; font-size: 13px; color: var(--ink-3); }

/* Đang xử lý */
.loading { max-width: 440px; margin: 9vh auto; text-align: center; }
.spinner { width: 48px; height: 48px; margin: 0 auto var(--s5); border-radius: 50%; border: 4px solid var(--brand-100); border-top-color: var(--orange); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading h2 { margin: 0 0 var(--s5); font-size: 18px; }
.progress { list-style: none; padding: 0; margin: 0 0 var(--s4); text-align: left; display: grid; gap: var(--s2); }
.progress li { position: relative; padding: 11px 14px 11px 42px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: var(--ink-4); }
.progress li::before { content: ''; position: absolute; left: 15px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--line-2); }
.progress li.is-active { color: var(--ink); font-weight: 600; border-color: var(--brand-200); }
.progress li.is-active::before { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.progress li.is-done { color: var(--ok); }
.progress li.is-done::before { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12l4 4 8-8' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 10px no-repeat; border-color: var(--ok); }

/* Danh sách slide */
.slides { display: grid; gap: var(--s6); }
.slide-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s3); }
.slide-no { padding-top: 10px; text-align: right; font-size: 13px; font-weight: 800; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.slide-card { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s; }
.slide-card:hover { border-color: var(--brand-200); }
.slide-bar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s2) var(--s3); background: #fbfbfe; border-bottom: 1px solid var(--line); }
.slide-bar select { width: auto; height: 32px; font-size: 12.5px; font-weight: 600; border-radius: var(--r-sm); }
.slide-bar .tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 6px 2px; }
.slide-bar .spacer { flex: 1; }
.slide-bar .icon-btn { width: 32px; height: 32px; font-size: 13px; border-radius: var(--r-sm); }
.slide-bar .icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.slide-bar .icon-btn.del:hover { color: var(--danger); border-color: var(--danger); }
.notes { padding: var(--s2) var(--s4); border-top: 1px solid var(--line); background: #fbfbfe; }
.notes summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.notes summary:hover { color: var(--brand); }
.notes textarea { margin: var(--s2) 0 var(--s1); font-size: 13px; }
.add-slide { justify-self: center; height: 44px; padding: 0 var(--s6); border-style: dashed; }

/* ---------- Stage (slide preview) ---------- */
.stage-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; container-type: inline-size; }
.stage {
  position: absolute; left: 0; top: 0; width: 1333px; height: 750px; transform-origin: 0 0;
  background: var(--bg); color: var(--text); font-family: var(--bfont); overflow: hidden;
}
.stage [contenteditable] { outline: none; border-radius: 4px; transition: box-shadow .12s; cursor: text; }
.stage [contenteditable]:hover { box-shadow: 0 0 0 2px rgba(56, 189, 248, .45); }
.stage [contenteditable]:focus { box-shadow: 0 0 0 2px #38bdf8; background: rgba(56, 189, 248, .06); }
.stage .abs { position: absolute; }
.stage .deco { position: absolute; border-radius: 50%; pointer-events: none; }
.stage .kicker { position: absolute; left: 60px; top: 30px; font-size: 16px; font-weight: 700; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.stage .s-title { position: absolute; left: 60px; top: 60px; right: 80px; font-family: var(--tfont); font-weight: 700; font-size: 40px; line-height: 1.12; color: var(--title); }
.stage .underline { position: absolute; left: 60px; top: 150px; width: 90px; height: 6px; background: var(--accent); }
.stage.academic .s-title { top: 0; height: 120px; display: flex; align-items: center; color: var(--onp); }
.stage .content { position: absolute; left: 60px; right: 60px; top: 178px; bottom: 72px; display: flex; gap: 40px; }
.stage .footer { position: absolute; left: 60px; right: 60px; bottom: 22px; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.stage ul.bl { margin: 0; padding: 0 0 0 28px; font-size: var(--fs, 24px); line-height: 1.3; flex: 1; min-width: 0; }
.stage ul.bl li { margin-bottom: 12px; }
.stage ul.bl li::marker { color: var(--primary); }
.stage .rows { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; }
.stage .row { display: flex; align-items: center; gap: 26px; padding: 14px 0; border-bottom: 1.5px solid var(--surface); font-size: var(--fs, 24px); line-height: 1.28; }
.stage .row:last-child { border-bottom: 0; }
.stage .num { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; background: var(--primary); color: var(--onp); }
.stage .row:nth-child(even) .num { background: var(--accent); color: var(--onacc); }
/* Ảnh trong khung: viền trắng + bóng đổ + khối màu nhấn lệch ra mép slide */
.stage .imgbox { flex: 0 0 42%; display: flex; flex-direction: column; justify-content: center; min-height: 0; min-width: 0; padding: 18px 26px 6px; }
.stage .imgbox .frame { position: relative; align-self: center; display: inline-block; max-width: 100%; min-height: 0; }
.stage .imgbox img { position: relative; z-index: 1; display: block; max-width: 100%; max-height: 430px; object-fit: contain; border: 3px solid #fff; box-shadow: 0 14px 30px rgba(28, 26, 74, .28); }
.stage .imgbox.side-right .frame::before, .stage .imgbox.side-left .frame::before {
  content: ''; position: absolute; z-index: 0; inset: 22px -22px -22px 22px; background: var(--accent); border-radius: 10px; opacity: .92;
}
.stage .imgbox.side-left .frame::before { inset: 22px 22px -22px -22px; }
.stage .imgbox.side-right .frame::after, .stage .imgbox.side-left .frame::after {
  content: ''; position: absolute; z-index: 0; top: -26px; width: 110px; height: 80px;
  background: radial-gradient(circle, var(--primary) 2.2px, transparent 2.6px) 0 0 / 14px 14px; opacity: .45;
}
.stage .imgbox.side-right .frame::after { left: -26px; }
.stage .imgbox.side-left .frame::after { right: -26px; }
.stage .imgbox .cap { font-size: 14px; font-style: italic; color: var(--muted); text-align: center; padding-top: 34px; }
.stage .gallery { flex: 1; min-height: 0; display: grid; gap: 22px; }
.stage .gallery.g2 { grid-template-columns: 1fr 1fr; }
.stage .gallery.g3 { grid-template-columns: 1fr 1fr 1fr; }
.stage .gallery.g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.stage .gallery .imgbox { padding: 6px; }
.stage .gallery img { max-height: 340px; }
.stage .gallery.g4 img { max-height: 170px; }
.stage .gallery.g4.row { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; }
.stage .gallery.g4.row img { max-height: 300px; }
.stage .gallery .cap { padding-top: 10px; font-size: 13px; }
.stage .gstrip { flex: none; display: flex; gap: 28px; align-items: center; padding: 14px 24px; background: var(--surface); border-radius: 10px; border-left: 8px solid var(--accent); font-size: 17px; }
.stage .col { flex: 1; background: var(--surface); border-radius: 12px; overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.stage .col h4 { margin: 0; padding: 18px 25px; font-family: var(--tfont); font-size: 24px; background: var(--primary); color: var(--onp); }
.stage .col:nth-child(2) h4 { background: var(--accent); color: var(--onacc); }
.stage .col:nth-child(3) h4 { background: var(--secondary); color: #fff; }
.stage .col ul.bl { padding: 22px 25px 0 50px; --fs: 22px; }
.stage .vs { align-self: center; flex: none; width: 76px; height: 76px; margin: 0 -18px; border-radius: 50%; border: 3px solid var(--accent); display: grid; place-items: center; font-weight: 800; color: var(--accent); background: var(--bg); font-size: 22px; z-index: 1; }
.stage .statgrid { display: flex; gap: 35px; }
.stage .stat { flex: 1; background: var(--surface); border-radius: 14px; padding: 30px; min-width: 0; }
.stage .stat::before { content: ''; display: block; width: 50px; height: 7px; background: var(--primary); margin-bottom: 18px; }
.stage .stat:nth-child(even)::before { background: var(--accent); }
.stage .stat .v { font-family: var(--tfont); font-size: 64px; font-weight: 800; color: var(--title); line-height: 1.1; }
.stage .stat:nth-child(even) .v { color: var(--accent); }
.stage .stat .l { margin-top: 14px; font-size: 20px; color: var(--muted); }
.stage .steps { display: flex; width: 100%; position: relative; padding-top: 25px; }
.stage .steps::before { content: ''; position: absolute; top: 72px; left: var(--half); right: var(--half); border-top: 2px dashed var(--muted); }
.stage .stp { flex: 1; text-align: center; padding: 0 14px; position: relative; min-width: 0; }
.stage .stp .c { width: 95px; height: 95px; margin: 0 auto 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 28px; background: var(--primary); color: var(--onp); box-shadow: 0 0 0 8px var(--bg), 0 0 0 10px var(--primary); }
.stage .stp:nth-child(even) .c { background: var(--accent); color: var(--onacc); box-shadow: 0 0 0 8px var(--bg), 0 0 0 10px var(--accent); }
.stage .stp .t { font-weight: 700; font-size: 22px; color: var(--title); margin-bottom: 10px; }
.stage .stp .d { font-size: 18px; color: var(--muted); }
.stage .tl { position: relative; width: 100%; display: flex; }
.stage .tl::before { content: ''; position: absolute; left: 0; right: 0; top: 248px; height: 6px; background: var(--primary); }
.stage .tli { flex: 1; position: relative; text-align: center; padding: 0 10px; min-width: 0; height: 100%; }
.stage .tli .dot { position: absolute; left: 50%; top: 234px; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%; background: var(--accent); border: 4px solid var(--bg); }
.stage .tli .box { position: absolute; left: 10px; right: 10px; }
.stage .tli.up .box { bottom: calc(100% - 215px); display: flex; flex-direction: column-reverse; }
.stage .tli.down .box { top: 290px; }
.stage .tli .t { font-family: var(--tfont); font-weight: 800; font-size: 26px; color: var(--accent); margin: 6px 0; }
.stage .tli .d { font-size: 18px; }
.stage .chartbox { flex: 1.7; background: var(--surface); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; min-width: 0; }
.stage .chartbox svg { flex: 1; width: 100%; min-height: 0; }
.stage .side { flex: 1; min-width: 0; }
.stage .side h5 { margin: 0 0 14px; font-size: 16px; letter-spacing: .14em; color: var(--accent); }
.stage table { width: 100%; border-collapse: collapse; font-size: 20px; }
.stage th { background: var(--primary); color: var(--onp); text-align: left; padding: 10px 12px; }
.stage td { padding: 10px 12px; border-bottom: 1px solid var(--line-c); }
.stage tr:nth-child(odd) td { background: var(--surface); }
.stage .ex { flex: 0 0 60%; background: var(--surface); border-radius: 12px; padding: 30px 40px; position: relative; }
.stage .ex::before { content: ''; position: absolute; left: 0; top: 25px; bottom: 25px; width: 10px; background: var(--accent); }
.stage .ex .pill { display: inline-block; padding: 8px 20px; border-radius: 999px; background: var(--accent); color: var(--onacc); font-weight: 800; font-size: 15px; letter-spacing: .06em; }
.stage .ex h4 { font-family: var(--tfont); font-size: 30px; color: var(--title); margin: 20px 0 14px; }
.stage .ex p { font-size: 22px; line-height: 1.45; margin: 0; }
.stage .qmark { position: absolute; left: 80px; top: 140px; font-family: Georgia, serif; font-size: 200px; line-height: 1; color: var(--accent); font-weight: 700; }
.stage .qtext { position: absolute; left: 160px; right: 160px; top: 230px; height: 300px; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--tfont); font-style: italic; font-size: 40px; line-height: 1.3; color: var(--title); }
.stage .qauthor { position: absolute; left: 160px; right: 160px; top: 585px; text-align: center; font-size: 22px; color: var(--muted); }
.stage .qauthor::before { content: ''; display: block; width: 80px; height: 5px; background: var(--accent); margin: 0 auto 14px; }

/* Cover / section / thanks */
.stage.cover, .stage.section-s { background: var(--hl); color: var(--cfg); }
.stage.cover.minimal { background: var(--bg); color: var(--text); }
.stage .c-school { position: absolute; left: 70px; top: 45px; right: 480px; height: 110px; display: flex; align-items: center; gap: 30px; }
.stage .c-logo { flex: none; height: 100px; max-width: 240px; padding: 10px; border-radius: 12px; display: grid; place-items: center; }
.stage .c-logo.badge { background: #fff; }
.stage .c-logo img { max-height: 100px; max-width: 220px; object-fit: contain; }
.stage .c-school .s1 { font-family: var(--tfont); font-weight: 700; font-size: 22px; text-transform: uppercase; line-height: 1.25; }
.stage .c-school .s2 { font-size: 17px; text-transform: uppercase; margin-top: 4px; opacity: .92; }
.stage .c-kind { position: absolute; left: 70px; top: 195px; font-weight: 800; letter-spacing: .2em; color: var(--accent); font-size: 18px; text-transform: uppercase; }
.stage .c-title { position: absolute; left: 70px; top: 240px; width: 940px; height: 190px; display: flex; align-items: center; font-family: var(--tfont); font-weight: 800; font-size: 54px; line-height: 1.1; }
.stage .c-sub { position: absolute; left: 70px; top: 432px; width: 940px; font-size: 24px; font-style: italic; opacity: .92; }
.stage .c-line { position: absolute; left: 70px; top: 500px; width: 130px; height: 7px; background: var(--accent); }
.stage .c-info { position: absolute; left: 70px; top: 525px; right: 300px; font-size: 20px; line-height: 1.45; display: flex; gap: 40px; }
.stage .c-info b { color: var(--accent); }
.stage.cover.minimal .c-info b { color: var(--primary); }
.stage .c-info ul { margin: 0; padding-left: 20px; columns: var(--pcols, 1); column-gap: 30px; font-size: var(--pfs, 19px); }
.stage .c-date { position: absolute; right: 80px; bottom: 25px; font-style: italic; font-size: 17px; }
.stage .sec-no { position: absolute; left: 90px; top: 150px; font-family: var(--tfont); font-weight: 800; font-size: 150px; color: var(--accent); line-height: 1; }
.stage .sec-title { position: absolute; left: 90px; top: 355px; width: 840px; font-family: var(--tfont); font-weight: 800; font-size: 54px; line-height: 1.1; }
.stage .sec-sub { position: absolute; left: 90px; top: 530px; width: 840px; font-size: 24px; opacity: .85; }
.stage .agenda { display: grid; grid-template-columns: var(--acols, 1fr); grid-auto-rows: min(88px, var(--arow, 88px)); gap: 12px 50px; width: 100%; }
.stage .ag { display: flex; align-items: center; gap: 20px; background: var(--surface); border-radius: 10px; overflow: hidden; font-size: 21px; }
.stage .ag i { font-style: normal; flex: none; align-self: stretch; width: 85px; display: grid; place-items: center; font-weight: 800; font-size: 24px; background: var(--primary); color: var(--onp); }
.stage .ag:nth-child(even) i { background: var(--accent); color: var(--onacc); }


/* ============ Thông báo nổi ============ */
.toast {
  position: fixed; left: 50%; bottom: var(--s6); z-index: 60; max-width: min(560px, 90vw);
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500;
  box-shadow: var(--shadow-lg); transform: translate(-50%, 30px); opacity: 0; transition: .2s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--danger); }

/* ============ Responsive ============ */
@media (max-width: 1280px) {
  .ws-toolbar { flex-wrap: wrap; row-gap: var(--s2); padding: var(--s3) var(--s6); }
  :root { --panel-w: 380px; }
  .step span { display: none; }
  .hero { grid-template-columns: 1fr; padding: 36px 32px; }
}
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding-right: var(--s4); }
  .brand { padding-left: var(--s4); }
  .brand-tag { font-size: 10px; }
  .stepper, .top-link { display: none; }
  .app { grid-template-columns: 1fr; height: auto; }
  .panel { border-right: 0; }
  #form { overflow: visible; }
  .panel-actions { position: sticky; bottom: 0; z-index: 20; }
  .workspace { overflow: visible; }
  .ws-toolbar { top: var(--topbar-h); padding: var(--s3) var(--s4); flex-wrap: wrap; }
  .ws-inner { padding: var(--s5) var(--s4) 64px; }
  .how { grid-template-columns: 1fr; }
  .slide-item { grid-template-columns: 1fr; gap: 6px; }
  .slide-no { text-align: left; padding: 0; }
}
@media (max-width: 480px) {
  .hero { padding: 28px 20px; border-radius: 18px; }
  .langs { grid-template-columns: repeat(3, 1fr); }
  .themes { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr 1fr; }
  .grid-label { grid-template-columns: 1fr; }
  .ws-actions { width: 100%; }
  .ws-actions .btn { flex: 1; }
  .badge { display: none; }
}

/* ============ Phong cách cao cấp (xem trước) ============ */
.stage.editorial .rule { position: absolute; left: 60px; right: 60px; top: 152px; height: 1.5px; background: var(--muted); }
.stage .pageno { position: absolute; right: 60px; top: 36px; font-family: var(--tfont); font-weight: 700; font-size: 19px; color: var(--accent); }
.stage.editorial .s-title { right: 200px; }
.stage.diagonal .s-title, .stage.corner .s-title, .stage.geometric .s-title { right: 200px; }
.stage.ribbon .footer { bottom: 14px; color: var(--onp); }
.stage.frame .footer { bottom: 34px; }
.stage.cover.narrow .c-title, .stage.cover.narrow .c-sub { width: 760px; }
.stage.cover.narrow .c-info { right: 470px; gap: 24px; font-size: 18px; }
.stage.cover.narrow .c-school { right: 460px; }
.stage.cover.narrow .c-date { right: auto; left: 70px; }
.stage.cover.wide .c-title, .stage.cover.wide .c-sub { width: 1120px; }
.stage.cover.indent .c-school, .stage.cover.indent .c-kind, .stage.cover.indent .c-title, .stage.cover.indent .c-sub,
.stage.cover.indent .c-line, .stage.cover.indent .c-info { left: 110px; }
.stage.cover.framed .c-school, .stage.cover.framed .c-kind, .stage.cover.framed .c-title, .stage.cover.framed .c-sub,
.stage.cover.framed .c-line, .stage.cover.framed .c-info { left: 100px; }

/* ============ Minh hoạ (xem trước) ============ */
.stage .c-hero { position: absolute; right: 45px; top: 125px; width: 490px; height: auto; pointer-events: none; }
.stage.cover.with-hero .c-title, .stage.cover.with-hero .c-sub { width: 700px; }
.stage.cover.with-hero .c-title { top: 215px; height: 255px; }
.stage.cover.with-hero .c-kind { top: 170px; }
.stage.cover.with-hero .c-sub { top: 478px; }
.stage.cover.with-hero .c-line { top: 536px; }
.stage.cover.with-hero .c-info { top: 555px; right: 560px; }
.stage.cover.with-hero .c-school { right: 560px; }
.stage .panel-art { flex: 0 0 404px; width: 404px; height: auto; max-height: 500px; object-fit: contain; align-self: center; }
.stage .sec-art { position: absolute; left: 830px; top: 135px; width: 460px; height: 460px; pointer-events: none; }


/* ============ Kiểu chữ ============ */
h1, h2, h3, h4, .card-head h2, .hero h1, .ws-info h1, .loading h2, .how h3, .summary h3,
.step, .btn, .theme-filter button, .lang b, .count, .card-no, .eyebrow, .badge, .slide-no {
  font-family: var(--font-display);
}
.hero h1 { font-weight: 700; letter-spacing: -.025em; line-height: 1.16; }
.hero p { line-height: 1.65; }
.card-head h2 { font-weight: 600; letter-spacing: -.01em; }
.card-head p, .hint, .drop-sub { line-height: 1.5; }
.how h3 { font-weight: 600; letter-spacing: -.01em; }
.ws-info h1 { font-weight: 600; letter-spacing: -.01em; }
.btn { font-weight: 600; letter-spacing: .005em; }
.field label, .label, .label-row label { font-weight: 600; letter-spacing: .005em; }
.step { font-weight: 500; }
.eyebrow { font-weight: 600; letter-spacing: .12em; }
input, select, textarea { font-size: 13.5px; }

/* ============ Chân trang ============ */
.site-footer { position: relative; background: var(--brand-800); color: rgba(255, 255, 255, .72); font-size: 13px; }
.site-footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--brand-600), var(--orange) 70%, var(--orange-400)); }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 40px var(--s8) 28px;
  display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(150px, 1fr)); gap: 32px;
}
.footer-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 12px; }
.footer-logo img { height: 32px; width: auto; background: #fff; border-radius: 8px; padding: 3px 4px; }
.footer-logo span { font-family: var(--font-display); font-size: 18px; color: #fff; letter-spacing: -.01em; }
.footer-logo .tag-viet { color: #fff; font-weight: 700; }
.footer-logo .tag-sci { color: var(--orange-400); font-weight: 700; }
.footer-logo em { font-style: normal; font-weight: 400; color: rgba(255, 255, 255, .7); margin-left: 4px; }
.footer-brand p { margin: 0 0 12px; line-height: 1.65; max-width: 380px; }
.footer-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.footer-note svg { width: 16px; height: 16px; flex: none; color: var(--orange-400); }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #fff; letter-spacing: .02em; }
.footer-col > a, .footer-col > .fi { display: flex; align-items: flex-start; gap: 10px; color: rgba(255, 255, 255, .74); text-decoration: none; line-height: 1.45; }
.footer-col > a .ic, .footer-col > .fi .ic {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -3px;
  border-radius: 7px; background: rgba(255, 255, 255, .08); color: var(--orange-400); transition: background .15s, color .15s;
}
.footer-col > a:hover { color: #fff; }
.footer-col > a:hover .ic { background: var(--orange); color: #fff; }
.footer-col h4 { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-bottom {
  max-width: 1180px; margin: 0 auto; padding: 16px var(--s8) 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: rgba(255, 255, 255, .5);
}
@media (max-width: 1100px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; padding: 32px var(--s4) 20px; gap: 24px; }
  .footer-bottom { padding: 14px var(--s4) 20px; }
}


/* ============ Phong cách tham khảo (xem trước) ============ */
.stage .meta { position: absolute; left: 60px; right: 60px; top: 10px; height: 28px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.stage .meta b { color: var(--text); }
.stage.f-square .col, .stage.f-square .stat, .stage.f-square .ex, .stage.f-square .ag, .stage.f-square .ag i,
.stage.f-square .gstrip, .stage.f-square .chartbox { border-radius: 0; }
.stage.f-square .num { border-radius: 3px; }
.stage.f-upper .s-title { text-transform: uppercase; font-weight: 400; letter-spacing: .01em; }
.stage.f-pill .kicker { top: 26px; padding: 7px 16px 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; letter-spacing: .08em; }
.stage.f-pill .s-title { top: 74px; }
.stage.f-darkcards .col, .stage.f-darkcards .stat { background: var(--primary); color: #fff; }
.stage.f-darkcards .col h4 { background: transparent; color: #fff; padding-bottom: 6px; }
.stage.f-darkcards .col h4::after { content: ''; display: block; width: 60px; height: 5px; background: var(--accent); margin-top: 12px; }
.stage.f-darkcards .col ul.bl li::marker { color: var(--accent); }
.stage.f-darkcards .stat .v, .stage.f-darkcards .stat:nth-child(even) .v { color: #fff; }
.stage.f-darkcards .stat .l { color: #dde6ee; }
.stage.f-darkcards .stat::before { background: var(--accent); }
.stage.f-arch .imgbox.side-left img, .stage.f-arch .imgbox.side-right img { border: 0; border-radius: 999px 999px 14px 14px / 46% 46% 14px 14px; }
.stage.f-arch .imgbox.side-left .frame::before, .stage.f-arch .imgbox.side-right .frame::before { background: var(--secondary); border-radius: 999px 999px 14px 14px / 46% 46% 14px 14px; }
.stage.seminar .footer { left: 220px; }


/* ============ Biểu tượng phân cách chung (thay " · ") ============ */
.sep {
  display: inline-block; flex: none; width: 5px; height: 5px; margin: 0 .6em; vertical-align: .18em;
  background: var(--orange); border-radius: 1px; transform: rotate(45deg);
}
.opt .sep { margin-left: .45em; opacity: .8; }
.hero .sep, .preview-label .sep { background: var(--orange-400); }
.badge .sep { background: currentColor; opacity: .6; }
.stage .footer .sep { width: 6px; height: 6px; background: var(--accent); margin: 0 12px; vertical-align: .15em; }

.ic { display: inline-grid; place-items: center; line-height: 0; }
.ic svg { width: 16px; height: 16px; display: block; }
.footer-col > a .ic svg, .footer-col > .fi .ic svg { width: 14px; height: 14px; }

/* ============ Trình hướng dẫn 3 bước ============ */
button.step { border: 0; background: none; padding: 4px 6px; border-radius: 999px; cursor: pointer; font: inherit; }
button.step:disabled { cursor: not-allowed; opacity: .55; }
button.step:not(:disabled):hover { background: var(--brand-50); }
/* Cột cài đặt hiển thị theo bước */
body[data-step="1"] .card[data-section="2"], body[data-step="1"] .card[data-section="3"], body[data-step="1"] .card[data-section="4"],
body[data-step="2"] .card[data-section="1"], body[data-step="2"] .card[data-section="4"],
body[data-step="3"] .card[data-section="1"], body[data-step="3"] .card[data-section="2"], body[data-step="3"] .card[data-section="3"] { display: none; }
body[data-step="1"] .step2-only, body[data-step="2"] .step1-only, body[data-step="3"] .step1-only { display: none !important; }
body[data-mode="summary"] .script-only, body[data-mode="script"] .summary-only { display: none !important; }
body[data-mode="script"] .script-only { display: flex !important; }

.action-row { display: flex; gap: var(--s2); }
.action-row .btn.ghost { height: 50px; flex: none; padding: 0 14px; }
.action-row .btn.big { flex: 1; }
.btn .ic svg { width: 18px; height: 18px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.sm .ic svg { width: 15px; height: 15px; }

/* Hai chế độ nhập nội dung */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: var(--s4); }
.mode {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 3px; align-items: center;
  padding: 11px 12px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: #fff; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.mode .ic { grid-row: 1; color: var(--brand); }
.mode b { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.mode span { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.mode:hover { border-color: var(--brand); }
.mode.is-on { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.mode.is-on .ic { color: var(--orange); }
.drop.drop-sm { padding: var(--s4); margin-bottom: var(--s3); }
.drop.drop-sm .drop-icon { width: 38px; height: 38px; }
.or { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s3); font-size: 12px; color: var(--ink-4); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#scriptText { font-family: "Inter", ui-monospace, monospace; font-size: 13px; line-height: 1.55; min-height: 170px; }
.howto { margin: -4px 0 var(--s4); font-size: 12.5px; color: var(--ink-2); }
.howto summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.howto ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.5; }
.up-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; padding: 6px; border: 1px dashed var(--line-2); border-radius: var(--r); background: #fff; }
.up-strip img { width: 46px; height: 34px; object-fit: cover; border-radius: 5px; box-shadow: var(--shadow-sm); }
.up-strip .hint { padding: 0 4px; }
.final { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.final li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--brand-50); }
.final li .ic { color: var(--orange); margin-top: 1px; }
.final li b { color: var(--ink); }

/* ============ Kịch bản slide (storyboard) ============ */
.storyboard { display: grid; gap: var(--s5); }
.sb-lib { padding: var(--s4) var(--s5); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s; }
.sb-lib.is-over { border-color: var(--brand); background: var(--brand-50); }
.sb-lib-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.sb-lib-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-lib-title .ic { color: var(--brand); }
.sb-lib-title h3 { margin: 0; font-size: 15px; }
.sb-lib-actions { display: flex; gap: 8px; }
.sb-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.sb-lib-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px; border: 1.5px dashed var(--line-2); border-radius: var(--r); color: var(--ink-3); cursor: pointer; }
.sb-lib-empty:hover { border-color: var(--brand); color: var(--brand); }
.sb-thumb { position: relative; margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.sb-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--brand-50); }
.sb-thumb figcaption { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; font-size: 11.5px; }
.sb-thumb figcaption b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-use { align-self: flex-start; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--line); color: var(--ink-3); }
.sb-thumb.used { border-color: var(--brand-200); }
.sb-thumb.used .badge-use { background: var(--brand-50); color: var(--brand); }
.sb-thumb-del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; font-size: 14px; background: rgba(255, 255, 255, .92); }

.sb-list { display: grid; gap: var(--s3); }
.sb-special { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r); background: var(--brand-50); border: 1px dashed var(--brand-200); font-size: 13px; }
.sb-special .ic { color: var(--brand); }
.sb-no { flex: none; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.sb-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: var(--s4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: border-color .15s; }
.sb-card:focus-within { border-color: var(--brand-200); box-shadow: var(--shadow); }
.sb-card > .sb-no { padding-top: 10px; }
.sb-main { display: grid; gap: var(--s3); min-width: 0; }
.sb-top { display: flex; gap: 8px; align-items: center; }
.sb-layout { flex: none; width: 160px !important; height: 36px; font-size: 12.5px; font-weight: 600; }
.sb-title { flex: 1; min-width: 0; height: 36px; font-family: var(--font-display); font-size: 15px !important; font-weight: 600; }
.sb-tools { display: flex; gap: 4px; flex: none; }
.sb-tools .icon-btn { width: 32px; height: 32px; font-size: 14px; }
.sb-tools .icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.sb-tools .icon-btn.del:hover { color: var(--danger); border-color: var(--danger); }
.sb-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: var(--s4); }
.sb-content { display: grid; gap: 6px; min-width: 0; }
.sb-label { display: flex; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sb-label small { font-weight: 400; color: var(--ink-4); }
.sb-text { font-size: 13.5px; line-height: 1.6; resize: vertical; min-height: 84px; }
.sb-notes summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sb-notes summary:hover { color: var(--brand); }
.sb-notes textarea { margin-top: 6px; font-size: 13px; }
.sb-media { display: flex; flex-direction: column; gap: 6px; }
.sb-shot { display: grid; place-items: center; height: 118px; border-radius: var(--r); overflow: hidden; background: var(--brand-50); border: 1px solid var(--line); }
.sb-shot img { width: 100%; height: 100%; object-fit: cover; }
.sb-shot.multi { grid-template-columns: 1fr 1fr; gap: 2px; place-items: stretch; }
.sb-shot.empty { gap: 4px; align-content: center; color: var(--ink-4); font-size: 12px; border-style: dashed; }
.sb-img-select { height: 34px; font-size: 12px; }
.sb-media-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.sb-media-actions .link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.sb-media-actions .link .ic svg { width: 14px; height: 14px; }

@media (max-width: 760px) {
  .sb-body { grid-template-columns: 1fr; }
  .sb-top { flex-wrap: wrap; }
  .sb-layout { width: auto !important; }
  .modes { grid-template-columns: 1fr; }
}
