/* zilk.uk — dark, glassy, one accent. */

:root {
  color-scheme: dark;

  --bg: #07080f;
  --bg-soft: #0b0d17;
  --surface: rgba(20, 23, 38, 0.66);
  --surface-solid: #121527;
  --surface-raised: #171b30;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f4f6fc;
  --muted: #98a1ba;
  --faint: #6f7891;

  --accent: #8b7bff;
  --accent-bright: #b9adff;
  --accent-soft: rgba(139, 123, 255, 0.14);
  --cyan: #56d8f5;
  --green: #57e0a8;
  --amber: #f5c46a;
  --red: #ff8a9b;

  --radius: 18px;
  --radius-lg: 26px;
  --shell: min(1180px, calc(100% - 40px));
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .9em; }

.icon-defs { position: absolute; width: 0; height: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 10px 16px; background: var(--accent); color: #0b0713; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------ backdrop --- */

.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora-blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.aurora-blob.a { width: 46vw; height: 46vw; left: -10vw; top: -14vw; background: radial-gradient(circle, #6d5bff, transparent 68%); }
.aurora-blob.b { width: 38vw; height: 38vw; right: -8vw; top: 8vh; background: radial-gradient(circle, #1f7fd4, transparent 68%); opacity: .38; }
.aurora-blob.c { width: 40vw; height: 40vw; left: 26vw; bottom: -22vw; background: radial-gradient(circle, #b45bff, transparent 70%); opacity: .28; }
.aurora-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 78%);
  opacity: .5;
}

/* -------------------------------------------------------------- topbar --- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  width: 100%;
  display: flex; align-items: center; gap: 22px;
  padding: 14px max(20px, calc((100% - var(--shell)) / 2));
  background: rgba(7, 8, 15, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.03em; font-size: 19px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 9px;
  background: linear-gradient(140deg, var(--accent-bright), var(--accent) 45%, #4b3ce0);
  box-shadow: 0 4px 16px rgba(139, 123, 255, .45);
  display: grid; place-items: center;
}
.brand-mark::after {
  content: "z";
  font-size: 17px; font-weight: 800; line-height: 1;
  color: rgba(11, 8, 22, .92);
}
.brand-dot { color: var(--faint); font-weight: 500; }

.tabs { display: flex; gap: 2px; margin-right: auto; }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 11px;
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background .18s, color .18s;
}
.tab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.tab.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(139,123,255,.28); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.net-badge {
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  color: var(--green); background: rgba(87, 224, 168, .12);
  box-shadow: inset 0 0 0 1px rgba(87, 224, 168, .25);
}

.menu-toggle { display: none; }

/* --------------------------------------------------------------- atoms --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 0;
  font: inherit; font-size: 14px; font-weight: 550; letter-spacing: -.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s, background .18s, box-shadow .18s, opacity .18s;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(140deg, var(--accent-bright), var(--accent));
  color: #100a24;
  box-shadow: 0 6px 20px rgba(139, 123, 255, .35);
}
.btn-primary:hover:not([disabled]) { box-shadow: 0 8px 26px rgba(139, 123, 255, .5); }

.btn-ghost { background: rgba(255,255,255,.05); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover:not([disabled]) { background: rgba(255,255,255,.09); }

.btn-danger { background: rgba(255, 138, 155, .12); color: var(--red); box-shadow: inset 0 0 0 1px rgba(255,138,155,.3); }
.btn-danger:hover:not([disabled]) { background: rgba(255, 138, 155, .2); }

.btn-tiny { padding: 6px 10px; font-size: 13px; border-radius: 9px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--muted); }
.field > span { font-weight: 550; letter-spacing: -.01em; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field small { color: var(--faint); font-weight: 450; font-size: 12px; }

input[type="text"], input[type="url"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 10, 20, .6);
  color: var(--text);
  font: inherit; font-size: 14.5px;
  transition: border-color .18s, box-shadow .18s;
}
textarea { resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(139,123,255,.6);
  box-shadow: 0 0 0 3px rgba(139,123,255,.15);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

.field-check { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.field-check input[type="checkbox"] {
  appearance: none; width: 17px; height: 17px; flex: none;
  border-radius: 5px; border: 1.5px solid var(--line-strong); background: rgba(8,10,20,.6);
  cursor: pointer; position: relative; transition: background .16s, border-color .16s;
}
.field-check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.field-check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 8px;
  border: solid #100a24; border-width: 0 2px 2px 0; transform: rotate(43deg);
}
.field-check span { color: var(--muted); font-size: 13.5px; }

input[type="range"] { appearance: none; width: 100%; height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); cursor: pointer; padding: 0; border: 0; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 2px 8px rgba(0,0,0,.5); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--accent-bright); }

.segmented { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: rgba(8,10,20,.6); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented button {
  flex: 1; padding: 8px 6px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; transition: background .16s, color .16s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--accent-soft); color: var(--accent-bright); box-shadow: inset 0 0 0 1px rgba(139,123,255,.3); }

.form-error { color: var(--red); font-size: 13.5px; margin-top: 4px; }
.hint { color: var(--faint); font-size: 12.5px; }

/* ---------------------------------------------------------------- main --- */

main { flex: 1; width: var(--shell); margin: 0 auto; padding: 40px 0 64px; }

.view-head { margin-bottom: 22px; }
.view-head h2 { font-size: clamp(24px, 3.4vw, 32px); }
.view-head p { color: var(--muted); margin-top: 6px; }

/* ------------------------------------------------------------- shorten --- */

.hero { max-width: 780px; margin: 0 auto; text-align: center; padding-top: clamp(10px, 5vh, 48px); }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-bright); padding: 5px 13px; border-radius: 999px;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(139,123,255,.25);
}
.hero-title { font-size: clamp(38px, 7vw, 66px); margin: 20px 0 0; letter-spacing: -.035em; font-weight: 660; }
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-bright), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 16.5px; margin: 18px auto 0; max-width: 560px; }
.hero-sub strong { color: var(--text); font-weight: 600; }

.shorten-card {
  margin-top: 34px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  backdrop-filter: blur(16px); box-shadow: var(--shadow); text-align: left;
}
.shorten-main { display: flex; align-items: center; gap: 10px; position: relative; }
.field-icon { position: absolute; left: 14px; display: flex; color: var(--faint); pointer-events: none; }
.field-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shorten-main input {
  flex: 1; padding: 14px 14px 14px 42px; font-size: 15.5px;
  border-radius: 14px; background: rgba(8,10,20,.72);
}
.shorten-main .btn { padding: 14px 22px; border-radius: 14px; font-size: 15px; }

.advanced { margin-top: 12px; }
.advanced summary {
  cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 550;
  padding: 7px 4px; list-style: none; display: flex; align-items: center; gap: 7px; width: fit-content;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "›"; transition: transform .2s; display: inline-block; font-size: 17px; line-height: 1; }
.advanced[open] summary::before { transform: rotate(90deg); }
.advanced summary:hover { color: var(--text); }
.advanced-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; padding: 12px 4px 4px; }
.advanced-grid .field-check { grid-column: 1 / -1; }

.slug-input { display: flex; align-items: center; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(8,10,20,.6); overflow: hidden; }
.slug-input:focus-within { border-color: rgba(139,123,255,.6); box-shadow: 0 0 0 3px rgba(139,123,255,.15); }
.slug-prefix { padding: 0 2px 0 13px; color: var(--faint); font-size: 14px; font-family: var(--mono); white-space: nowrap; }
.slug-input input { border: 0; background: transparent; padding-left: 2px; }
.slug-input input:focus { box-shadow: none; }

.result-card {
  margin-top: 18px; padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(139,123,255,.14), rgba(86,216,245,.07));
  border: 1px solid rgba(139,123,255,.3);
  text-align: left; animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result-main { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.result-text { flex: 1; min-width: 220px; }
.result-label { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent-bright); font-weight: 600; }
.result-url { display: block; font-size: clamp(19px, 3vw, 26px); font-weight: 600; letter-spacing: -.02em; margin-top: 4px; word-break: break-all; }
.result-url:hover { color: var(--accent-bright); }
.result-target { color: var(--faint); font-size: 13px; margin-top: 5px; word-break: break-all; }
.result-actions { display: flex; gap: 9px; }
.result-qr-preview { margin-top: 18px; display: none; justify-content: center; }
.result-qr-preview.show { display: flex; }
.result-qr-preview svg { border-radius: 14px; box-shadow: var(--shadow-sm); }

.feature-strip { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; color: var(--faint); font-size: 13.5px; }
.feature-strip li { display: flex; align-items: center; gap: 8px; }
.feature-strip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ----------------------------------------------------------- qr studio --- */

.qr-layout { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.qr-controls { display: flex; flex-direction: column; gap: 16px; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type="color"] {
  width: 42px; height: 40px; flex: none; padding: 3px; cursor: pointer;
  border-radius: 11px; border: 1px solid var(--line-strong); background: rgba(8,10,20,.6);
}
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.color-field input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }
.color-field input[type="text"] { font-family: var(--mono); font-size: 13px; text-transform: uppercase; }

.qr-preview-panel { display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; min-height: 420px; }
.qr-canvas { width: min(100%, 380px); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.qr-canvas svg { width: 100%; height: 100%; border-radius: 16px; box-shadow: var(--shadow); }
.qr-export { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }

/* --------------------------------------------------------------- links --- */

.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; }
.search-field input { padding-left: 40px; }
.toolbar select { width: auto; min-width: 160px; }

.links-body { display: flex; flex-direction: column; gap: 10px; }

.link-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 16px; align-items: center;
  padding: 15px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(12px); transition: border-color .18s, transform .18s;
}
.link-row:hover { border-color: var(--line-strong); }
.link-main { min-width: 0; }
.link-short { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15.5px; letter-spacing: -.015em; }
.link-short a:hover { color: var(--accent-bright); }
.link-title { color: var(--muted); font-size: 13px; margin-top: 2px; }
.link-target { color: var(--faint); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.link-meta { text-align: right; }
.link-clicks { font-size: 20px; font-weight: 620; letter-spacing: -.02em; }
.link-clicks small { display: block; font-size: 11px; font-weight: 500; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.link-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.05); color: var(--muted); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line); transition: background .16s, color .16s;
}
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: rgba(255,255,255,.1); color: var(--text); }
.icon-btn.danger:hover { background: rgba(255,138,155,.16); color: var(--red); }

.badge-expired { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,138,155,.14); color: var(--red); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; color: var(--muted); font-size: 13.5px; }

/* ----------------------------------------------------------- analytics --- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px);
}
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 640; letter-spacing: -.03em; margin-top: 6px; }
.stat-value.accent { background: linear-gradient(100deg, var(--accent-bright), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.chart-panel { margin-bottom: 20px; }
.chart-panel h3 { font-size: 16px; margin-bottom: 4px; }
.chart-sub { color: var(--faint); font-size: 12.5px; margin-bottom: 16px; }
.spark { width: 100%; height: 190px; overflow: visible; }
.spark .grid-line { stroke: var(--line); stroke-width: 1; }
.spark .axis-label { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.spark .area { fill: url(#spark-fill); }
.spark .line { fill: none; stroke: var(--accent-bright); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .point { fill: var(--accent-bright); }

.breakdown-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 12px; align-items: center; margin-bottom: 9px; font-size: 13.5px; }
.bar-row .bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 7px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.bar-count { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* --------------------------------------------------------------- tools --- */

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.tool-card { display: flex; flex-direction: column; gap: 14px; }
.tool-card h3 { font-size: 17px; }
.tool-sub { color: var(--muted); font-size: 13.5px; margin-top: -8px; }
.tool-note { color: var(--faint); font-size: 13px; }
.tool-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.check-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }

.password-out {
  display: block; padding: 15px; border-radius: 13px;
  background: rgba(8,10,20,.7); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--mono); font-size: 16px; word-break: break-all; letter-spacing: .01em;
}
.strength { height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: -6px; }
.strength span { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .3s, background .3s; }

.paste-result { padding: 14px; border-radius: 13px; background: rgba(139,123,255,.1); box-shadow: inset 0 0 0 1px rgba(139,123,255,.28); font-size: 14px; }
.paste-result a { font-weight: 600; word-break: break-all; }
.paste-result a:hover { color: var(--accent-bright); }

.paste-doc { max-width: 860px; margin: 0 auto; }
.paste-doc pre {
  margin: 16px 0 0; padding: 20px; border-radius: var(--radius);
  background: rgba(8,10,20,.75); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}

/* --------------------------------------------------------------- panel --- */

.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }

.meter { margin-top: 12px; }
.meter-track { height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width .4s; }
.meter-fill.warn { background: linear-gradient(90deg, var(--amber), #ff9d6b); }
.meter-fill.crit { background: linear-gradient(90deg, #ff7a8a, var(--red)); }
.meter-caption { color: var(--faint); font-size: 12px; margin-top: 7px; }

.section-title { font-size: 17px; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title .count { font-size: 12.5px; color: var(--faint); font-weight: 500; }

.container-list { display: flex; flex-direction: column; gap: 9px; }
.container-row {
  display: grid; grid-template-columns: 10px minmax(0,1fr) auto auto; gap: 14px; align-items: center;
  padding: 13px 17px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px);
}
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.state-dot.running { background: var(--green); box-shadow: 0 0 10px rgba(87,224,168,.6); }
.state-dot.exited, .state-dot.dead { background: var(--red); }
.state-dot.restarting, .state-dot.paused { background: var(--amber); }
.container-name { font-weight: 580; font-size: 14.5px; }
.container-image { color: var(--faint); font-size: 12px; font-family: var(--mono); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container-status { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.service-chip {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px;
}

.gateway-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.gateway-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.gateway-card .gw-name { font-weight: 580; display: flex; align-items: center; gap: 8px; }
.gateway-card .gw-note { color: var(--faint); font-size: 12.5px; }
.gw-private { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; color: var(--cyan); background: rgba(86,216,245,.12); padding: 3px 8px; border-radius: 999px; }

.log-view {
  margin-top: 12px; padding: 16px; border-radius: var(--radius);
  background: rgba(6,7,14,.85); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--muted);
}

/* -------------------------------------------------------------- states --- */

.empty, .loading {
  padding: 52px 24px; text-align: center; color: var(--faint);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; font-weight: 570; }

.spinner {
  width: 22px; height: 22px; margin: 0 auto 14px;
  border: 2px solid var(--line-strong); border-top-color: var(--accent-bright);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.08), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; height: 76px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* -------------------------------------------------------------- modals --- */

.modal { border: 0; padding: 0; background: transparent; color: inherit; max-width: min(460px, calc(100% - 32px)); }
.modal::backdrop { background: rgba(4, 5, 12, .72); backdrop-filter: blur(6px); }
.modal-card {
  display: flex; flex-direction: column; gap: 14px; padding: 26px;
  background: var(--surface-solid); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.modal-card h3 { font-size: 19px; }
.modal-card > p { color: var(--muted); font-size: 14px; margin-top: -6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px; }

/* -------------------------------------------------------------- toasts --- */

.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 17px; border-radius: 13px; font-size: 14px; font-weight: 500;
  background: var(--surface-raised); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); animation: toast-in .28s ease both;
}
.toast.ok { border-color: rgba(87,224,168,.4); }
.toast.err { border-color: rgba(255,138,155,.45); color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------- footer --- */

.footer {
  width: var(--shell); margin: 0 auto; padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--faint); font-size: 13px;
}

/* ------------------------------------------------------------ responsive --- */

@media (max-width: 900px) {
  .qr-layout { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: minmax(0,1fr) auto; }
  .link-meta { grid-column: 2; }
  .link-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 780px) {
  :root { --shell: calc(100% - 28px); }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .menu-toggle {
    display: grid; place-content: center; gap: 5px; width: 38px; height: 38px; margin-left: auto;
    border: 0; border-radius: 11px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer;
  }
  .menu-toggle span { display: block; width: 16px; height: 1.8px; border-radius: 2px; background: var(--text); transition: transform .2s; }
  .tabs {
    order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none; display: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs.open { display: flex; }
  .topbar-actions { order: 2; margin-left: 0; }
  .shorten-main { flex-direction: column; align-items: stretch; }
  .shorten-main input { padding-left: 42px; }
  .field-icon { top: 17px; }
  .control-row { grid-template-columns: 1fr; }
  .container-row { grid-template-columns: 10px minmax(0,1fr) auto; }
  .container-status { grid-column: 2 / -1; text-align: left; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
}
