:root {
  --bg: #f6f4ef;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --card: #fffdf9;
  --accent: #0f766e;
  --accent-ink: #fff;
  --warn: #9a3412;
  --warn-bg: #fff7ed;
  --ok: #166534;
  --ok-bg: #f0fdf4;
  --err: #9f1239;
  --err-bg: #fff1f2;
  --shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 8px 24px rgba(28, 25, 23, .06);
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 16px/1.5 "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  color: var(--ink);
  overflow-wrap: anywhere;
  background:
    radial-gradient(1200px 500px at 10% -10%, #efe8d8 0%, transparent 55%),
    var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }
.wrap.wide { max-width: 56rem; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .4rem 0 1.4rem;
}
.brand {
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 2rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.nav { display: flex; gap: .85rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.nav form { display: inline; margin: 0; }
.hero { padding: 2.2rem 0 1.4rem; }
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: -.04em;
  line-height: 1.05;
  margin: 0 0 .6rem;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 32rem; margin: 0 0 1.4rem; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.3rem;
}
.stack { display: grid; gap: 1rem; }
h1, h2 { letter-spacing: -.03em; }
h1 { font-size: 1.8rem; margin: 0 0 .8rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .5rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
label { display: block; font-size: .92rem; margin: 0 0 .85rem; color: var(--muted); }
input, select, textarea, button {
  font: inherit;
  min-width: 0;
  max-width: 100%;
}
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%;
  margin-top: .3rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, white);
  border-color: var(--accent);
}
.paste-arrow {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  margin-left: .25rem;
  color: #c2410c;
  fill: currentColor;
  vertical-align: middle;
}
input.destination-input {
  min-height: 3.5rem;
  padding: .9rem 1rem;
  border: 2px solid #0d9488;
  border-radius: 12px;
  background: #f0fdfa;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .1);
  font-size: 1rem;
}
input.destination-input::placeholder { color: #526b67; opacity: 1; }
input.destination-input:hover { border-color: var(--accent); }
input.destination-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 6px rgba(13, 148, 136, .16);
}
.row { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 8rem; }
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: .55rem 1rem;
  cursor: pointer;
  font-size: .95rem;
}
.btn.ghost, button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.danger, button.danger { background: #9f1239; }
.btn.small, button.small { padding: .3rem .7rem; font-size: .82rem; }
.flash { padding: .7rem .85rem; border-radius: 10px; margin: 0 0 1rem; }
.flash.error { background: var(--err-bg); color: var(--err); }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.note { background: var(--warn-bg); color: var(--warn); }
.muted { color: var(--muted); }
.redirect-eyebrow { color: var(--warn); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.redirect-page h1 { margin-bottom: 1.25rem; }
.redirect-destination h2 { margin-top: 0; }
.redirect-host { font-size: 1.35rem; font-weight: 700; margin: .5rem 0; }
.redirect-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; overflow-wrap: anywhere; max-height: 8rem; overflow-y: auto; }
.redirect-disclaimer { color: var(--muted); font-size: .92rem; }
.redirect-actions { justify-content: center; margin: 1.25rem 0; }
.redirect-actions > * { min-height: 44px; }
#redirect-countdown { text-align: center; }
#redirect-seconds { display: block; margin: .35rem 0; font-size: 5rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
td, th { padding: .65rem .35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge {
  display: inline-block;
  padding: .12rem .45rem;
  border-radius: 999px;
  font-size: .75rem;
  background: #f5f5f4;
  color: var(--muted);
}
.badge.active { background: var(--ok-bg); color: var(--ok); }
.badge.pending_review { background: var(--warn-bg); color: var(--warn); }
.badge.blocked_security, .badge.blocked_policy, .badge.disabled { background: var(--err-bg); color: var(--err); }
.badge.disabled_owner { background: var(--warn-bg); color: var(--warn); }
.inline { display: inline; }
.created {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  word-break: break-all;
}
.copy-link {
  display: inline;
  padding: .2rem 0;
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  text-align: left;
  overflow-wrap: anywhere;
}
.copy-link:hover { text-decoration: underline; }
.copy-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.copy-toast {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 1000;
  max-width: min(30rem, calc(100vw - 2rem));
  max-height: 40vh;
  overflow-y: auto;
  overflow-wrap: anywhere;
  padding: .65rem 1.1rem;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: .95rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -.4rem);
  transition: opacity .15s ease, transform .15s ease;
}
.copy-toast:not(:empty) { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.copy-toast.near-pointer, .copy-toast.near-pointer:not(:empty) { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .copy-toast { transition: none; }
}
.links-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 .5rem; }
.links-heading h2 { margin: 0; }
.links-search { flex: 1; max-width: 18rem; margin-left: auto; min-width: 0; }
.links-search input { margin: 0; padding: .4rem .65rem; min-height: 36px; }
.mobile-link-sort { display: none; }
.sort-link { padding: 0; border-radius: 2px; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.sort-link::after { content: ""; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid currentColor; opacity: .35; }
th[aria-sort] .sort-link { color: var(--accent); }
th[aria-sort] .sort-link::after { opacity: 1; }
th[aria-sort="ascending"] .sort-link::after { transform: rotate(180deg); }
.sort-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.created-date time { white-space: nowrap; font-size: .82rem; font-variant-numeric: tabular-nums; }
.warp-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; margin: 0; cursor: pointer; color: var(--ink); }
.warp-toggle input, .link-toggle-track {
  appearance: none;
  display: block;
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.5rem;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
}
.warp-toggle input::before, .link-toggle-track::before { content: ""; display: block; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(28, 25, 23, .2); }
.warp-toggle input:checked, .link-toggle[aria-checked="true"] .link-toggle-track { background: var(--accent); border-color: var(--accent); }
.warp-toggle input:checked::before, .link-toggle[aria-checked="true"] .link-toggle-track::before { transform: translateX(1rem); }
.warp-toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.link-toggle {
  gap: .5rem;
  min-height: 28px;
  vertical-align: middle;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: .92rem;
}
.link-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.links-table { padding: 0 .75rem; }
.links-table table { table-layout: fixed; }
.links-table td, .links-table th { padding-top: .2rem; padding-bottom: .2rem; }
.links-table td { vertical-align: middle; }
.links-table th { white-space: nowrap; }
.links-table th:nth-child(1) { width: 6.5rem; }
.links-table th:nth-child(3) { width: 8rem; }
.links-table th:nth-child(4) { width: 5rem; }
.links-table th:nth-child(5) { width: 6.5rem; }
.links-table th:nth-child(6) { width: 7rem; }
.target-url {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.links-heading:has(#warp-targets:checked) + .links-table .target-url {
  white-space: normal;
  overflow: visible;
}
@media (max-width: 900px) {
  .links-heading { flex-wrap: wrap; gap: .5rem; }
  .links-search { order: 3; flex-basis: 100%; max-width: none; }
  .links-search input { min-height: 44px; }
  .warp-toggle { margin-left: auto; }
  .mobile-link-sort { display: block; }
  .wrap { padding: 1rem 1rem 2rem; }
  .top { align-items: flex-start; flex-direction: column; }
  .nav { gap: .5rem 1rem; }
  .nav a, .foot a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero { padding: 1.2rem 0 .8rem; }
  .card { padding: 1rem; }
  input, select, textarea { font-size: 1rem; }
  .btn, button, .btn.small, button.small, .link-toggle { min-height: 44px; }
  .row > * { min-width: min(8rem, 100%); }
  .links-table { padding: 0; border: 0; background: transparent; box-shadow: none; }
  table, tbody { display: block; }
  /* Keep column headings available to screen readers in the stacked layout. */
  thead, tr:has(> th) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  tbody { display: grid; gap: 1rem; }
  tr:has(> td) {
    display: block;
    min-width: 0;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  td { display: block; padding: .5rem 0; border: 0; }
  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .2rem;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  td + td { border-top: 1px solid var(--line); }
  td form:not(.inline) { margin-top: .35rem; }
  .foot { gap: .5rem; }
}
