:root {
  --paper: #0c1410;
  --ink: #e4ede5;
  --muted: #a0b3a5;
  --green: #73c991;
  --line: #294436;
  --white: #111f18;
  --soft: #182a20;
  --red: #f19c91;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { opacity: .6; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
h2 { font-size: .9375rem; font-weight: 600; }
h3 { font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
p { line-height: 1.4; }
.topbar { max-width: 1040px; margin: auto; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 8px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-size: 1.125rem; font-weight: 600; gap: 8px; }
.brand:hover { text-decoration: none; }
.brandmark { display: block; width: 32px; height: 32px; }
nav { display: flex; align-items: center; gap: 4px; font-size: .8125rem; }
nav form { margin: 0; }
nav a, nav .text-button { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 8px; }
nav a[aria-current="page"] { color: var(--green); background: var(--soft); border-radius: 6px; }
main { max-width: 1040px; margin: auto; }
.button, .outline-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--green); border-radius: 6px; background: var(--green); color: #0a2013; min-height: 44px; padding: 10px 14px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.button:hover { background: #8fdda8; text-decoration: none; }
.outline-button { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.outline-button:hover, .outline-button[aria-expanded="true"] { background: var(--soft); border-color: #355b43; text-decoration: none; }
.small-btn { min-height: 38px; padding: 7px 11px; font-size: .78rem; }
.quiet-link { min-height: 44px; display: inline-flex; align-items: center; font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; }
.text-button { min-height: 44px; border: 0; background: none; padding: 8px 0; color: var(--ink); font-size: .8125rem; }
.text-button:hover { text-decoration: underline; }
.danger { color: var(--red); }
.muted { color: var(--muted); }
.optional { font-weight: 400; color: var(--muted); font-size: .75rem; margin-left: 4px; }
.js-only { display: none; }
html[data-js] .js-only { display: inline-flex; }

/* Landing page */
.landing { padding: 36px 20px 28px; }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 28px; }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--green); background: #182f22; border: 1px solid #315640; border-radius: 99px; padding: 4px 10px; margin-bottom: 12px; }
.landing-copy h1 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); line-height: 1.15; letter-spacing: -0.01em; }
.landing-lead { font-size: .95rem; margin-top: 12px; max-width: 54ch; line-height: 1.5; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.landing-showcase { display: flex; flex-direction: column; gap: 10px; }
.showcase-card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.showcase-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.showcase-dest { font-size: .75rem; color: var(--muted); margin-top: 6px; font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showcase-barcode { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; align-items: center; }
.showcase-qr { width: 60px; height: 60px; border-radius: 8px; background: #0b1711; border: 1px solid var(--line); display: grid; place-items: center; }
.showcase-barcode-meta strong { display: block; font-size: .875rem; margin-bottom: 4px; }
.showcase-barcode-meta p { font-size: .75rem; }
.showcase-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.landing-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.feature-card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.feature-card h2 { font-size: .95rem; color: var(--ink); margin-bottom: 6px; }
.feature-card p { font-size: .8125rem; line-height: 1.45; }

footer { max-width: 1040px; margin: 16px auto 0; padding: 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
.workspace { padding: 16px 20px; }
.workspace:focus { outline: none; }
.page-heading { margin-bottom: 12px; }
.page-heading p.muted { margin-top: 6px; font-size: .8125rem; }
.create-panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.create-panel h2 { margin-bottom: 8px; }
.form-row { display: flex; gap: 10px; align-items: end; }
.grow { flex: 1; min-width: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; font-weight: 600; min-width: 0; }
input, select, textarea { width: 100%; border: 1px solid #315040; background: #0b1711; border-radius: 5px; min-height: 44px; padding: 9px 10px; font-size: 1rem; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
textarea { resize: vertical; line-height: 1.4; }

/* Link creation progressive disclosure */
.url-bar { display: flex; gap: 8px; align-items: flex-end; }
.link-options-drawer { margin-top: 8px; border-top: 1px solid var(--line); }
.link-options-drawer > summary { min-height: 36px; padding: 8px 0 2px; font-size: .78rem; color: var(--muted); }
.link-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.slug-group { display: flex; align-items: stretch; border: 1px solid #315040; background: #0b1711; border-radius: 5px; overflow: hidden; }
.slug-group:focus-within { outline: 2px solid var(--green); border-color: var(--green); }
.slug-prefix { display: inline-flex; align-items: center; padding: 0 8px 0 10px; background: #12241b; border-right: 1px solid var(--line); color: var(--muted); font-family: monospace; font-size: .8125rem; white-space: nowrap; }
.slug-group input { border: 0; border-radius: 0; background: transparent; min-height: 42px; }
.slug-group input:focus { outline: none; }

/* Saved links list */
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; font-size: .75rem; }
.link-list { display: flex; flex-direction: column; gap: 8px; }
.link-card { border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 10px 12px; }
.link-summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.link-identity { min-width: 0; flex: 1; }
.link-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.short-link { display: inline-block; font-family: monospace; font-size: .875rem; color: var(--green); font-weight: 600; overflow-wrap: anywhere; }
.link-title-row h3 { margin: 0; font-size: .85rem; color: var(--ink); }
.destination { font-size: .75rem; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.inline-form { margin: 0; display: inline-flex; }
.badge { display: inline-block; border: 1px solid #355b43; background: #203828; color: #a3ddb3; font-size: .72rem; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.inactive { color: #f4b2a3; background: #35251f; border-color: #634235; }
details { margin-top: 8px; border-top: 1px solid var(--line); }
summary { min-height: 44px; padding: 12px 0; font-size: .8125rem; cursor: pointer; color: var(--muted); }
html[data-js] .link-drawer > summary { display: none; }
html[data-js] .link-drawer:not([open]) { margin-top: 0; border-top: 0; }
html[data-js] .link-drawer[open] { padding-top: 10px; margin-top: 10px; }
.edit-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; align-items: end; margin: 4px 0 8px; }
.manage-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.fine-print { font-size: .75rem; line-height: 1.4; margin-top: 6px; }
.notice { padding: 12px; background: #1c3423; border: 1px solid #355b43; border-radius: 6px; font-size: .8125rem; margin-bottom: 12px; }
.notice p { margin-top: 4px; overflow-wrap: anywhere; }
.error { background: #34211e; border-color: #70443a; color: #f2b0a0; }
.empty-state { padding: 16px 12px; border: 1px dashed #355b43; border-radius: 8px; color: var(--muted); font-size: .8125rem; }
.checkbox { flex-direction: row; align-items: center; min-height: 44px; gap: 8px; font-weight: 400; }
.checkbox input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; padding: 0; accent-color: var(--green); }
.auth-wrap { padding: 24px 20px; }
.auth-card { max-width: 400px; margin: auto; }
.auth-card > p { margin-top: 8px; font-size: .8125rem; }
.auth-card form { margin-top: 12px; }
.auth-card form label + label { margin-top: 12px; }
.auth-card form .button { width: 100%; margin-top: 12px; }
.auth-card > .button { margin-top: 12px; }
.auth-card .notice { margin-top: 12px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .8125rem; margin-top: 8px; }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }
.auth-card .fine-print a { display: inline-flex; align-items: center; min-height: 44px; }
.account-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .8125rem; overflow-wrap: anywhere; }
.workspace > h2 { margin: 16px 0 8px; }
.pagination { margin: 12px 8px 0 0; }
.skip { position: absolute; top: -60px; left: 12px; background: var(--ink); color: #0a2013; padding: 12px; z-index: 10; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
form.htmx-request button[type=submit] { opacity: .6; pointer-events: none; }
::selection { background: #355b43; color: #eef9f0; }

@media (max-width: 850px) {
  .landing-hero { grid-template-columns: 1fr; }
  .landing-features { grid-template-columns: 1fr; }
  .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row .grow, .form-row > .button { grid-column: 1 / -1; }
  .edit-form { grid-template-columns: 1fr; }
  .edit-form button { justify-self: start; }
}
@media (max-width: 600px) {
  .topbar { padding: 6px 12px; }
  nav { gap: 2px; }
  nav a, nav .text-button { padding: 8px 4px; }
  .landing { padding: 20px 12px; }
  .workspace { padding: 12px; }
  .url-bar { flex-direction: column; align-items: stretch; }
  .link-options-grid { grid-template-columns: 1fr; }
  .link-summary { flex-direction: column; align-items: stretch; gap: 8px; }
  .link-actions { justify-content: flex-start; flex-wrap: wrap; }
  .link-actions > * { flex: 1; }
  .link-actions .inline-form > button { width: 100%; }
  .account-row { flex-wrap: wrap; }
  footer { padding: 0 12px; }
}
@media (max-width: 440px) {
  .brand-text { display: none; }
}

.icon-library { margin-block: 1rem 1.25rem; }
.icon-library > summary { min-height: 36px; padding: 6px 0; font-weight: 600; color: var(--ink); }
.icon-upload-form { margin-top: 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.icon-card { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #0b1711; display: flex; flex-direction: column; gap: 8px; }
.icon-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-card img { object-fit: contain; background: white; border-radius: 4px; flex-shrink: 0; padding: 2px; }
.icon-card-meta { min-width: 0; }
.icon-card h3 { overflow-wrap: anywhere; margin-bottom: 2px; }
.icon-card form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
