:root {
  --bg: #f4f6fb; --surface: #fff; --text: #1d2433; --muted: #6b7486; --line: #e3e7ef;
  --primary: #3a5bdc; --primary-ink: #fff; --good: #1f9d63; --warn: #d98a12; --bad: #d33f50;
  --radius: 12px; --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151d; --surface: #1a202b; --text: #e7ebf3; --muted: #9aa3b5; --line: #2b3342; --primary: #6d8bff; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; }
h3 { font-size: 1.05rem; } h4 { font-size: .95rem; margin-top: 1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.error { color: var(--bad); min-height: 1em; margin: .25rem 0; font-size: .85rem; }
.ok { color: var(--good); }

.btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: .5rem .9rem; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: .25rem .55rem; font-size: .82rem; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: wait; }

input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; width: 100%; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
label { display: grid; gap: .3rem; font-size: .88rem; font-weight: 500; }
label.inline { display: inline-flex; align-items: center; gap: .5rem; }
.form { display: grid; gap: .8rem; }
.form.narrow { max-width: 420px; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; flex-wrap: wrap; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); display: grid; gap: 1rem; }
.brand { display: flex; gap: .8rem; align-items: center; }
.brand p { margin: 0; color: var(--muted); font-size: .85rem; }
.logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; flex: none; }
.roles { display: flex; flex-wrap: wrap; gap: .35rem; }
.roles span { font-size: .75rem; padding: .15rem .5rem; border-radius: 99px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }

/* Layout */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
#sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
#sidebar .brand { margin-bottom: 1rem; }
#nav { display: grid; gap: 2px; }
#nav a { padding: .5rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; }
#nav a:hover { background: var(--bg); }
#nav a.active { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 600; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h2 { flex: 1; font-size: 1.1rem; margin: 0; }
#menuToggle { display: none; }
.view { padding: 1.5rem; display: grid; gap: 1rem; max-width: 1400px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: grid; gap: .2rem; }
.stat span { color: var(--muted); font-size: .8rem; }
.stat strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat.good strong { color: var(--good); } .stat.warn strong { color: var(--warn); } .stat.bad strong { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar input, .toolbar select { width: auto; }
.note { background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); padding: .7rem .9rem; border-radius: 10px; font-size: .88rem; }
.note p { margin: .2rem 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: .25rem; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; background: var(--bg); border: 1px solid var(--line); }
.badge.hadir, .badge.lunas, .badge.aktif { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.badge.izin, .badge.menunggu { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.badge.sakit { color: var(--warn); }
.badge.alpa, .badge.belum, .badge.batal { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: center; }

.bars { display: flex; align-items: flex-end; gap: .5rem; height: 170px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .2rem; font-size: .75rem; color: var(--muted); }
.bar { width: 70%; max-width: 40px; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 2px; }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.menu-item { display: grid; gap: .3rem; }
.menu-img { aspect-ratio: 4/3; background: var(--bg); border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.menu-img img { width: 100%; height: 100%; object-fit: cover; }
.menu-img.big { max-width: 480px; margin-bottom: .75rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .5rem; }
.price { font-size: 1.5rem; }

dialog { border: none; border-radius: 14px; padding: 1.25rem; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 20, 35, .45); }
#modalBody { display: grid; gap: .75rem; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: .5rem; z-index: 50; }
.toast { background: var(--text); color: var(--bg); padding: .65rem 1rem; border-radius: 10px; font-size: .9rem; max-width: 360px; }
.toast.bad { background: var(--bad); color: #fff; }

/* Kurikulum */
.kur-wrap { display: grid; place-items: center; margin: 1rem 0; }
.kur-svg { width: min(640px, 100%); height: auto; touch-action: manipulation; user-select: none; }
.kur-node { cursor: pointer; }
.kur-node:hover circle { stroke-width: 3; }
.kur-label { fill: var(--text); font-weight: 600; pointer-events: none; }
.kur-empty { fill: var(--muted); font-size: 16px; }

/* Halaman absensi (kiosk) */
.kiosk { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.kiosk-card { width: min(440px, 100%); text-align: center; display: grid; gap: 1rem; justify-items: center; }
.kiosk-card h1 { font-size: 3.2rem; font-variant-numeric: tabular-nums; margin: 0; }
.fp-btn { width: 220px; height: 220px; border-radius: 50%; border: 3px solid var(--primary); background: var(--surface); color: var(--primary);
  display: grid; place-items: center; align-content: center; gap: .5rem; cursor: pointer; font: inherit; font-size: .9rem; padding: 1.5rem; box-shadow: var(--shadow); }
.fp-btn svg { width: 92px; height: 92px; }
.fp-btn:active { transform: scale(.97); }
.fp-btn:disabled { opacity: .6; }
.hasil { min-height: 90px; width: 100%; border-radius: 12px; padding: .8rem; }
.hasil p { margin: .3rem 0 0; }
.hasil.ok { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.hasil.info, .hasil.wait { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.hasil.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }

/* Kiosk kartu QR */
.kiosk-card.wide { width: min(560px, 100%); }
.h-setup { font-size: 1.6rem !important; }
.camera { position: relative; width: 100%; max-width: 420px; aspect-ratio: 4/3; background: #000; border-radius: 14px; overflow: hidden; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera .frame { position: absolute; inset: 18% 22%; border: 3px solid rgba(255,255,255,.85); border-radius: 12px; }
.toolbar.center { justify-content: center; width: 100%; }
.toolbar.center input { flex: 1; min-width: 0; }
.hasil .big { font-size: 1.3rem; }
.riwayat { text-align: left; width: 100%; font-size: .85rem; color: var(--muted); margin: 0; padding-left: 1.2rem; }

/* Kartu siswa */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.id-card { background: #fff; color: #111; border: 1px solid #ccc; border-radius: 12px; padding: .7rem; display: grid; justify-items: center; gap: .2rem; text-align: center; break-inside: avoid; }
.id-head { font-weight: 700; font-size: .8rem; color: #3a5bdc; }
.id-card .kode { font-family: ui-monospace, monospace; font-size: .62rem; color: #555; word-break: break-all; }
.kode { font-family: ui-monospace, monospace; word-break: break-all; }
.qr { max-width: 100%; height: auto; }
@media print {
  #sidebar, .topbar, .no-print, #toasts { display: none !important; }
  .layout { display: block; }
  body { background: #fff; }
  .view { padding: 0; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .id-card { border: 1px dashed #999; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  #sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open #sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  #menuToggle { display: inline-flex; }
  .view { padding: 1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .stat { padding: .6rem .75rem; }
  .stat strong { font-size: 1.1rem; overflow-wrap: anywhere; }
  .toolbar input[type=search] { max-width: none; flex: 1 1 100%; }
  .grid2 { grid-template-columns: 1fr; }
  dialog { padding: 1rem; }
  .form-actions .btn { flex: 1; justify-content: center; }
  .topbar { padding: .6rem 1rem; }
  table.responsive thead { display: none; }
  table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: .5rem 0; }
  table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: none; padding: .2rem .3rem; text-align: right; }
  table.responsive td[colspan] { display: block; text-align: left; }
  table.responsive td[colspan]::before { content: none; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  table.responsive td.actions { justify-content: flex-end; flex-wrap: wrap; }
}

/* Setup */
.setup-card { width: min(560px, 100%); }
.secrets { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .7rem; font-size: .72rem; white-space: pre-wrap; word-break: break-all; user-select: all; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
code { font-family: ui-monospace, monospace; font-size: .9em; }

/* ===== Halaman login: logo & latar ===== */
.auth-bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
body.has-bg::before { content: ""; position: fixed; inset: 0; background: rgba(10, 15, 30, .35); z-index: -1; }
body.has-bg .auth-card { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); }
.logo.has-img { background: transparent; width: 56px; height: 56px; }
.logo img { width: 100%; height: 100%; object-fit: contain; }
.tampilan-prev { min-height: 120px; display: grid; place-items: center; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; overflow: hidden; }
.tampilan-prev img { max-width: 100%; max-height: 220px; object-fit: contain; }
.tampilan-prev.logo img { max-height: 120px; }
.toolbar.filters select { width: auto; min-width: 150px; }
.big-code { display: block; font-size: 1.6rem; letter-spacing: .12em; padding: .75rem; text-align: center; background: var(--bg); border-radius: 10px; user-select: all; }
.badge.nonaktif { color: var(--muted); }

/* ===== Editor teks kaya ===== */
dialog.wide { width: min(980px, calc(100vw - 32px)); }
.rt { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; border-radius: 10px 10px 0 0; }
.rt-btn { min-width: 32px; height: 32px; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 6px; cursor: pointer; font: inherit; font-size: .9rem; padding: 0 6px; }
.rt-btn:hover { background: var(--bg); border-color: var(--line); }
.rt-btn.on { background: color-mix(in srgb, var(--primary) 15%, transparent); border-color: var(--primary); }
.rt-btn.b { font-weight: 700; } .rt-btn.i { font-style: italic; } .rt-btn.u { text-decoration: underline; } .rt-btn.s { text-decoration: line-through; }
.rt-btn.tc { color: #d93025; font-weight: 700; } .rt-btn.hl { color: #f9ab00; }
.rt-block { width: auto; height: 32px; padding: 0 .4rem; }
.rt-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.rt-wrap { position: relative; display: inline-block; }
.rt-pop { position: absolute; top: 36px; left: 0; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; gap: 4px; flex-wrap: wrap; width: max-content; max-width: 280px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.rt-pop[hidden] { display: none; }
.rt-linkbar { max-width: 340px; } .rt-link-input { width: 200px; }
.rt-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); outline: 1px solid var(--line); cursor: pointer; }
.rt-imgbar { display: flex; gap: 4px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rt-imgbar[hidden] { display: none; }
.rt-area { min-height: 220px; max-height: 55vh; overflow: auto; padding: .9rem 1rem; outline: none; }
.rt.rt-full { position: fixed; inset: 8px; z-index: 50; }
.rt.rt-full .rt-area { max-height: none; flex: 1; }
.rt-area img.rt-sel { outline: 3px solid var(--primary); }
.rt-desain-pop { position: absolute; z-index: 20; left: 8px; right: 8px; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .75rem; box-shadow: 0 12px 32px rgba(0,0,0,.2); max-height: 60vh; overflow: auto; }
.rt-desain-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; } .rt-desain-head strong { flex: 1; }
.rt { position: relative; }
/* Konten (dipakai di editor dan tampilan) */
.rt-area, .rt-view { line-height: 1.6; overflow-wrap: anywhere; }
.rt-area h1, .rt-view h1 { font-size: 1.6rem; margin: .6rem 0 .4rem; } .rt-area h2, .rt-view h2 { font-size: 1.3rem; margin: .6rem 0 .4rem; } .rt-area h3, .rt-view h3 { font-size: 1.1rem; margin: .5rem 0 .3rem; }
.rt-area p, .rt-view p { margin: 0 0 .6rem; }
.rt-area blockquote, .rt-view blockquote { margin: .5rem 0; padding: .4rem .9rem; border-left: 4px solid var(--primary); background: var(--bg); border-radius: 0 8px 8px 0; }
.rt-area pre, .rt-view pre { background: var(--bg); padding: .6rem; border-radius: 8px; overflow: auto; }
.rt-area table, .rt-view table { border-collapse: collapse; width: 100%; margin: .5rem 0; }
.rt-area th, .rt-area td, .rt-view th, .rt-view td { border: 1px solid var(--line); padding: .35rem .5rem; vertical-align: top; min-width: 40px; }
.rt-area th, .rt-view th { background: var(--bg); text-align: left; }
.rt-area img, .rt-view img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: .5rem auto; }
.img-kecil { width: 30%; } .img-sedang { width: 60%; } .img-penuh { width: 100%; }
.rt-view { overflow: auto; }
.ta-left { text-align: left; } .ta-center { text-align: center; } .ta-right { text-align: right; } .ta-justify { text-align: justify; }
.tc-merah { color: #d93025; } .tc-oranye { color: #e8710a; } .tc-kuning { color: #b06000; } .tc-hijau { color: #188038; } .tc-biru { color: #1a73e8; } .tc-ungu { color: #9334e6; } .tc-abu { color: #5f6368; } .tc-hitam { color: #202124; }
.hl-merah { background: #fad2cf; } .hl-oranye { background: #fedfc8; } .hl-kuning { background: #feefc3; } .hl-hijau { background: #ceead6; } .hl-biru { background: #d2e3fc; } .hl-ungu { background: #e9d2fd; } .hl-abu { background: #e8eaed; } .hl-hitam { background: #3c4043; color: #fff; }
.bg-merah { background: #d93025; } .bg-oranye { background: #e8710a; } .bg-kuning { background: #f9ab00; } .bg-hijau { background: #188038; } .bg-biru { background: #1a73e8; } .bg-ungu { background: #9334e6; } .bg-abu { background: #5f6368; } .bg-hitam { background: #202124; }
.hlbg-merah { background: #fad2cf; } .hlbg-oranye { background: #fedfc8; } .hlbg-kuning { background: #feefc3; } .hlbg-hijau { background: #ceead6; } .hlbg-biru { background: #d2e3fc; } .hlbg-ungu { background: #e9d2fd; } .hlbg-abu { background: #e8eaed; } .hlbg-hitam { background: #3c4043; }
@media (prefers-color-scheme: dark) { .hl-merah, .hl-oranye, .hl-kuning, .hl-hijau, .hl-biru, .hl-ungu, .hl-abu { color: #202124; } }
.menu-item details { font-size: .85rem; }

/* ===== Desain grafis ===== */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.ds-grid.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.ds-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; display: grid; gap: .35rem; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.ds-thumb { aspect-ratio: 4 / 3; background: repeating-conic-gradient(var(--bg) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.ds-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ds-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }
.ds-tpl { display: grid; gap: .2rem; text-align: left; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; width: 100%; }
.ds-tpl.on, .ds-tpl:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.ds-tpl small { color: var(--muted); }
.view.view-full { max-width: none; padding: .5rem; }
.ds-editor { display: flex; flex-direction: column; height: calc(100vh - 80px); min-height: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ds-top { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .45rem; border-bottom: 1px solid var(--line); }
.ds-title { width: 220px; font-weight: 600; }
.ds-zoom { min-width: 48px; text-align: center; font-size: .85rem; }
.ds-export { width: auto; padding: .25rem .4rem; font-size: .85rem; }
.ds-status { margin-left: auto; }
.ds-body { flex: 1; display: grid; grid-template-columns: 230px 1fr 260px; min-height: 0; }
.ds-left, .ds-right { overflow: auto; padding: .6rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: .5rem; }
.ds-right { border-right: none; border-left: 1px solid var(--line); }
.ds-right h4 { margin: .25rem 0 0; } .ds-right h5 { margin: .4rem 0 0; font-size: .8rem; color: var(--muted); }
.ds-tabs { display: flex; flex-wrap: wrap; gap: 3px; }
.ds-tabs button { flex: 1 1 30%; padding: .35rem .2rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; font: inherit; font-size: .8rem; cursor: pointer; }
.ds-tabs button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.ds-tab-body { display: grid; gap: .5rem; }
.ds-tab-body label { display: grid; gap: .2rem; font-size: .85rem; }
.ds-tab-body label.btn { display: flex; }
.ds-tab-body label.btn input { display: none; }
.ds-add-text { text-align: left; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer; font-family: Arial, sans-serif; }
.ds-add-text.t1 { font-size: 1.35rem; font-weight: 700; } .ds-add-text.t2 { font-size: 1.05rem; font-weight: 600; } .ds-add-text.t3 { font-size: .9rem; }
.ds-shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.ds-shape { display: grid; place-items: center; gap: 2px; padding: .45rem .2rem; font-size: 1.4rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.ds-shape small { font-size: .65rem; color: var(--muted); }
.ds-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.ds-sw { aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; }
.ds-stage { overflow: auto; background: repeating-conic-gradient(#e9ecf2 0 25%, #f4f6fb 0 50%) 0 0 / 20px 20px; display: flex; padding: 20px; min-width: 0; }
.ds-page { margin: auto; box-shadow: 0 6px 24px rgba(0,0,0,.18); background: #fff; line-height: 0; }
.ds-props { display: grid; gap: .4rem; }
.ds-row { display: grid; grid-template-columns: 92px 1fr auto; gap: .35rem; align-items: center; font-size: .82rem; }
.ds-row input[type=color] { padding: 2px; height: 30px; }
.ds-row input[type=number] { padding: .25rem .4rem; }
.ds-btnrow { display: flex; flex-wrap: wrap; gap: 3px; }
.ds-btnrow .btn.on { background: color-mix(in srgb, var(--primary) 18%, transparent); border-color: var(--primary); }
.ds-layers { display: grid; gap: 2px; }
.ds-layer { display: flex; gap: .4rem; align-items: center; padding: .25rem .4rem; border-radius: 6px; cursor: pointer; font-size: .82rem; border: 1px solid transparent; }
.ds-layer:hover { background: var(--bg); } .ds-layer.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.ds-layer-type { width: 20px; text-align: center; color: var(--muted); }
.ds-layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-layer input { flex: 1; padding: .15rem .3rem; }
@media (max-width: 1100px) { .ds-body { grid-template-columns: 200px 1fr 230px; } }
@media (max-width: 860px) {
  .ds-editor { height: auto; }
  .ds-body { grid-template-columns: 1fr; }
  .ds-stage { order: -1; height: 60vh; padding: 10px; }
  .ds-left, .ds-right { border: none; border-top: 1px solid var(--line); max-height: none; }
  .ds-title { width: 100%; order: -1; }
  .ds-status { margin-left: 0; width: 100%; }
  .rt-area { max-height: 45vh; }
}
@media print { .rt-toolbar { display: none; } }
.form .field { display: grid; gap: .3rem; }
.form .field-label { font-size: .88rem; font-weight: 500; }
