:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --accent: #14b8a6;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mt { margin-top: 24px; } .mb { margin-bottom: 24px; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.logo-dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), var(--accent)); display: inline-block; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .linkbtn { color: var(--ink); padding: 8px 12px; border-radius: 10px; font-size: .95rem; }
.nav a:hover, .linkbtn:hover { background: var(--bg); text-decoration: none; }
.nav a.on { background: #eef2ff; color: var(--brand-dark); font-weight: 600; }
.nav a.btn { color: #fff; }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; }
form.inline { display: inline; margin: 0; }

.btn {
  display: inline-block; background: var(--brand); color: #fff; border: 0; cursor: pointer;
  padding: 11px 20px; border-radius: 12px; font: inherit; font-weight: 600; text-align: center;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #b91c1c; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.flashes { margin-top: 20px; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 10px; border: 1px solid; }
.f-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.f-err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.f-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }

.page { padding: 32px 0 56px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.6rem; }

/* forms */
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: .95rem; }
.field { margin-bottom: 18px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c7d2fe; border-color: var(--brand); }
input[type=color] { width: 56px; height: 42px; padding: 3px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; cursor: pointer; }
input[type=file] { width: 100%; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-bottom: 10px; }
.check input { margin-top: 5px; }
.narrow { max-width: 460px; margin: 0 auto; }
.mid { max-width: 720px; margin: 0 auto; }
.errors { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; }
.errors ul { margin: 0; padding-left: 18px; }
.logo-preview { width: 84px; height: 84px; border-radius: 18px; border: 1px solid var(--line); object-fit: cover; background: #fff; }

/* badges, tables */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.b-success { background: #dcfce7; color: #166534; }
.b-failed { background: #fee2e2; color: #991b1b; }
.b-queued, .b-building { background: #fef3c7; color: #92400e; }
.b-none { background: #e2e8f0; color: #475569; }
.b-blocked { background: #fee2e2; color: #991b1b; }
.b-active { background: #dcfce7; color: #166534; }
.b-admin { background: #e0e7ff; color: #3730a3; }
table.t { width: 100%; border-collapse: collapse; font-size: .93rem; }
.t th, .t td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap .t tr:last-child td { border-bottom: 0; }
.logmsg { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; white-space: pre-wrap; word-break: break-word; background: #f1f5f9; padding: 8px 10px; border-radius: 8px; max-height: 160px; overflow: auto; margin-top: 6px; }

.tabs { display: flex; gap: 6px; margin: 22px 0 0; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: .93rem; }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a:hover { text-decoration: none; background: #e2e8f0; }
.tabs a.on:hover { background: var(--ink); }

.stat { padding: 18px 20px; }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }

/* app cards */
.appcard { display: flex; gap: 16px; align-items: flex-start; }
.appcard img { width: 64px; height: 64px; border-radius: 16px; border: 1px solid var(--line); flex: none; object-fit: cover; }
.appcard h3 { margin: 0 0 2px; }
.appcard .url { color: var(--muted); font-size: .85rem; word-break: break-all; }
.appcard .row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { text-align: center; padding: 48px 20px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: .95rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f1f5f9; padding: 2px 8px; border-radius: 6px; }

/* landing */
.hero { background: radial-gradient(1200px 500px at 80% -10%, #4f46e5 0%, transparent 60%), radial-gradient(900px 500px at 0% 110%, #0d9488 0%, transparent 55%), #0f172a; color: #fff; padding: 84px 0 96px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 760px; margin-bottom: 18px; }
.hero p.lead { font-size: 1.2rem; max-width: 620px; color: #cbd5e1; margin-bottom: 28px; }
.hero .btn { padding: 14px 26px; font-size: 1.05rem; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: #475569; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.08); }
.pill { display: inline-block; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); padding: 5px 14px; border-radius: 999px; font-size: .85rem; margin-bottom: 18px; }
.section { padding: 64px 0; }
.section h2 { font-size: 1.8rem; text-align: center; margin-bottom: 8px; }
.section .sub { text-align: center; color: var(--muted); margin-bottom: 36px; }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; background: #eef2ff; color: var(--brand); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.step .num { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.cta { background: #eef2ff; border-radius: 22px; padding: 44px 24px; text-align: center; }
.footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .9rem; background: #fff; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; }
.tip { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; padding: 12px 16px; border-radius: 12px; }

/* menu button (mobile) */
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; font-size: 1.3rem; padding: 4px 12px; cursor: pointer; color: var(--ink); }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .nav a, .nav .linkbtn { padding: 11px 12px; text-align: left; }
  .nav a.btn { text-align: center; }
}

/* footer */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }

/* long text pages */
.prose h2 { margin-top: 1.6em; font-size: 1.25rem; }
.prose p, .prose li { color: #334155; }
.prose ul { padding-left: 20px; }
.ticks { list-style: none; padding: 0; margin: 0 0 20px; }
.ticks li { padding: 5px 0 5px 26px; position: relative; color: #334155; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* pricing */
.toggle { display: inline-flex; background: #e2e8f0; border-radius: 999px; padding: 4px; margin: 0 auto 28px; }
.toggle button { border: 0; background: none; padding: 8px 20px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.toggle button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--brand); }
.plan .flag { position: absolute; top: -12px; left: 20px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.plan .price { font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin: 8px 0 2px; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan .btn { margin-top: auto; }
.save { color: var(--ok); font-size: .85rem; font-weight: 600; min-height: 1.3em; margin-bottom: 14px; }

/* faq */
details.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 10px 0 0; color: #334155; }

/* tickets */
.msg { padding: 14px 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--line); background: #fff; }
.msg.staff { background: #eef2ff; border-color: #c7d2fe; }
.msg .who { font-size: .8rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
textarea { min-height: 120px; resize: vertical; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* verification box */
.verify { border: 1px solid #fde68a; background: #fffbeb; border-radius: var(--radius); padding: 20px; }
.verify.done { border-color: #bbf7d0; background: #f0fdf4; }
.verify pre { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: .82rem; margin: 6px 0 14px; white-space: pre-wrap; word-break: break-all; }
.invoice { background: #fff; max-width: 780px; margin: 30px auto; padding: 36px; border: 1px solid var(--line); border-radius: 14px; }
.invoice table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.invoice th, .invoice td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.invoice .r { text-align: right; }
@media print { .topbar, .footer, .noprint, .flashes { display: none !important; } .invoice { border: 0; margin: 0; } body { background: #fff; } }
