/* The hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

/* EventBooth admin dashboard — Minselfie design tokens, no external assets. */

:root {
  --bg: #FAF9F7;
  --bg-card: #FFFFFF;
  --bg-soft: #F3F1ED;
  --bg-cream: #FBF4EC;
  --bg-inverse: #1C2130;
  --border: #E3DED6;
  --border-strong: #C8C1B5;
  --ink: #1C2130;
  --ink-soft: #2D3146;
  --muted: #7A7570;
  --on-dark: #FAF9F7;
  --terracotta: #C05C38;
  --terracotta-soft: #E8C7B8;
  --yellow: #FFD074;
  --yellow-hover: #f5c860;
  --yellow-soft: #FFE7B8;
  --danger: #B0362C;
  --danger-soft: #F6E0DD;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 100px;
  --shadow: 0 4px 16px rgba(28, 33, 48, 0.06);
  --shadow-md: 0 8px 24px rgba(28, 33, 48, 0.08);
  --shadow-yellow: 0 4px 14px rgba(255, 208, 116, 0.35);
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0 0 8px;
}
h1 { font-size: clamp(26px, 3.4vw, 36px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); margin: 0 0 8px; font-size: 14px; }

/* ---- Top bar ---- */

.topbar {
  background: var(--bg-inverse);
  color: var(--on-dark);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--on-dark);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 208, 116, 0.25);
  display: inline-block;
}
.brand-dot.big { width: 22px; height: 22px; margin-bottom: 10px; }
.topnav { display: flex; gap: 4px; }
.topnav a {
  color: rgba(250, 249, 247, 0.72);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 14px;
}
.topnav a:hover { color: var(--on-dark); text-decoration: none; }
.topnav a.active { background: rgba(250, 249, 247, 0.12); color: var(--on-dark); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.version { color: rgba(250, 249, 247, 0.5); font-size: 12px; }
.topbar .btn-outline {
  border-color: rgba(250, 249, 247, 0.35);
  color: var(--on-dark);
  background: transparent;
}
.topbar .btn-outline:hover { border-color: var(--on-dark); }

/* ---- Layout ---- */

.page { max-width: 1120px; margin: 0 auto; padding: 32px 24px 88px; }

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--terracotta); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: var(--shadow-yellow); }
.btn-yellow:hover { background: var(--yellow-hover); }
.btn-dark { background: var(--ink); color: var(--on-dark); }
.btn-dark:hover { background: var(--ink-soft); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  padding: 11px 22px;
}
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #96271e; }
.btn-ghost-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger-soft); }
.btn-ghost-danger:hover { border-color: var(--danger); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; pointer-events: none; }

/* ---- Login ---- */

.view-login { display: grid; place-items: center; min-height: calc(100vh - 200px); }
.login-card {
  width: min(380px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 32px;
  text-align: center;
}
.login-card form { text-align: left; margin-top: 20px; display: grid; gap: 14px; }

/* ---- Forms ---- */

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color 160ms var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--terracotta);
}
textarea { resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  margin: 0 0 16px;
}

.switch { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--terracotta); flex: none; }

/* Mode chips */
.mode-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  background: var(--bg-card);
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}
.chip input { width: 16px; height: 16px; accent-color: var(--terracotta); }
.chip:has(input:checked) { background: var(--yellow-soft); border-color: var(--yellow); }

/* Color fields */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.color-field {
  display: grid;
  justify-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}
.color-field input[type="color"] {
  width: 52px;
  height: 40px;
  padding: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
}
.color-field code { font-size: 11px; color: var(--muted); }

/* Branding uploads */
.branding {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.branding-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.branding-preview {
  height: 180px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.checker {
  background-color: #efece7;
  background-image:
    linear-gradient(45deg, #e3ded6 25%, transparent 25%, transparent 75%, #e3ded6 75%),
    linear-gradient(45deg, #e3ded6 25%, transparent 25%, transparent 75%, #e3ded6 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.branding-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.branding-empty { color: var(--muted); font-size: 13px; background: rgba(250, 249, 247, 0.85); padding: 4px 12px; border-radius: var(--radius-pill); }
.branding-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- AI styles editor ---- */

.ai-style {
  display: grid;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ai-style-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-style-head .ai-style-title { flex: 1 1 220px; min-width: 0; }
.ai-style-key {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.ai-style-prompt { resize: vertical; font-size: 13px; }
.ai-styles-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ai-styles-empty { margin: 0 0 10px; }

.editor-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
  padding: 16px 0 20px;
}
.editor-footer .spacer { flex: 1; }

/* ---- Event list ---- */

.event-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.event-row-main { flex: 1 1 260px; min-width: 0; }
.event-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.event-name a { color: var(--ink); }
.event-meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.event-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.count-badge {
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.count-badge strong { color: var(--terracotta); }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty-state {
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  color: var(--muted);
}
.empty-state h2 { color: var(--ink); }

/* ---- Captures grid ---- */

.captures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.capture-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  /* minmax(0, …) — the aspect-ratio thumb would otherwise give the auto track
     a min-content width a few px wider than the card, clipping every row. */
  grid-template-columns: minmax(0, 1fr);
}
.capture-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-inverse);
  display: block;
}
.capture-thumb img, .capture-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.capture-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(28, 33, 48, 0.75);
  color: var(--on-dark);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  letter-spacing: 0.02em;
}
.capture-info { padding: 10px 14px 12px; font-size: 12px; color: var(--muted); display: grid; gap: 2px; }
.capture-info .email { color: var(--terracotta); overflow-wrap: anywhere; }
/* The card clips its corners, so the three buttons must never overflow it:
   wrap onto a second line instead of having "Slett" cut in half. */
.capture-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.capture-actions .btn { flex: 1 1 auto; min-width: 0; padding: 7px 8px; font-size: 12px; }

/* ---- Shares table ---- */

.table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
td .pill-yes { color: var(--terracotta); font-weight: 600; }

td.share-status { white-space: nowrap; }
.pill-status {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
}
.pill-status.ok { background: #E2F0E5; color: #2C7A49; }
.pill-status.fail { background: var(--danger-soft); color: var(--danger); }
.pill-status.wait { background: var(--bg-soft); color: var(--muted); }
.btn-resend { padding: 5px 12px; font-size: 12px; }

/* ---- Status card (dashboard) ---- */

.status-card {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 12px 20px;
  margin-bottom: 16px;
  font-size: 13px;
}
.status-item { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.status-item.version { color: var(--muted); font-weight: 400; margin-left: auto; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-dot.ok { background: #3D9A5F; }
.status-dot.off { background: var(--border-strong); }

/* ---- Setup ---- */

.setup-keys { display: grid; gap: 12px; margin: 16px 0; }
.setup-key {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-cream);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}
.setup-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; min-width: 100px; }
.setup-key code {
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  overflow-wrap: anywhere;
  flex: 1 1 200px;
  min-width: 0;
}
.steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { position: relative; padding-left: 46px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--terracotta-soft);
  color: var(--terracotta);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
}

/* ---- Toast ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--bg-inverse);
  color: var(--on-dark);
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 50;
  max-width: min(90vw, 480px);
  text-align: center;
}
.toast.error { background: var(--danger); }

/* ---- Survey builder ---- */

.survey-builder { display: grid; gap: 22px; }
/* Grid items default to min-width:auto, which lets a long field row inflate
   the whole builder past the card. body has overflow-x: clip, so anything
   pushed outside the viewport can never be scrolled to. */
.survey-section { min-width: 0; }
.survey-section h3 { font-size: 15px; margin: 0 0 10px; }
.survey-list { display: grid; gap: 8px; margin-bottom: 10px; }
.survey-empty { margin: 0 0 4px; }
.survey-field {
  min-width: 0;
  border: 1px solid var(--line, #E5E0D8);
  border-radius: 12px;
  background: #fff;
}
.survey-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
}
.survey-field-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 4px 2px;
}
.survey-field-name > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.survey-field-type {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--terracotta, #C05C38);
  background: rgba(192, 92, 56, 0.10);
  border-radius: 100px;
  padding: 3px 10px;
}
.survey-flag {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: #2C7A49;
  background: #E2F0E5;
  border-radius: 100px;
  padding: 3px 10px;
}
.survey-field-editor {
  border-top: 1px solid var(--line, #E5E0D8);
  padding: 14px 12px;
  background: #FCFBF9;
  border-radius: 0 0 12px 12px;
}
.survey-add { display: flex; gap: 8px; align-items: center; }
.survey-add select { max-width: 240px; }
.survey-head { margin-top: 40px; }

/* ---- AI style extras (identity guard, reference images, test) ---- */

.ai-style-guard { margin-top: 8px; }
.ai-style-refs {
  margin-top: 10px;
  border-top: 1px dashed var(--line, #E5E0D8);
  padding-top: 10px;
}
.ai-refs-hint { font-size: 12.5px; margin: 0 0 8px; }
.ai-refs-empty { margin: 0 0 8px; }
.ai-ref-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; }
.ai-ref-slot-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.ai-ref-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  background: #F4F1EB;
  border-radius: 100px;
  padding: 3px 6px 3px 12px;
}
.ai-ref-file a { color: inherit; text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ai-ref-del {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--danger, #B4462E);
  padding: 2px 6px;
}
.ai-refs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.ai-ref-slot-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ai-ref-slot-pick select { width: auto; }
.ai-test-result { margin-top: 10px; }
.ai-test-result img { max-width: 220px; border-radius: 10px; display: block; }
.ai-refs-savefirst { margin-top: 8px; }

.ai-style-preview {
  margin-top: 10px;
  border-top: 1px dashed var(--line, #E5E0D8);
  padding-top: 10px;
}
.ai-preview-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ai-preview-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; display: block; }

/* ---- Event report ---- */

.report-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.report-tile {
  background: #fff;
  border: 1px solid var(--line, #E3DED6);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-tile strong { font-size: 26px; letter-spacing: -0.02em; }
.report-tile span { font-size: 13px; color: var(--muted); }
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 800px) { .report-grid { grid-template-columns: 1fr; } }
.report-table { width: 100%; border-collapse: collapse; }
.report-table td { padding: 8px 4px; border-bottom: 1px solid var(--line, #E3DED6); }
.report-table td:last-child { text-align: right; font-weight: 600; }
.report-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-top: 18px;
}
.report-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  height: 100%;
  position: relative;
}
.report-bar-fill {
  width: 100%;
  max-width: 34px;
  background: var(--yellow, #FFD074);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
}
.report-bar-count { font-size: 11px; font-weight: 600; }
.report-bar-label { font-size: 11px; color: var(--muted); }
.report-stack {
  width: 100%;
  max-width: 34px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}
.report-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.report-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.report-legend-item i, .report-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}
.report-legend-item i { margin-right: 0; }

@media print {
  .topbar, .view-head .btn, .view-head button, #report-back { display: none !important; }
  body { background: #fff; }
}

.autosave-state {
  font-size: 13px;
  color: var(--muted);
  align-self: center;
}
.autosave-state.is-error { color: #B23A2A; }

/* ---- Release notes ---- */

.news-doc { max-width: 70ch; }
.news-doc h1 { font-size: 26px; margin: 0 0 6px; }
.news-doc h2 { font-size: 20px; margin: 28px 0 6px; }
.news-doc h3 { font-size: 15px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.news-doc p { margin: 0 0 10px; line-height: 1.55; }
.news-doc hr { border: none; border-top: 1px solid var(--line, #E3DED6); margin: 26px 0; }
.news-list { margin: 0 0 12px; padding-left: 20px; }
.news-list li { margin-bottom: 7px; line-height: 1.55; }
.news-doc code { background: #F4F1EB; border-radius: 5px; padding: 1px 5px; font-size: 13px; }
a.version { text-decoration: none; }
a.version:hover { text-decoration: underline; }

/* ---- Server log ---- */

.log-level {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.log-error { background: #F7DDD6; color: #B23A2A; }
.log-warn { background: #FFE7B8; color: #7A5A16; }
.log-time { white-space: nowrap; }
.log-message { word-break: break-word; max-width: 560px; }

/* ---- Devices ---- */

.device-assign { width: auto; max-width: 220px; margin-right: 6px; }
.battery { font-weight: 600; }
.battery.ok { color: #2C7A49; }
.battery.mid { color: #9A6B00; }
.battery.low { color: var(--danger, #B4462E); }

/* ---- Loading ---- */

.loading { color: var(--muted); text-align: center; padding: 48px 0; }

/* ---- Mobile ---- */

@media (max-width: 680px) {
  .page { padding: 20px 16px 72px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branding { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 16px; }
  .topbar-inner { padding: 10px 16px; }
  .topbar-right { margin-left: 0; }
  /* The field name plus ↑ ↓ Slett do not fit on one line on a phone —
     put the controls on their own row rather than outside the viewport. */
  .survey-field-row { flex-wrap: wrap; }
  .survey-field-name { flex: 1 1 100%; }
  .survey-add { flex-wrap: wrap; }
  .survey-add select { max-width: none; flex: 1 1 160px; }
}
