/* Valoria Capsule — builder UI */
:root {
  --teal: #4FADAF; --teal-d: #3D9092; --teal-dd: #2F7B7D; --navy: #262C3F; --navy-2: #323A52;
  --bg: #F4F6F9; --card: #fff; --text: #1E2433; --muted: #667085; --line: #E4E8EE; --line-2: #EEF1F5;
  --soft: #EAF6F6; --warn: #B7791F; --warn-bg: #FDF5E6; --bad: #D9534F; --bad-bg: #FCEDEC; --good: #1F9D6B; --good-bg: #E8F6EF;
  --r: 14px; --sh: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.12);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Poppins', 'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--teal-dd); text-decoration: none; }
h1, h2, h3 { margin: 0; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; } h2 { font-size: 17px; font-weight: 600; } h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
[data-lucide], svg.lucide { width: 18px; height: 18px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* top bar */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; }
.tb-in { max-width: 1320px; margin: 0 auto; height: 60px; display: flex; align-items: center; gap: 24px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font-size: 14px; letter-spacing: .28em; font-weight: 600; }
.brand em { font-style: normal; font-size: 12px; color: var(--teal); letter-spacing: .04em; font-weight: 500; }
.tb-nav { display: flex; gap: 4px; flex: 1; }
.tb-nav a { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.72); padding: 8px 14px; border-radius: 10px; font-weight: 500; }
.tb-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.tb-nav a.on { color: #fff; background: rgba(79,173,175,.22); }
.tb-user { display: flex; align-items: center; gap: 10px; }
.tb-user .who { font-weight: 500; opacity: .9; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; margin-inline-end: 10px; vertical-align: middle; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: inherit; transition: background .15s; }
.icon-btn:hover { background: rgba(127,140,160,.14); }
.topbar .icon-btn { color: #fff; }

/* layout */
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 20px 60px; }
.wrap.narrow { max-width: 860px; }
.wrap.narrow-wide { max-width: 1180px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h2, .card-h h3 { display: flex; align-items: center; gap: 10px; }
.card-h h2 [data-lucide], .card-h h2 svg, .card-h h3 svg { color: var(--teal-d); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--teal-d); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; }
.eyebrow svg { width: 15px; height: 15px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head p.muted { max-width: 720px; margin: 8px 0 0; }
.sep { height: 1px; background: var(--line-2); margin: 16px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: #F7F9FB; border-color: #D3DAE3; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 6px 16px -8px rgba(47,123,125,.7); }
.btn.primary:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(127,140,160,.1); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn.xs svg { width: 14px; height: 14px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon { width: 34px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.btn-row select.sm { height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; background: #fff; max-width: 190px; font-size: 13px; }
.upl { cursor: pointer; }

/* forms */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 600; color: #3A4256; }
.fld > span em { font-style: normal; font-weight: 400; color: var(--muted); margin-inline-start: 4px; }
.fld input, .fld select, .fld textarea, textarea, .q-card input { width: 100%; border: 1px solid #D8DEE6; border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.fld input, .fld select { height: 42px; }
textarea { resize: vertical; line-height: 1.55; }
.fld input:focus, .fld select:focus, textarea:focus, .q-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(79,173,175,.18); }
.fld.inline { flex-direction: row; align-items: center; margin: 0; }
.fld.inline input { width: 76px; height: 38px; }
.fld.inline em { font-style: normal; color: var(--muted); }
.two-fld { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.hint { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.hint svg { width: 16px; height: 16px; margin-top: 2px; color: var(--teal-d); }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 8px 0; margin-bottom: 6px; }
.toggle input { display: none; }
.toggle .sw { width: 40px; height: 23px; border-radius: 99px; background: #CBD3DD; position: relative; flex: none; transition: background .2s; margin-top: 2px; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked + .sw { background: var(--teal); }
.toggle input:checked + .sw::after { transform: translateX(17px); }
.toggle b { display: block; font-weight: 600; font-size: 14px; }
.toggle small { color: var(--muted); font-size: 12.5px; }

/* alerts */
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.alert.ok { background: var(--good-bg); color: var(--good); }
.alert.err { background: var(--bad-bg); color: var(--bad); }

/* auth */
body.auth { background: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at 0% 0%, rgba(79,173,175,.35), transparent 60%), var(--navy); color: #fff; display: flex; align-items: center; padding: 48px; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(79,173,175,.12); right: -180px; bottom: -200px; }
.auth-side-in { max-width: 520px; position: relative; z-index: 1; }
.auth-side h1 { color: #fff; font-size: 44px; line-height: 1.1; margin: 46px 0 16px; }
.auth-side p { color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.65; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-points svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(79,173,175,.22); color: var(--teal); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; }
.auth-card h2 { font-size: 24px; } .auth-card > p { margin: 6px 0 22px; }

/* dashboard */
.hero-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 60%, #2E5D68 100%); color: #fff; border-radius: 20px; padding: 30px 32px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero-band::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 50px solid rgba(79,173,175,.16); right: 14%; top: -160px; }
.hero-band h1 { color: #fff; font-size: 30px; } .hero-band .muted { color: rgba(255,255,255,.72); margin: 6px 0 0; } .hero-band .eyebrow { color: var(--teal); }
.hero-band > * { position: relative; z-index: 1; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--sh); }
.stat > svg { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--soft); color: var(--teal-d); }
.stat b { display: block; font-size: 22px; color: var(--navy); line-height: 1.1; } .stat span { color: var(--muted); font-size: 13px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: visible; box-shadow: var(--sh); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16,24,40,.05), 0 18px 40px -18px rgba(16,24,40,.22); }
.cc-thumb { display: block; aspect-ratio: 16 / 9; position: relative; background: var(--soft); border-radius: 16px 16px 0 0; overflow: hidden; }
.cc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--teal-d); }
.cc-ph svg { width: 40px; height: 40px; opacity: .5; }
.cc-thumb .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.lang-chip { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(38,44,63,.82); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; letter-spacing: .06em; }
.cc-body { padding: 14px 16px 6px; flex: 1; }
.cc-body h3 { font-size: 16px; line-height: 1.35; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; margin: 0 0 4px; flex-wrap: wrap; }
.meta span { display: inline-flex; gap: 6px; align-items: center; } .meta svg { width: 15px; height: 15px; }
.meta.sub { font-size: 12px; }
.cc-actions { display: flex; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--line-2); align-items: center; }
.cc-actions form { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #EEF1F5; color: #4A5468; }
.badge.st-ready { background: var(--good-bg); color: var(--good); }
.badge.st-building { background: var(--warn-bg); color: var(--warn); }
.badge.st-draft { background: #EEF1F5; color: #4A5468; }
.empty { text-align: center; padding: 50px 20px; }
.empty-ico { width: 72px; height: 72px; border-radius: 20px; background: var(--soft); color: var(--teal-d); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-ico svg { width: 34px; height: 34px; }
.empty p { margin: 8px 0 20px; }

/* menus */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(16,24,40,.25); padding: 6px; min-width: 220px; z-index: 50; }
.menu-pop.right { inset-inline-start: auto; inset-inline-end: 0; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font-weight: 500; cursor: pointer; text-align: start; font-size: 13.5px; }
.menu-pop a:hover, .menu-pop button:hover { background: #F4F6F9; }
.menu-pop .danger { color: var(--bad); }
.menu-pop form { margin: 0; }
.menu-pop .exp span { display: flex; flex-direction: column; } .menu-pop .exp small { color: var(--muted); font-weight: 400; }
.menu-pop form.pw { display: flex; gap: 6px; padding: 6px; }
.menu-pop form.pw input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; height: 28px; min-width: 0; }

/* new course */
.new-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.side-opts { position: sticky; top: 80px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border: 2px dashed #CFD8E2; border-radius: 14px; padding: 26px 16px; cursor: pointer; transition: border-color .15s, background .15s; background: #FAFBFC; }
.drop:hover, .drop.over { border-color: var(--teal); background: var(--soft); }
.drop.has { border-style: solid; border-color: var(--teal); background: var(--soft); }
.drop input { display: none; }
.drop > svg { width: 34px; height: 34px; color: var(--teal-d); }
.drop b { color: var(--navy); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#source { min-height: 300px; }

/* generate */
.gen-card { padding: 30px; }
.gen-top { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; }
.gen-top p { margin: 4px 0 0; }
.gen-orb { width: 72px; height: 72px; border-radius: 22px; background: linear-gradient(135deg, var(--teal), var(--navy)); color: #fff; display: grid; place-items: center; position: relative; flex: none; }
.gen-orb svg { width: 32px; height: 32px; position: relative; }
.gen-orb span { position: absolute; inset: -6px; border-radius: 26px; border: 2px solid var(--teal); opacity: .5; animation: orb 1.8s ease-out infinite; }
@keyframes orb { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.25); opacity: 0; } }
.gen-bar { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; margin-bottom: 20px; }
.gen-bar span { display: block; height: 100%; width: 3%; background: linear-gradient(90deg, var(--teal), var(--teal-dd)); border-radius: 8px; transition: width .6s ease; }
.gen-steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.gen-steps li { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--muted); transition: all .2s; }
.gen-steps li b { display: block; color: var(--navy); font-weight: 600; } .gen-steps li small { font-size: 12.5px; }
.gen-steps .ico { width: 38px; height: 38px; border-radius: 10px; background: #F1F4F7; display: grid; place-items: center; flex: none; }
.gen-steps li.run { border-color: var(--teal); background: var(--soft); }
.gen-steps li.run .ico { background: var(--teal); color: #fff; animation: pulseIco 1.2s ease-in-out infinite; }
@keyframes pulseIco { 50% { transform: scale(.92); } }
.gen-steps li.ok .ico { background: var(--good); color: #fff; }
.gen-steps li.warn .ico { background: var(--warn); color: #fff; }
.gen-steps li.err { border-color: var(--bad); } .gen-steps li.err .ico { background: var(--bad); color: #fff; }
.gen-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.gen-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 22px; }
.gp { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; animation: fadeUp .4s both; }
.gp img, .gp-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: linear-gradient(110deg, #EEF1F5 30%, #F7F9FB 50%, #EEF1F5 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.gp img { animation: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gp span { display: block; font-size: 12px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.gp-a { position: absolute; top: 6px; right: 6px; width: 22px !important; height: 22px !important; padding: 4px; border-radius: 6px; background: rgba(38,44,63,.8); color: #fff; }

/* editor */
body.editor { overflow: hidden; height: 100vh; display: flex; flex-direction: column; }
body.editor .topbar { position: static; }
.ed-bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-title { flex: 1; min-width: 160px; border: 1px solid transparent; border-radius: 9px; padding: 7px 10px; font-size: 17px; font-weight: 600; color: var(--navy); background: transparent; outline: none; }
.ed-title:hover { border-color: var(--line); } .ed-title:focus { border-color: var(--teal); background: #fff; }
.save-st { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); min-width: 92px; }
.save-st svg { width: 15px; height: 15px; }
.save-st.saving svg { animation: spin 1s linear infinite; }
.save-st.dirty { color: var(--warn); } .save-st.err { color: var(--bad); } .save-st.ok { color: var(--good); }
.ed-tabs { display: flex; background: #F1F4F7; padding: 4px; border-radius: 11px; gap: 2px; }
.ed-tabs button { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; font-size: 13px; }
.ed-tabs button svg { width: 16px; height: 16px; }
.ed-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.ed-actions { display: flex; gap: 6px; align-items: center; }
.ed-body { flex: 1; min-height: 0; position: relative; }
.ed-pane { display: none; height: 100%; overflow: auto; }
.ed-pane.on { display: block; }
#pane-slides.on { display: grid; grid-template-columns: 290px minmax(0, 1fr); overflow: hidden; }
.sl-list { border-inline-end: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.sl-list-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.sl-list-h span { color: var(--muted); font-weight: 400; }
#slList { list-style: none; margin: 0; padding: 8px; overflow: auto; flex: 1; }
#slList li { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; position: relative; border: 1px solid transparent; margin-bottom: 4px; }
#slList li:hover { background: #F6F8FA; }
#slList li.on { background: var(--soft); border-color: rgba(79,173,175,.45); }
#slList .th { width: 76px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #EEF1F5; flex: none; position: relative; display: grid; place-items: center; color: #A7B1BF; }
#slList .th img { width: 100%; height: 100%; object-fit: cover; }
#slList .th em { position: absolute; left: 3px; bottom: 3px; font-style: normal; font-size: 10px; font-weight: 700; background: rgba(38,44,63,.85); color: #fff; border-radius: 4px; padding: 0 5px; }
#slList .tt { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#slList .tt small { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }
#slList .tt small svg { width: 12px; height: 12px; } #slList .tt small .warn { color: var(--warn); }
#slList .ops { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); display: none; background: #fff; border-radius: 8px; box-shadow: 0 4px 14px rgba(16,24,40,.15); padding: 2px; }
#slList li:hover .ops { display: flex; }
#slList .ops button { width: 26px; height: 26px; border: 0; background: none; border-radius: 6px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
#slList .ops button:hover { background: #F1F4F7; color: var(--navy); }
#slList .ops svg { width: 14px; height: 14px; }
.sl-main { overflow: auto; padding: 18px; }
.sl-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; max-width: 1500px; }
.sl-col { display: grid; gap: 16px; min-width: 0; }
.pv-card { padding: 12px; }
.pv-h { display: flex; gap: 10px; align-items: center; margin: 2px 4px 10px; }
.pv-h .muted { flex: 1; font-size: 12.5px; }
.pv { position: relative; overflow: hidden; border-radius: 10px; background: #F3F6F8; border: 1px solid var(--line-2); }
.pv iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; }
.layouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lay { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); }
.lay:hover { border-color: #C5CFDA; color: var(--navy); }
.lay.on { border-color: var(--teal); background: var(--soft); color: var(--teal-dd); }
.ai-row { display: flex; gap: 8px; align-items: center; background: linear-gradient(90deg, var(--soft), #F5FAFA); border: 1px solid rgba(79,173,175,.35); border-radius: 12px; padding: 6px 6px 6px 12px; }
.ai-row > svg { color: var(--teal-d); }
.ai-row input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; height: 32px; }
.tag { display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #EEF1F5; color: #4A5468; }
.tag svg { width: 13px; height: 13px; }
.tag.ok { background: var(--good-bg); color: var(--good); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
audio { width: 100%; height: 40px; margin-top: 4px; }
.img-box { border-radius: 12px; overflow: hidden; background: #F1F4F7; aspect-ratio: 16 / 9; margin-bottom: 14px; border: 1px solid var(--line-2); }
.img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-ph { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; color: #9AA5B4; }
.img-ph svg { width: 34px; height: 34px; }
.pane-in { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; }
.pane-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pane-head p { margin: 4px 0 0; }
.q-card { margin-bottom: 14px; }
.q-top { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.q-top select { height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: #fff; font-size: 13px; }
.q-top .sp { flex: 1; }
.q-num { background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 8px; }
.q-card > textarea { font-weight: 500; font-size: 15px; margin-bottom: 10px; }
.opts { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.opts li { display: flex; gap: 8px; align-items: center; }
.opts li input { height: 40px; }
.opts li.right input { border-color: var(--good); background: var(--good-bg); }
.mark { width: 26px; height: 26px; border: 2px solid #C5CDD8; background: #fff; flex: none; display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0; }
.mark.rad { border-radius: 50%; } .mark.box { border-radius: 7px; }
.mark svg { width: 14px; height: 14px; stroke-width: 3; }
.opts li.right .mark { background: var(--good); border-color: var(--good); }
.q-card .fld { margin: 12px 0 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; max-width: 1200px; }
.color { display: flex; align-items: center; gap: 10px; border: 1px solid #D8DEE6; border-radius: 10px; padding: 5px 10px; height: 42px; }
.color input { width: 34px !important; height: 30px !important; padding: 0 !important; border: 0 !important; background: none; cursor: pointer; }
.swatch { display: flex; align-items: center; gap: 8px; }
.swatch span { width: 40px; height: 40px; border-radius: 10px; } .swatch em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 500; z-index: 100; box-shadow: 0 16px 32px -12px rgba(0,0,0,.35); max-width: min(560px, calc(100% - 32px)); }
.toast.err { background: var(--bad); }

/* users */
.users-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); }
.tbl tr.off td { opacity: .5; }
.tbl td.act { text-align: end; width: 50px; }
.users-grid > .card:first-child { overflow-x: auto; padding: 8px 12px; }

/* responsive */
@media (max-width: 1100px) {
  .sl-grid { grid-template-columns: minmax(0, 1fr); }
  .new-grid { grid-template-columns: minmax(0, 1fr); }
  .side-opts { position: static; }
  .users-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .tb-nav a span, .tb-user .who { display: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 20px; } .auth-side h1 { font-size: 32px; margin-top: 28px; } .auth-points { display: none; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-band { flex-direction: column; align-items: flex-start; padding: 24px; }
  body.editor { overflow: auto; height: auto; }
  #pane-slides.on { display: block; overflow: visible; }
  .sl-list { border: 0; border-bottom: 1px solid var(--line); }
  #slList { display: flex; overflow-x: auto; gap: 6px; }
  #slList li { flex: 0 0 210px; margin: 0; }
  #slList .ops { display: none !important; }
  .ed-pane { height: auto; }
  .ed-actions .btn span { display: none; }
  .layouts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two-fld { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .tb-in { gap: 10px; padding: 0 12px; }
  .wrap { padding: 18px 14px 40px; }
  .layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-actions { flex-wrap: wrap; }
}
