:root {
  --ink: #14213d;
  --muted: #667085;
  --line: #e5e9f0;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --accent: #e36b2c;
  --accent-dark: #c4521b;
  --green: #16794b;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(20, 33, 61, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 10% 0%, #fff 0, transparent 34rem), var(--canvas); }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-dark); }
button, input, textarea, select { font: inherit; }
.shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 80px; }
.shell-wide { width: min(1240px, calc(100% - 32px)); }
.topbar { height: 76px; padding: 0 max(24px, calc((100vw - 1240px)/2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.025em; font-size: 20px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: white; border-radius: 10px 10px 10px 3px; }
.brand-large { font-size: 24px; margin-bottom: 36px; }
.brand-large .brand-mark { width: 42px; height: 42px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(32px, 4vw, 52px); letter-spacing: -.045em; line-height: 1.05; margin-bottom: 12px; }
h2 { font-size: 20px; letter-spacing: -.02em; margin-bottom: 6px; }
p { color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--accent-dark); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; margin-bottom: 10px; }
.lead { font-size: 18px; max-width: 560px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 32px; }
.page-heading.compact h1 { font-size: clamp(30px, 4vw, 42px); }
.page-heading p:last-child { margin-bottom: 0; }
.heading-line { display: flex; align-items: center; gap: 14px; }
.back { display: block; color: var(--muted); margin-bottom: 30px; font-size: 14px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; cursor: pointer; background: white; color: var(--ink); white-space: nowrap; }
.button-primary { background: var(--accent); color: white; box-shadow: 0 7px 18px rgba(227,107,44,.22); }
.button-primary:hover { background: var(--accent-dark); color: white; }
.button-ghost { border-color: var(--line); background: white; }
.button-danger { color: var(--red); border-color: #f2c8c4; background: #fff8f7; }
.button-small { min-height: 36px; padding: 7px 12px; border-radius: 9px; font-size: 14px; }
.button-large { min-height: 52px; padding: 14px 22px; }
.inline-form { display: inline; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { padding: 24px 26px 18px; display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.panel-heading p { font-size: 14px; margin-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.metric { border-radius: 18px; padding: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 10px 0 2px; font-size: 34px; letter-spacing: -.04em; }
.metric small { font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
td { font-size: 14px; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.actions { text-align: right; }
.item-title { font-weight: 750; }
.short-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--accent-dark); }
.status { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 750; }
.status-active { color: var(--green); background: #eaf8f0; }
.status-muted { color: var(--muted); background: #f0f2f5; }
.empty { padding: 60px 20px; text-align: center; }
.empty strong { font-size: 20px; }
.empty p { max-width: 500px; margin: 8px auto 20px; }
.alert { padding: 14px 16px; border: 1px solid #f1d7a7; background: #fff9ec; color: #744d0d; border-radius: 12px; margin-bottom: 20px; line-height: 1.5; }
.alert-error { color: var(--red); background: #fff4f2; border-color: #f4c7c2; }
.editor { display: grid; gap: 18px; }
.form-section { display: grid; grid-template-columns: 58px 1fr; padding: 28px; overflow: visible; }
.section-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #fff0e8; color: var(--accent-dark); font-weight: 850; }
.section-content > p { font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.field { display: grid; gap: 7px; align-content: start; }
.field > span, .copy-field > span, .definition > span { font-size: 13px; font-weight: 720; }
.field small { color: var(--muted); font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
input, textarea, select { width: 100%; border: 1px solid #ccd3dd; border-radius: 10px; background: white; color: var(--ink); padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227,107,44,.12); }
input[type="color"] { height: 46px; padding: 5px; }
.check { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.segmented { display: flex; padding: 4px; background: #eef1f5; border-radius: 11px; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; width: 1px; }
.segmented span { display: block; text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 14px; }
.segmented input:checked + span { background: white; box-shadow: 0 2px 8px rgba(20,33,61,.1); }
.form-actions { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; }
.form-actions > div { display: flex; gap: 10px; }
.detail-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; margin-bottom: 20px; }
.qr-preview { padding: 30px; text-align: center; }
.qr-preview img { display: block; width: 100%; aspect-ratio: 1; }
.download-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.code-info { padding: 30px; }
.copy-field { display: grid; gap: 8px; margin: 24px 0; }
.copy-field div { display: flex; gap: 8px; }
.copy-field input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.definition { display: grid; gap: 8px; margin-bottom: 24px; }
.definition code { padding: 14px; border-radius: 10px; background: #f5f7fa; color: #38445a; overflow-wrap: anywhere; line-height: 1.5; }
.manage-row { display: flex; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.metrics-detail { margin-top: 0; }
.analytics-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.bars { padding: 0 26px 26px; max-height: 380px; overflow-y: auto; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 36px; align-items: center; gap: 12px; margin: 10px 0; font-size: 12px; color: var(--muted); }
.bar-row strong { color: var(--ink); text-align: right; }
.bar-track { height: 8px; border-radius: 999px; background: #eef1f4; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.stat-list { list-style: none; padding: 0 26px 26px; margin: 0; }
.stat-list li { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); }
.muted { color: var(--muted); }
.login-panel, .public-card { width: min(650px, 100%); padding: 56px; margin: 8vh auto 0; border-radius: 28px; background: white; box-shadow: var(--shadow); border: 1px solid var(--line); }
.login-panel .button, .public-card .button { margin-top: 18px; }
.public-card { text-align: center; }
.public-card .brand { justify-content: center; }
.public-card p { white-space: pre-wrap; }
@media (max-width: 800px) {
  .topbar { height: auto; min-height: 70px; padding: 12px 16px; }
  .topbar nav > a:first-child { display: none; }
  .shell { padding-top: 34px; }
  .page-heading { align-items: start; flex-direction: column; }
  .metrics, .detail-grid, .analytics-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-section { grid-template-columns: 1fr; gap: 16px; padding: 22px; }
  .form-actions { align-items: stretch; flex-direction: column; gap: 18px; }
  .form-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .login-panel, .public-card { padding: 34px 24px; margin-top: 2vh; }
}
