
:root {
  color-scheme: light dark;
  --bg: #f6f6f4; --surface: #fff; --text: #1c1c1a; --muted: #6b6b66;
  --border: #dcdcd6; --accent: #1f5fd1; --accent-text: #fff; --danger: #b3261e;
  --fresh: #eef4ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --surface: #1e1e1c; --text: #ecece6; --muted: #a0a09a;
    --border: #34342f; --accent: #7aa7ff; --accent-text: #0b1730; --danger: #ff8a80;
    --fresh: #1b2740;
  }
}
* { box-sizing: border-box; }
/* Without this, any element given a display value below ignores the hidden attribute. */
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { font-weight: 650; color: var(--text); text-decoration: none; }
.account { display: flex; align-items: center; gap: .75rem; margin: 0; font-size: .9rem; }
nav { display: flex; gap: 1rem; font-size: .9rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }

.heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.heading p { margin: .35rem 0 0; }
.heading a { word-break: break-all; }
.heading .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.heading .crumb { margin: 0 0 .6rem; font-size: .9rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); vertical-align: middle; }
.badge.warn { border-color: var(--danger); color: var(--danger); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
pre { background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: .75rem .9rem; overflow-x: auto; margin: .5rem 0 1rem; }
#new-token-value { word-break: break-all; user-select: all; }
h3 { font-size: .95rem; margin: 1.25rem 0 .4rem; }
ol, ul { margin: .4rem 0; padding-left: 1.3rem; }
li { margin: .2rem 0; }
.address { flex: 1; min-width: 12rem; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: .5rem .7rem; word-break: break-all; user-select: all; }
.card.consent { max-width: 34rem; margin: 2rem auto 0; }
.card.consent h1 { font-size: 1.3rem; overflow-wrap: anywhere; }
.notice { border-left: 3px solid var(--danger); padding: .1rem 0 .1rem .75rem; }

main { max-width: 70rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; display: grid; gap: 1.75rem; }
/* Grid items refuse to shrink below their content by default, which would let
   a wide table push the whole page sideways instead of scrolling in its box. */
main > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.card.center { max-width: 26rem; margin: 4rem auto 0; text-align: center; display: grid; gap: .75rem; justify-items: center; }

button, .button { font: inherit; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: .45rem .9rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--muted); }
button:disabled { opacity: .6; cursor: default; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.quiet { border-color: transparent; background: transparent; padding: .3rem .5rem; color: var(--accent); }
.danger { color: var(--danger); }
.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

form#upload-form { display: grid; gap: 1rem; }
.dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 2rem 1rem; text-align: center; transition: border-color .12s, background .12s; }
.dropzone p { margin: 0; }
.dropzone p + p { margin-top: .35rem; font-size: .9rem; }
.dropzone.over { border-color: var(--accent); background: var(--fresh); }
.dropzone.has-file { border-style: solid; }
details summary { cursor: pointer; color: var(--muted); }
textarea, input[type="text"], select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: .5rem .6rem; }
form#token-form { align-items: flex-end; }
.grow { flex: 1; min-width: 12rem; }
textarea { margin-top: .6rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; resize: vertical; }
.field { display: grid; gap: .3rem; }
.row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.error { color: var(--danger); margin: 0; }

.banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--fresh); border: 1px solid var(--accent); border-radius: 10px; padding: 1rem 1.25rem; }
.banner a { word-break: break-all; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .8rem; font-weight: 600; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td.title { white-space: normal; min-width: 9rem; font-weight: 550; }
/* Slugs are long; the full address is in the link itself and the Copy button. */
td .slug { display: inline-block; max-width: 13rem; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
th, td { padding-left: .7rem; padding-right: .7rem; }
.actions .quiet { padding-left: .35rem; padding-right: .35rem; }
td.title a { color: inherit; text-decoration: none; }
td.title a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { text-align: right; }
tr.fresh td { background: var(--fresh); }

dialog { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 1.25rem; width: min(26rem, calc(100vw - 2rem)); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog form { display: grid; gap: .75rem; }
dialog p { margin: 0; }
