:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #f0ede7;
  --text: #202225;
  --muted: #6b6b6b;
  --line: #dedbd4;
  --accent: #d8c5a1;
  --accent-ink: #6f5429;
  --button: #232527;
  --button-text: #fffaf1;
  --positive: #386749;
  --positive-bg: #e9f1e9;
  --danger: #a5443c;
  --shadow: 0 16px 50px #20222508, 0 1px 3px #20222504;
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101214;
  --surface: #191c1f;
  --surface-soft: #202428;
  --text: #f1f0ed;
  --muted: #a4a8b0;
  --line: #303438;
  --accent: #d8c5a1;
  --accent-ink: #e0cba7;
  --button: #d8c5a1;
  --button-text: #17191b;
  --positive: #b5d9b8;
  --positive-bg: #212e27;
  --danger: #eaa49b;
  --shadow: 0 16px 50px #00000018, 0 1px 2px #00000012;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1; }
::selection { background: var(--accent); color: #17191b; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 5px; }
.shell { width: min(1320px, calc(100% - 96px)); margin-inline: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 100px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 14px; font-size: 23px; font-weight: 650; letter-spacing: -.7px; text-decoration: none; white-space: nowrap; }
.brand strong { font-weight: 650; }
.brand-mark { width: 31px; height: 34px; flex-shrink: 0; stroke: var(--accent-ink); stroke-width: 2; }
.header-actions { display: flex; align-items: center; gap: 25px; }
.header-actions nav { display: flex; align-items: center; }
.header-actions nav a { font-size: 13px; text-decoration: none; color: var(--muted); }
.header-actions nav a:hover { color: var(--text); }
.header-actions form { margin: 0; }
.theme-toggle { display: inline-flex; gap: 11px; align-items: center; padding: 8px 0 8px 10px; background: transparent; color: var(--muted); border: 0; font-size: 12px; font-weight: 450; white-space: nowrap; }
.theme-track { width: 42px; height: 25px; border-radius: 20px; background: var(--surface-soft); border: 1px solid var(--line); display: block; position: relative; }
.theme-track span { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); font-size: 0; transition: transform .2s ease, background .2s ease; }
.theme-toggle[aria-checked="true"] .theme-track span { transform: translateX(17px); background: var(--accent); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 46px; border: 1px solid var(--button); border-radius: 9px; padding: 12px 21px; background: var(--button); color: var(--button-text); font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease; }
button:hover, .button:hover { box-shadow: 0 4px 18px #00000015; filter: brightness(1.06); }
.secondary, .subtle { color: var(--text); background: transparent; border-color: var(--line); }
.secondary:hover { background: var(--surface-soft); border-color: var(--accent-ink); }
.subtle { border: 0; color: var(--muted); font-size: 13px; font-weight: 450; padding: 10px 0; }
.theme-toggle:hover { background: transparent; box-shadow: none; filter: none; }
.subtle:hover { color: var(--text); box-shadow: none; }
.small { min-height: 36px; padding: 6px 13px; font-size: 12px; border-radius: 7px; }
h1 { font-size: clamp(48px, 5.3vw, 76px); line-height: 1.06; font-weight: 650; letter-spacing: -2.8px; margin: 0 0 18px; }
h2 { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 600; letter-spacing: -.25px; overflow-wrap: anywhere; }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; line-height: 1.7; }
.hero { max-width: 850px; padding-block: clamp(80px, 11vw, 150px); }
.hero h1 { font-size: clamp(56px, 7.5vw, 100px); line-height: 1.02; letter-spacing: -4.5px; }
.hero .muted { font-size: 19px; max-width: 430px; margin-block: 28px 34px; }
.hero .button { padding-inline: 25px; min-height: 52px; }
.eyebrow { color: var(--accent-ink); font-size: 11px; font-weight: 600; letter-spacing: 1.8px; }
footer.shell { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 90px; padding-block: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: 2.7px; }
footer span { letter-spacing: .1px; font-size: 12px; }
.dashboard { padding-block: 58px 40px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-heading h1 { font-size: clamp(42px, 4.8vw, 64px); margin-bottom: 12px; }
.page-heading .muted { margin: 0; font-size: 17px; }
.page-heading .button { min-width: 165px; min-height: 52px; }
.search { display: flex; gap: 12px; margin-block: 36px 25px; }
.search input { min-width: 0; flex: 1; padding-left: 20px; }
.search button { min-width: 105px; border-color: var(--accent-ink); }
input, textarea, select { width: 100%; padding: 15px 17px; min-height: 50px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); font-size: 15px; line-height: 1.5; transition: border-color .18s ease, box-shadow .18s ease; }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; margin: 25px 0 10px; }
.list-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.list-head, .link-card { display: grid; grid-template-columns: minmax(95px, 1fr) minmax(180px, 1.7fr) minmax(110px, 1.25fr) minmax(63px, .65fr) minmax(85px, .85fr) minmax(85px, .85fr) 78px 78px; column-gap: 20px; align-items: center; }
.list-head { padding: 14px 0 18px; border-bottom: 1px solid var(--line); font-size: 10px; line-height: 1.5; color: var(--muted); text-transform: uppercase; letter-spacing: .65px; }
.link-card { grid-template-areas: "title short destination count created last status edit"; min-height: 134px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.card-heading, .card-bottom, .metrics { display: contents; }
.card-heading h2 { grid-area: title; font-size: 15px; }
.badge { grid-area: status; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 9px; min-height: 29px; border-radius: 20px; font-size: 10px; font-weight: 500; white-space: nowrap; color: var(--positive); background: var(--positive-bg); border: 1px solid color-mix(in srgb, var(--positive) 12%, transparent); }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.badge.disabled { background: var(--surface-soft); color: var(--muted); }
.short-row { grid-area: short; display: flex; align-items: flex-start; flex-direction: column; gap: 7px; min-width: 0; }
.short-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 12px; line-height: 1.5; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.short-link:hover { border-color: var(--accent-ink); }
.short-link svg { width: 14px; height: 14px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.copy { min-height: 30px; padding: 4px 13px; font-size: 11px; border-color: var(--accent-ink); }
.destination { grid-area: destination; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; margin: 0; }
.metric-count { grid-area: count; font-size: 13px; font-variant-numeric: tabular-nums; }
.metric-count strong { font-weight: 550; }
.metrics .metric-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.metric-time { color: var(--muted); font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.time-detail { display: block; font-size: 11px; }
.created { grid-area: created; }
.last-redirect { grid-area: last; }
.edit-link { grid-area: edit; justify-self: end; font-size: 11px; font-weight: 500; white-space: nowrap; text-decoration: none; padding: 8px 10px; border: 1px solid var(--accent-ink); border-radius: 7px; color: var(--accent-ink); }
.edit-link:hover { background: var(--surface-soft); }
.dashboard > .hint { margin-top: 24px; max-width: 590px; font-size: 11px; }
.pagination { display: flex; justify-content: flex-end; gap: 25px; padding-block: 22px 4px; font-size: 13px; }
.empty { padding: 72px 24px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; background: var(--surface); }
.empty h2 { font-size: 23px; }
.empty-icon { color: var(--accent-ink); font-size: 34px; margin-bottom: 20px; }
.empty .button { margin-top: 14px; }
.copy-fallback { grid-column: 1 / -1; min-height: 40px; font-size: 12px; margin-block: 10px; }
.auth-panel { max-width: 440px; margin: 80px auto 100px; }
.auth-panel h1, .editor h1 { font-size: clamp(35px, 4vw, 48px); letter-spacing: -1.8px; }
.auth-panel > .muted, .editor > .muted { font-size: 15px; margin-block: 0 32px; }
.auth-panel form, .editor > form { padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.auth-panel label, .editor > form > label:first-of-type { margin-top: 0; }
.auth-panel form button { width: 100%; margin-top: 24px; }
.auth-panel > .hint { text-align: center; margin-top: 22px; }
.editor { width: min(100%, 700px); padding-block: 65px 90px; margin-inline: auto; }
.editor > form { margin-top: 28px; }
.editor input[type="url"] { min-height: 58px; }
.optional-settings { margin-top: 26px; padding-top: 21px; border-top: 1px solid var(--line); }
.optional-settings summary { cursor: pointer; font-size: 13px; color: var(--muted); padding-block: 4px; }
.optional-settings summary:hover { color: var(--text); }
.alias-field { display: flex; align-items: center; gap: 12px; }
.alias-field > span { color: var(--muted); font-size: 23px; }
.form-actions { display: flex; align-items: center; gap: 24px; margin-top: 28px; font-size: 13px; }
.form-actions > button { flex: 1; }
.form-actions > a { color: var(--muted); padding: 10px; }
.immutable { overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 15px; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 45px; padding-top: 25px; }
.danger-zone h2 { font-size: 15px; }
.danger-zone p { font-size: 13px; }
.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); min-height: 42px; font-size: 12px; }
.notice { padding: 15px 18px; border: 1px solid color-mix(in srgb, var(--positive) 30%, transparent); border-radius: 10px; background: var(--positive-bg); color: var(--positive); font-size: 13px; }
.error { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1150px) {
  .shell { width: calc(100% - 64px); }
  .list-head, .link-card { column-gap: 12px; grid-template-columns: minmax(80px, .8fr) minmax(150px, 1.5fr) minmax(85px, 1fr) 54px 78px 78px 74px 70px; }
  .short-link { font-size: 10px; padding: 8px; }
}
@media (max-width: 1100px) {
  .list-head { display: none; }
  .link-card { grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "title title status" "short short short" "destination destination destination" "count created last" "edit edit edit"; gap: 12px 0; min-height: 0; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 13px; padding: 20px; background: var(--surface); box-shadow: var(--shadow); }
  .card-heading h2 { font-size: 17px; }
  .badge { justify-self: end; font-size: 11px; }
  .short-row { flex-direction: row; align-items: stretch; gap: 10px; }
  .short-link { font-size: 13px; padding: 10px 12px; }
  .copy { min-height: 42px; padding-inline: 17px; }
  .destination { font-size: 12px; margin: -4px 0 3px; }
  .metrics .metric-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; font-size: 10px; color: var(--muted); font-weight: 400; line-height: 1.5; }
  .metric-count, .metric-time { align-self: stretch; font-size: 11px; padding-inline: 14px; border-left: 1px solid var(--line); }
  .metric-count { padding-left: 0; border: 0; }
  .metric-count strong { font-size: 16px; }
  .created .metric-label, .last-redirect .metric-label { margin-bottom: 4px; }
  .metric-time time { display: block; font-size: 11px; line-height: 1.6; }
  .edit-link { width: 100%; text-align: right; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 0; font-size: 12px; min-height: 44px; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 36px); }
  .masthead { min-height: 80px; gap: 10px; }
  .brand { font-size: 19px; gap: 9px; letter-spacing: -.6px; }
  .brand-mark { width: 25px; height: 29px; }
  .header-actions { gap: 15px; }
  .header-actions nav a, .header-actions .subtle { font-size: 11px; max-width: 82px; line-height: 1.4; }
  .theme-label { display: none; }
  .theme-toggle { min-height: 44px; padding: 0; }
  .theme-track { width: 38px; height: 24px; }
  .theme-track span { width: 16px; height: 16px; }
  .theme-toggle[aria-checked="true"] .theme-track span { transform: translateX(14px); }
  .dashboard { padding-block: 31px 30px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 22px; }
  .page-heading h1 { font-size: 39px; letter-spacing: -1.6px; margin-bottom: 10px; }
  .page-heading .muted { font-size: 14px; line-height: 1.6; }
  .page-heading .button { width: 100%; min-height: 48px; }
  .search { margin: 22px 0 19px; gap: 9px; }
  .search input { padding: 12px 14px; min-height: 46px; font-size: 13px; }
  .search button { min-width: 76px; min-height: 46px; padding: 10px 15px; font-size: 12px; }
  .list-caption { font-size: 12px; margin-bottom: 15px; }
  .link-card { padding: 17px; gap: 12px 0; }
  .card-heading h2 { font-size: 16px; padding-right: 10px; }
  .short-row { gap: 8px; }
  .short-link { padding: 9px; font-size: 11px; }
  .copy { font-size: 11px; padding-inline: 12px; min-height: 40px; }
  .metric-count, .metric-time { padding-inline: 9px; }
  .metric-count { padding-left: 0; }
  .metric-time time { font-size: 11px; }
  .metrics .metric-label { font-size: 10px; }
  .destination { font-size: 11px; }
  .dashboard > .hint { font-size: 10px; }
  .auth-panel { margin-block: 50px 70px; }
  .auth-panel h1, .editor h1 { font-size: 35px; }
  .auth-panel form, .editor > form { padding: 22px; border-radius: 13px; }
  .editor { padding-block: 38px 65px; }
  .editor > .muted { font-size: 14px; }
  .editor input[type="url"] { font-size: 16px; }
  .form-actions { gap: 12px; }
  .form-actions > button { padding-inline: 13px; font-size: 13px; }
  .hero { padding-block: 75px 95px; }
  .hero h1 { font-size: clamp(48px, 12vw, 70px); letter-spacing: -2.5px; }
  .hero .muted { font-size: 16px; }
  footer.shell { font-size: 9px; letter-spacing: 1.8px; min-height: 80px; }
  footer span { font-size: 10px; max-width: 145px; text-align: right; }
}
@media (max-width: 360px) {
  .shell { width: calc(100% - 28px); }
  .brand { gap: 7px; font-size: 17px; }
  .brand-mark { width: 22px; }
  .header-actions { gap: 10px; }
  .link-card { padding: 14px; }
  .short-link { font-size: 10px; }
  .short-link svg { width: 12px; height: 12px; }
  .metric-count, .metric-time { padding-inline: 7px; }
  .metric-count { padding-left: 0; }
  .auth-panel form, .editor > form { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
