/* ==========================================================
   FolioCraft — app styles
   ========================================================== */
:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e6e8f0;
  --line-strong: #cfd3e1;
  --primary: #5b5bf0;
  --primary-600: #4845e0;
  --primary-50: #eef0ff;
  --primary-ink: #3730a3;
  --danger: #e5484d;
  --success: #16a34a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px -4px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px -20px rgba(30, 27, 75, .35);
  --ring: 0 0 0 4px rgba(91, 91, 240, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.i { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label .i { width: 14px; height: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #818cf8, #ec4899); box-shadow: 0 6px 16px -6px rgba(236, 72, 153, .6); flex: none; }
.brand-mark .i { width: 18px; height: 18px; fill: currentColor; }
.brand-mark.sm { width: 24px; height: 24px; border-radius: 7px; }
.brand-mark.sm .i { width: 13px; height: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  background: none; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn .i { width: 17px; height: 17px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.sm .i { width: 15px; height: 15px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.15); }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn.text { color: var(--muted); padding: 0 8px; }
.btn.text:hover { color: var(--text); }
.btn.danger, .btn.text.danger { color: var(--danger); }
.btn.dashed { border: 1.5px dashed var(--line-strong); color: var(--muted); background: transparent; }
.btn.dashed:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: .15s; flex: none; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.sm .i { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--danger); border-color: #f5c2c4; background: #fff5f5; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: #94a3b8;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
.input:focus-within { border-color: var(--primary); box-shadow: var(--ring); color: var(--primary); }
.input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.input input::placeholder, textarea::placeholder { color: #a0a8ba; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(229, 72, 77, .12); color: var(--danger); }
textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical;
  outline: 0; background: var(--surface); line-height: 1.55; transition: border-color .15s, box-shadow .15s;
}
textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
.eye { border: 0; background: none; color: var(--muted); display: grid; place-items: center; padding: 4px; border-radius: 6px; }
.eye:hover { color: var(--text); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.form-error { color: var(--danger); font-size: 13.5px; }
.form-error:not(:empty) { margin: 2px 0 14px; padding: 10px 12px; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 10px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

select { height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--surface); font-size: 13px; font-weight: 600; }

/* ==========================================================
   Auth
   ========================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 44px 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(900px 520px at -10% -10%, rgba(124, 124, 255, .9) 0%, transparent 60%),
    radial-gradient(800px 480px at 115% 115%, rgba(236, 72, 153, .85) 0%, transparent 55%),
    linear-gradient(160deg, #1e1b4b, #312e81 55%, #4c1d95);
}
.auth-brand-body { max-width: 520px; }
.auth-brand h1 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -.03em; margin-bottom: 16px; }
.lead { font-size: 17px; opacity: .82; max-width: 470px; }
.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.features li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.features li > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); }
.features .i { width: 17px; height: 17px; }
.brand-foot { font-size: 13px; opacity: .6; }

.mock { margin-top: 36px; max-width: 420px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); transform: rotate(-2deg); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.mock-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); }
.mock-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.mock-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #a5b4fc, #f9a8d4); flex: none; }
.mock-hero div { flex: 1; display: grid; gap: 8px; }
.mock-hero b { display: block; height: 10px; border-radius: 6px; background: rgba(255,255,255,.55); }
.mock-hero b.w60 { width: 60%; background: rgba(255,255,255,.3); }
.mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-cards span { height: 64px; border-radius: 10px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.12); }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.mobile-brand { display: none; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.tab { height: 38px; border: 0; border-radius: 9px; background: none; font-weight: 600; color: var(--muted); transition: .15s; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.auth-form h2 { font-size: 24px; margin-bottom: 4px; }
.auth-form > .muted { margin-bottom: 22px; }
.form-row { margin: -2px 0 16px; }
.link { font-size: 14px; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.switch a { font-weight: 600; text-decoration: none; }
.strength { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 2px; }
.strength i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }

/* ==========================================================
   App shell
   ========================================================== */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 24px; background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 600; font-size: 14px; transition: .15s; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--primary-50); color: var(--primary); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.account { position: relative; }
.account-btn { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); transition: .15s; }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line-strong); }
.account-name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { display: grid; color: var(--muted); }
.chev .i { width: 16px; height: 16px; transition: transform .2s; }
.account-btn[aria-expanded="true"] .chev .i { transform: rotate(180deg); }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none; color: #fff; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, #818cf8, #ec4899); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; }

.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 264px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .14s ease-out; }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu-who { min-width: 0; }
.menu-who strong { display: block; font-size: 14px; }
.menu-who small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: none; font-size: 14px; font-weight: 500; color: var(--text-2); text-align: left; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item .i { color: var(--muted); width: 17px; height: 17px; }
.menu-item.danger, .menu-item.danger .i { color: var(--danger); }
.menu-item.danger:hover { background: #fff5f5; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.content { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
.view { animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: 28px; }
.page-head .muted { margin-top: 6px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.section-title { font-size: 18px; margin: 36px 0 16px; }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.progress-top { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.progress-top h2 { font-size: 18px; }
.ring { --p: 0; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--primary-50) 0); }
.ring span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 700; font-size: 15px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14px; font-weight: 500; }
.checklist button:hover { background: var(--surface-2); }
.cb { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.cb .i { width: 13px; height: 13px; stroke-width: 3; }
.done .cb { background: var(--success); border-color: var(--success); color: #fff; }
.done .cl-text { color: var(--muted); text-decoration: line-through; }
.checklist .go { margin-left: auto; width: 16px; height: 16px; color: #b4bacb; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 18px; margin-top: 2px; }

.thumb { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #fff; aspect-ratio: 16 / 11; }
.thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; border: 0; transform-origin: 0 0; pointer-events: none; }
.mini-thumb { margin-bottom: 12px; }

.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile:hover { transform: translateY(-2px); border-color: #d5d8f5; box-shadow: 0 14px 30px -14px rgba(49, 46, 129, .28); }
.tile-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, white); }
.tile-ic .i { width: 21px; height: 21px; }
.tile strong { font-size: 15px; }
.tile .muted { font-size: 13.5px; }

/* ---------- Templates ---------- */
.accent-picker { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 7px 12px 7px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.accent-picker .label { margin-right: 4px; }
.swatch { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .12s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch.custom { position: relative; overflow: hidden; cursor: pointer; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.tpl-card { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.tpl-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(49, 46, 129, .32); }
.tpl-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 91, 240, .18); }
.badge { position: absolute; top: 10px; right: 10px; display: inline-flex; gap: 4px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 4px 12px -4px rgba(91, 91, 240, .7); }
.badge .i { width: 13px; height: 13px; stroke-width: 3; }
.tpl-info { display: flex; flex-direction: column; gap: 14px; padding: 14px 6px 6px; }
.tpl-info h3 { font-size: 17px; margin-bottom: 4px; }
.tpl-info p { font-size: 13.5px; }
.tpl-actions { display: flex; gap: 8px; }

/* ---------- Editor ---------- */
.view.editor { display: grid; grid-template-columns: minmax(360px, 470px) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-panel { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.editor-head h1 { font-size: 22px; }
.editor-head .muted { font-size: 13.5px; margin-top: 4px; }
.save-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--success); background: #ecfdf3; }
.save-state .i { width: 14px; height: 14px; }
.save-state.saving { color: var(--muted); background: var(--surface-2); }
.save-state.error { color: var(--danger); background: #fff1f2; }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border: 0; border-radius: 9px; background: none; font-size: 11.5px; font-weight: 600; color: var(--muted); transition: .15s; }
.step .i { width: 17px; height: 17px; }
.step:hover { color: var(--text); }
.step.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.tab-intro { margin-bottom: 18px; }
.tab-intro h2 { font-size: 18px; margin-bottom: 4px; }
.tab-intro p { font-size: 13.5px; }
.avatar-edit { display: flex; gap: 16px; align-items: center; padding: 14px; margin-bottom: 18px; border: 1px dashed var(--line-strong); border-radius: 14px; }
.avatar-edit .row { gap: 6px; margin-bottom: 6px; }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.interest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.interest { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; font-weight: 500; font-size: 13.5px; transition: .15s; }
.interest:hover { border-color: var(--line-strong); }
.interest-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; transition: .15s; }
.interest-ic .i { width: 16px; height: 16px; }
.interest .tick { width: 18px; height: 18px; margin-left: auto; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); color: transparent; flex: none; }
.interest .tick .i { width: 11px; height: 11px; stroke-width: 3; }
.interest.on { border-color: var(--primary); background: var(--primary-50); }
.interest.on .interest-ic { background: var(--primary); color: #fff; }
.interest.on .tick { background: var(--primary); border-color: var(--primary); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--primary-50); color: var(--primary-ink); font-size: 13px; font-weight: 600; }
.chip button { display: grid; place-items: center; padding: 0; border: 0; background: none; color: inherit; opacity: .55; }
.chip button:hover { opacity: 1; }
.chip .i { width: 14px; height: 14px; }
.chip.add { background: var(--surface); border: 1px dashed var(--line-strong); color: var(--muted); }
.chip.add:hover { border-color: var(--primary); color: var(--primary); }
.tag-input { margin-bottom: 14px; }
.suggest { margin-top: 20px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.suggest .label { margin-bottom: 10px; }
.callout { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--primary-50); color: var(--primary-ink); font-size: 13.5px; }
.list { display: grid; gap: 14px; margin-bottom: 14px; }
.item-card { padding: 14px 14px 2px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.empty { padding: 22px; margin-bottom: 14px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: 14px; }

.preview-panel { position: sticky; top: 88px; display: flex; flex-direction: column; height: calc(100vh - 112px); min-height: 520px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.dots { display: flex; gap: 6px; margin-right: auto; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #febc2e; }
.dots i:first-child { background: #ff5f57; }
.dots i:last-child { background: #28c840; }
.seg { display: flex; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.seg-btn { width: 32px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); }
.seg-btn .i { width: 16px; height: 16px; }
.seg-btn.active { background: var(--primary-50); color: var(--primary); }
.preview-stage { flex: 1; display: flex; justify-content: center; overflow: hidden; background: #eceef4; }
.preview-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width .25s; }
.preview-stage.mobile { padding: 20px 0; }
.preview-stage.mobile iframe { width: 390px; max-width: calc(100% - 32px); border-radius: 26px; box-shadow: 0 0 0 8px #1f2937, 0 24px 40px -12px rgba(0,0,0,.45); }

/* ---------- Download ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.dl-card { display: flex; flex-direction: column; gap: 10px; }
.dl-card h3 { font-size: 17px; }
.dl-card p { font-size: 14px; }
.dl-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.share-card { grid-column: 1 / -1; }
.share-box { display: flex; gap: 8px; flex-wrap: wrap; }
.share-box .input { flex: 1; min-width: 220px; }
.share-box input { font-size: 13px; color: var(--muted); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.note .i { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- Dialog ---------- */
.dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 20px; color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
.dialog form { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.dialog-head h2 { font-size: 20px; }
.account-summary { display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.account-summary small { display: block; color: var(--muted); font-size: 13px; }
.dialog h3 { font-size: 14px; margin: 18px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: #111827; color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .i { color: #4ade80; }
.toast.error .i { color: #f87171; }

/* ---------- Shared view ---------- */
#shared-view iframe { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.made-with { position: fixed; right: 16px; bottom: 16px; display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(17, 24, 39, .9); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-lg); }
.shared-error { min-height: 100vh; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1040px) {
  .view.editor { grid-template-columns: 1fr; }
  .preview-panel { position: static; height: 720px; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .mobile-brand { display: flex; justify-content: center; margin-bottom: 20px; }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 16px; }
  .nav { margin-left: 0; }
  .nav-btn { padding: 0 10px; }
  .nav-label, .account-name, .brand-name, .hide-sm { display: none; }
  .account-btn { padding-right: 8px; gap: 4px; }
}
@media (max-width: 560px) {
  .content { padding: 24px 16px 48px; }
  .auth-panel { padding: 24px 16px; }
  .auth-card { padding: 22px 18px; }
  .grid2, .interest-grid { grid-template-columns: 1fr; }
  .step > span:last-child { display: none; }
  .editor-panel { padding: 18px 16px; }
  .page-head h1 { font-size: 24px; }
  .preview-panel { height: 620px; }
  .dialog-actions { flex-wrap: wrap; }
}
