/* Visitly design system — clean, modern, no-emoji. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --border: #e6e8ef;
  --border-strong: #d4d7e2;
  --text: #0f1222;
  --muted: #6b7186;
  --muted-2: #9aa0b4;
  --accent: #5b5bd6;
  --accent-600: #4f46e5;
  --accent-700: #4338ca;
  --accent-soft: #eef0ff;
  --success: #15a06b;
  --success-soft: #e6f6ee;
  --danger: #e1463c;
  --danger-soft: #fdecea;
  --warn: #b7791f;
  --ink: #0b1020;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16,18,34,.06), 0 1px 3px rgba(16,18,34,.04);
  --shadow: 0 6px 24px rgba(16,18,34,.08);
  --shadow-lg: 0 24px 60px rgba(16,18,34,.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
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;
}
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small { color: var(--muted); }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 760px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hide { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* Top navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #8b5cf6); box-shadow: var(--shadow-sm); display: inline-block; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: transform .04s ease, background .15s ease, border-color .15s ease, box-shadow .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-700); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c63a31; text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 9px; }
.btn-lg { padding: 13px 24px; font-size: 1.02rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text); }
.input, .select, textarea.input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--muted-2); }
.hint { font-size: .8rem; color: var(--muted); }
.input-group { display: flex; }
.input-group .prefix { display: inline-flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border-strong); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-size: .9rem; white-space: nowrap; }
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

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

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); }
.badge.green { color: var(--success); background: var(--success-soft); border-color: transparent; }
.badge.red { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.violet { color: var(--accent-700); background: var(--accent-soft); border-color: transparent; }
.badge.gray { color: var(--muted); background: var(--surface-2); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted-2); }
.dot.green { background: var(--success); } .dot.red { background: var(--danger); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* App layout */
.app-shell { display: grid; grid-template-columns: 244px 1fr; min-height: calc(100vh - 64px); }
.sidebar { border-right: 1px solid var(--border); padding: 22px 16px; background: var(--surface); }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: .94rem; margin-bottom: 2px; }
.sidebar a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--accent-soft); color: var(--accent-700); }
.main { padding: 30px 34px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* Marketing */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 50% -10%, #ece9ff 0%, transparent 60%), var(--bg); padding: 96px 0 72px; text-align: center; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); letter-spacing: -.04em; margin-bottom: 18px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--accent-700); background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.shorten-box { max-width: 620px; margin: 34px auto 0; display: flex; gap: 10px; background: var(--surface); padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.shorten-box .input { border: none; box-shadow: none; }
.section { padding: 72px 0; }
.section h2 { text-align: center; font-size: clamp(1.6rem,3vw,2.2rem); }
.section .sub { text-align: center; color: var(--muted); max-width: 560px; margin: -4px auto 44px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.feature h3 { margin-bottom: 8px; }
.feature .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-700); display: grid; place-items: center; margin-bottom: 16px; }
.feature .ic svg { width: 22px; height: 22px; }
.compare { max-width: 760px; margin: 0 auto; }
.compare .table td.yes { color: var(--success); font-weight: 700; }
.compare .table td.no { color: var(--muted-2); }
.cta-band { background: linear-gradient(135deg, var(--ink), #1b1f3b); color: #fff; border-radius: var(--radius-lg); padding: 56px 40px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #c7cbe0; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 48px 0; color: var(--muted); font-size: .9rem; background: var(--surface); }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 28px; }
.footer a { color: var(--muted); display: block; padding: 4px 0; }
.footer a:hover { color: var(--text); }
.footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); }

/* Auth */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 412px; }
.auth-card .panel { padding: 32px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: .82rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }

/* Toast */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 340px; animation: slideup .2s ease; }
.toast.ok { background: #0f5132; } .toast.err { background: #842029; }
@keyframes slideup { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(11,16,32,.5); display: grid; place-items: center; z-index: 90; padding: 20px; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 26px; }
.modal h3 { margin-bottom: 14px; }

/* Code */
pre, code { font-family: var(--mono); }
pre.code { background: var(--ink); color: #e6e8f5; padding: 18px; border-radius: var(--radius); overflow-x: auto; font-size: .86rem; line-height: 1.5; }
code.inline { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.copy-row { display: flex; align-items: center; gap: 8px; }

/* Charts (inline SVG) */
.chart { width: 100%; }
.chart .bar { fill: var(--accent); }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--muted); font-size: 11px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; }
.barlist { display: flex; flex-direction: column; gap: 10px; }
.barlist .item { display: grid; grid-template-columns: 120px 1fr 48px; gap: 10px; align-items: center; font-size: .88rem; }
.barlist .track { background: var(--surface-2); border-radius: 6px; height: 10px; overflow: hidden; }
.barlist .fill { background: var(--accent); height: 100%; border-radius: 6px; }

/* Empty state */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h3 { color: var(--text); }

/* Utilities */
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs button { background: none; border: none; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--accent-700); border-bottom-color: var(--accent); }

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; overflow-x: auto; gap: 6px; border-right: none; border-bottom: 1px solid var(--border); padding: 10px; }
  .sidebar a { margin-bottom: 0; white-space: nowrap; }
  .main { padding: 22px 18px; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .nav-links { gap: 14px; }
  .nav-links a.hide-sm { display: none; }
}
