/* LUSTIG – "Geschenkpapier": warm paper, ribbon red, gold and a dash of teal.
   The old MkDocs site's colours live on (dark: red and deep orange; light: teal and amber), on paper instead of slate.

   Contents: 1 fonts and tokens · 2 base · 3 layout and top bar · 4 buttons · 5 forms · 6 messages and notices
   7 cards, badges, tables · 8 tiles · 9 a list and its items · 10 reserving (guests only) · 11 the editor
   12 single pages · 13 small screens · 14 motion */

/* ---------------------------------------------------------------- 1 fonts and tokens */

@font-face { font-family: Roboto; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-400.4279528ce0e7.woff2") format("woff2"); }
@font-face { font-family: Roboto; font-weight: 500; font-display: swap; src: url("../fonts/roboto-latin-500.55cfeb5304f0.woff2") format("woff2"); }
@font-face { font-family: Roboto; font-weight: 700; font-display: swap; src: url("../fonts/roboto-latin-700.10a07810f28f.woff2") format("woff2"); }

:root {
  --font: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Headings: one line to change should a display font be added to static/fonts */
  --font-display: var(--font);
  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 20px;
  --container: 1120px;
  --gap: 1rem;
  /* The wrapping: the same in both schemes, like the things on a gift table */
  --wrap-red: #d9432f;
  --wrap-orange: #f2603c;
  --wrap-gold: #ffc145;
  --wrap-teal: #14908f;
  --wrap-plum: #7a3b69;
  --wrap-cream: #fff3dc;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf5ec;
  --dot: rgb(140 96 48 / .11);
  --surface: #fffdf9;
  --surface-2: #f7efe3;
  --surface-3: #efe3d2;
  --field: #fffefc;
  --text: #2b211c;
  --muted: #6b5e54;
  --border: #e6d8c5;
  --border-strong: #a08a73;
  --primary: #c2362b;
  --primary-hover: #a92c22;
  --primary-shade: #8c2119;
  --on-primary: #fff;
  --primary-soft: #fbe4df;
  --primary-ink: #a3291f;
  --accent: #e9a319;
  --accent-soft: #fdefc9;
  --accent-ink: #7d5200;
  --teal: #0f7f83;
  --on-teal: #fff;
  --teal-soft: #dcf1ee;
  --teal-ink: #0a5f63;
  --danger: #b3261e;
  --danger-soft: #fbe4e1;
  --link: #0a5f63;
  --focus: #0f7f83;
  --shadow: 0 1px 2px rgb(74 45 20 / .06), 0 8px 22px -12px rgb(74 45 20 / .22);
  --shadow-lift: 0 2px 4px rgb(74 45 20 / .08), 0 16px 30px -14px rgb(74 45 20 / .32);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1614;
  --dot: rgb(255 214 170 / .055);
  --surface: #26201d;
  --surface-2: #302925;
  --surface-3: #3b332e;
  --field: #1c1816;
  --text: #f3ebe3;
  --muted: #b8aa9d;
  --border: #40372f;
  --border-strong: #7d6e62;
  --primary: #ff7059;
  --primary-hover: #ff8672;
  --primary-shade: #c8452f;
  --on-primary: #2a0d08;
  --primary-soft: #47211b;
  --primary-ink: #ffa494;
  --accent: #ffbe4d;
  --accent-soft: #46340f;
  --accent-ink: #ffd27f;
  --teal: #3cc5bd;
  --on-teal: #06302e;
  --teal-soft: #143b39;
  --teal-ink: #84e1d9;
  --danger: #ff8a80;
  --danger-soft: #4a1f1c;
  --link: #ffab7a;
  --focus: #ffd27f;
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 10px 24px -14px rgb(0 0 0 / .7);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / .4), 0 18px 32px -14px rgb(0 0 0 / .8);
}

/* ---------------------------------------------------------------- 2 base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 1.0625rem;
  line-height: 1.55;
  /* Paper with a faint dot grid */
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.5px);
  background-size: 22px 22px;
}
main { flex: 1; }

h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.7rem, 1.3rem + 2vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.3rem, 1.15rem + .8vw, 1.6rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }
h5 { font-size: 1rem; font-weight: 500; }
h1 a { color: inherit; text-decoration: none; }
p { margin: 0 0 .8em; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
strong { font-weight: 700; }
small { font-size: .875rem; }
img { max-width: 100%; }
code {
  font-family: ui-monospace, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: .9em; background: var(--surface-3); padding: .1em .4em; border-radius: 6px; overflow-wrap: anywhere;
}
hr { border: 0; border-top: 2px dashed var(--border); margin: 1.5rem 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--accent); color: #2b211c; }

/* Icons come from img/icons.svg through <use>; the line style is set here and inherited into it */
.icon {
  width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.inline { display: inline; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.stack > p { margin: 0; }
.eyebrow {
  margin: 0 0 .35rem; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary-ink);
}
.lead { font-size: 1.05rem; max-width: 62ch; margin-bottom: 0; }

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100; padding: .6rem 1rem; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: .75rem; }

/* Markdown from users */
.prose { max-width: 70ch; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 .8em; }
.prose li + li { margin-top: .2em; }
.prose h3, .prose h4, .prose h5 { margin-top: 1.2em; }
.prose blockquote { margin: 0 0 .8em; padding: .1rem 0 .1rem 1rem; border-left: 4px solid var(--accent); color: var(--muted); }
.prose pre { background: var(--surface-3); padding: .8rem 1rem; border-radius: var(--radius-s); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose mark { background: var(--accent-soft); color: inherit; padding: 0 .2em; border-radius: 4px; }

/* ---------------------------------------------------------------- 3 layout and top bar */

.container { width: min(var(--container), 100% - 2rem); margin: 1.75rem auto 2.5rem; }
.container.narrow { width: min(720px, 100% - 2rem); }
.container--center { display: flex; flex-direction: column; justify-content: center; }
.container.container--login { width: min(27rem, 100% - 2rem); }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 6px 16px -14px rgb(0 0 0 / .5); }
/* The ribbon along the top edge */
.topbar::before {
  content: ""; display: block; height: 6px;
  background: repeating-linear-gradient(-45deg, var(--wrap-red) 0 14px, var(--wrap-gold) 14px 20px);
}
.topbar-inner {
  width: min(var(--container), 100% - 2rem); margin: 0 auto; min-height: 3.75rem;
  display: flex; align-items: center; gap: .5rem 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .65rem; padding: .3rem .25rem .3rem 0; border-radius: var(--radius-s);
  color: var(--text); text-decoration: none;
}
.brand img { display: block; flex: none; width: 2.375rem; height: 2.375rem; transition: transform .25s; }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; gap: .25rem; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1; letter-spacing: .07em; }
.brand-sub { font-size: .7rem; line-height: 1.25; letter-spacing: .01em; color: var(--muted); }

/* What the name stands for (_brand_expansion.html): the initials in ribbon red and bold, so LUSTIG can be read off
   them. If it has to break, then after the comma. */
.expansion b { font-weight: 700; color: var(--primary-ink); }
.expansion-part { white-space: nowrap; }
.expansion > .visually-hidden { user-select: none; }

.mainnav { flex: 1; display: flex; align-items: center; gap: .25rem; }
.nav-link {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: .4rem .85rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: var(--primary-ink); background: var(--primary-soft); }
.nav-account { margin-left: auto; max-width: 16rem; }
.nav-account .nav-text--wide { overflow: hidden; text-overflow: ellipsis; }
.nav-text--narrow { display: none; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.mainnav + .topbar-tools { margin-left: 0; }
.logout-form { display: contents; }

[data-theme="dark"] .theme-toggle-moon, [data-theme="light"] .theme-toggle-sun { display: none; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--wrap-gold); color: #3a2500; font-weight: 700; font-size: .95rem; line-height: 1;
}
.avatar--s { width: 1.5rem; height: 1.5rem; font-size: .75rem; }
.avatar--xl { width: 3.5rem; height: 3.5rem; font-size: 1.6rem; }

.footer { text-align: center; padding: 1.5rem 1rem 2rem; color: var(--muted); font-size: .85rem; }
.footer a { color: inherit; }
.footer-name { font-weight: 700; letter-spacing: .07em; }

/* The expansion is on every page exactly once: below the name in the top bar, and where the bar is too full for
   that, in the footer instead of the bare name. Too full means: next to the menu on medium screens (on wide ones in
   two lines), and next to the "Anmelden" button on a phone. The login page spells it out in its card. */
.footer-expansion { display: none; }
@media (min-width: 720px) {
  .has-nav .brand-sub .expansion-part { display: block; }
}
@media (min-width: 720px) and (max-width: 1179.98px) {
  .has-nav .brand-sub, .has-nav .footer-name { display: none; }
  .has-nav .footer-expansion { display: inline; }
}
@media (max-width: 439.98px) {
  body:not(.has-nav) .brand-sub, body:not(.has-nav) .footer-name { display: none; }
  body:not(.has-nav) .footer-expansion { display: inline; }
}
body.page-login .brand-sub, body.page-login .footer-expansion { display: none; }
body.page-login .footer-name { display: inline; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1, .page-head h2 { margin-bottom: 0; }
.page-head h1 + p { margin: .4rem 0 0; }
.page-head--sub { margin-top: 2.25rem; margin-bottom: 1rem; align-items: center; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.identity { display: flex; align-items: center; gap: 1rem; }
.identity p { margin: .2rem 0 0; }
.back { margin: 0 0 1rem; }
.back a {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.25rem; color: var(--muted);
  text-decoration: none; font-weight: 500;
}
.back a:hover { color: var(--text); }

/* ---------------------------------------------------------------- 4 buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem;
  padding: .5rem 1.15rem; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
}
.button:hover { border-color: var(--text); background: var(--surface-2); }
.button:active { transform: translateY(1px); }
.button.primary {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
  box-shadow: 0 3px 0 var(--primary-shade);
}
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--primary-shade); }
.button.accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.button.accent:hover { background: var(--accent); border-color: var(--accent); color: #3a2500; }
.button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.button.danger.solid { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.button.danger.solid:hover { filter: brightness(1.08); }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button.quiet:hover { background: var(--surface-2); color: var(--text); }
.button.small { min-height: 2.25rem; padding: .3rem .85rem; font-size: .9rem; }
.button.block { width: 100%; }
.button .icon { width: 1.15em; height: 1.15em; vertical-align: 0; }

.icon-button {
  display: inline-grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%;
  border: 1.5px solid transparent; background: transparent; color: var(--muted); font: inherit; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-button .icon { vertical-align: 0; }

/* Waiting for the server: htmx marks the element that asked, app.js the button of an ordinary form */
.htmx-request, .is-busy { opacity: .65; cursor: progress; }
.button.is-busy::after, .button.htmx-request::after, .htmx-request .button::after {
  content: ""; width: .9em; height: .9em; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: spin .7s linear infinite;
}

/* ---------------------------------------------------------------- 5 forms */

label, legend { font-weight: 500; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > label { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .6rem; }
.optional { font-weight: 400; font-size: .8rem; color: var(--muted); }

input[type="text"], input[type="url"], input[type="number"], input[type="password"], input[type="email"],
input[type="search"], input:not([type]), select, textarea {
  width: 100%; min-height: 2.75rem; padding: .55rem .8rem; border-radius: var(--radius-s);
  border: 1.5px solid var(--border-strong); background-color: var(--field); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.45; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("../img/chevron.61a797f315c3.svg"); background-repeat: no-repeat;
  background-position: right .75rem center; background-size: 1.05rem;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:hover, select:hover, textarea:hover { border-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus);
}
[aria-invalid="true"] { border-color: var(--danger) !important; }
input[type="checkbox"], input[type="radio"] {
  width: 1.3rem; height: 1.3rem; margin: 0; flex: none; accent-color: var(--primary); cursor: pointer;
}
input[type="file"] { max-width: 100%; font: inherit; font-size: .9rem; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: .75rem; min-height: 2.5rem; padding: .4rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--surface-2); border-color: var(--text); }

.helptext { color: var(--muted); font-size: .875rem; }
.helptext ul { margin: .2rem 0 0; padding-left: 1.2rem; }
.errorlist {
  list-style: none; margin: 0; padding: .45rem .75rem; border-radius: var(--radius-s);
  background: var(--danger-soft); color: var(--danger); font-size: .9rem; font-weight: 500;
}
[data-theme="light"] .errorlist { color: #8f1d17; }

.check { display: inline-flex; align-items: center; gap: .6rem; min-height: 2.25rem; font-weight: 400; cursor: pointer; }
fieldset { margin: 0; min-width: 0; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1rem; }
legend { padding: 0 .5rem; }

/* Choices as cards: "Privat" / "Öffentlich lesbar" */
.choices { border: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.choices legend { padding: 0; margin-bottom: .5rem; }
.choice {
  display: flex; align-items: flex-start; gap: .8rem; padding: .85rem 1rem; border-radius: var(--radius);
  border: 1.5px solid var(--border-strong); background: var(--field); cursor: pointer; font-weight: 400;
  transition: border-color .15s, background-color .15s;
}
.choice input { margin-top: .15rem; accent-color: var(--teal); }
.choice:hover { border-color: var(--text); }
.choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.choice-text { display: flex; flex-direction: column; gap: .1rem; }
.choice-text > span { color: var(--muted); font-size: .9rem; }
.choice:has(input:checked) .choice-text > span { color: var(--text); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 1rem; align-items: start; }
.form-row--action { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; }
.form-row + p { margin-top: .9rem; }
/* Next to the inputs, below their labels */
.form-row--action > .button { justify-self: start; margin-top: 2rem; }
.form-row > .errorlist { grid-column: 1 / -1; }
.form-narrow { max-width: 32rem; }

.url-fetch { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .75rem; align-items: end; }
.url-fetch-help { grid-column: 1 / -1; margin: 0; }
.picture-row { display: flex; gap: 1.1rem; align-items: flex-start; }
.picture-row > .stack { flex: 1; min-width: 0; }
.options-edit { display: flex; flex-direction: column; gap: .6rem; }
.options-edit > p { margin: 0; }
.option-row { display: grid; grid-template-columns: 1.15fr 1fr 1.35fr 6.5rem; gap: .5rem; align-items: center; }
.option-row .errorlist { grid-column: 1 / -1; }

.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); margin: 1.1rem 0; font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 2px dashed var(--border); }

/* ---------------------------------------------------------------- 6 messages and notices */

/* Stays in view while scrolling, so the answer to a click far down the page is seen */
.messages {
  position: sticky; top: .6rem; z-index: 60; width: min(var(--container), 100% - 2rem); margin: 0 auto;
  display: flex; flex-direction: column; gap: .5rem; pointer-events: none;
}
.message, .notice {
  display: flex; align-items: flex-start; gap: .7rem; padding: .8rem 1rem; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text);
}
.message > .icon, .notice > .icon { margin-top: .15rem; color: var(--accent-ink); }
.message { pointer-events: auto; box-shadow: var(--shadow-lift); transition: opacity .5s, transform .5s; animation: drop-in .3s ease-out; }
.messages > .message:first-child { margin-top: .9rem; }
.message-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.message-close {
  flex: none; display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin: -.25rem -.4rem -.25rem 0;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .7; cursor: pointer;
}
.message-close:hover { opacity: 1; background: rgb(128 128 128 / .2); }
.message.fade { opacity: 0; transform: translateY(-.5rem); }
.notice { margin: 0 0 1.25rem; }
.notice a { color: inherit; font-weight: 500; }

.message--success { background: var(--teal-soft); border-color: var(--teal); }
.message--success > .icon { color: var(--teal-ink); }
.message--error, .notice--error { background: var(--danger-soft); border-color: var(--danger); }
.message--error > .icon, .notice--error > .icon { color: var(--danger); }
.message--warning, .notice--warning { background: var(--accent-soft); border-color: var(--accent); }
.message--info, .notice--info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* ---------------------------------------------------------------- 7 cards, badges, tables */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.card.pad { padding: clamp(1.1rem, .7rem + 2vw, 1.6rem); }
.card > h2:first-child { margin-top: 0; }
.card--row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card--row h2 { margin-bottom: .2rem; font-size: 1.15rem; }
.card--row p { margin: 0; }
.card--danger { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }

.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 500; line-height: 1.35; white-space: nowrap; vertical-align: middle;
  background: var(--surface-3); color: var(--text); border: 1px solid transparent;
}
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge--ok { background: var(--teal-soft); color: var(--teal-ink); }
.badge.warn, .badge--warn { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
/* The price as a tag on a string */
.badge.price {
  position: relative; padding-left: 1.15rem; border-radius: 4px 999px 999px 4px;
  background: var(--surface-3); color: var(--text); clip-path: polygon(.6rem 0, 100% 0, 100% 100%, .6rem 100%, 0 50%);
}
.badge.price::before {
  content: ""; position: absolute; left: .55rem; top: 50%; width: .32rem; height: .32rem; margin-top: -.16rem;
  border-radius: 50%; background: var(--surface);
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.inactive td:not(.actions) { opacity: .55; }
.table .actions { text-align: right; }
.table .nowrap { white-space: nowrap; }
.table .actions form { display: inline-block; margin: .15rem 0 .15rem .3rem; }
.person { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; overflow-wrap: anywhere; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty p { margin: 0 auto .8rem; max-width: 34rem; }
.empty-art { display: block; margin: 0 auto 1rem; width: 200px; height: auto; }
.empty-art--s { width: 120px; margin-bottom: .6rem; }
.empty--inline {
  padding: 1.5rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius-l); margin: 0 0 1rem;
}
.empty--inline > :last-child { margin-bottom: 0; }
.empty--page { padding: clamp(2rem, 8vh, 5rem) 1rem; }
.empty--page h1 { color: var(--text); }

/* ---------------------------------------------------------------- 8 tiles: lists and sections as wrapped presents */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); gap: var(--gap); margin: 0 0 1rem; }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px) rotate(-.5deg); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.tile:nth-child(even):hover, .tile:nth-child(even):focus-visible { transform: translateY(-4px) rotate(.5deg); }
.tile-cover { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; background: var(--surface-3); }
.tile-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-body { display: flex; flex-direction: column; gap: .4rem; padding: .85rem 1rem 1rem; }
.tile-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.tile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; color: var(--muted); font-size: .875rem; }
.tile-owner, .tile-visibility { display: inline-flex; align-items: center; gap: .35rem; }
.tile-visibility .icon { width: 1em; height: 1em; }

/* Without a picture: wrapping paper, four kinds in turn, tied with a ribbon and a bow. ".tiles--shift" starts with
   the second kind, so two short rows below each other (my lists, shared with me) don't look the same. */
.tile-cover--paper { --tie-x: 27%; --tie-w: 8px; --bow-w: clamp(58px, 28%, 96px); background-color: var(--paper); }
/* red with golden dots */
.tile-cover--paper,
.tiles--shift .tile:nth-child(4n + 4) .tile-cover--paper {
  --paper: var(--wrap-red); --ribbon: var(--wrap-gold);
  background-image: radial-gradient(circle, rgb(255 193 69 / .9) 0 3px, transparent 3.5px), radial-gradient(circle, rgb(255 193 69 / .9) 0 3px, transparent 3.5px);
  background-size: 28px 28px; background-position: 0 0, 14px 14px;
}
/* teal with stripes */
.tile:nth-child(4n + 2) .tile-cover--paper,
.tiles--shift .tile:nth-child(4n + 1) .tile-cover--paper {
  --paper: var(--wrap-teal); --ribbon: var(--wrap-cream);
  background-image: repeating-linear-gradient(45deg, rgb(255 243 220 / .2) 0 7px, transparent 7px 20px);
  background-size: auto; background-position: 0 0;
}
/* golden gingham */
.tile:nth-child(4n + 3) .tile-cover--paper,
.tiles--shift .tile:nth-child(4n + 2) .tile-cover--paper {
  --paper: var(--wrap-gold); --ribbon: var(--wrap-red);
  background-image: linear-gradient(90deg, rgb(217 67 47 / .22) 50%, transparent 50%), linear-gradient(rgb(217 67 47 / .22) 50%, transparent 50%);
  background-size: 26px 26px; background-position: 0 0;
}
/* plum with confetti */
.tile:nth-child(4n + 4) .tile-cover--paper,
.tiles--shift .tile:nth-child(4n + 3) .tile-cover--paper {
  --paper: var(--wrap-plum); --ribbon: var(--wrap-gold);
  background-image: radial-gradient(circle, #ffc145 0 2.5px, transparent 3px), radial-gradient(circle, #ff8a65 0 2.5px, transparent 3px), radial-gradient(circle, #6fd6cd 0 2.5px, transparent 3px);
  background-size: 36px 36px; background-position: 0 0, 12px 18px, 24px 6px;
}
.tile-cover--paper::before, .item--taken .item-media::before, .item--mine .item-media::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(var(--tie-x) - var(--tie-w)), var(--ribbon) calc(var(--tie-x) - var(--tie-w)) calc(var(--tie-x) + var(--tie-w)), transparent calc(var(--tie-x) + var(--tie-w))),
    linear-gradient(0deg, transparent calc(50% - var(--tie-w)), var(--ribbon) calc(50% - var(--tie-w)) calc(50% + var(--tie-w)), transparent calc(50% + var(--tie-w)));
}
.tile-cover--paper::after, .item--taken .item-media::after, .item--mine .item-media::after {
  content: ""; position: absolute; left: var(--tie-x); top: 50%; width: var(--bow-w); aspect-ratio: 60 / 46;
  transform: translate(-50%, -50%); pointer-events: none;
  background: url("../img/bow-gold.caf5eded23d9.svg") center / contain no-repeat;
}
.tiles--shift .tile:nth-child(4n + 3) .tile-cover--paper::after,
.tiles--shift .tile:nth-child(4n + 4) .tile-cover--paper::after { background-image: url("../img/bow-gold.caf5eded23d9.svg"); }
.tile:nth-child(4n + 2) .tile-cover--paper::after,
.tiles--shift .tile:nth-child(4n + 1) .tile-cover--paper::after { background-image: url("../img/bow-cream.168764212e8f.svg"); }
.tile:nth-child(4n + 3) .tile-cover--paper::after,
.tiles--shift .tile:nth-child(4n + 2) .tile-cover--paper::after { background-image: url("../img/bow-red.50e27398b890.svg"); }

/* The greeting on the start page */
.hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem;
  margin-bottom: 1.25rem; padding: clamp(1.25rem, .8rem + 2.5vw, 2.25rem);
  padding-right: clamp(1.25rem, 24vw, 15rem);
  border-radius: var(--radius-l); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
}
.hero h1 { margin-bottom: .35rem; }
.hero::after {
  content: ""; position: absolute; right: clamp(-1.5rem, 2vw, 2rem); bottom: -1.4rem;
  width: clamp(6.5rem, 20vw, 11rem); aspect-ratio: 1; background: url("../img/gift.97e628e06c37.svg") center / contain no-repeat;
  transform: rotate(9deg); pointer-events: none;
}
.callout {
  display: flex; align-items: center; gap: .9rem; margin-bottom: 1.75rem; padding: .85rem 1.1rem;
  border-radius: var(--radius-l); border: 1.5px solid var(--teal); background: var(--teal-soft);
  color: var(--text); text-decoration: none; font-weight: 500; transition: transform .15s, box-shadow .15s;
}
.callout:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.callout-icon { display: inline-grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--teal); color: var(--on-teal); }
.callout-text { flex: 1; }
.dash-section { margin-top: 1.75rem; }
.dash-section > h2 { margin-bottom: .9rem; }

/* ---------------------------------------------------------------- 9 a list and its items */

.list-head { display: flex; align-items: center; gap: 1rem 1.4rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.list-cover {
  flex: none; display: grid; place-items: center; width: 6.25rem; height: 6.25rem; overflow: hidden;
  border-radius: var(--radius-l); border: 4px solid #fff; background: var(--accent-soft);
  box-shadow: var(--shadow-lift); transform: rotate(-3deg);
}
.list-header-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.list-header-art { width: 62%; height: auto; }
.list-head-text { flex: 1 1 14rem; min-width: 0; }
.list-head-text h1 { margin: 0; }
.list-head-text p:last-child { margin: .3rem 0 0; }
.list-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.list-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .25rem 1rem; margin-top: 2.5rem; }

.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.75rem; padding: .4rem 0; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem 1.1rem; border-radius: 999px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s;
}
.tabs a:hover { border-color: var(--text); background: var(--surface-2); }
.tabs a.active { background: var(--text); border-color: var(--text); color: var(--bg); }

.intro { margin-bottom: 1.75rem; font-size: 1.05rem; }
.section { margin-bottom: 2rem; }
.section > .prose { margin-bottom: 1rem; }
.section.depth-1 > h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); margin-bottom: .8rem; }
.section.depth-1 > h2::after {
  content: ""; display: block; width: 3.5rem; height: 5px; margin-top: .5rem; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, var(--wrap-red) 0 7px, var(--wrap-gold) 7px 11px);
}
.section.depth-2 { margin-top: 2.25rem; }
.section.depth-2 > h3 { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; }
.section.depth-2 > h3::before { content: ""; flex: none; width: .7rem; height: .7rem; border-radius: 3px; background: var(--primary); transform: rotate(45deg); }
.section.depth-3 { margin: 1.5rem 0 1.25rem; }
.section.depth-3 > h4 { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; }
.section.depth-3 > h4::after { content: ""; flex: 1; border-top: 2px dashed var(--border); }
.section-img { display: block; max-width: min(100%, 18rem); max-height: 11rem; margin: 0 0 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.section-img--top { max-width: min(100%, 22rem); max-height: 13rem; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: var(--gap); margin-bottom: 1rem; }

/* An item: the link card of the old site, as a gift coupon */
.item {
  position: relative; display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); box-shadow: var(--shadow);
}
.item-main { flex: 1; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1rem; }
.item-media {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--border); background: #fff;
}
.item-media img { display: block; width: 100%; height: 100%; padding: 6px; object-fit: contain; }
.item-placeholder, .thumb--empty {
  display: grid; place-items: center; width: 100%; height: 100%; color: var(--accent-ink);
  background-color: var(--accent-soft);
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 45%, transparent) 2px, transparent 2.5px);
  background-size: 16px 16px;
}
.item-placeholder .icon { width: 2.5rem; height: 2.5rem; stroke-width: 1.6; }
/* A picture that didn't load (app.js notices) gives way to the paper below it */
.item-media.img-broken { background-color: var(--accent-soft); }
.img-broken > img, img.thumb.img-broken, img.thumb-lg.img-broken { visibility: hidden; }

.item-body { min-width: 0; }
.item-source { display: flex; align-items: center; gap: .4rem; margin-bottom: .15rem; color: var(--muted); font-size: .8rem; letter-spacing: .02em; }
.favicon { width: 16px; height: 16px; border-radius: 3px; }
.item-title { margin: 0 0 .4rem; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.item-title a { color: var(--text); text-decoration: none; }
.item-title a:hover { color: var(--link); text-decoration: underline; }
.item-title .icon { width: .8em; height: .8em; margin-left: .35em; color: var(--muted); vertical-align: -.05em; }
.item-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .5rem; }
.item-desc {
  margin: 0 0 .5rem; color: var(--muted); font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.options { margin: 0 0 .5rem; padding: 0; list-style: none; font-size: .92rem; }
.options li { position: relative; padding-left: 1.1rem; }
.options li::before { content: ""; position: absolute; left: .15rem; top: .62em; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.item-note { padding: .5rem .75rem; border-radius: var(--radius-s); background: var(--surface-2); }
.item:target { outline: 3px solid var(--accent); outline-offset: 3px; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 2px dashed var(--border); }
.pager-link {
  display: inline-flex; align-items: center; gap: .7rem; min-height: 3rem; padding: .5rem 1.1rem; border-radius: var(--radius);
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500;
}
.pager-link:hover { border-color: var(--text); background: var(--surface-2); }
.pager-link span { display: flex; flex-direction: column; line-height: 1.25; }
.pager-link small { color: var(--muted); font-size: .75rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.pager-link--next { margin-left: auto; text-align: right; }

/* ---------------------------------------------------------------- 10 reserving: only ever on a guest's page */

/* The tear-off part of the coupon */
.reserve {
  position: relative; display: flex; flex-direction: column; gap: .7rem; padding: .9rem 1rem 1rem;
  border-top: 2px dashed var(--border-strong); background: var(--surface-2);
}
.reserve::before, .reserve::after {
  content: ""; position: absolute; top: -.65rem; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
}
.reserve::before { left: -.65rem; }
.reserve::after { right: -.65rem; }
.reserve-count { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; margin: 0; font-size: .9rem; font-weight: 500; }
.pips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.pip { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--border-strong); }
.pip--on { background: var(--primary); border-color: var(--primary); }
.givers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.reserved-by { display: flex; align-items: flex-start; gap: .55rem; margin: 0; font-size: .95rem; }
.reserved-by .avatar { margin-top: .05rem; }
.reserved-by--me .avatar { background: var(--teal); color: var(--on-teal); }
.giver-note { color: var(--muted); }
.reserve-form { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.reserve-form select { flex: 0 0 auto; width: auto; }
.reserve-form input[type="text"] { flex: 3 1 11rem; width: auto; }
.reserve-form .button { flex: 1 0 auto; }
.reserve-form--undo { justify-content: flex-start; }
.reserve-form--undo .button { flex: none; }

/* Given away: the picture gets its ribbon */
.item--taken, .item--mine { --tie-x: 50%; --tie-w: 6px; --bow-w: 56px; }
.item--taken { --ribbon: var(--wrap-red); }
.item--taken .item-media::after { background-image: url("../img/bow-red.50e27398b890.svg"); }
.item--taken .item-media img { opacity: .8; }
.item--taken:not(.item--mine) .item-title, .item--taken:not(.item--mine) .item-title a { color: var(--muted); }
.item--mine .item-media::after { background-image: url("../img/bow-teal.e9d53ab3fffc.svg"); }
.item--taken .item-placeholder .icon, .item--mine .item-placeholder .icon { display: none; }
.item--mine { --ribbon: var(--wrap-teal); border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), var(--shadow); }
.item--mine .reserve { background: var(--teal-soft); border-top-color: var(--teal); }
.item--mine .reserve::before, .item--mine .reserve::after { border-color: var(--teal); }
.item--fresh { animation: pop .45s ease-out; }
.item--fresh .item-media::after { animation: tie .5s .1s ease-out backwards; }

.reservation-list { list-style: none; margin: 0; padding: 0; }
.reservation-list li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.reservation-list li:first-child { border-top: 0; }
.reservation-list li:last-child { padding-bottom: 0; }
.reservation-icon { display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--teal-soft); color: var(--teal-ink); }
.reservation-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reservation-text a { font-weight: 500; }
.reservation-note { display: block; color: var(--muted); font-size: .9rem; }
.reservation-group h2 { font-size: 1.25rem; margin-bottom: .6rem; }
.reservation-group h2 .small { font-weight: 400; white-space: nowrap; }

/* ---------------------------------------------------------------- 11 the editor */

.settings { padding: 0; overflow: hidden; }
.settings summary {
  display: flex; align-items: center; gap: .8rem; padding: 1rem 1.25rem; cursor: pointer; list-style: none;
}
.settings summary::-webkit-details-marker { display: none; }
.settings summary:hover { background: var(--surface-2); }
.settings summary > span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.settings summary small { color: var(--muted); }
.settings summary > .icon:first-child { color: var(--accent-ink); }
.summary-chevron { transition: transform .2s; }
.settings[open] .summary-chevron { transform: rotate(90deg); }
.settings[open] summary { border-bottom: 1px solid var(--border); }
.settings-body { padding: 1.25rem; }
.danger-zone { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 2px dashed var(--border); font-size: .9rem; }
.danger-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--danger); }
[data-theme="light"] .danger-link { color: #8f1d17; }

.edit-tree { display: flex; flex-direction: column; gap: 1rem; }
.edit-section { scroll-margin-top: 1rem; }
.edit-section.depth-1 { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow); }
.edit-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .45rem .75rem; border-radius: var(--radius-s); scroll-margin-top: 1rem; }
.edit-row--section { font-weight: 700; }
.depth-1 > .edit-row--section { padding: .7rem .75rem .7rem 1.1rem; border-radius: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 1.15rem; }
.edit-row--section > .edit-title > .icon { color: var(--primary-ink); }
.edit-row--item:hover { background: var(--surface-2); }
.edit-title { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.edit-name { overflow-wrap: anywhere; }
.edit-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.edit-children { padding: .4rem .5rem .6rem; }
/* Sections inside a tab: indented along a ribbon */
.edit-section .edit-section { margin: .6rem 0 .6rem .9rem; border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.edit-section .edit-section .edit-section { border-left-color: var(--teal); }
.edit-section .edit-section > .edit-children { padding-bottom: .4rem; }
.edit-add { display: flex; flex-wrap: wrap; gap: .5rem; padding: .5rem .25rem .1rem; }
.add-link {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.25rem; padding: .25rem .9rem .25rem .7rem; border-radius: 999px;
  border: 1.5px dashed var(--border-strong); color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: none;
}
.add-link:hover { border-style: solid; border-color: var(--text); color: var(--text); background: var(--surface); }
.edit-row:target, .edit-section:target > .edit-row--section { animation: flash 2.4s ease-out; }

.thumb { display: inline-grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 8px; border: 1px solid var(--border); background: #fff; object-fit: contain; overflow: hidden; }
.thumb-lg { display: grid; place-items: center; flex: none; width: 8.75rem; height: 8.75rem; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; object-fit: contain; overflow: hidden; }
.thumb.thumb--empty, .thumb-lg.thumb--empty { background-color: var(--accent-soft); }
.thumb-lg .icon { width: 2.25rem; height: 2.25rem; stroke-width: 1.5; }

/* ---------------------------------------------------------------- 12 single pages */

.login-card { overflow: hidden; }
.login-head { text-align: center; margin-bottom: 1.5rem; }
.login-head img { display: block; margin: 0 auto .5rem; transform: rotate(-6deg); }
.login-head p { margin: 0; }
.login-head .login-name { margin: 0 0 .45rem; font-size: clamp(2.3rem, 1.8rem + 2.5vw, 2.9rem); line-height: 1; letter-spacing: .1em; text-indent: .1em; }
.login-expansion { font-size: 1.02rem; line-height: 1.4; }
/* A piece of ribbon between the name and the greeting */
.login-expansion::after {
  content: ""; display: block; width: 3.5rem; height: 5px; margin: .9rem auto; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, var(--wrap-red) 0 7px, var(--wrap-gold) 7px 11px);
}
.login-hello { color: var(--muted); }
.login-foot { margin: 1.25rem 0 0; text-align: center; }

.share { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; margin-top: 1.25rem; padding: .8rem 1rem; border-radius: var(--radius); background: var(--surface-2); font-size: .9rem; }
.share-label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
.share code { flex: 1 1 12rem; background: none; padding: 0; }
.members { margin: 0 0 1.5rem; }
.members td { padding-left: 0; }
.members td:last-child { padding-right: 0; text-align: right; }
.role-form { display: inline-flex; align-items: center; gap: .4rem; }
.role-form select { width: auto; min-height: 2.25rem; padding-top: .25rem; padding-bottom: .25rem; }

/* ---------------------------------------------------------------- 13 small screens */

@media (min-width: 720px) {
  .tiles--sections { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
}

@media (max-width: 719.98px) {
  body { font-size: 1rem; }
  .container { margin-top: 1.25rem; }

  /* The menu moves to the thumb */
  .has-nav { padding-bottom: calc(4.1rem + env(safe-area-inset-bottom)); }
  .mainnav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    gap: 0; padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 20px -16px rgb(0 0 0 / .6);
  }
  .nav-link { flex-direction: column; justify-content: center; gap: .15rem; min-height: 3.4rem; padding: .25rem; border-radius: var(--radius); font-size: .74rem; min-width: 0; }
  .nav-link .icon { width: 1.45rem; height: 1.45rem; }
  .nav-link .avatar { width: 1.45rem; height: 1.45rem; font-size: .75rem; }
  .nav-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nav-my, .nav-text--wide { display: none; }
  .nav-text--narrow { display: inline; }
  .nav-account { margin-left: 0; max-width: none; }
  .logout-form { display: none; }
  .mainnav + .topbar-tools { margin-left: auto; }
  .topbar-inner { min-height: 3.25rem; }
  .brand { gap: .55rem; padding-block: .2rem; }
  .brand-text { gap: .2rem; }
  .brand-name { font-size: 1.15rem; }
  .brand-sub { font-size: .66rem; }
  .brand img { width: 2rem; height: 2rem; }

  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head--sub { flex-direction: row; align-items: center; }
  .hero { padding-right: 4.75rem; }
  .hero::after { width: 5.25rem; right: -.6rem; bottom: -1rem; }
  .hero .lead { font-size: 1rem; }

  /* Tabs: one row to swipe through, out to the screen's edges */
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -1rem; padding-inline: 1rem; scrollbar-width: none; scroll-padding-inline: 1rem; }
  .tabs::-webkit-scrollbar { display: none; }

  .tiles--sections { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .tiles--sections .tile-body { padding: .7rem .8rem .8rem; }
  .tiles--sections .tile-title { font-size: 1.05rem; }
  .tiles--sections .tile-cover--paper { --tie-w: 6px; --bow-w: 52px; }
  .tiles:not(.tiles--sections) .tile-cover { aspect-ratio: 5 / 2; }

  .list-head { gap: .9rem 1rem; }
  .list-cover { width: 4.75rem; height: 4.75rem; border-width: 3px; }
  .list-head-text { flex-basis: 10rem; }
  .list-actions { width: 100%; }
  .list-actions .button { flex: 1; }

  .item-main { grid-template-columns: 5.5rem minmax(0, 1fr); gap: .85rem; padding: .85rem; }
  .item--taken, .item--mine { --tie-w: 5px; --bow-w: 46px; }
  .reserve { padding: .85rem; }
  .reserve-form:not(.reserve-form--undo) .button { min-height: 3rem; }
  .pager { gap: .6rem; }
  .pager-link { flex: 1 1 8rem; min-width: 0; padding-inline: .8rem; }
  .pager-link span { min-width: 0; overflow-wrap: anywhere; }
  .pager-link--next { justify-content: flex-end; }


  .edit-row { flex-wrap: wrap; row-gap: 0; padding: .4rem .5rem; }
  .depth-1 > .edit-row--section { padding: .6rem .5rem .5rem .9rem; }
  .edit-actions .icon-button { width: 2.4rem; height: 2.4rem; }
  .edit-title { flex: 1 1 100%; }
  .edit-actions { margin-left: auto; }
  .edit-actions .button-text, .members .button-text { display: none; }
  .edit-actions .button.small, .members .button.small.danger { width: 2.4rem; min-height: 2.4rem; padding: 0; }
  .edit-section .edit-section { margin-left: .35rem; }
  .edit-children { padding-inline: .25rem; }

  .url-fetch { grid-template-columns: minmax(0, 1fr); }
  .picture-row { flex-direction: column; align-items: stretch; }
  .picture-row > .thumb-lg { align-self: flex-start; }
  .option-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: .75rem; border-bottom: 2px dashed var(--border); }
  .option-row input[type="url"], .option-row .check { grid-column: 1 / -1; }
  .form-actions .button.primary { flex: 1 1 auto; }
  .form-row--action { grid-template-columns: minmax(0, 1fr); }
  .form-row--action > .button { margin-top: 0; justify-self: stretch; }

  /* Tables turn into stacked cards */
  .table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; }
  .table--cards tr { padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
  .table--cards tbody tr:last-child { border-bottom: 0; }
  .table--cards td { padding: .15rem 0; border: 0; }
  .table--cards td[data-label]:not(:first-child) { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .92rem; }
  .table--cards td[data-label]:not(:first-child)::before { content: attr(data-label) ":"; color: var(--muted); }
  .table--cards .actions { text-align: left; padding-top: .5rem; }
  .table--cards .actions form { margin: .15rem .3rem .15rem 0; }

  .members, .members tbody { display: block; }
  .members tr { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
  .members tr:last-child { border-bottom: 0; }
  .members td { padding: 0; border: 0; }
  .members td:first-child { flex: 1 1 100%; }
  .members td:last-child { margin-left: auto; }
  .members td:empty { display: none; }
}

@media (max-width: 359.98px) {
  .brand-sub .expansion-part { white-space: normal; }
  .tiles--sections { grid-template-columns: minmax(0, 1fr); }
  .item-main { grid-template-columns: 4.5rem minmax(0, 1fr); }
}

@media print {
  .topbar, .footer, .messages, .tabs, .pager, .reserve, .list-actions, .notice { display: none !important; }
  body { background: #fff; color: #000; }
  .item, .card { box-shadow: none; break-inside: avoid; }
}

/* ---------------------------------------------------------------- 14 motion */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-.6rem); } }
@keyframes pop { 0% { transform: scale(.985); } 55% { transform: scale(1.012); } 100% { transform: scale(1); } }
@keyframes tie { from { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-25deg); } }
@keyframes flash { 0%, 35% { background-color: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .tile:hover, .tile:focus-visible, .tile:nth-child(even):hover, .tile:nth-child(even):focus-visible, .callout:hover, .brand:hover img { transform: none; }
}
