:root {
  --ink: #14233a;
  --ink-soft: #53647b;
  --paper: #f6f8fb;
  --surface: #ffffff;
  --line: #dce4ef;
  --line-dark: #c6d1df;
  --blue: #165fe8;
  --blue-dark: #0e47b8;
  --blue-soft: #eaf1ff;
  --mint: #12a47c;
  --mint-soft: #e4f7f1;
  --orange: #d9683d;
  --orange-soft: #fff0e9;
  --display: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  --body: "Aptos", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 18px 45px rgba(20, 35, 58, 0.08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(22, 95, 232, 0.28); outline-offset: 3px; }

.admin-shell { min-height: 100vh; background: var(--paper); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #fff;
  background: var(--ink);
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font: 700 22px/1 var(--display); letter-spacing: -.02em; }
.brand small { margin-top: 5px; color: #93a4ba; font: 600 9px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.brand-mark { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 30px; height: 30px; padding: 4px 2px; }
.brand-mark::before { content: ""; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: #68a0ff; }
.brand-mark i { position: relative; z-index: 1; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--ink); }
.brand-mark i:nth-child(2) { margin-left: 11px; background: var(--blue); border-color: #9cbfff; }
.brand-mark i:last-child { width: 7px; height: 7px; margin-left: 2px; }

.main-nav { display: grid; gap: 5px; margin-top: 56px; }
.main-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; color: #aebbd0; font-weight: 600; text-decoration: none; transition: background .18s, color .18s; }
.main-nav a > span { display: grid; place-items: center; width: 23px; height: 23px; color: #87a8e6; font: 18px/1 var(--mono); }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.main-nav a.active { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(0,0,0,.18); }
.main-nav a.active > span { color: #fff; }

.sidebar-note { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.035); }
.sidebar-note div { display: flex; flex-direction: column; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { color: #8fa0b7; font-size: 11px; }
.pulse { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(18,164,124,.14); }
.logout-form { margin-top: 10px; }
.text-button { width: 100%; padding: 8px; color: #8192aa; border: 0; background: transparent; cursor: pointer; font-size: 12px; text-align: left; }
.text-button span { display: none; }
.text-button b { font: inherit; }
.text-button:hover { color: #fff; }

.workspace { min-height: 100vh; margin-left: 244px; padding: 44px 50px 70px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; max-width: 1320px; margin: 0 auto 28px; }
.page-header.compact { align-items: center; }
.page-header h1 { max-width: 780px; margin: 4px 0 7px; font: 700 clamp(32px, 4vw, 47px)/.98 var(--display); letter-spacing: -.025em; }
.page-header.compact h1 { font-size: clamp(30px, 3vw, 40px); }
.page-header p:not(.eyebrow) { margin: 0; color: var(--ink-soft); }
.eyebrow { margin: 0; color: var(--blue); font: 700 10px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--ink-soft); font-size: 13px; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--blue); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-weight: 700; text-decoration: none; transition: transform .17s, background .17s, border-color .17s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(22,95,232,.18); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { color: var(--blue); border-color: #aac5f7; background: var(--blue-soft); }
.button.ghost { color: var(--ink-soft); border-color: var(--line-dark); background: transparent; }
.button.danger { color: #b42318; border-color: #f0b5ae; background: #fff5f3; }
.button.danger:hover { color: #fff; border-color: #b42318; background: #b42318; }
.button.wide { width: 100%; }

.routing-rail { position: relative; display: grid; grid-template-columns: 1fr minmax(80px, .45fr) 1.2fr minmax(80px, .45fr) 1fr; align-items: center; max-width: 1320px; min-height: 116px; margin: 0 auto 24px; padding: 20px 30px; overflow: hidden; border: 1px solid #b9cff5; border-radius: 12px; background: var(--blue-soft); }
.routing-rail::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(22,95,232,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(22,95,232,.055) 1px, transparent 1px); background-size: 24px 24px; }
.route-stop { position: relative; z-index: 1; display: grid; grid-template-columns: 16px 1fr; column-gap: 10px; align-items: center; }
.route-stop small, .route-stop strong { grid-column: 2; }
.route-stop small { color: #607492; font: 700 9px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.route-stop strong { margin-top: 4px; font-size: 14px; }
.route-stop .route-dot { grid-row: 1 / 3; width: 13px; height: 13px; border: 3px solid var(--surface); border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.route-stop.emphasis { padding: 13px 16px; border: 1px solid #b8cef3; border-radius: 8px; background: rgba(255,255,255,.72); }
.route-segment { position: relative; z-index: 1; height: 2px; margin: 0 13px; background: #87acec; }
.route-segment::after { content: ""; position: absolute; right: -1px; top: -3px; width: 7px; height: 7px; border-top: 2px solid var(--blue); border-right: 2px solid var(--blue); transform: rotate(45deg); }
.route-segment span { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); color: #657fa8; font: 650 8px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1320px; margin: 0 auto 24px; }
.metric-grid.three { grid-template-columns: repeat(3, 1fr); }
.metric-card { position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 20px 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 5px 18px rgba(20,35,58,.035); }
.metric-card::before { content: ""; position: absolute; top: 0; left: 20px; width: 28px; height: 3px; background: var(--line-dark); }
.metric-card.blue::before { background: var(--blue); }
.metric-card > span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.metric-card > strong { margin: auto 0 2px; font: 700 40px/1 var(--display); letter-spacing: -.03em; }
.metric-card > small { color: #8794a6; font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(270px, .85fr); gap: 14px; max-width: 1320px; margin: 0 auto 24px; }
.dashboard-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 5px 18px rgba(20,35,58,.035); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 15px; }
.panel-heading h2 { margin: 4px 0 0; font: 700 22px/1 var(--display); }
.panel-total, .platform-chip { padding: 6px 9px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font: 650 10px/1 var(--mono); }
.subtle-link { color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.table-tools { display: flex; align-items: center; gap: 8px; }
.table-tools select { width: auto; min-height: 36px; padding: 7px 28px 7px 10px; font-size: 11px; }
.search-field { display: flex; align-items: center; min-width: 210px; margin: 0; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; }
.search-field span { padding-left: 10px; color: #8290a2; font-size: 16px; }
.search-field input { min-height: 34px; padding: 7px 9px; border: 0; box-shadow: none; font-size: 11px; }
.filter-empty { margin: 0; padding: 28px; color: var(--ink-soft); border-top: 1px solid #edf1f6; text-align: center; }

.traffic-panel { min-height: 330px; }
.bar-chart { display: flex; align-items: flex-end; gap: clamp(7px, 1.4vw, 15px); height: 230px; padding: 30px 26px 20px; border-top: 1px solid #edf1f6; background-image: linear-gradient(to top, #edf1f6 1px, transparent 1px); background-size: 100% 25%; }
.bar-column { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 9px; }
.bar-column i { width: 100%; max-width: 28px; height: max(4px, var(--height)); border-radius: 3px 3px 1px 1px; background: var(--blue); opacity: .88; transition: opacity .15s; }
.bar-column:hover i { opacity: 1; }
.bar-column small { margin-top: 7px; color: #8290a2; font: 9px/1 var(--mono); }
.bar-value { margin-bottom: 4px; color: #6f7f93; font: 9px/1 var(--mono); opacity: 0; }
.bar-column:hover .bar-value { opacity: 1; }

.breakdown-list { display: grid; gap: 17px; padding: 14px 24px 26px; }
.breakdown-row > div { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 7px; }
.breakdown-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-row span { color: var(--ink-soft); font: 10px var(--mono); }
.breakdown-row progress { display: block; width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 5px; background: #edf1f6; }
.breakdown-row progress::-webkit-progress-bar { background: #edf1f6; }
.breakdown-row progress::-webkit-progress-value { border-radius: 5px; background: var(--blue); }
.breakdown-row progress::-moz-progress-bar { border-radius: 5px; background: var(--blue); }
.empty-compact { margin: 15px 24px 25px; padding: 25px 15px; color: #8592a4; border: 1px dashed var(--line-dark); border-radius: 7px; text-align: center; }

.links-panel, .activity-panel { max-width: 1320px; margin: 0 auto 24px; }
.table-wrap { overflow-x: auto; border-top: 1px solid #edf1f6; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 18px; color: #7f8da0; background: #fafbfd; font: 700 9px/1 var(--mono); letter-spacing: .1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 18px; border-top: 1px solid #edf1f6; color: #5b6a7e; font-size: 12px; vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover td { background: #fbfcfe; }
.link-name { display: block; max-width: 260px; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 750; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.link-name:hover { color: var(--blue); }
.copy-inline { display: block; max-width: 220px; padding: 3px 0 0; overflow: hidden; color: var(--blue); border: 0; background: none; cursor: pointer; font: 10px/1.2 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.copy-inline span { margin-left: 4px; }
.truncate { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 100px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.active { color: #087a5a; background: var(--mint-soft); }
.status-pill.off { color: #9a4b2c; background: var(--orange-soft); }
.row-arrow { display: grid; place-items: center; width: 29px; height: 29px; color: var(--blue); border: 1px solid var(--line); border-radius: 50%; text-decoration: none; }
.row-arrow:hover { color: #fff; border-color: var(--blue); background: var(--blue); }

.empty-state { display: flex; flex-direction: column; align-items: center; padding: 54px 25px 60px; border-top: 1px solid #edf1f6; text-align: center; }
.empty-state.small { padding: 34px 20px 40px; }
.empty-state h3 { margin: 16px 0 3px; font: 700 22px/1.1 var(--display); }
.empty-state p { max-width: 430px; margin: 4px 0 20px; color: var(--ink-soft); }
.empty-route { position: relative; width: 78px; height: 24px; border-top: 2px solid #9db9ed; }
.empty-route::after { content: ""; position: absolute; right: 0; top: -5px; width: 8px; height: 8px; border-top: 2px solid var(--blue); border-right: 2px solid var(--blue); transform: rotate(45deg); }
.empty-route i { position: absolute; top: -6px; width: 10px; height: 10px; border: 2px solid var(--blue); border-radius: 50%; background: #fff; }
.empty-route i:first-child { left: 0; }
.empty-route i:last-child { left: 35px; }

.activity-list { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid #edf1f6; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 14px 22px; border-bottom: 1px solid #edf1f6; }
.activity-item:nth-child(odd) { border-right: 1px solid #edf1f6; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.activity-item div { display: flex; flex-direction: column; }
.activity-item strong { font-size: 12px; }
.activity-item small { color: #8491a2; font-size: 10px; }
.activity-item time { color: #7f8da0; font: 10px var(--mono); }

.flash-stack { position: fixed; top: 20px; right: 24px; z-index: 50; display: grid; gap: 8px; max-width: 380px; }
.flash { padding: 12px 15px; border: 1px solid var(--line-dark); border-radius: 8px; background: #fff; box-shadow: var(--shadow); font-size: 13px; }
.flash.success { color: #087a5a; border-color: #9edbca; background: #f0fbf7; }
.flash.error { color: #9a3f27; border-color: #efbca9; background: #fff5f1; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; max-width: 1160px; margin: 0 auto; }
.form-panel { overflow: hidden; }
.form-section { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 30px 32px; border-top: 1px solid #edf1f6; }
.form-section:first-child { border-top: 0; }
.section-marker { display: grid; place-items: center; width: 28px; height: 28px; color: var(--blue); border: 1px solid #abc5f4; border-radius: 50%; background: var(--blue-soft); font: 700 10px var(--mono); }
.section-content h2 { margin: 0 0 3px; font: 700 21px/1.1 var(--display); }
.section-content > p, .field-span > p { margin: 0 0 22px; color: var(--ink-soft); font-size: 13px; }
.two-columns, .advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-span { grid-column: 1 / -1; }
label { display: block; margin: 0 0 7px; color: #43536a; font-size: 11px; font-weight: 750; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; transition: border .15s, box-shadow .15s; }
textarea { width: 100%; padding: 10px 12px; resize: vertical; color: var(--ink); border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; line-height: 1.5; }
input::placeholder { color: #a1adbc; }
input:hover, select:hover { border-color: #9baabe; }
input:focus, select:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgba(22,95,232,.11); }
label + input[type="url"] { font-family: var(--mono); font-size: 12px; }
.section-content small { display: block; margin-top: 6px; color: #8a96a6; font-size: 10px; }
.detected-platform { display: flex; align-items: center; gap: 8px; min-height: 30px; margin-top: 8px; padding: 6px 9px; color: #5c6e86; border-radius: 5px; background: #f4f7fb; font-size: 11px; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line-dark); border-radius: 6px; overflow: hidden; }
.input-prefix:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,95,232,.11); }
.input-prefix > span { align-self: stretch; display: flex; align-items: center; padding: 0 10px; color: #75859a; border-right: 1px solid var(--line); background: #f4f7fb; font: 11px var(--mono); }
.input-prefix input { border: 0; border-radius: 0; box-shadow: none; }
.input-prefix input:focus { box-shadow: none; }
.advanced-fields { margin-top: 20px; border: 1px solid var(--line); border-radius: 7px; }
.advanced-fields summary { padding: 12px 14px; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 750; }
.advanced-grid { padding: 4px 14px 17px; }
.form-aside { position: sticky; top: 24px; display: grid; gap: 12px; }
.route-preview { padding: 22px; }
.route-preview > .eyebrow { margin-bottom: 20px; }
.preview-stop { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: center; }
.preview-stop i { width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: #7690b4; box-shadow: 0 0 0 2px #7690b4; }
.preview-stop.focus i { background: var(--blue); box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px var(--blue-soft); }
.preview-stop span { display: flex; flex-direction: column; font-size: 12px; font-weight: 750; }
.preview-stop small { color: #8a96a6; font: 8px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.preview-line { width: 2px; height: 35px; margin: 2px 0 2px 5px; background: #b8c7da; }
.privacy-hint { margin: 0; color: #8996a7; font-size: 10px; text-align: center; }

.link-detail-header { align-items: flex-end; }
.title-with-status { display: flex; align-items: center; gap: 12px; }
.title-with-status h1 { margin-bottom: 9px; }
.destination-link { display: block; max-width: 720px; overflow: hidden; color: var(--blue); font: 11px var(--mono); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.header-actions form { margin: 0; }
.share-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1320px; margin: 0 auto 16px; padding: 17px 20px; color: #fff; border-radius: 10px; background: var(--ink); box-shadow: var(--shadow); }
.share-strip div { min-width: 0; display: flex; flex-direction: column; }
.share-strip small { color: #95a8c1; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.share-strip strong { overflow: hidden; margin-top: 3px; font: 13px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.context-list { display: grid; gap: 2px; padding: 8px 24px 25px; }
.context-list > div { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid #edf1f6; }
.context-list > div:first-child { border-top: 0; }
.context-icon { display: grid; place-items: center; width: 28px; height: 28px; color: var(--blue); border-radius: 6px; background: var(--blue-soft); font: 700 10px var(--mono); }
.context-list strong { font-size: 12px; }
.context-list b { color: var(--ink-soft); font: 700 11px var(--mono); }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 30px; background: var(--ink); }
.login-card { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(360px, 1fr); width: min(940px, 100%); min-height: 590px; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.login-visual { position: relative; overflow: hidden; background-color: #dfeaff; background-image: linear-gradient(rgba(22,95,232,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(22,95,232,.1) 1px, transparent 1px); background-size: 32px 32px; }
.login-visual::before { content: ""; position: absolute; left: 17%; right: 17%; top: 50%; height: 3px; background: #7da6ec; }
.route-line { position: absolute; left: 17%; right: 17%; top: calc(50% - 8px); display: flex; justify-content: space-between; }
.route-line i { width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.route-line i:nth-child(2) { transform: scale(.72); }
.route-label { position: absolute; padding: 7px 9px; color: var(--blue); border: 1px solid #a9c3f1; border-radius: 5px; background: rgba(255,255,255,.8); font: 700 9px var(--mono); letter-spacing: .12em; }
.route-label.from { left: 16%; top: 34%; }
.route-label.to { right: 16%; top: 58%; }
.login-copy { display: flex; flex-direction: column; justify-content: center; padding: 50px clamp(35px, 6vw, 72px); }
.login-copy .brand { align-self: flex-start; margin-bottom: 64px; color: var(--ink); }
.login-copy .brand-mark i { background: #fff; border-color: var(--ink); }
.login-copy .brand-mark::before { background: #8ab0f2; }
.login-copy .brand-mark i:nth-child(2) { background: var(--blue); border-color: var(--blue); }
.login-copy h1 { margin: 8px 0 10px; font: 700 39px/.98 var(--display); letter-spacing: -.025em; }
.login-copy .lede { margin: 0 0 25px; color: var(--ink-soft); }
.login-form { display: grid; gap: 9px; }
.login-form .button { margin-top: 7px; }

.bio-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1320px; margin: 0 auto; }
.bio-admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 25px rgba(20,35,58,.06); }
.bio-card-visual { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 176px; overflow: hidden; background-color: var(--bio-bg); }
.bio-card-visual::before { content: ""; position: absolute; inset: 0; opacity: .6; background-image: linear-gradient(color-mix(in srgb, var(--bio-accent) 18%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--bio-accent) 18%, transparent) 1px, transparent 1px); background-size: 24px 24px; }
.bio-card-visual.effect-clean::before { display: none; }
.bio-card-visual.effect-halo::after { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; background: var(--bio-accent); filter: blur(55px); opacity: .25; }
.bio-mini-avatar { position: relative; z-index: 2; display: grid; width: 72px; height: 72px; margin-bottom: 45px; overflow: hidden; color: #fff; border: 4px solid rgba(255,255,255,.85); border-radius: 50%; background: var(--bio-accent); font: 700 27px var(--display); place-items: center; }
.bio-mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bio-card-visual > i { position: absolute; z-index: 2; bottom: 31px; width: 62%; height: 9px; border-radius: 8px; background: color-mix(in srgb, var(--bio-text) 14%, transparent); }
.bio-card-visual > i:nth-of-type(2) { bottom: 18px; width: 52%; }.bio-card-visual > i:nth-of-type(3) { bottom: 8px; width: 40%; }
.bio-card-copy { padding: 20px; }
.bio-card-copy h2 { margin: 0; overflow: hidden; font: 700 22px/1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.bio-card-stats { display: flex; gap: 17px; margin: 18px 0; padding: 14px 0; border-top: 1px solid #edf1f6; border-bottom: 1px solid #edf1f6; }
.bio-card-stats span { color: #7f8da0; font-size: 10px; }.bio-card-stats strong { display: block; color: var(--ink); font: 700 18px/1 var(--display); }
.bio-empty { display: flex; max-width: 740px; margin: 80px auto 0; padding: 55px; flex-direction: column; align-items: center; text-align: center; }
.bio-empty h2 { max-width: 560px; margin: 10px 0; font: 700 34px/1 var(--display); }.bio-empty > p:not(.eyebrow) { max-width: 560px; color: var(--ink-soft); }
.bio-empty-phone { position: relative; width: 86px; height: 140px; margin-bottom: 25px; padding: 15px 10px; border: 3px solid var(--ink); border-radius: 17px; background: var(--blue-soft); }
.bio-empty-phone span { display: block; width: 28px; height: 28px; margin: 0 auto 17px; border-radius: 50%; background: var(--blue); }.bio-empty-phone i { display: block; height: 12px; margin-top: 7px; border: 1px solid #a9c3f1; border-radius: 4px; background: #fff; }

.bio-builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; max-width: 1180px; margin: 0 auto; }
.bio-settings { overflow: hidden; }
.bio-settings-section { padding: 28px 30px; border-top: 1px solid #edf1f6; }.bio-settings-section:first-child { border-top: 0; }
.bio-settings-section > .eyebrow { margin-bottom: 18px; }.bio-settings-section h2 { margin: 0 0 18px; font: 700 23px/1 var(--display); }
.avatar-upload-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 15px; align-items: center; margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.avatar-upload-preview { display: grid; width: 62px; height: 62px; overflow: hidden; color: #fff; border-radius: 50%; background: var(--blue); font: 700 23px var(--display); place-items: center; }.avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-row input[type="file"] { min-height: 0; padding: 0; border: 0; background: transparent; font-size: 11px; }.avatar-upload-row small { display: block; color: #8a96a6; font-size: 9px; }
.check-grid { display: flex; gap: 12px; margin-top: 15px; }.check-row { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }.check-row input { width: 17px; min-height: 17px; accent-color: var(--blue); }
.theme-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.theme-option { margin: 0; cursor: pointer; }.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch { position: relative; display: block; height: 72px; margin-bottom: 7px; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: var(--swatch-bg); }.theme-swatch::before { content: ""; position: absolute; left: 12px; top: 12px; width: 25px; height: 25px; border: 3px solid var(--swatch-surface); border-radius: 50%; background: var(--swatch-accent); }.theme-swatch i, .theme-swatch b { position: absolute; left: 12px; right: 12px; bottom: 18px; height: 7px; border-radius: 4px; background: var(--swatch-surface); }.theme-swatch b { bottom: 7px; opacity: .75; }
.theme-option input:checked + .theme-swatch { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }.theme-option > strong { font-size: 10px; }
.color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 22px 0; }.color-grid label { padding: 9px; border: 1px solid var(--line); border-radius: 7px; }.color-grid input[type="color"] { display: block; width: 100%; height: 35px; min-height: 0; margin-top: 6px; padding: 2px; cursor: pointer; }
.compact-fields { align-items: end; }
.bio-preview-column { position: sticky; top: 24px; display: grid; gap: 12px; }
.bio-phone-preview { min-height: 580px; padding: 48px 29px 28px; overflow: hidden; color: var(--preview-text); border: 8px solid var(--ink); border-radius: 38px; background-color: var(--preview-bg); box-shadow: 0 22px 55px rgba(20,35,58,.16); text-align: center; }
.bio-phone-preview.effect-route-grid { background-image: linear-gradient(color-mix(in srgb, var(--preview-accent) 14%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--preview-accent) 14%, transparent) 1px, transparent 1px); background-size: 26px 26px; }.bio-phone-preview.effect-halo { background-image: radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--preview-accent) 26%, transparent), transparent 40%), radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--preview-accent) 20%, transparent), transparent 38%); }
.preview-profile-avatar { display: grid; width: 78px; height: 78px; margin: 0 auto 18px; color: var(--preview-surface); border: 4px solid var(--preview-surface); border-radius: 50%; background: var(--preview-accent); box-shadow: 0 0 0 2px var(--preview-accent); place-items: center; font: 700 29px var(--display); }
.preview-profile-avatar { overflow: hidden; }
.preview-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bio-phone-preview > small { color: var(--preview-accent); font: 700 8px var(--mono); letter-spacing: .15em; }.bio-phone-preview h2 { margin: 7px 0 3px; font: 700 31px/1 var(--display); }.bio-phone-preview.font-editorial h2 { font-family: Georgia,serif; }.bio-phone-preview.font-rounded h2 { font-family: "Arial Rounded MT Bold",sans-serif; font-size: 27px; }
.bio-phone-preview > b { opacity: .55; font-size: 10px; }.bio-phone-preview > p { min-height: 55px; margin: 13px 0 23px; opacity: .72; font-size: 11px; line-height: 1.5; }
.preview-link { display: block; height: 53px; margin-top: 10px; border: 1px solid color-mix(in srgb, var(--preview-text) 12%, transparent); border-radius: 13px; background: var(--preview-surface); box-shadow: 0 8px 20px color-mix(in srgb, var(--preview-text) 8%, transparent); }.buttons-pill .preview-link { border-radius: 28px; }.buttons-square .preview-link { border-radius: 2px; }.buttons-outline .preview-link { border: 2px solid var(--preview-accent); background: transparent; box-shadow: none; }.preview-link.short { width: 75%; margin-right: auto; margin-left: auto; }
.preview-link.filled { display: grid; grid-template-columns: 28px minmax(0, 1fr) 12px; gap: 8px; align-items: center; padding: 0 13px; text-align: left; }
.preview-link.filled > span { display: grid; width: 27px; height: 27px; color: var(--preview-accent); border-radius: 8px; background: color-mix(in srgb, var(--preview-accent) 12%, transparent); place-items: center; font-size: 10px; }
.preview-link.filled .bio-svg-icon { width: 14px; height: 14px; }
.preview-link.filled b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.preview-link.filled i { opacity: .45; font-style: normal; }

.bio-editor-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .7fr); gap: 14px; max-width: 1320px; margin: 0 auto; }.bio-items-panel { overflow: hidden; }.bio-source-summary { align-self: start; }
.bio-item-list { border-top: 1px solid #edf1f6; }.bio-item-row { display: grid; grid-template-columns: 28px 42px minmax(0, 1fr) 52px minmax(154px, auto); gap: 12px; align-items: center; padding: 15px 18px; border-top: 1px solid #edf1f6; }.bio-item-row:first-child { border-top: 0; }.bio-item-row.disabled { opacity: .48; background: #f7f8fa; }
.bio-reorder { display: grid; gap: 2px; }.bio-reorder form { margin: 0; }.bio-reorder button { width: 24px; height: 20px; padding: 0; color: #78879a; border: 0; background: transparent; cursor: pointer; }
.bio-svg-icon { display: block; width: 20px; height: 20px; color: inherit; }
.bio-item-icon { display: grid; width: 38px; height: 38px; color: var(--blue); border-radius: 9px; background: var(--blue-soft); place-items: center; }.bio-item-icon .bio-svg-icon { width: 19px; height: 19px; }.bio-item-copy { display: flex; min-width: 0; flex-direction: column; }.bio-item-copy > strong { font-size: 13px; }.bio-item-copy > small { overflow: hidden; color: #8290a2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.route-mode { align-self: flex-start; margin-top: 5px; padding: 3px 6px; border-radius: 4px; font-size: 8px; font-weight: 800; text-transform: uppercase; }.route-mode.smart { color: #0b5dc1; background: #e8f1ff; }.route-mode.direct { color: #657185; background: #eef0f3; }
.bio-item-stats { display: flex; flex-direction: column; text-align: center; }.bio-item-stats strong { font: 700 19px var(--display); }.bio-item-stats small { color: #8b97a7; font-size: 8px; }
.bio-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }.bio-item-actions form { margin: 0; }
.mini-toggle { padding: 5px 8px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; font-size: 9px; }.icon-delete { display: grid; width: 28px; height: 28px; padding: 0; color: #b42318; border: 1px solid #f1cbc7; border-radius: 6px; background: #fff8f7; cursor: pointer; place-items: center; font-size: 17px; line-height: 1; }.icon-delete:hover { color: #fff; border-color: #b42318; background: #b42318; }.smart-note { display: grid; grid-template-columns: 38px 1fr; gap: 10px; margin: 8px 18px 20px; padding: 14px; border-radius: 8px; background: var(--blue-soft); }.smart-note > span { display: grid; width: 34px; height: 34px; color: #fff; border-radius: 50%; background: var(--blue); place-items: center; }.smart-note p { display: flex; margin: 0; color: #62738b; flex-direction: column; font-size: 10px; }.smart-note strong { color: var(--ink); font-size: 11px; }
.icon-picker-field { min-width: 0; padding: 0; border: 0; }
.icon-picker-field legend { padding: 0; color: var(--ink); font-size: 12px; font-weight: 750; }
.icon-picker-field > p { margin: 3px 0 13px; color: var(--ink-soft); font-size: 11px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.icon-choice { position: relative; display: grid; min-width: 0; gap: 6px; padding: 9px 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; place-items: center; text-align: center; transition: border-color .16s, background .16s, transform .16s; }
.icon-choice:hover { border-color: #9ebcf2; background: #f8fbff; transform: translateY(-1px); }
.icon-choice input { position: absolute; opacity: 0; pointer-events: none; }
.icon-choice > span { display: grid; width: 38px; height: 38px; color: var(--ink); border-radius: 10px; background: #f0f3f8; place-items: center; }
.icon-choice small { width: 100%; overflow: hidden; color: var(--ink-soft); font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.icon-choice input:checked + span { color: #fff; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.icon-choice:has(input:checked) { border-color: var(--blue); background: #f7faff; }
.icon-choice:has(input:focus-visible) { outline: 3px solid rgba(22,95,232,.28); outline-offset: 2px; }
.smart-open-choice { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 16px; border: 1px solid #a9c7fa; border-radius: 8px; background: var(--blue-soft); cursor: pointer; }.smart-open-choice input { width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--blue); }.smart-open-choice span { display: flex; flex-direction: column; }.smart-open-choice strong { color: var(--ink); }.smart-open-choice small { color: #61728b; }
.smart-route-preview { padding: 22px; text-align: center; }.smart-route-preview h2 { margin: 9px 0; font: 700 22px/1 var(--display); }.smart-route-preview > p:last-child { color: var(--ink-soft); font-size: 11px; }.smart-bolt { display: grid; width: 54px; height: 54px; margin: 0 auto 18px; color: #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 9px var(--blue-soft); place-items: center; font-size: 20px; }

@media (max-width: 1050px) {
  .workspace { padding-right: 28px; padding-left: 28px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .routing-rail { grid-template-columns: 1fr 50px 1fr; }
  .routing-rail .route-segment:nth-of-type(4), .routing-rail .route-stop:last-child { display: none; }
  .form-layout { grid-template-columns: 1fr 260px; }
  .bio-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bio-builder { grid-template-columns: 1fr 280px; }
}

@media (max-width: 800px) {
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: auto; min-height: 72px; flex-direction: row; align-items: stretch; padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid rgba(255,255,255,.13); border-right: 0; box-shadow: 0 -12px 36px rgba(20,35,58,.18); }
  .sidebar .brand, .sidebar-note { display: none; }
  .main-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; gap: 4px; margin: 0; }
  .main-nav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 5px 3px; border-radius: 9px; font-size: 9px; line-height: 1.1; text-align: center; }
  .main-nav a > span { width: 22px; height: 22px; font-size: 18px; }
  .logout-form { display: block; flex: 0 0 70px; margin: 0 0 0 4px; }
  .text-button { display: flex; height: 100%; min-height: 54px; padding: 5px 3px; color: #aebbd0; border-radius: 9px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9px; line-height: 1.1; text-align: center; }
  .text-button span { display: block; color: #87a8e6; font: 18px/22px var(--mono); }
  .text-button:hover { color: #fff; background: rgba(255,255,255,.06); }
  .workspace { margin-left: 0; padding: max(26px, env(safe-area-inset-top)) 20px 166px; }
  .button { min-height: 48px; }
  input, select { min-height: 48px; font-size: 16px; }
  textarea { min-height: 112px; font-size: 16px; }
  .dashboard-grid, .dashboard-grid.equal, .form-layout { grid-template-columns: 1fr; }
  .bio-builder, .bio-editor-grid { grid-template-columns: 1fr; }
  .bio-preview-column { position: static; }.bio-phone-preview { display: none; }
  .form-aside { position: static; }
  .form-aside > .button, .bio-preview-column > .button { position: fixed; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 12px; z-index: 18; width: auto; max-width: 560px; margin: auto; min-height: 52px; box-shadow: 0 12px 34px rgba(22,95,232,.3), 0 0 0 7px rgba(246,248,251,.92); }
  .privacy-hint { display: none; }
  .route-preview { display: none; }
  .activity-list { grid-template-columns: 1fr; }
  .activity-item:nth-child(odd) { border-right: 0; }
  .login-card { grid-template-columns: 1fr; min-height: auto; }
  .login-visual { display: none; }
  .flash-stack { top: 12px; right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 590px) {
  .workspace { padding-right: 13px; padding-left: 13px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header > .button { width: 100%; }
  .page-header h1 { font-size: 32px; }
  .page-header.compact h1 { font-size: 29px; }
  .back-link { margin-bottom: 14px; }
  .routing-rail { grid-template-columns: 1fr 45px 1fr; padding: 16px; }
  .route-stop strong { font-size: 11px; }
  .route-stop.emphasis { padding: 10px; }
  .route-segment span { display: none; }
  .metric-grid, .metric-grid.three { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 125px; padding: 17px; }
  .metric-card > strong { font-size: 32px; }
  .bar-chart { gap: 5px; padding-right: 15px; padding-left: 15px; }
  .bar-column:nth-child(even) small { visibility: hidden; }
  .form-section { grid-template-columns: 1fr; gap: 10px; padding: 22px 17px; }
  .section-marker { width: 25px; height: 25px; }
  .section-content h2 { font-size: 20px; }
  .two-columns, .advanced-grid { grid-template-columns: 1fr; }
  .field-span { grid-column: auto; }
  .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; }
  .header-actions > a, .header-actions > form, .header-actions form .button { width: 100%; }
  .header-actions .button { padding: 0 9px; font-size: 11px; }
  .link-detail-header { align-items: stretch; }
  .share-strip { align-items: stretch; flex-direction: column; }
  .share-strip .button { width: 100%; }
  .login-page { padding: 12px; }
  .login-card { min-height: calc(100svh - 24px); border-radius: 12px; }
  .login-copy { justify-content: center; padding: 34px 23px; }
  .login-copy .brand { margin-bottom: 38px; }
  .login-copy h1 { font-size: 34px; }
  .bio-card-grid { grid-template-columns: 1fr; }
  .theme-picker, .color-grid { grid-template-columns: repeat(2,1fr); }
  .avatar-upload-row { grid-template-columns: 62px 1fr; }.avatar-upload-row > .check-row { grid-column: 1 / -1; }
  .bio-item-row { grid-template-columns: 24px 38px minmax(0,1fr); padding: 15px 13px; }.bio-item-stats { display: none; }.bio-item-actions { grid-column: 2 / -1; justify-content: flex-start; }.bio-item-actions .row-arrow, .bio-item-actions .icon-delete { width: 42px; height: 42px; }.bio-item-actions .mini-toggle { min-height: 42px; padding: 0 13px; }
  .icon-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .panel-heading:has(.table-tools) { align-items: stretch; flex-direction: column; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; }
  .table-tools select { width: 100%; }
}

@media (max-width: 410px) {
  .metric-grid, .metric-grid.three { gap: 9px; }
  .metric-card { min-height: 116px; padding: 14px; }
  .metric-card > strong { font-size: 29px; }
  .icon-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main-nav a, .text-button { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
