:root {
  --bg: #121214; --panel: #1a1a1d; --panel2: #202024; --line: #2c2c31; --text: #f4f4f5; --muted: #a1a1aa; --dim: #71717a;
  --accent: #ce346b; --accent2: #e0457c; --ok: #34d399; --warn: #fbbf24; --bad: #f87171; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 15px; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* --- auth --- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .box { width: 100%; max-width: 380px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: .2px; }
.mark { width: 34px; height: 34px; border-radius: 9px; display: block; }
.auth h1 { font-weight: 600; font-size: 24px; margin: 28px 0 6px; }
.auth p.sub { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { color: var(--muted); font-size: 13px; }
.inp { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; width: 100%; }
.inp:focus { border-color: #52525b; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel2);
  border-radius: 999px; padding: 10px 18px; cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3f3f46; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent2); }
.btn.block { width: 100%; padding: 13px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.links { display: flex; justify-content: space-between; margin-top: 16px; color: var(--muted); font-size: 14px; }
.links a { cursor: pointer; text-decoration: none; }
.links a:hover { color: var(--text); }
.msg { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.msg.err { color: var(--bad); border-color: #4c1d1d; }

/* --- shell --- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px 22px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; text-decoration: none; }
.nav:hover { color: var(--text); background: var(--panel); }
.nav.on { color: var(--text); background: var(--panel2); }
.side .grow { flex: 1; }
.side .who { color: var(--dim); font-size: 13px; padding: 8px 12px; overflow: hidden; text-overflow: ellipsis; }
main { padding: 34px 40px 60px; max-width: 1100px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.head h1 { font-weight: 600; font-size: 24px; margin: 0; }
.head p { color: var(--muted); margin: 6px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.card .big { font-size: 26px; font-weight: 600; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--panel2); overflow: hidden; margin: 12px 0 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.bar.warn i { background: var(--warn); } .bar.full i { background: var(--bad); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; background: var(--panel2); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); }
.banner { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid #4a3b12; background: #1f1a0d; color: var(--warn); line-height: 1.5; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--panel2); color: var(--text); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.plan.cur { border-color: var(--accent); }
.plan h3 { margin: 0; font-size: 17px; }
.plan .price { font-size: 26px; font-weight: 600; } .plan .price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; color: var(--muted); line-height: 1.9; font-size: 14px; flex: 1; }
.plan li::before { content: "✓  "; color: var(--accent2); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); }
th { color: var(--dim); font-weight: 500; border-top: 0; }
td.num, th.num { text-align: right; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--panel2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.thumb:hover .x { opacity: 1; }
.thumb .tag { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(0,0,0,.6); padding: 2px 7px; border-radius: 99px; }
.copy { display: flex; gap: 8px; } .copy .inp { font-size: 13px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #27272a; border: 1px solid #3f3f46;
  padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 90vw; }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.err { color: var(--bad); }
.swatch { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0; cursor: pointer; }
.logo-prev { max-height: 56px; max-width: 220px; background: var(--panel2); border-radius: 10px; padding: 8px; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .side .brand { padding: 6px 8px; width: 100%; } .side .grow, .side .who { display: none; }
  main { padding: 22px 16px 50px; }
}
