:root {
  --bg: #f6f6f9; --surface: #fff; --line: #e7e7ee; --line-2: #d9d9e3;
  --ink: #14121f; --ink-2: #4b4860; --muted: #7c7990;
  --accent: #6d4aff; --accent-2: #5838e6; --accent-soft: #efebff;
  --ok: #138a4a; --ok-soft: #e7f7ee; --warn: #b45309; --warn-soft: #fff6e6; --err: #c0262d; --err-soft: #fdecec;
  --ig: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); --fb: #1877f2;
  --radius: 14px; --shadow: 0 1px 2px rgba(20, 18, 31, .05), 0 4px 16px rgba(20, 18, 31, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 0; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.ok { color: var(--ok); } .err { color: var(--err); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* top bar (public pages and app) */
nav, .topbar { display: flex; justify-content: space-between; align-items: center; max-width: 1080px; margin: 0 auto; padding: 16px 24px; gap: 16px; }
.brand { font-weight: 750; font-size: 18px; color: var(--ink); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
nav .links a { margin-left: 16px; color: var(--ink); }
main { max-width: 1080px; margin: 0 auto; padding: 8px 24px 64px; }
.wrap { max-width: 960px; }
.narrow { max-width: 420px; margin: 40px auto; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head p { margin-top: 4px; }

/* inputs */
label.f { display: block; margin: 12px 0 6px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 96px; resize: vertical; }

/* buttons */
button, .btn { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
button:hover, .btn:hover { background: var(--accent-2); text-decoration: none; }
button.ghost, .btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
button.ghost:hover, .btn.ghost:hover { background: #fafafe; border-color: #c9c6d8; }
button.link { background: none; border: 0; color: var(--accent); padding: 4px 6px; font-weight: 600; }
button.danger { background: #fff; color: var(--err); border-color: #f1c4c6; }
button.danger:hover { background: var(--err-soft); }
button.sm, .btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; }

/* pills, chips */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f0eff5; color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.err { background: var(--err-soft); color: var(--err); }
.pill.accent { background: var(--accent-soft); color: var(--accent-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .02em; padding: 5px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; }
.chip button { all: unset; cursor: pointer; opacity: .7; font-weight: 400; }
.chip button:hover { opacity: 1; }
.plat { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.plat.ig { background: var(--ig); } .plat.fb { background: var(--fb); }

/* banners */
.banner { padding: 12px 16px; border-radius: 12px; margin: 12px 0; border: 1px solid var(--line); background: #fff; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { border-color: #f4d39b; background: var(--warn-soft); } .banner.good { border-color: #a7e3bf; background: var(--ok-soft); } .banner.err { border-color: #f1c4c6; background: var(--err-soft); }

/* switch */
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d5d3e0; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* segmented control */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; transition: .15s; }
.seg label:hover { border-color: #c9c6d8; }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.seg b { display: block; font-size: 14px; }

/* legacy table + log (owner page) */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.log { font: 12px/1.5 ui-monospace, Menlo, monospace; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; }

/* landing */
.hero { padding: 40px 0 16px; } .hero h1 { font-size: 42px; max-width: 760px; }
.price { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }

@media (max-width: 640px) {
  nav, .topbar, main { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 32px; }
  .seg { grid-template-columns: 1fr; }
}
