/*!
 * Slugvane - main stylesheet
 * (c) 2026 gioktughatipoglu
 */

:root {
  --brand: #0d9488;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f0f3f4;
  --border: #e2e7ea;
  --text: #0f1b24;
  --muted: #5d6b76;
  --faint: #8995a0;
  --success: #15803d;
  --danger: #dc2626;
  --warning: #b45309;
  --info: #2563eb;
  --shadow: 0 1px 2px rgba(15, 27, 36, .05), 0 4px 16px rgba(15, 27, 36, .06);
  --shadow-lg: 0 10px 40px rgba(15, 27, 36, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b1217;
  --surface: #121b22;
  --surface-2: #18232b;
  --border: #233139;
  --text: #e7eef2;
  --muted: #9aabb6;
  --faint: #6f818c;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;
  --brand-soft: color-mix(in srgb, var(--brand) 20%, transparent);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 600 .9rem/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { text-decoration: none; border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.15); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 10px; font-size: .82rem; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; border-radius: 10px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label, .label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; }
.hint { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.input-group { display: flex; }
.input-group .prefix {
  display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); border-inline-end: 0;
  border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: .85rem; white-space: nowrap; max-width: 55%; overflow: hidden;
  text-overflow: ellipsis; direction: rtl; display: block; line-height: 40px;
}
[dir="rtl"] .input-group .prefix { direction: ltr; }
.input-group .input { border-radius: 0; border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; cursor: pointer; margin-bottom: .75rem; }
.check input { margin-top: .25rem; accent-color: var(--brand); width: 16px; height: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
details.more { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; }
details.more summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
details.more[open] summary { margin-bottom: 1rem; }
.color-input { display: flex; gap: .5rem; align-items: center; }
.color-input input[type=color] { width: 44px; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }

/* Cards, tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; padding: .7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .actions { display: flex; gap: .25rem; justify-content: flex-end; }
.table .actions form { display: inline; margin: 0; }
.link-cell { display: flex; flex-direction: column; min-width: 0; max-width: 420px; }
.link-cell .short { font-weight: 600; color: var(--text); display: inline-flex; gap: .4rem; align-items: center; align-self: flex-start; }
[dir="rtl"] .link-cell .short { align-self: flex-end; }
.link-cell .dest { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-success { background: color-mix(in srgb, var(--success) 13%, transparent); color: var(--success); }
.badge-danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.badge-warning { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge .icon { width: 12px; height: 12px; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty > .icon { width: 40px; height: 40px; color: var(--faint); margin-bottom: .5rem; }

/* Alerts */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: color-mix(in srgb, var(--success) 10%, var(--surface)); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-error { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-info { background: color-mix(in srgb, var(--info) 9%, var(--surface)); border-color: color-mix(in srgb, var(--info) 28%, transparent); }
.alert .grow { word-break: break-word; }

/* App shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1.1rem .85rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.12rem; color: var(--text); letter-spacing: -.02em; padding: .2rem .5rem 1.2rem; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 1rem .7rem .4rem; }
.nav a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550; font-size: .92rem; margin-bottom: 2px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a .count { margin-inline-start: auto; background: var(--danger); color: #fff; font-size: .7rem; padding: 0 .45rem; border-radius: 999px; line-height: 1.5; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .5rem; }
.avatar-initial { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand); flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem;
  padding: .8rem 2rem; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.content { padding: 1.75rem 2rem 3rem; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: 0; color: var(--muted); }
.menu-toggle { display: none; }
.lang-select { height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); padding: 0 .5rem; font: inherit; font-size: .85rem; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1.1rem 1.2rem; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .4rem; }
.stat .value { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; margin-top: .25rem; }
.stat .sub { font-size: .78rem; color: var(--faint); }
.stat .icon-bubble { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat .icon-bubble .icon { width: 16px; height: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.split-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.chart { position: relative; width: 100%; height: 260px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .area { fill: url(#svGradient); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-2 { fill: none; stroke: color-mix(in srgb, var(--brand) 45%, var(--text)); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
.chart .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: .78rem; padding: .35rem .6rem; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .1s; }
.chart-legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-inline-end: .35rem; vertical-align: middle; background: var(--brand); }
.chart-legend span.dashed::before { background: color-mix(in srgb, var(--brand) 45%, var(--text)); }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { position: relative; display: flex; justify-content: space-between; gap: .75rem; padding: .5rem .7rem; font-size: .88rem; border-radius: 6px; margin-bottom: 4px; overflow: hidden; }
.bars li .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--brand-soft); border-radius: 6px; z-index: 0; }
.bars li > span { position: relative; z-index: 1; }
.bars li .n { font-weight: 650; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.seg a { padding: .3rem .7rem; border-radius: 6px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Toolbar + pagination */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.toolbar .search { position: relative; flex: 1 1 240px; }
.toolbar .search .icon { position: absolute; inset-inline-start: 11px; top: 12px; color: var(--faint); }
.toolbar .search .input { padding-inline-start: 36px; }
.toolbar select.input { width: auto; min-width: 140px; }
.pagination { display: flex; gap: .3rem; justify-content: space-between; align-items: center; padding: .9rem 1.25rem; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.pagination .pages { display: flex; gap: .25rem; }
.pagination a, .pagination span.cur { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 .5rem; border-radius: 6px; border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.pagination span.cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pagination a:hover { text-decoration: none; background: var(--surface-2); }

/* Copy box */
.copy-box { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .35rem .35rem .8rem; }
.copy-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
pre.code { background: #0e1a21; color: #d6e4ea; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .8rem; line-height: 1.6; margin: 0 0 1rem; }

/* Public site */
.public-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem clamp(1rem, 4vw, 3rem); max-width: 1200px; margin: 0 auto; gap: 1rem; }
.public-header nav { display: flex; align-items: center; gap: .4rem; }
.public-header nav > a:not(.btn) { color: var(--muted); font-weight: 600; font-size: .92rem; padding: .4rem .6rem; }
.hero { position: relative; text-align: center; padding: clamp(2.5rem, 8vw, 5.5rem) 1rem 3rem; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 620px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
              radial-gradient(closest-side at 70% 60%, color-mix(in srgb, #f59e0b 14%, transparent), transparent 70%);
  filter: blur(10px);
}
.hero .eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 650; font-size: .8rem; color: var(--brand); background: var(--brand-soft); padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.25rem; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); line-height: 1.08; letter-spacing: -.035em; max-width: 820px; margin: 0 auto 1rem; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--muted); max-width: 620px; margin: 0 auto 2rem; }
.shorten-box { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: .5rem; display: flex; gap: .5rem; }
.shorten-box .input { border: 0; height: 52px; font-size: 1rem; box-shadow: none; background: transparent; }
.shorten-box .input:focus { box-shadow: none; }
.shorten-result { max-width: 720px; margin: 1rem auto 0; text-align: start; display: none; }
.shorten-result.show { display: flex; }
.shorten-result .card-body { display: flex; gap: 1rem; align-items: center; width: 100%; }
.shorten-result img { width: 92px; height: 92px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.shorten-note { color: var(--faint); font-size: .85rem; margin-top: .9rem; }
.hero-stats { display: flex; gap: 2.5rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.hero-stats span { color: var(--muted); font-size: .85rem; }
.features { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem 4rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.feature { padding: 1.5rem; }
.feature .icon-bubble { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 1rem; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; font-size: .92rem; }
.public-footer { border-top: 1px solid var(--border); padding: 1.5rem 1rem; text-align: center; color: var(--faint); font-size: .85rem; }
.public-footer a { color: var(--muted); }
.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 2rem; }
.auth-card h1 { font-size: 1.45rem; }
.narrow { max-width: 640px; margin: 0 auto; padding: 2rem 1rem 4rem; }

/* Mini centered pages (password, unavailable) */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.center-page .card { max-width: 420px; width: 100%; text-align: center; }
.center-page .card-body { padding: 2.2rem 2rem; }
.center-page .big-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 1rem; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.center-page .big-icon .icon { width: 26px; height: 26px; }

/* QR designer */
.qr-stage { display: grid; place-items: center; padding: 1.5rem; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.qr-stage img { width: 260px; height: 260px; image-rendering: pixelated; border-radius: 6px; box-shadow: var(--shadow); }
.swatches { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }

/* Bio editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
.editor .preview-col { position: sticky; top: 84px; }
.phone { width: 340px; height: 690px; margin: 0 auto; border-radius: 44px; padding: 12px; background: #0e1418; box-shadow: var(--shadow-lg), inset 0 0 0 2px #2b363d; }
.phone-screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; overflow-y: auto; scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }
.item-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.item-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: .5rem; align-items: center; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: .5rem; }
.item-row.dragging { opacity: .5; }
.item-row.is-hidden .input { opacity: .55; }
.item-row .grip { cursor: grab; color: var(--faint); display: grid; place-items: center; }
.item-row .meta { display: flex; gap: .15rem; }
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.theme-option { position: relative; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; }
.theme-option .swatch { display: block; height: 64px; border-radius: 10px; border: 2px solid var(--border); position: relative; overflow: hidden; }
.theme-option .swatch::after { content: ""; position: absolute; inset-inline: 18%; height: 9px; top: 50%; border-radius: 5px; background: var(--btn); box-shadow: 0 13px 0 var(--btn); transform: translateY(-80%); }
.theme-option input:checked + .swatch { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.theme-option .name { display: block; text-align: center; font-size: .75rem; color: var(--muted); margin-top: .25rem; text-transform: capitalize; }
.social-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; }
.social-field { display: flex; align-items: center; gap: .5rem; }
.social-field .ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.social-field .ico svg { width: 18px; height: 18px; }
.avatar-edit { display: flex; gap: 1rem; align-items: center; }
.avatar-edit img, .avatar-edit .avatar-initial { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; font-size: 1.4rem; }

/* Install */
.install-wrap { max-width: 640px; margin: 0 auto; padding: 3rem 1rem; }
.checks { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.checks li { display: flex; gap: .45rem; align-items: center; font-size: .88rem; }
.checks .ok { color: var(--success); }
.checks .bad { color: var(--danger); }

.sidebar .lang-select { display: none; }

/* Responsive */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .editor { grid-template-columns: minmax(0, 1fr); }
  .editor .preview-col { position: static; }
  .split-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; inset-inline-start: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: .7rem 1rem; }
  .content { padding: 1.25rem 1rem 3rem; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .split-even, .split-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .stat-grid { gap: .6rem; }
  .stat .value { font-size: 1.4rem; }
  .grid-2, .grid-3, .social-grid, .checks { grid-template-columns: minmax(0, 1fr); }
  .shorten-box { flex-direction: column; }
  .shorten-result .card-body { flex-direction: column; text-align: center; }
  .public-header nav .hide-sm { display: none; }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .item-row .url-input { grid-column: 2 / 4; grid-row: 2; }
  .phone { width: 100%; max-width: 340px; }
  .table .hide-sm { display: none; }
  .topbar .lang-select { display: none; }
  .sidebar .lang-select { display: block; width: 100%; margin-bottom: .5rem; }
  .public-header .brand span { display: none; }
  .public-header { padding-inline: 1rem; }
  .public-header .lang-select { max-width: 104px; }
}

/* Theme toggle icon swap */
.when-light, .when-dark { display: inline-flex; }
[data-theme="dark"] .when-light, :root:not([data-theme="dark"]) .when-dark { display: none; }

/* Right-to-left tweaks */
[dir="rtl"] .chart svg { direction: ltr; }
[dir="rtl"] .copy-box code, [dir="rtl"] .link-cell .dest, [dir="rtl"] pre.code, [dir="rtl"] .mono { direction: ltr; text-align: end; }

/* File inputs */
input[type="file"] { font: inherit; font-size: .85rem; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: 600 .82rem/1 var(--font); height: 32px; padding: 0 12px; margin-inline-end: .6rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
}

/* Live demo banner */
.demo-banner { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .45rem 1rem; background: #fbbf24; color: #1f1300; font-size: .85rem; text-align: center; position: relative; z-index: 60; }
.demo-banner .icon { width: 15px; height: 15px; vertical-align: -2px; }
.demo-banner .btn { color: inherit; width: 28px; height: 28px; flex: none; }
