/* Roylance Shortlinks
   Brand: deep blue #1c5fa8, light blue #6eb8f7, dark navy #1a2a3a */

:root {
  --navy: #1a2a3a;
  --navy-2: #22364a;
  --blue: #1c5fa8;
  --blue-ink: #174f8d;
  --sky: #6eb8f7;
  --sky-soft: #e3f1fd;

  --bg: #edf1f5;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --ink: #1a2a3a;
  --muted: #5a6a7a;
  --faint: #8a98a6;
  --line: #d9e1e8;
  --line-soft: #e8edf2;

  --ok: #24804f;   --ok-bg: #e2f3ea;
  --warn: #9a6300; --warn-bg: #fbf0d9;
  --bad: #b8332a;  --bad-bg: #fbe6e3;
  --idle: #5a6a7a; --idle-bg: #e8edf2;

  --focus: 0 0 0 3px rgba(110,184,247,.55);
  --r-panel: 10px;
  --r-ctl: 7px;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --side-w: 236px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1822;
    --surface: #152230;
    --surface-2: #192838;
    --ink: #e4ecf4;
    --muted: #9badbf;
    --faint: #73879a;
    --line: #27394b;
    --line-soft: #1f3041;
    --blue-ink: #8cc6fa;
    --sky-soft: #173450;
    --ok: #63c993;   --ok-bg: #133526;
    --warn: #e8b55a; --warn-bg: #3a2c10;
    --bad: #f08a80;  --bad-bg: #3d1a17;
    --idle: #9badbf; --idle-bg: #223344;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .8em; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 5px; }
small { font-size: 12.5px; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; border-radius: 6px; }
.skip:focus { left: 8px; }
.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- URL display (the signature element) ---------- */
.url { font-family: var(--mono); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; vertical-align: bottom; }
.url-host { color: var(--faint); font-weight: 400; }
.url-slug { color: var(--ink); font-weight: 700; }
.url.lg { font-size: clamp(18px, 3.2vw, 28px); letter-spacing: -.02em; }
.url.xl .url-host { white-space: nowrap; }
.url.xl { font-size: clamp(16px, 4.2vw, 40px); letter-spacing: -.03em; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
.url.xl .url-slug { color: var(--blue-ink); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #c9d6e3; }
.side-inner { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 10px 20px; font-size: 13px; line-height: 1.15; color: #9fb4c8; }
.brand b { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--blue); display: grid; place-items: center; color: #fff; }
.side-toggle { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; color: #c9d6e3; text-decoration: none; font-weight: 500; }
.side-nav a:hover { background: var(--navy-2); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--blue); color: #fff; }
.side-nav a[aria-current="page"] .ic { color: var(--sky); }
.side-sep { margin: 18px 10px 6px; font-size: 12.5px; color: #7f95ab; }
.side-nav .count { margin-left: auto; font-style: normal; background: var(--sky); color: var(--navy); font-size: 12px; font-weight: 700; border-radius: 99px; padding: 0 7px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #2c4054; display: flex; flex-direction: column; gap: 2px; }

.main { padding: 30px clamp(16px, 3.4vw, 44px) 60px; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side-inner { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .brand { padding: 4px 6px; flex: 1; }
  .side-toggle { display: inline-flex; background: transparent; border: 1px solid #36506a; color: #fff; border-radius: 7px; padding: 7px; cursor: pointer; }
  .side-nav { display: none; flex-basis: 100%; padding-top: 10px; }
  .side-nav.open { display: flex; }
  .side-foot { margin-top: 10px; }
  .main { padding-top: 20px; }
}

/* ---------- flash / toast ---------- */
.flash { padding: 11px 14px; border-radius: var(--r-ctl); margin-bottom: 16px; border: 1px solid; }
.flash-ok  { background: var(--ok-bg);  color: var(--ok);  border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-err { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.flash-info{ background: var(--sky-soft); color: var(--blue-ink); border-color: color-mix(in srgb, var(--sky) 40%, transparent); }
.flash code { background: var(--surface); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .18s ease; z-index: 100; font-weight: 500; box-shadow: 0 10px 30px rgba(10,20,30,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: var(--r-ctl); padding: 9px 15px; font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--blue-ink); border-color: var(--blue-ink); text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn:hover { background: #2a71c2; border-color: #2a71c2; } }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--faint); color: var(--ink); }
@media (prefers-color-scheme: dark) { .btn-ghost:hover { background: var(--surface-2); border-color: var(--faint); } }
.btn-danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-sm { padding: 6px 10px; font-size: 13px; gap: 5px; }
.btn-icon { padding: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--blue-ink); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- forms ---------- */
label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 5px; font-weight: 400; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 9px 11px; font: 15px/1.4 var(--font);
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--sky); box-shadow: var(--focus); outline: none; }
input.mono-in, textarea.mono-in { font-family: var(--mono); font-size: 14px; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--blue); vertical-align: -3px; margin: 0 8px 0 0; }
.check { display: flex; align-items: flex-start; gap: 2px; font-weight: 500; cursor: pointer; margin: 0; }
.check .hint { margin-top: 1px; }
.field { margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.input-group { display: flex; align-items: stretch; }
.input-group > .addon { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--line); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); color: var(--faint); font-family: var(--mono); font-size: 13.5px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-group > input { border-radius: 0; min-width: 0; }
.input-group > select.addon { width: auto; max-width: 60%; flex: 0 1 auto; border-radius: var(--r-ctl) 0 0 var(--r-ctl); border-right: 0; background-color: var(--surface-2); color: var(--muted); font: 13.5px/1.4 var(--mono); padding-right: 28px; }
.input-group > input:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.input-group > .btn { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.input-group > input:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.slug-state { font-size: 13px; margin-top: 5px; min-height: 18px; }
.slug-state.ok { color: var(--ok); } .slug-state.bad { color: var(--bad); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg label { margin: 0; font-weight: 500; font-size: 14px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 13px; cursor: pointer; border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .seg input:checked + span { background: var(--blue); } }
.seg input:focus-visible + span { box-shadow: inset var(--focus); }
.seg > a { display: block; padding: 7px 13px; border-right: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; }
.seg > a:last-child { border-right: 0; }
.seg > a:hover { background: var(--surface-2); }
.seg > a[aria-current] { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .seg > a[aria-current] { background: var(--blue); } }
.inline-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-fields input[type=number] { width: 96px; }
.inline-fields select { width: auto; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 22px; margin-bottom: 20px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > .panel-head { padding: 16px 20px 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-even { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.cols-even > .panel, .cols > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 20px; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }
details.more { border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 14px; }
details.more > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--blue-ink); margin-bottom: 4px; }
details.more > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 2px; }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 16px; }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); margin-bottom: 20px; }
.stat { padding: 16px 20px; border-left: 1px solid var(--line-soft); }
.stat:first-child { border-left: 0; }
.stat .num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.stat .delta { font-size: 12.5px; color: var(--faint); }
@media (max-width: 640px) { .stat { border-left: 0; border-top: 1px solid var(--line-soft); } .stat:first-child { border-top: 0; } }

/* ---------- pills / tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-active  { background: var(--ok-bg);  color: var(--ok); }
.pill-paused  { background: var(--idle-bg); color: var(--idle); }
.pill-expired { background: var(--bad-bg); color: var(--bad); }
.pill-limit   { background: var(--warn-bg); color: var(--warn); }
.pill-plain   { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-soft); }
.pill-plain::before { display: none; }
.tag { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 5px; background: var(--sky-soft); color: var(--blue-ink); text-decoration: none; margin: 2px 4px 2px 0; }
a.tag:hover { background: var(--sky); color: var(--navy); }
.flags { display: inline-flex; gap: 6px; color: var(--faint); vertical-align: middle; }
.flags .ic { width: 15px; height: 15px; }

/* ---------- link list ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 300px; position: relative; }
.toolbar .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.toolbar .search input { padding-left: 36px; }
.toolbar select { width: auto; min-width: 130px; max-width: 210px; flex: 0 1 auto; }
.bulkbar { display: none; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: var(--r-panel); padding: 9px 12px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 5; }
.bulkbar.on { display: flex; }
.bulkbar .btn-ghost { background: transparent; color: #fff; border-color: #3d556d; }
.bulkbar .btn-ghost:hover { background: var(--navy-2); }
.bulkbar .btn-danger { background: transparent; color: #ffb4ab; border-color: #6d3b3b; }
.bulkbar .btn-danger:hover { background: var(--bad); color: #fff; }
.bulkbar .count { font-weight: 700; margin-right: 6px; }
.bulkbar input[type=number] { width: 72px; padding: 5px 8px; background: transparent; color: #fff; border-color: #3d556d; }

.links { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.links > li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 6px 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.links > li:first-child { border-top: 0; }
.links > li:hover { background: var(--surface-2); }
.links > li.is-sel { background: var(--sky-soft); }
.link-main { min-width: 0; }
.link-main .t { font-weight: 600; margin-top: 2px; }
.link-main .dest { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; text-decoration: none; }
.link-main .dest:hover { color: var(--blue-ink); text-decoration: underline; }
.link-main .meta { color: var(--faint); font-size: 12.5px; margin-top: 3px; display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: center; }
.link-main .url { font-size: 15px; }
.link-main a.url { text-decoration: none; }
.link-main a.url:hover .url-slug { text-decoration: underline; }
.link-clicks { text-align: right; font-variant-numeric: tabular-nums; min-width: 70px; }
.link-clicks b { display: block; font-size: 19px; line-height: 1.1; }
.link-clicks span { font-size: 12px; color: var(--faint); }
.link-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.link-tools form { display: inline; margin: 0; }
@media (max-width: 760px) {
  .links > li { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .link-tools { grid-column: 2 / -1; justify-content: flex-start; }
  .link-main .url { white-space: normal; overflow-wrap: anywhere; }
  .link-main .url-host { font-size: 12.5px; }
}
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 8px; }
.empty-sm { color: var(--faint); margin: 4px 0; font-size: 14px; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.pager a, .pager span { min-width: 34px; text-align: center; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-size: 14px; }
.pager .cur { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager .gap { border: 0; background: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl .actions form { display: inline; }
.panel.flush .tbl th:first-child, .panel.flush .tbl td:first-child { padding-left: 20px; }
.panel.flush .tbl th:last-child, .panel.flush .tbl td:last-child { padding-right: 20px; }

/* ---------- charts ---------- */
.chart-wrap { position: relative; padding-bottom: 22px; }
.chart { width: 100%; height: var(--h, 180px); display: block; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .axis { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .val { fill: var(--sky); }
.chart .hit { fill: transparent; }
.chart .bar:hover .val { fill: var(--blue); }
@media (prefers-color-scheme: dark) { .chart .val { fill: #3f8fd6; } .chart .bar:hover .val { fill: var(--sky); } }
.chart-x { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; font-size: 11.5px; color: var(--faint); }
.chart-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.chart-max { position: absolute; top: -2px; right: 0; font-size: 11.5px; color: var(--faint); }

.share { list-style: none; margin: 0; padding: 0; }
.share li { margin-bottom: 10px; }
.share-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.share-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.share-num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.share-num small { color: var(--faint); font-weight: 400; margin-left: 4px; }
.share-bar { height: 5px; background: var(--line-soft); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.share-bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
@media (prefers-color-scheme: dark) { .share-bar i { background: var(--sky); } }

/* ---------- link hero (detail/success) ---------- */
.hero-link { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px 24px; margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 24px; align-items: center; }
.hero-link.created { border-color: var(--sky); box-shadow: 0 0 0 4px var(--sky-soft); }
.hero-link .dest { color: var(--muted); margin-top: 8px; word-break: break-all; font-size: 14px; }
.hero-link .dest a { color: inherit; }
.hero-qr { width: 112px; height: 112px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; display: grid; place-items: center; }
.hero-qr svg, .hero-qr canvas, .hero-qr img { width: 100%; height: 100%; }
@media (max-width: 640px) { .hero-link { grid-template-columns: 1fr; } .hero-qr { display: none; } }

/* ---------- QR dialog ---------- */
.qr-dialog { border: 0; border-radius: 14px; padding: 0; width: min(420px, 94vw); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(5,15,25,.4); }
.qr-dialog::backdrop { background: rgba(14,24,34,.6); }
.qr-inner { padding: 18px 20px 20px; }
.qr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.qr-canvas { background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 14px; display: grid; place-items: center; }
.qr-canvas svg { width: 100%; max-width: 300px; height: auto; }
.qr-url { font-family: var(--mono); font-size: 13px; text-align: center; color: var(--muted); margin: 10px 0 12px; word-break: break-all; }
.qr-opts { display: flex; gap: 14px; justify-content: center; margin-bottom: 14px; }
.qr-opts label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.qr-opts input[type=color] { width: 36px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: var(--surface); }
.qr-opts select { width: auto; padding: 5px 8px; }
.qr-actions { display: flex; gap: 8px; }
.qr-actions .btn { flex: 1; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 8px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.codeblock { font-family: var(--mono); font-size: 13px; background: var(--navy); color: #d8e6f3; border-radius: 8px; padding: 14px 16px; overflow-x: auto; white-space: pre; line-height: 1.6; margin: 0 0 12px; }
.codeblock .k { color: var(--sky); }
.secret { font-family: var(--mono); font-size: 13.5px; background: var(--surface-2); border: 1px dashed var(--line); padding: 3px 8px; border-radius: 6px; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 4px 2px 10px; }
.chip form { display: inline; margin: 0; }
.chip button { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 5px; border-radius: 99px; }
.chip button:hover { color: var(--bad); background: var(--bad-bg); }
.note { background: var(--surface-2); border-left: 3px solid var(--sky); padding: 12px 14px; border-radius: 0 7px 7px 0; font-size: 14px; color: var(--muted); }
.note strong { color: var(--ink); }
.utm { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 14px 14px 0; margin-top: 10px; }
.utm .grid3 { gap: 0 12px; }
.utm .field { margin-bottom: 12px; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.result-list li:first-child { border-top: 0; }
.result-list .err { color: var(--bad); font-size: 14px; }

/* ---------- public pages ---------- */
.public { min-height: 100vh; background: var(--bg); }
.solo { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.solo-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; }
.solo-card h1 { font-size: 24px; margin-bottom: 10px; }
.solo-card p { color: var(--muted); }
.solo-card .field:last-of-type { margin-bottom: 14px; }
.solo-card .btn.full, .btn.full { width: 100%; padding: 11px; }
.solo-mark { width: 44px; height: 44px; border-radius: 11px; background: var(--sky-soft); color: var(--blue-ink); display: grid; place-items: center; margin-bottom: 16px; }
.solo-foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: 18px; }
.solo-foot a { color: inherit; }
.preview-dest { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; margin: 14px 0 16px; word-break: break-all; font-size: 14px; }
.preview-dest strong { display: block; color: var(--ink); margin-bottom: 2px; }
.preview-qr { width: 150px; margin: 4px auto 18px; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.preview-qr svg { width: 100%; height: auto; display: block; }

/* users: inline manage row */
.manage-row td { background: var(--surface-2); }
.manage { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
label.mini { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin: 0; }
label.mini select, label.mini input { width: auto; min-width: 120px; padding: 6px 9px; font-size: 14px; }
