:root {
  --navy: #0B2A5B; --navy-2: #12366F; --royal: #1E56D9; --royal-2: #2F6BF0; --royal-50: #EEF3FF; --royal-100: #DCE6FF;
  --bg: #F4F7FC; --card: #FFFFFF; --text: #0F1B33; --muted: #5B6B86; --line: #E2E8F2; --line-2: #CBD5E4;
  --ok: #0E9F6E; --ok-50: #E7F8F1; --warn: #D97706; --warn-50: #FEF5E7; --bad: #DC2626; --bad-50: #FDECEC; --gold: #F5B83D;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,27,51,.06), 0 4px 16px rgba(15,27,51,.06); --shadow-lg: 0 20px 50px rgba(11,42,91,.22);
  --font: 'Open Sans', 'Segoe UI', system-ui, sans-serif; --font-head: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 17px; font-weight: 600; } h3 { font-size: 15px; font-weight: 600; }
a { color: var(--royal); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny { font-size: 11px; } .bold { font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; } .right { margin-left: auto; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--navy) 0%, #0A2350 100%); color: #C9D6F0; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--royal-2), #6FA0FF); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: #fff; box-shadow: 0 6px 16px rgba(30,86,217,.45); }
.brand b { font-family: var(--font-head); font-size: 17px; display: block; line-height: 1.1; } .brand small { font-size: 10.5px; color: #8FA6D3; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: #C9D6F0; font-weight: 500; font-size: 13.5px; text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--royal); color: #fff; box-shadow: 0 6px 14px rgba(30,86,217,.35); }
.nav .sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6F86B5; padding: 14px 11px 6px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar .school-chip { display: flex; align-items: center; gap: 10px; }
.topbar .school-chip img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: var(--royal-50); }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.menu-btn { display: none; }

@media (min-width: 961px) { .shell.full { grid-template-columns: 1fr; } .shell.full .side { display: none; } .shell.full .side.open { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: 248px; z-index: 60; box-shadow: var(--shadow-lg); } }
.shell.full .menu-btn { display: inline-flex; }
/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; } .card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .ico svg { width: 22px; height: 22px; }
.stat b { font-family: var(--font-head); font-size: 24px; color: var(--navy); display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.tone-blue { background: var(--royal-50); color: var(--royal); } .tone-green { background: var(--ok-50); color: var(--ok); }
.tone-amber { background: var(--warn-50); color: var(--warn); } .tone-red { background: var(--bad-50); color: var(--bad); }
.tone-navy { background: #E7ECF6; color: var(--navy); } .tone-violet { background: #F1EAFE; color: #7C3AED; }
.quick { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; }
.quick a { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 600; text-decoration: none; transition: .15s; }
.quick a:hover { border-color: var(--royal); transform: translateY(-2px); box-shadow: var(--shadow); }
.quick a .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; } .quick a svg { width: 20px; height: 20px; }
.quick a small { font-weight: 400; color: var(--muted); font-size: 12px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--navy); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; }
.btn:hover { background: #F6F8FC; border-color: #B9C6DA; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--royal); border-color: var(--royal); color: #fff; box-shadow: 0 4px 12px rgba(30,86,217,.25); }
.btn.primary:hover { background: #1849BD; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--bad); border-color: #F3C2C2; } .btn.danger:hover { background: var(--bad-50); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--royal-50); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; } .btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #34425C; }
label.field > span.hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.input, select.input, textarea.input { height: 38px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 11px; background: #fff; outline: none; width: 100%; font-weight: 400; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--royal); box-shadow: 0 0 0 3px rgba(30,86,217,.15); }
.input.sm { height: 30px; font-size: 12.5px; padding: 0 8px; border-radius: 7px; }
.input[type=color] { padding: 2px; width: 44px; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--royal); }
.seg { display: inline-flex; background: #EEF2F8; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-50); color: var(--ok); } .badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.bad { background: var(--bad-50); color: var(--bad); } .badge.info { background: var(--royal-50); color: var(--royal); } .badge.gray { background: #EEF2F7; color: #5B6B86; }
.badge.gold { background: #FFF4D6; color: #9A6A00; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; background: #F8FAFD; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #FAFBFE; }
.table tr.sel td { background: var(--royal-50); }
.table td.check-cell, .table th.check-cell { width: 36px; padding-right: 0; }
.thumb { width: 38px; height: 46px; border-radius: 6px; object-fit: cover; background: #E8EDF5; display: block; }
.thumb.empty { display: grid; place-items: center; color: #9AA7BD; } .thumb.empty svg { width: 18px; height: 18px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--navy); color: #fff; border-radius: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bulkbar .btn { height: 30px; font-size: 12.5px; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state svg { width: 46px; height: 46px; color: #A9B7D0; margin-bottom: 10px; }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(9,22,48,.5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .12s; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .15s; }
.modal.wide { width: min(900px, 100%); } .modal.xl { width: min(1200px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 20px; overflow: auto; } .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: scale(.97); opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 420px; font-size: 13px; animation: pop .15s; }
.toast.err { background: var(--bad); } .toast.ok { background: var(--ok); }
.progress { height: 8px; background: #E5EBF5; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--royal), #5B8CFF); border-radius: 99px; transition: width .3s; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(30,86,217,.2); border-top-color: var(--royal); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; padding: 80px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at -10% -20%, #2F6BF0 0%, transparent 55%), linear-gradient(160deg, #0B2A5B, #081C3E); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero h1 { color: #fff; font-size: 38px; line-height: 1.15; margin: 26px 0 14px; }
.auth-hero p { color: #B8C8E8; font-size: 15px; max-width: 460px; line-height: 1.6; }
.auth-hero ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 10px; align-items: center; color: #DCE6FF; }
.auth-hero li svg { width: 18px; height: 18px; color: var(--gold); }
.hero-cards { position: absolute; right: -40px; bottom: 60px; transform: rotate(-8deg); opacity: .95; display: flex; gap: 14px; pointer-events: none; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-form .box { width: min(440px, 100%); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--royal); border-bottom-color: var(--royal); }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.alert.err { background: var(--bad-50); color: #9B1C1C; } .alert.ok { background: var(--ok-50); color: #05603A; } .alert.info { background: var(--royal-50); color: #1D3E91; } .alert.warn { background: var(--warn-50); color: #8A4B00; }

/* ---------- template gallery ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tpl { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: .15s; display: flex; flex-direction: column; }
.tpl:hover { box-shadow: var(--shadow); border-color: #BFD0F5; }
.tpl .stage { background: repeating-conic-gradient(#F2F5FA 0% 25%, #E9EEF6 0% 50%) 50% / 16px 16px; display: grid; place-items: center; padding: 16px; height: 190px; position: relative; }
.tpl .meta { padding: 12px 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.tpl .lock { position: absolute; top: 10px; right: 10px; }

/* ---------- card render (shared with designer) ---------- */
.idcard { position: relative; overflow: hidden; background: #fff; box-shadow: 0 6px 18px rgba(11,42,91,.18); flex: none; }
.idcard .el { position: absolute; box-sizing: border-box; }
.idcard .el-text { overflow: hidden; }
.idcard .el-text .ln { position: absolute; left: 0; white-space: pre; }
.idcard img { user-select: none; -webkit-user-drag: none; }

/* ---------- designer ---------- */
.designer { display: grid; grid-template-columns: 64px 280px 1fr 300px; height: calc(100vh - 60px); background: #E9EEF6; }
.d-rail { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px; }
.d-rail button { width: 52px; border: 0; background: transparent; border-radius: 10px; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.d-rail button svg { width: 20px; height: 20px; }
.d-rail button:hover { background: var(--royal-50); color: var(--royal); } .d-rail button.on { background: var(--royal); color: #fff; }
.d-panel { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 14px; }
.d-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.d-panel h4:first-child { margin-top: 0; }
.d-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-tile { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--navy); text-align: center; }
.d-tile:hover { border-color: var(--royal); background: var(--royal-50); }
.d-tile svg { width: 22px; height: 22px; color: var(--royal); }
.d-field { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: 12.5px; background: #fff; }
.d-field:hover { border-color: var(--royal); background: var(--royal-50); }
.d-field code { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.d-stage { position: relative; overflow: auto; display: flex; flex-direction: column; }
.d-toolbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 8px 12px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.d-canvas-wrap { flex: 1; display: grid; place-items: center; padding: 48px; min-height: 0; }
.d-canvas { position: relative; }
.d-canvas .idcard { box-shadow: 0 10px 40px rgba(11,42,91,.25); }
.d-canvas .el { cursor: move; }
.d-canvas .el.locked { cursor: default; }
.d-canvas .el:hover { outline: 1px dashed rgba(30,86,217,.6); }
.d-sel { position: absolute; border: 1.5px solid var(--royal); pointer-events: none; z-index: 50; }
.d-sel .h { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid var(--royal); border-radius: 3px; pointer-events: auto; }
.d-sel .h.nw { left: -6px; top: -6px; cursor: nwse-resize; } .d-sel .h.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.d-sel .h.sw { left: -6px; bottom: -6px; cursor: nesw-resize; } .d-sel .h.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.d-sel .h.n { left: calc(50% - 5px); top: -6px; cursor: ns-resize; } .d-sel .h.s { left: calc(50% - 5px); bottom: -6px; cursor: ns-resize; }
.d-sel .h.w { top: calc(50% - 5px); left: -6px; cursor: ew-resize; } .d-sel .h.e { top: calc(50% - 5px); right: -6px; cursor: ew-resize; }
.d-sel .rot { position: absolute; left: calc(50% - 7px); top: -30px; width: 14px; height: 14px; border-radius: 50%; background: var(--royal); pointer-events: auto; cursor: grab; }
.d-sel .rot::after { content: ''; position: absolute; left: 6px; top: 14px; width: 1.5px; height: 12px; background: var(--royal); }
.d-guide { position: absolute; background: #FF2E8A; z-index: 49; pointer-events: none; }
.d-props { background: #fff; border-left: 1px solid var(--line); overflow-y: auto; padding: 14px; }
.d-props .grp { border-bottom: 1px solid var(--line); padding: 12px 0; } .d-props .grp:first-child { padding-top: 0; }
.d-props .grp > b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pgrid label, .prow label { font-size: 11px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 3px; }
.prow { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.layers { display: flex; flex-direction: column; gap: 3px; }
.layer { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; font-size: 12.5px; cursor: pointer; border: 1px solid transparent; }
.layer:hover { background: #F4F7FC; } .layer.on { background: var(--royal-50); border-color: var(--royal-100); }
.layer svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatches i { width: 20px; height: 20px; border-radius: 5px; cursor: pointer; border: 1px solid rgba(0,0,0,.12); }
.facebar { display: flex; gap: 10px; justify-content: center; padding: 10px 0 0; }

/* ---------- misc ---------- */
.bulk-tab > div > .page-head { display: none; } /* sub-pages keep their own header out of the Bulk Print tabs */
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 18px; }
@media (max-width: 700px) {
  .share-grid { grid-template-columns: 1fr; }
  .page-head > .grow, .toolbar > .grow { flex: 1 1 100%; }
  .page-head h1 { font-size: 19px; }
}
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps .st { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 12.5px; color: var(--muted); }
.steps .st i { width: 22px; height: 22px; border-radius: 50%; background: #EEF2F8; display: grid; place-items: center; font-style: normal; font-size: 11.5px; }
.steps .st.on { border-color: var(--royal); color: var(--royal); } .steps .st.on i { background: var(--royal); color: #fff; }
.steps .st.done { color: var(--ok); } .steps .st.done i { background: var(--ok); color: #fff; }
.drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 34px 20px; text-align: center; background: #FAFCFF; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--royal); background: var(--royal-50); }
.drop svg { width: 40px; height: 40px; color: var(--royal); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.file-row:hover { background: #FAFBFE; } .file-row svg { width: 20px; height: 20px; flex: none; }
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.crumbs a { cursor: pointer; }
.photo-editor { display: grid; grid-template-columns: 1fr 260px; gap: 18px; }
.crop-box { position: relative; background: #1B2436; border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 380px; user-select: none; }
.crop-box img { max-width: 100%; max-height: 420px; display: block; }
.crop-rect { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); cursor: move; }
.crop-rect .h { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 3px; right: -8px; bottom: -8px; cursor: nwse-resize; }
video.cam { width: 100%; border-radius: 12px; background: #000; max-height: 420px; }
.sheet-preview { background: #EEF2F8; border-radius: 12px; padding: 16px; display: grid; place-items: center; min-height: 300px; overflow-x: auto; }
.sheet-preview > .row { flex-wrap: wrap; justify-content: center; }
.sheet-preview svg { max-width: 100%; height: auto; }
iframe.pdf { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--line-2); font-size: 12.5px; cursor: pointer; font-weight: 500; }
.chip.on { background: var(--royal); border-color: var(--royal); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bar-chart div { flex: 1; background: linear-gradient(180deg, var(--royal-2), var(--royal)); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; }
.bar-chart div span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }

@media (max-width: 1200px) { .designer { grid-template-columns: 56px 240px 1fr 270px; } .quick { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar .badge.gold { display: none; }
  .menu-btn { display: inline-flex; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-hero { display: none; }
  .content { padding: 16px; } .topbar { padding: 0 16px; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .row.wrap > .btn, .row > .btn.sm { white-space: normal; height: auto; min-height: 30px; }
  .sticky-gen .muted { display: none; }
  .page-head > .btn, .page-head > a.btn { flex: 1 1 auto; }
  .main { min-width: 0; overflow-x: hidden; }
  .designer { grid-template-columns: 1fr; height: auto; } .d-rail { flex-direction: row; overflow-x: auto; } .d-panel, .d-props { max-height: 50vh; }
  .photo-editor { grid-template-columns: 1fr; }
}
@media print { .side, .topbar { display: none; } }
