/* Rökkur = dusk. Two looks share one set of token names: "dusk" (deep
   twilight + tamed amber) and "mono" (black on paper, like the printed logo,
   the site default). A third setting, "auto", is rewritten to mono/dusk by an
   inline script in base.html from prefers-color-scheme; the selectors below
   also match [data-theme='auto'] so it renders as mono without JS. The admin
   pins data-theme="dusk" and reuses these tokens — keep the token NAMES
   stable. */
:root {
  --bg: #100f16;
  --bg-raised: #17151f;
  --bg-sunken: #0b0a10;
  --border: #262330;
  --rule: #3a3648;
  --text: #f2ede2;
  --text-muted: #97907f;
  --accent: #c98a4b;
  --accent-strong: #dda05f;
  --accent-ink: #16100a;
  --ok: #7fc98a;
  --danger: #e08b8b;
  --font-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-btn: 4px;
  --page-width: 64rem;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2397907f' stroke-width='2'/%3E%3C/svg%3E");
  color-scheme: dark;
}

[data-theme='mono'], [data-theme='auto'] {
  --bg: #faf8f4;
  --bg-raised: #ffffff;
  --bg-sunken: #f1eee7;
  --border: #d8d4cb;
  --rule: #111014;
  --text: #111014;
  --text-muted: #5d5952;
  --accent: #111014;
  --accent-strong: #000000;
  --accent-ink: #faf8f4;
  --ok: #1a7f37;
  --danger: #b3261e;
  --radius: 0px;
  --radius-btn: 0px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235d5952' stroke-width='2'/%3E%3C/svg%3E");
  color-scheme: light;
}

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/anton-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/anton-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.5rem, 8vw, 4.25rem); line-height: 1.02; letter-spacing: 0.015em; }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.1; letter-spacing: 0.03em; }

h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

.kicker {
  font: 600 0.78rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.15em;
}

a:hover, a:focus-visible {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Longhand on purpose: many elements carry class="container section" and the
   padding shorthand would wipe out .container's horizontal padding. */
.section {
  padding-top: 2.75rem;
  padding-bottom: 2.75rem;
}

.section-title {
  letter-spacing: 0.02em;
}

/* ---------- Logo mark ----------
   One cached SVG recolored via currentColor: the mask carries the shape,
   background-color paints it. */
.logo-mark {
  display: inline-block;
  width: var(--logo-size, 2.25rem);
  aspect-ratio: 1;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url('/static/logo.svg') center / contain no-repeat;
  mask: url('/static/logo.svg') center / contain no-repeat;
}

/* 404 page: heading + one muted line + two buttons, same chrome as the rest. */
.notfound p { color: var(--text-muted); max-width: 36rem; }
.notfound-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Ridge divider (echoes the mountain line in the logo) ---------- */
.ridge {
  display: block;
  width: 100%;
  height: clamp(10px, 2vw, 16px);
  color: var(--rule);
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

[data-theme='mono'] .site-header,
[data-theme='auto'] .site-header {
  border-bottom: 2px solid var(--rule);
}

.site-header .container {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  flex-basis: 100%;
  justify-content: center;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand:hover { text-decoration: none; }

/* Four short links (Matseðill · Veislur · Viðburðir · Borðapantanir).
   The tighter phone gap keeps them on one row where it fits; on the
   narrowest phones they wrap to two centered rows. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (min-width: 40rem) {
  .site-nav { gap: 1.25rem; }
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--text); }

.site-nav a[aria-current='page'] {
  color: var(--text);
  border-bottom-color: var(--rule);
}

/* On phones the switch sits in the top-right corner beside the brand row so
   the nav row is only page links; ≥40rem it rejoins the nav inline. */
.lang-switch {
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 0.2rem 0.6rem;
  position: absolute;
  top: 0.95rem;
  right: 1.25rem;
}

@media (min-width: 40rem) {
  .lang-switch { position: static; }
}

@media (min-width: 40rem) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .site-header .container {
    justify-content: space-between;
  }

  .brand {
    flex-basis: auto;
    justify-content: flex-start;
  }
}

/* ---------- Announcement ---------- */
.announcement {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: center;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.announcement::before {
  content: '';
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.6em;
  vertical-align: 0.05em;
}

[data-theme='mono'] .announcement,
[data-theme='auto'] .announcement {
  background: var(--rule);
  color: var(--bg);
}

[data-theme='mono'] .announcement::before,
[data-theme='auto'] .announcement::before {
  background: var(--bg);
}

/* ---------- Hero ---------- */
.hero {
  padding: 3.5rem 0 0;
  text-align: center;
}

.hero .container {
  padding-bottom: 3rem;
}

.hero-mark {
  --logo-size: clamp(9rem, 30vw, 13rem);
  margin-bottom: 1.75rem;
}

.hero h1 { margin-bottom: 0.35em; }

.hero .tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.hero-hours {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero .ridge {
  margin-top: 0.5rem;
}

.cta-row {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
}

.button.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button.secondary {
  color: var(--text);
  border: 1px solid var(--rule);
}

.button.secondary:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

/* ---------- Feature rows (specials & events) ---------- */
.feature-list {
  display: grid;
  border-top: 2px solid var(--rule);
}

.feature {
  display: grid;
  gap: 0.35rem 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.feature img {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  border-radius: var(--radius);
}

.feature h3 { margin: 0; }

.feature .when {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature p {
  color: var(--text-muted);
  margin: 0;
}

.feature .price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (min-width: 40rem) {
  .feature { grid-template-columns: 1fr auto; align-items: baseline; }
  .feature p { grid-column: 1; }
  .feature .price { grid-column: 2; grid-row: 1; }
  .feature.has-image { grid-template-columns: 9rem 1fr auto; align-items: center; }
  .feature.has-image img { width: 9rem; height: 6.5rem; grid-row: span 2; }
  .feature.has-image p { grid-column: 2; }
  .feature.has-image .price { grid-column: 3; grid-row: 1; }
}

.section-more {
  margin-top: 1.25rem;
}

/* ---------- Menu ---------- */
.menu-page {
  max-width: 46rem;
  margin: 0 auto;
}

.menu-jump {
  position: sticky;
  top: 0;
  z-index: 9;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.6rem 0;
  margin-bottom: 1.5rem;
}

.menu-jump::-webkit-scrollbar { display: none; }

/* On wider screens the chips wrap instead of scrolling (the sticky header
   already handles wayfinding there). */
@media (min-width: 40rem) {
  .menu-jump {
    position: static;
    flex-wrap: wrap;
    overflow: visible;
    border-bottom: none;
  }
}

.menu-jump a {
  flex: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 0.45rem 0.8rem;
}

.menu-jump a:hover {
  color: var(--text);
  border-color: var(--rule);
}

.menu-category {
  margin-bottom: 3rem;
  scroll-margin-top: 4.5rem;
}

.menu-category > h2 {
  text-align: center;
  margin-bottom: 0.25rem;
}

.menu-category .ridge {
  width: 6rem;
  margin: 0 auto 1.5rem;
  height: 10px;
  color: var(--border);
}

.menu-item {
  padding: 0.65rem 0;
}

.menu-item-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.menu-item .name {
  font-weight: 600;
  font-size: 1.05rem;
}

.menu-item .leader {
  flex: 1;
  min-width: 1.5rem;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-0.3em);
}

.menu-item .price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

/* Catering unit ("á mann", "bakkinn") on its own small line under the
   amount, so the price column stays narrow next to a thumbnail on phones. */
.menu-item .price .unit {
  display: block;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--text-muted);
}

.menu-item .desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0.15rem 0 0;
  max-width: 85%;
}

/* Optional dish image: square thumbnail left of the text, so the price
   column stays straight whether a dish has an image or not. Photos are
   cropped to fill it; transparent PNGs (.is-cutout) are shown whole,
   straight on the page background. */
.menu-item.has-image {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.menu-item.has-image .menu-thumb { order: -1; }
.menu-item.has-image .desc { max-width: none; }
.menu-item .menu-item-text { min-width: 0; }

.menu-thumb {
  width: 5.5rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-sunken);
}

.menu-thumb.is-cutout {
  object-fit: contain;
  border-radius: 0;
  background: none;
}

@media (min-width: 40rem) {
  .menu-thumb { width: 7rem; }
}

.badges {
  display: inline-flex;
  gap: 0.3rem;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-btn);
  padding: 0 0.3rem;
  letter-spacing: 0.02em;
  cursor: help;
  text-decoration: none;
}

.legend {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  padding: 0;
  list-style: none;
  margin: 0 0 1rem;
}

.allergy-note {
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

/* ---------- Catering ---------- */
/* Contact box at the end of the catering page: raised card with the owner's
   note and tel/mailto links. Token-only, so mono/dusk/auto all just work. */
.catering-order {
  margin-top: 2.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.catering-order h2 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: 0.5rem;
}

.catering-intro { max-width: 40rem; margin: 0 0 2.5rem; }
.catering-intro p + p { margin-top: 0.8rem; }

.catering-order ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catering-order li {
  padding: 0.15rem 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.catering-empty { color: var(--text-muted); }

.catering-teaser p { max-width: 40rem; }

/* ---------- Hours ---------- */
.hours-wrap {
  display: grid;
  gap: 2rem;
}

@media (min-width: 60rem) {
  .hours-wrap { grid-template-columns: 1fr 1fr; align-items: start; }
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.hours-table td {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.hours-table td:last-child { text-align: right; color: var(--text-muted); }

.hours-table tr[data-today='true'] td {
  color: var(--text);
  font-weight: 600;
}

.hours-table tr[data-today='true'] td:first-child::before {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.5em;
  vertical-align: 0.1em;
}

.open-indicator {
  display: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  padding: 0.2rem 0.6rem;
  margin-left: 0.6rem;
  vertical-align: middle;
}

.open-indicator[data-state='open'] {
  display: inline-block;
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ok);
}

.open-indicator[data-state='closed'] {
  display: inline-block;
  background: color-mix(in srgb, var(--text-muted) 15%, transparent);
  color: var(--text-muted);
}

/* ---------- Booking form ---------- */
.booking-phone {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.booking-phone .phone-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius-btn);
  padding: 0.35rem 1rem;
}

.booking-phone .phone-number:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

@media (max-width: 40rem) {
  .booking-phone .phone-number {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.65rem 1rem;
  }
}

.booking-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .booking-form { grid-template-columns: 1fr 1fr; }
}

.booking-form .full { grid-column: 1 / -1; }

.booking-form label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.booking-form input,
.booking-form select,
.booking-form textarea {
  width: 100%;
  min-height: 48px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 1rem; /* ≥16px keeps iOS from zooming on focus */
}

.booking-form textarea { min-height: 6rem; }

.booking-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.booking-form button {
  cursor: pointer;
  border: none;
  font: inherit;
}

.booking-form button[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.form-status {
  margin-top: 0.5rem;
  font-weight: 600;
}

.form-status[data-state='success'] { color: var(--ok); }
.form-status[data-state='error'] { color: var(--danger); }

.form-note {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ---------- Sticky call/book bar (phones only, not on the booking page) ---------- */
.sticky-cta {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom));
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
}

.sticky-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius-btn);
  color: var(--text);
}

.sticky-cta a.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

body:has(.sticky-cta) {
  padding-bottom: 4.75rem;
}

@media (min-width: 40rem) {
  .sticky-cta { display: none; }
  body:has(.sticky-cta) { padding-bottom: 0; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  margin-top: 3rem;
  padding: 2.5rem 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

[data-theme='mono'] .site-footer,
[data-theme='auto'] .site-footer {
  border-top: 2px solid var(--rule);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  margin-bottom: 2rem;
}

.footer-mark { --logo-size: 3rem; }

.footer-brand .brand-word {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-cols {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

.site-footer h3 {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li { padding: 0.15rem 0; }

.footer-bottom {
  max-width: var(--page-width);
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  text-align: center;
}

/* ---------- wider screens ---------- */
@media (min-width: 60rem) {
  .section { padding-top: 4rem; padding-bottom: 4rem; }
  .hero { padding-top: 5rem; }
  .menu-category { scroll-margin-top: 8rem; }
}

/* ---------- honeypot (public booking form) ---------- */
.honeypot {
  position: absolute;
  left: -9999px;
}

/* ---------- admin ---------- */
.admin-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.admin-header .brand {
  flex-basis: auto;
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-category { margin-top: 2.5rem; }

.admin-category > h2 {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table td, .admin-table th {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table .shrink { width: 1%; white-space: nowrap; }

.inline-form { display: inline; }

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0.1rem 0.3rem;
  text-decoration: underline;
}

.link-button:disabled { opacity: 0.3; cursor: default; }

.link-button.danger { color: var(--danger); }

.row-hidden { opacity: 0.5; }
.admin-category.row-hidden { opacity: 1; } /* dim the list, keep the heading and its toggle readable */
.admin-category.row-hidden > table, .admin-category.row-hidden > p { opacity: 0.5; }

.tag-hidden {
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  color: var(--text-muted);
  vertical-align: middle;
}

.admin-form { margin-top: 1rem; }

.admin-form h2 { margin: 1rem 0 0.5rem; color: var(--accent); font-size: 1.15rem; }

.admin-form textarea.long { min-height: 18rem; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.4rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.checkbox input { width: auto; min-height: auto; }

.admin-form .label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.admin-thumb {
  max-width: 12rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.hours-edit td { border-bottom: none; padding: 0.25rem 0.4rem; }
.hours-edit input { width: 5.5rem; }

.danger-zone {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

/* Admin actions: 40px bordered targets that a thumb can hit. .link-button
   stays for navigation-like actions (Útskrá). */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover { border-color: var(--accent); }
.icon-button:disabled { opacity: 0.3; cursor: default; }
.icon-button:disabled:hover { border-color: var(--border); }
.icon-button.danger { color: var(--danger); }

.button-group { display: inline-flex; gap: 0.25rem; }

/* Drag handles (≡) exist only when admin.js runs; the ↑↓ forms are the
   no-JS fallback. touch-action: none keeps a finger on the handle from
   scrolling the page instead of dragging. */
.handle {
  display: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.js .handle { display: inline-flex; }
.js-only { display: none; }
.js .js-only { display: inline; }

body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging { user-select: none; -webkit-user-select: none; }

.is-dragging { opacity: 0.35; outline: 2px dashed var(--accent); outline-offset: -2px; }

/* While a whole category is being dragged the lists collapse to headings so
   the trip across a 22-category page is short. */
body.dragging-cat .admin-category > table,
body.dragging-cat .admin-category > p { display: none; }

.drag-ghost {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  max-width: 90vw;
  padding: 0.5rem 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-category > h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Validation message rendered by admin_base.html above the page content. */
.admin-error {
  margin: 0 0 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
}

/* "Vistað ✓" — rendered for ?vistad=1 or created by admin.js. CSS fades it
   so it also disappears with JS off. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 60;
  padding: 0.6rem 1.2rem;
  background: var(--bg-raised);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-weight: 600;
  animation: toast-out 0.4s ease 2s forwards;
}

.toast-error { border-color: var(--danger); animation-delay: 3.5s; }

@keyframes toast-out { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) { .toast { animation-duration: 0.01s; } }

/* Redirects land on #rettur-… / #flokkur-…: keep the row off the very top
   edge and mark it briefly. */
.admin-table tr, .admin-category { scroll-margin-top: 1rem; }
.admin-table tr:target > td, .admin-category:target > h2 { background: var(--bg-sunken); }

.admin-table .name .price { display: block; color: var(--text-muted); font-size: 0.85rem; }
.admin-table .count { white-space: nowrap; }
.admin-table .count-label { color: var(--text-muted); font-size: 0.85rem; }

/* Why a button is dead, said out loud: the disabled Eyða on a non-empty
   category gets "tæmdu fyrst" under it, because title= tooltips never show
   on a phone. */
.inline-form:has(.cell-hint) {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.admin-table .cell-hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

@media (min-width: 40rem) {
  .admin-table .name .price { display: inline; margin-left: 0.6rem; }
}

.category-edit {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.category-edit input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

/* Phones: tighter cells; the Flokkar row becomes a grid with the rename
   form on its own line. */
@media (max-width: 40rem) {
  .admin-table td { padding: 0.35rem 0.25rem; }
  .admin-table.flokkar, .admin-table.flokkar tbody { display: block; }
  .admin-table.flokkar thead { display: none; }
  .admin-table.flokkar tr {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    grid-auto-flow: dense;
    gap: 0.3rem;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
  }
  .admin-table.flokkar td { display: block; border: 0; padding: 0; }
  .admin-table.flokkar td.edit { grid-column: 1 / -1; }
  .admin-table.flokkar td.count { text-align: center; }
}

.login-card {
  max-width: 22rem;
  margin: 12vh auto 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.login-card .booking-form { text-align: left; }

.booking-card { margin-bottom: 1rem; }
.booking-card-head { font-size: 1.05rem; }
.booking-card-actions { display: flex; gap: 1rem; }
