/* ============================================================
   AvaFrame — Design System
   Một hệ thống giao diện hiện đại, tối giản, lấy màu thương hiệu
   (--brand) làm điểm nhấn. Dùng chung cho landing / campaign / admin.
   ============================================================ */

:root {
  --brand: #2563eb;
  --brand-ink: #ffffff;

  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --border: #e6e8ef;
  --border-strong: #d3d7e3;

  --text: #10131a;
  --text-soft: #4a5163;
  --text-mute: #8a90a2;

  --danger: #e5484d;
  --success: #12a150;
  --warn: #f5a623;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 19, 26, .06), 0 1px 3px rgba(16, 19, 26, .04);
  --shadow: 0 4px 16px rgba(16, 19, 26, .08), 0 2px 6px rgba(16, 19, 26, .05);
  --shadow-lg: 0 18px 50px rgba(16, 19, 26, .16), 0 6px 18px rgba(16, 19, 26, .08);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
p { margin: 0 0 1em; color: var(--text-soft); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-mute); }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--surface);
  --_fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: .98rem; font-weight: 600; line-height: 1;
  padding: 13px 20px; border-radius: var(--radius-full);
  border: 1px solid var(--border-strong); background: var(--_bg); color: var(--_fg);
  cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease, opacity .18s;
  text-decoration: none; white-space: nowrap; user-select: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  --_bg: var(--brand); --_fg: var(--brand-ink); border-color: transparent;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, #fff) 0%, var(--brand) 60%, color-mix(in srgb, var(--brand) 78%, #000) 100%);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent);
}
.btn-primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 42%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-danger { --_bg: transparent; --_fg: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: .88rem; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px;
}

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text); }
.field { margin-bottom: 18px; }
.hint { font-size: .82rem; color: var(--text-mute); margin-top: 5px; }
input[type=text], input[type=password], input[type=url], input[type=color], textarea, select {
  width: 100%; font-family: inherit; font-size: .98rem; color: var(--text);
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-elev); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
input[type=color] { height: 46px; padding: 4px; cursor: pointer; }

/* ---------- Spinner / loading ---------- */
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 60vh; display: grid; place-items: center; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.empty-state { text-align: center; max-width: 420px; }
.empty-emoji { font-size: 3.5rem; margin-bottom: 8px; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600;
  padding: 4px 11px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-soft);
}
.badge.on { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.badge.off { background: color-mix(in srgb, var(--text-mute) 15%, transparent); color: var(--text-mute); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 9999; pointer-events: none; }
.toast {
  background: #10131a; color: #fff; padding: 12px 18px; border-radius: var(--radius-full);
  font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
  pointer-events: auto; max-width: 90vw;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logo-mark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; color: var(--text); }
.logo-mark:hover { text-decoration: none; }
.logo-glyph { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #7c3aed)); display: grid; place-items: center; color: #fff; }

.hero { padding: clamp(48px, 9vw, 100px) 0 clamp(40px, 6vw, 72px); text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -30% -10% auto; height: 520px; background: radial-gradient(50% 60% at 50% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%); z-index: -1; }
.hero .eyebrow { display: inline-block; font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 6px 14px; border-radius: var(--radius-full); margin-bottom: 20px; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 620px; margin: 0 auto 28px; color: var(--text-soft); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.grad-text { background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--brand) 45%, #db2777)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 40px 0; }
.feature { padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-size: 1.4rem; }
.feature h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feature p { font-size: .93rem; margin: 0; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step { position: relative; padding: 24px 22px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: -16px; left: 22px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; box-shadow: var(--shadow); }
.section { padding: clamp(36px, 6vw, 64px) 0; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 36px; }

.site-footer { border-top: 1px solid var(--border); padding: 30px 0; color: var(--text-mute); font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ============================================================
   CAMPAIGN PAGE  (editor)
   ============================================================ */
.campaign-body { background: var(--bg); }
.campaign-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* Mặc định: chỉ logo, không nền, không tiêu đề — gọn tối đa, nổi trên nền trang. */
.brand-hero { position: relative; padding: 12px 0; overflow: hidden; }
.brand-hero .container { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.brand-hero .brand-logo { object-fit: contain; flex: none; border-radius: 8px;
  filter: drop-shadow(0 3px 12px rgba(16,19,26,.22)); }
.brand-hero h1 { margin: 0; font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--text); }
.brand-hero .headline { color: var(--text-soft); font-weight: 500; font-size: .85rem; margin: 0; }

/* Bật "hiện nền màu/ảnh" → dải màu thương hiệu (hoặc ảnh nền), chữ trắng */
.brand-hero.branded { padding: 20px 0 18px; color: #fff;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #000)); }
.brand-hero.branded .brand-logo { filter: drop-shadow(0 5px 18px rgba(0,0,0,.4)); }
.brand-hero.branded h1 { color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.25); }
.brand-hero.branded .headline { color: rgba(255,255,255,.92); text-shadow: 0 1px 8px rgba(0,0,0,.2); }
.brand-hero.branded.has-bg::after { content: ""; position: absolute; inset: 0; background: inherit; opacity: .82; z-index: 0; }
.brand-hero .bg-img { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; z-index: -1; filter: saturate(1.05); }

.editor-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 28px; align-items: start; padding: 28px 0 60px; }
@media (max-width: 860px) { .editor-layout { grid-template-columns: 1fr; gap: 22px; } }

/* Stage — nơi ghép ảnh */
.stage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; }
.stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius);
  overflow: hidden; background:
    linear-gradient(45deg, #eceef4 25%, transparent 25%, transparent 75%, #eceef4 75%),
    linear-gradient(45deg, #eceef4 25%, #f7f8fb 25%, #f7f8fb 75%, #eceef4 75%);
  background-size: 22px 22px; background-position: 0 0, 11px 11px;
  touch-action: none; cursor: pointer; user-select: none;
}
.stage.has-photo { cursor: grab; }
.stage.dragging { cursor: grabbing; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .drop-hint {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; color: var(--text-soft); padding: 24px; pointer-events: none;
}
.stage.has-photo .drop-hint { display: none; }
.stage .drop-hint .big { font-size: 2.6rem; }
.stage.dragover { outline: 3px dashed var(--brand); outline-offset: -8px; }

.stage-tools { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.tools-row { display: flex; align-items: center; gap: 14px; }
.slider-group { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.slider-group label { margin: 0; font-size: .8rem; color: var(--text-mute); white-space: nowrap; display: inline-flex; align-items: center; }
.slider-group label svg { width: 18px; height: 18px; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: var(--surface-2); flex: 1; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); cursor: pointer; box-shadow: var(--shadow-sm); border: 2px solid #fff; }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); cursor: pointer; border: 2px solid #fff; }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--text-soft); transition: background .15s, transform .1s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }

/* Side panel */
.side-panel .panel-block { margin-bottom: 22px; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-row .btn { padding-left: 12px; padding-right: 12px; }
@media (max-width: 340px) { .action-row { grid-template-columns: 1fr; } }
.stage-actions { margin-top: 14px; }

.stat-row { display: flex; gap: 10px; margin-bottom: 20px; }
.stat-pill { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.stat-pill .n { font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.stat-pill .l { font-size: .72rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .03em; }

.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.share-buttons .btn { flex: 1; min-width: 96px; }
.share-fb { background: #1877f2 !important; color: #fff !important; border-color: transparent !important; }
.share-x { background: #0f1419 !important; color: #fff !important; border-color: transparent !important; }
.share-tg { background: #229ed9 !important; color: #fff !important; border-color: transparent !important; }

/* Social proof (growth) */
.social-proof { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 16px;
  border-radius: var(--radius-full); font-size: .95rem; font-weight: 600; color: var(--text);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.social-proof b { color: var(--brand); }
.social-proof .sp-ico { display: inline-flex; color: #f5a623; }
.social-proof .sp-ico svg { width: 20px; height: 20px; }

/* Hướng dẫn nhanh (details) */
.guide { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.guide summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 15px; font-weight: 600; font-size: .92rem; color: var(--brand); user-select: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary .g-left { display: inline-flex; align-items: center; gap: 8px; }
.guide summary svg { width: 18px; height: 18px; }
.guide .g-chevron { transition: transform .2s; color: var(--text-mute); }
.guide[open] .g-chevron { transform: rotate(180deg); }
.guide-steps { margin: 0; padding: 2px 18px 16px 40px; color: var(--text-soft); font-size: .92rem; }
.guide-steps li { margin: 8px 0; line-height: 1.5; }
.guide-steps li::marker { color: var(--brand); font-weight: 700; }
.guide-steps b { color: var(--text); }

/* Lưới chia sẻ đa nền tảng */
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
@media (max-width: 380px) { .share-grid { grid-template-columns: repeat(3, 1fr); } }
.share-chip { display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: 0; cursor: pointer;
  padding: 4px 2px; font-family: inherit; color: var(--text-soft); transition: transform .12s; }
.share-chip:hover { transform: translateY(-2px); }
.share-chip:active { transform: scale(.94); }
.share-chip .chip-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  box-shadow: var(--shadow-sm); }
.share-chip .chip-ico svg { width: 26px; height: 26px; }
.share-chip .chip-label { font-size: .74rem; font-weight: 600; }

.share-mini { display: flex; gap: 10px; margin-top: 12px; justify-content: center; }
.share-chip.mini { padding: 0; }
.share-chip.mini .chip-ico { width: 42px; height: 42px; }
.share-chip.mini .chip-ico svg { width: 21px; height: 21px; }

/* Màu thương hiệu từng nền tảng */
.p-fb    .chip-ico { background: #1877f2; }
.p-mess  .chip-ico { background: radial-gradient(circle at 30% 20%, #00b2ff, #006aff 60%, #a033ff); }
.p-zalo  .chip-ico { background: #0068ff; }
.p-ig    .chip-ico { background: linear-gradient(45deg, #f9ce34, #ee2a7b 45%, #6228d7); }
.p-threads .chip-ico { background: #000; }
.p-x     .chip-ico { background: #0f1419; }
.p-tg    .chip-ico { background: #229ed9; }
.p-email .chip-ico { background: #ea4335; }
.p-copy  .chip-ico { background: var(--text-mute); }

.share-modal { max-width: 460px; }
.success-modal .share-grid { margin-top: 4px; }

/* Success modal (sau khi tải ảnh) */
.success-modal { max-width: 440px; text-align: center; padding: 30px 26px 24px; }
.success-modal h2 { margin: 6px 0 6px; font-size: 1.4rem; }
.success-modal p { margin: 0 0 16px; }
.success-check { width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--success), color-mix(in srgb, var(--success) 70%, #000));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--success) 40%, transparent); animation: pop .35s ease; }
.success-check svg { width: 32px; height: 32px; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.success-preview { width: 168px; height: 168px; object-fit: cover; border-radius: var(--radius); margin: 0 auto 18px; box-shadow: var(--shadow); }
.success-preview.circle { border-radius: 50%; }
.success-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.success-actions .share-buttons { margin-bottom: 0; }

/* Tag chips (admin) */
.cc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-chip { font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--cc, var(--brand)) 14%, transparent); color: var(--cc, var(--brand)); }

.desc-block { color: var(--text-soft); font-size: .95rem; }
.links-list { display: flex; flex-direction: column; gap: 8px; }
.link-item { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; color: var(--text); transition: border-color .15s, transform .1s; }
.link-item:hover { text-decoration: none; border-color: var(--brand); transform: translateX(2px); }
.link-item .arrow { margin-left: auto; color: var(--text-mute); }

.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }
.panel-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); font-weight: 700; margin-bottom: 12px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.admin-top .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.admin-main { padding: 28px 0 60px; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.camp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .12s; }
.camp-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.camp-card .cc-head { height: 8px; background: var(--cc, var(--brand)); }
.camp-card .cc-body { padding: 18px; flex: 1; }
.camp-card .cc-title { font-weight: 700; font-size: 1.08rem; margin-bottom: 2px; }
.camp-card .cc-slug { font-size: .82rem; color: var(--text-mute); word-break: break-all; }
.camp-card .cc-stats { display: flex; gap: 14px; margin-top: 14px; font-size: .82rem; color: var(--text-soft); }
.camp-card .cc-stats b { color: var(--text); }
.camp-card .cc-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(16,19,26,.5); backdrop-filter: blur(3px); z-index: 200; display: grid; place-items: center; padding: 18px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* Uploader */
.uploader { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; background: var(--bg-elev); }
.uploader:hover, .uploader.dragover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, transparent); }
.uploader .preview { max-height: 120px; margin: 0 auto 10px; border-radius: 8px; }
.uploader .preview.checker { background: repeating-conic-gradient(#e3e6ee 0 25%, #fff 0 50%) 50%/16px 16px; }
.uploader small { color: var(--text-mute); font-size: .8rem; }

.links-editor .link-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 560px) { .links-editor .link-row { grid-template-columns: 1fr; } }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent), var(--bg); }
.login-card { width: 100%; max-width: 400px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

.hidden { display: none !important; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f14; --bg-elev: #161922; --surface: #161922; --surface-2: #1e222d;
    --border: #262b38; --border-strong: #333a4a;
    --text: #eef0f6; --text-soft: #aeb4c4; --text-mute: #7b8296; --brand-ink: #fff;
  }
  .uploader .preview.checker { background: repeating-conic-gradient(#2a2f3c 0 25%, #1a1e28 0 50%) 50%/16px 16px; }
  .stage { background:
    linear-gradient(45deg, #21252f 25%, transparent 25%, transparent 75%, #21252f 75%),
    linear-gradient(45deg, #21252f 25%, #1a1e28 25%, #1a1e28 75%, #21252f 75%);
    background-size: 22px 22px; background-position: 0 0, 11px 11px; }
}
