:root {
  --bg: #f5f3fb; --surface: #ffffff; --surface2: #f0edf8; --text: #1d1530; --muted: #6e6787; --line: #e4dff0;
  --brand: #6d4aff; --brand2: #b14aff; --ok: #12a26a; --warn: #c27a00; --danger: #e0344a;
  --shadow: 0 1px 2px rgba(30, 20, 60, .05), 0 12px 32px -16px rgba(30, 20, 60, .22);
  --radius: 16px; --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0b17; --surface: #171324; --surface2: #211b33; --text: #efeaff; --muted: #9c94b8; --line: #2c2541;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.7);
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); }
code { background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; background: var(--surface2); color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; box-shadow: 0 8px 20px -10px var(--brand); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface2); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 20% 10%, rgba(109, 74, 255, .25), transparent 50%), radial-gradient(circle at 90% 90%, rgba(177, 74, 255, .2), transparent 50%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 22px; padding: 34px 28px; box-shadow: var(--shadow); display: grid; gap: 14px; text-align: center; animation: pop .6s var(--ease); }
.login-card input { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); outline: none; }
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 74, 255, .2); }
.error { color: var(--danger); margin: 0; min-height: 1em; font-size: 14px; }

.brand { font-family: 'DM Serif Display', serif; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.brand.big { font-size: 30px; justify-content: center; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-size: 18px; background: linear-gradient(135deg, var(--brand), var(--brand2)); animation: spinIn 1s var(--ease); }

/* dashboard */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--brand); }
.top-actions { display: flex; gap: 8px; }
.warn { margin: 16px 28px 0; padding: 12px 16px; border-radius: 12px; background: rgba(194, 122, 0, .1); color: var(--warn); border: 1px solid rgba(194, 122, 0, .25); font-size: 14px; }

.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 22px 28px 6px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; animation: rise .6s var(--ease) both; }
.kpi:nth-child(2) { animation-delay: .06s; } .kpi:nth-child(3) { animation-delay: .12s; } .kpi:nth-child(4) { animation-delay: .18s; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand2)); opacity: .1; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }

.list-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px 10px; gap: 12px; }
.list-head h2 { margin: 0; font-size: 18px; }
.seg { display: inline-flex; background: var(--surface2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; padding: 6px 28px 60px; }
.icard { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; animation: rise .6s var(--ease) both; transition: transform .3s var(--ease), box-shadow .3s; }
.icard:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(30,20,60,.06), 0 24px 48px -20px rgba(30,20,60,.35); }
.icard.paused { opacity: .7; }
.icard .art { height: 128px; position: relative; display: flex; align-items: flex-end; padding: 14px 16px; overflow: hidden; }
.icard .art img { position: absolute; right: 14px; top: 14px; width: 78px; height: 100px; object-fit: cover; border-radius: 40px 40px 10px 10px; border: 2px solid rgba(255,255,255,.5); transition: transform .5s var(--ease); }
.icard:hover .art img { transform: rotate(-4deg) scale(1.05); }
.icard .art .nm { font-size: 30px; line-height: 1.05; max-width: 70%; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,.15); }
.icard .badge { position: absolute; left: 14px; top: 14px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.25); color: #fff; backdrop-filter: blur(6px); }
.icard .live { position: absolute; left: 14px; top: 40px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; color: #fff; background: rgba(0,0,0,.25); padding: 3px 8px; border-radius: 999px; }
.icard .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3ee08f; box-shadow: 0 0 0 0 #3ee08f; animation: blip 2s infinite; }
.icard.paused .live::before { background: #aaa; animation: none; }
.icard .body { padding: 14px 16px 16px; display: grid; gap: 10px; flex: 1; }
.icard .client { font-weight: 700; font-size: 16px; }
.icard .meta { font-size: 13px; color: var(--muted); margin-top: -8px; }
.icard .link { display: flex; align-items: center; gap: 6px; background: var(--surface2); border-radius: 10px; padding: 6px 6px 6px 10px; font-size: 13px; }
.icard .link span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.icard .link button { border: 0; background: var(--surface); padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stats4 div { padding: 8px 2px; }
.stats4 div + div { border-left: 1px solid var(--line); }
.stats4 b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stats4 b.bump { animation: bump .6s var(--ease); color: var(--brand); }
.stats4 small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.icard .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.icard .actions .btn { flex: 1; }
.lastv { font-size: 12px; color: var(--muted); }

.empty { text-align: center; padding: 60px 20px; animation: rise .6s var(--ease); }
.empty-art { font-size: 56px; animation: float 4s ease-in-out infinite; }

/* editor */
.editor { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; animation: slideIn .45s var(--ease); }
.editor-head { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.editor-head h2 { margin: 0; font-size: 17px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-actions { display: flex; gap: 8px; }
.editor-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: 0; }
.form { overflow-y: auto; padding: 22px 26px 80px; display: grid; gap: 18px; align-content: start; }
.panel { border: 0; margin: 0; background: var(--surface); border-radius: var(--radius); padding: 18px 20px 20px; box-shadow: var(--shadow); display: grid; gap: 14px; min-width: 0; }
.panel legend { float: left; width: 100%; padding: 0; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.f { display: grid; gap: 6px; min-width: 0; }
.f > span:first-child { font-size: 13px; font-weight: 600; color: var(--muted); }
.f small { color: var(--muted); font-size: 12px; }
.f small.inline { font-weight: 400; }
.f input, .f textarea, .f select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); outline: none; transition: border-color .2s, box-shadow .2s; }
.f textarea { resize: vertical; }
.f input:focus, .f textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 74, 255, .15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.slug { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.slug span { padding: 0 4px 0 12px; color: var(--muted); font-size: 13px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.slug input { border: 0 !important; box-shadow: none !important; padding-left: 2px !important; background: transparent !important; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 0; }
.switch input { display: none; }
.switch i { width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .25s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch em { font-style: normal; font-size: 14px; }

.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.preset { border: 2px solid transparent; border-radius: 14px; padding: 0; overflow: hidden; cursor: pointer; background: var(--surface2); text-align: left; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
.preset:hover { transform: translateY(-3px); }
.preset.on { border-color: var(--brand); box-shadow: 0 10px 24px -12px var(--brand); }
.preset .sw { height: 76px; display: grid; place-items: center; font-size: 22px; position: relative; overflow: hidden; }
.preset .sw::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%); transform: translateX(-100%); }
.preset:hover .sw::after { animation: sheen 1s var(--ease); }
.preset .pn { padding: 7px 9px 8px; font-size: 12px; font-weight: 700; }
.preset .pc { display: block; font-weight: 400; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cover-up { position: relative; width: 170px; aspect-ratio: 4/5; border-radius: 90px 90px 14px 14px; overflow: hidden; border: 2px dashed var(--line); cursor: pointer; background: var(--bg); transition: border-color .2s; }
.cover-up:hover { border-color: var(--brand); }
.cover-up img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 13px; gap: 4px; }
.cover-empty b { font-size: 28px; color: var(--brand); }
.x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; z-index: 2; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg); animation: pop .4s var(--ease); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .mv { position: absolute; bottom: 4px; left: 4px; display: flex; gap: 3px; }
.thumb .mv button { width: 22px; height: 22px; border: 0; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 11px; padding: 0; }
.thumb.add { border: 2px dashed var(--line); display: grid; place-content: center; text-align: center; cursor: pointer; color: var(--muted); font-size: 12px; transition: border-color .2s; }
.thumb.add:hover { border-color: var(--brand); }
.thumb.add b { font-size: 24px; color: var(--brand); display: block; }
.uploading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; }
.uploading::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }

.event-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; margin-bottom: 10px; animation: pop .35s var(--ease); background: var(--bg); }
.event-card .eh { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; color: var(--muted); }
.event-card .eh button { border: 0; background: none; color: var(--danger); cursor: pointer; font-size: 13px; font-weight: 600; }
.event-card .f input { background: var(--surface); }
.music-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.preview { border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; background:
  radial-gradient(circle at 50% 30%, rgba(109, 74, 255, .12), transparent 60%), var(--surface2); min-height: 0; }
.phone { width: 360px; height: min(740px, calc(100vh - 150px)); border-radius: 46px; padding: 12px; background: #0b0910; box-shadow: 0 30px 70px -30px rgba(20, 10, 50, .7), inset 0 0 0 2px #2b2638; position: relative; }
.phone .notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; border-radius: 20px; background: #0b0910; z-index: 2; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 36px; background: #fff; }

/* modals */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(10, 6, 25, .55); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .25s; }
.modal-card { background: var(--surface); border-radius: 22px; width: 100%; max-width: 880px; max-height: 90vh; overflow-y: auto; padding: 26px; position: relative; box-shadow: var(--shadow); animation: pop .45s var(--ease); }
.modal-card.small { max-width: 460px; text-align: center; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface2); cursor: pointer; }
.share-art { font-size: 52px; animation: pop .7s var(--ease), float 3s ease-in-out .7s infinite; }
.modal h3 { margin: 6px 0 4px; font-size: 22px; }
.linkbox { display: flex; gap: 8px; margin: 18px 0 12px; }
.linkbox input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; }
.share-row { display: flex; gap: 8px; justify-content: center; }

.st-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; padding-right: 40px; }
.st-head .sw { width: 54px; height: 54px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #fff; font-size: 22px; }
.st-head h3 { margin: 0; }
.st-head a { font-size: 13px; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 20px; }
.st-kpis div { background: var(--surface2); border-radius: 14px; padding: 12px 14px; animation: rise .5s var(--ease) both; }
.st-kpis b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.st-kpis small { color: var(--muted); font-size: 12px; }
.st-section { margin: 20px 0 8px; display: flex; justify-content: space-between; align-items: center; }
.st-section h4 { margin: 0; font-size: 15px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 10px 4px 0; border-bottom: 1px solid var(--line); }
.chart .bar { flex: 1; background: linear-gradient(180deg, var(--brand2), var(--brand)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; transform-origin: bottom; animation: grow .8s var(--ease) both; cursor: default; }
.chart .bar.zero { background: var(--line); }
.chart .bar:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 4px 2px 0; }
.devices { display: grid; gap: 8px; }
.dev { display: grid; grid-template-columns: 80px 1fr 50px; align-items: center; gap: 10px; font-size: 13px; }
.dev .track { height: 10px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.dev .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 6px; animation: grow-x .9s var(--ease) both; transform-origin: left; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.yes { background: rgba(18, 162, 106, .12); color: var(--ok); }
.pill.no { background: rgba(224, 52, 74, .1); color: var(--danger); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.brand-card { max-width: 760px; }
.brand-card h3 { margin: 0 0 2px; }
.brand-grid { display: grid; grid-template-columns: 1fr 260px; gap: 22px; margin-top: 18px; }
.brand-form { display: grid; gap: 14px; }
.logo-up { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-box { width: 180px; height: 90px; border-radius: 14px; border: 2px dashed var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; padding: 10px; position: relative; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-btns { display: flex; flex-direction: column; gap: 6px; }
.brand-preview { display: flex; flex-direction: column; gap: 8px; }
.bp-card { flex: 1; border-radius: 18px; padding: 26px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 0%, #5a1424, #22060c 80%); color: #f8e9d2; min-height: 220px; }
.bp-card .l { font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: .3em; text-transform: uppercase; color: #d8b98c; }
.bp-card .lg { background: rgba(255,255,255,.94); border-radius: 14px; padding: 8px 14px; }
.bp-card .lg img { max-height: 46px; max-width: 160px; display: block; }
.bp-card .n { font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: .1em; font-weight: 600; }
.bp-card .p { font-size: 12px; color: #d4af37; }
.brand-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
@media (max-width: 700px) { .brand-grid { grid-template-columns: 1fr; } }

.modal-card.pw-card { display: grid; gap: 12px; text-align: left; }
.pw-card h3, .pw-card .share-art, .pw-card > .muted { text-align: center; margin: 0; }
.pw-meter { height: 6px; border-radius: 6px; background: var(--surface2); overflow: hidden; margin-top: -4px; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .35s var(--ease), background .35s; }
.pw-show { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.warn .btn { margin-left: 8px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); z-index: 60; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .35s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-only { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(24px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinIn { from { transform: rotate(-180deg) scale(.4); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes blip { 0% { box-shadow: 0 0 0 0 rgba(62, 224, 143, .7); } 100% { box-shadow: 0 0 0 8px rgba(62, 224, 143, 0); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes sheen { to { transform: translateX(100%); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .editor-body { grid-template-columns: 1fr; }
  .preview { display: none; border-left: 0; }
  .preview.show { display: flex; position: fixed; inset: 61px 0 0 0; z-index: 25; }
  .mobile-only { display: inline-flex; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .summary, .list-head, .grid { padding-left: 16px; padding-right: 16px; }
  .warn { margin: 12px 16px 0; }
  .summary { gap: 10px; }
  .kpi .value { font-size: 24px; }
  .form { padding: 16px 14px 80px; }
  .row2, .row3, .cols2 { grid-template-columns: 1fr; }
  .editor-head { padding: 10px 12px; gap: 8px; }
  .editor-head h2 { font-size: 15px; }
  .phone { width: min(360px, 92vw); }
  .modal-card { padding: 20px 16px; }
  #newBtn span + * { display: none; }
}
