:root {
  --bg: #fbf5f2;
  --bg-soft: #f6ebe6;
  --bg-elevated: #ffffff;
  --text: #2a2024;
  --text-muted: #837278;
  --primary: #2d4a3a;
  --primary-hover: #1f352a;
  --accent: #c98a8a;
  --accent-soft: #f4dcd6;
  --accent-deep: #a96565;
  --rose-tint: rgba(201, 138, 138, 0.08);
  --border: rgba(58, 38, 44, 0.09);
  --border-strong: rgba(58, 38, 44, 0.18);
  --shadow-sm: 0 1px 2px rgba(60, 30, 35, 0.04);
  --shadow: 0 6px 22px rgba(120, 70, 80, 0.08);
  --shadow-lg: 0 14px 38px rgba(120, 70, 80, 0.12);
  --radius: 18px;
  --radius-sm: 10px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 138, 138, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(244, 220, 214, 0.5), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.018em;
  margin: 0 0 0.5rem;
  color: var(--text);
  font-variation-settings: "opsz" 36;
}
h1 { font-size: 2.6rem; line-height: 1.08; font-weight: 500; font-variation-settings: "opsz" 144; }
h2 { font-size: 1.95rem; margin-top: 2.5rem; font-variation-settings: "opsz" 96; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; }
em, .italic { font-family: var(--font-serif); font-style: italic; }
p { margin: 0 0 1rem; }

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header {
  background: rgba(255, 250, 248, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 144;
}
.brand:hover { color: var(--accent-deep); text-decoration: none; }
.brand-mark { color: var(--accent); margin-right: 0.4rem; font-style: normal; }
.site-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--primary); text-decoration: none; }
.site-nav a.active { color: var(--primary); }
.site-nav a.nav-logout {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  color: var(--accent-deep);
  font-size: 0.85rem;
}
.site-nav a.nav-logout:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
}
.shopping-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, #2a1410 0%, #4a1a0a 50%, #1a0a06 100%);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  color: #fff8e1;
  text-decoration: none;
  margin: 2rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shopping-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  text-decoration: none;
  color: #fff;
}
.shopping-card .sedlar {
  flex: 0 0 auto;
  width: 110px;
  height: 110px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(255,120,40,0.25);
}
.shopping-card .sedlar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shopping-card .text { display: flex; flex-direction: column; gap: 0.25rem; }
.shopping-card .text h3 { margin: 0; font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600; color: #fff; }
.shopping-card .text p { margin: 0; color: rgba(255,248,225,0.78); font-size: 0.95rem; }
.shopping-card .arrow { margin-left: auto; font-size: 1.4rem; opacity: 0.7; }

@media (max-width: 600px) {
  .site-header .container { flex-wrap: wrap; row-gap: 0.4rem; }
  .site-nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { gap: 1rem; font-size: 0.9rem; white-space: nowrap; padding-bottom: 0.15rem; }
  .site-nav li { flex: 0 0 auto; }
  .brand { font-size: 1rem; }
}

/* Hero */
.hero {
  position: relative;
  height: min(70vh, 600px);
  min-height: 380px;
  background-image: url('/static/hero.jpg');
  background-size: cover;
  background-position: center;
  margin-bottom: 0;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 1;
}
.hero-content {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 0 3rem;
  color: white;
  z-index: 2;
}
.hero-content h1 {
  color: white;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  margin: 0;
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.hero-content .lead {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.95;
  margin: 0.6rem 0 0;
  max-width: 620px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

main.container { padding-top: 3rem; padding-bottom: 4rem; }

/* Stats (legacy — bibehålls för andra sidor) */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0 3rem;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: block;
  color: var(--text);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  text-decoration: none;
  color: var(--text);
}
.stat-card .num {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 500;
  display: block;
  line-height: 1;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.stat-card .label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Section heading med kursivt eyebrow */
.section-eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent-deep);
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem;
  font-variation-settings: "opsz" 96;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  margin: 0 0 0.4rem;
}
.section-intro {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 640px;
}

/* Byggnadkort — hjärtat av förstasidan */
.byggnad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  margin: 1.25rem 0 3rem;
}
.byggnad-card {
  position: relative;
  background: linear-gradient(155deg, #ffffff 0%, var(--accent-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.byggnad-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.55), transparent 60%);
  pointer-events: none;
}
.byggnad-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  text-decoration: none;
  color: var(--text);
}
.byggnad-card .ikon {
  width: 38px;
  height: 38px;
  color: var(--accent-deep);
  margin-bottom: 0.25rem;
}
.byggnad-card .ikon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.5; }
.byggnad-card .namn {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variation-settings: "opsz" 96;
}
.byggnad-card .antal {
  font-size: 0.92rem;
  color: var(--text-muted);
}
.byggnad-card .antal strong {
  font-family: var(--font-serif);
  color: var(--accent-deep);
  font-weight: 500;
  font-size: 1.05rem;
}
.byggnad-card .pil {
  position: absolute;
  right: 1.3rem;
  bottom: 1.3rem;
  color: var(--accent-deep);
  font-size: 1.4rem;
  font-family: var(--font-serif);
  font-style: italic;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.byggnad-card:hover .pil { transform: translateX(4px); opacity: 1; }

/* Snabb-genvägar (Inventarier / System / TV / Bilder) */
.shortcut-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin: 0.5rem 0 2.75rem;
}
.shortcut {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.shortcut:hover {
  border-color: var(--accent);
  background: var(--rose-tint);
  text-decoration: none;
  color: var(--text);
  transform: translateY(-1px);
}
.shortcut .num {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--accent-deep);
  line-height: 1;
  min-width: 1.8rem;
  font-variation-settings: "opsz" 96;
}
.shortcut .text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.shortcut .text strong {
  font-weight: 600;
  font-size: 0.98rem;
}
.shortcut .text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Card grid for items */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: block;
  color: var(--text);
  text-decoration: none;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
  text-decoration: none;
}
.card h3 {
  margin: 0 0 .35rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.card .submeta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.card-thumb {
  display: block;
  width: calc(100% + 2.5rem);
  height: 160px;
  object-fit: cover;
  margin: -1.25rem -1.25rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-with-photo h3 { margin-top: 0; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}
.photo-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 4 / 3;
}
.photo-item a { display: block; height: 100%; }
.photo-item img { transition: transform 0.25s ease; }
.photo-item:hover img { transform: scale(1.03); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 14, 12, 0.94);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 96vw; max-height: 92vh;
  object-fit: contain; border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform-origin: center center;
  will-change: transform;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  cursor: zoom-in;
}
.lightbox { touch-action: none; overscroll-behavior: contain; }
.lightbox.zoomed img { cursor: grab; }
.lightbox.zoomed .lb-prev, .lightbox.zoomed .lb-next, .lightbox.zoomed .lb-counter { opacity: 0.25; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, 0.12); color: #fff;
  border: none; border-radius: 50%; width: 46px; height: 46px;
  font-size: 2rem; line-height: 1; cursor: pointer; padding: 0;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.28); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8); font-size: 0.85rem; letter-spacing: 0.05em;
}
@media (max-width: 600px) {
  .lightbox img { max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .lb-prev, .lb-next { display: none; }   /* svep i stället */
}
body.lb-open { overflow: hidden; }
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.photo-item form {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  margin: 0;
}
.photo-item form button {
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 28px;
  cursor: pointer;
}
.photo-item form button:hover {
  background: rgba(160, 40, 40, 0.85);
  border-color: transparent;
}

.qr-section { border-left: 3px solid #6e756f; }
.qr-inline {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.qr-inline img {
  background: white;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.qr-inline code {
  font-size: 0.8rem;
  word-break: break-all;
}

.system-list {
  display: grid;
  gap: 1rem;
}
.system-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.system-item header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.system-item header strong {
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}
.system-item header .actions {
  margin-left: auto;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  font-size: 0.85rem;
}
.system-item header .actions a {
  color: var(--text-muted);
  text-decoration: none;
}
.system-item header .actions a:hover { color: var(--primary); }
.system-item header .actions form { margin: 0; display: inline; }
.system-item .varde { color: var(--text); }
.system-item .varde > *:first-child { margin-top: 0; }
.system-item .varde > *:last-child { margin-bottom: 0; }

.pill-success {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-link:hover {
  color: #a02828;
  background: none;
  border: none;
  text-decoration: underline;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.55rem 0;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
}

.byggnad-section { margin-bottom: 2.5rem; }
.byggnad-section h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-style: italic;
  color: var(--accent-deep);
}
.byggnad-section h2 small {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  font-style: normal;
}

/* Pills */
.pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.pill-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.pill-rose {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: transparent;
}

/* Forms */
form { margin: 0; }
.form-grid {
  display: grid;
  gap: 1.25rem;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.field-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
  font-weight: 400;
}
input[type="text"], input[type="date"], input[type="search"],
input[type="email"], input[type="password"], input[type="url"], input[type="number"],
select, textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 74, 58, 0.15);
}
textarea { font-family: var(--font-sans); resize: vertical; min-height: 80px; }
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e756f' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.btn, button, [role="button"] {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover, button:hover, [role="button"]:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  text-decoration: none;
  color: white;
}
.btn:active, button:active { transform: translateY(1px); }
.btn-secondary, button.secondary, [role="button"].secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover, button.secondary:hover, [role="button"].secondary:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-muted);
}
.btn-danger {
  background: transparent;
  color: #a02828;
  border: 1px solid #d4a8a8;
}
.btn-danger:hover {
  background: #f8e8e8;
  color: #7a1f1f;
  border-color: #a02828;
}

/* Filter bar */
.filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem;
  margin-bottom: 2rem;
  align-items: end;
}
@media (max-width: 640px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar button { grid-column: 1 / -1; }
}

/* Page header */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-header h1 { margin: 0; }
.page-header .count {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
}

/* Detail page */
.detail-meta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.detail-meta > div { min-width: 140px; }
.detail-meta dt {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
  font-weight: 500;
}
.detail-meta dd {
  font-size: 0.98rem;
  font-weight: 500;
  margin: 0;
}

.guide-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.guide-section h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.guide-section ul, .guide-section ol { padding-left: 1.25rem; }
.guide-section p:last-child { margin-bottom: 0; }
.guide-section.guide-snabb { border-left: 3px solid var(--accent); }
.guide-section.guide-full { border-left: 3px solid var(--primary); }
.guide-section.guide-fel { border-left: 3px solid #c87a5a; }

.action-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.empty p { margin-bottom: 1rem; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer small { color: var(--text-muted); }

/* Tables (fallback) */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Utility */
.muted { color: var(--text-muted); }
.mt-2 { margin-top: 2rem; }

/* ---------- Besök / kalender ---------- */
.varning-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  margin: 0 0 1.6rem;
  color: var(--accent-deep);
}
.varning-banner ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.varning-banner li { margin: .15rem 0; }

.besok-datum { color: var(--text-muted); font-weight: 500; }

.kal-nav {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; margin-bottom: 1.2rem;
}
.kal-range { font-family: var(--font-serif); font-size: 1.1rem; }
.kal-idag { color: var(--accent-deep); border-color: var(--accent); font-weight: 500; }

.kal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kal {
  min-width: 640px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}
.kal-row { display: grid; grid-template-columns: 140px 1fr; border-top: 1px solid var(--border); }
.kal-row:first-child { border-top: none; }
.kal-head { position: sticky; top: 0; z-index: 2; background: var(--bg-soft); }

.kal-label {
  padding: .55rem .7rem; display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--border); background: var(--bg-soft);
}
.kal-label strong { font-size: .92rem; }
.kal-label small { color: var(--text-muted); font-size: .75rem; }
.kal-corner { justify-content: flex-end; }

.kal-track { display: grid; position: relative; }
.kal-dayhead {
  text-align: center; padding: .35rem 0; font-size: .72rem; line-height: 1.15;
  border-left: 1px solid var(--border); color: var(--text-muted);
}
.kal-dayhead .kal-dom { display: block; font-weight: 600; color: var(--text); font-size: .9rem; }
.kal-dayhead.is-weekend { background: var(--rose-tint); }
/* idag: bara dagrubriken markeras (diskret), inte hela kolumnen */
.kal-dayhead.is-today { color: var(--accent-deep); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.kal-dayhead.is-today .kal-dom { color: var(--accent-deep); }

.kal-cell { border-left: 1px solid var(--border); min-height: 30px; }
.kal-cell.is-weekend { background: var(--rose-tint); }
/* tunn lodrät accentlinje markerar idag-kolumnen utan att fylla den */
.kal-cell.is-today { box-shadow: inset 1px 0 0 var(--accent); }

.kal-bar-wrap { pointer-events: none; }
.kal-bar {
  pointer-events: auto;
  margin: 2px 3px; padding: 0 .4rem; border-radius: 7px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; gap: .35rem; justify-content: space-between;
  font-size: .74rem; overflow: hidden; white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.kal-bar a { color: #fff; text-decoration: none; display: flex; gap: .35rem; width: 100%; justify-content: space-between; overflow: hidden; }
.kal-bar-namn { overflow: hidden; text-overflow: ellipsis; }
.kal-bar-pers { opacity: .8; flex: none; }

/* klickbara celler (admin) */
.kal-cell-add { cursor: pointer; transition: background .12s; text-decoration: none; }
.kal-cell-add:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.kal-cell-add:hover.is-today, .kal-cell-add:hover.is-weekend { background: var(--accent-soft); }

/* veckonummer-rad */
.kal-weekhead { background: var(--bg-soft); }
.kal-week {
  text-align: center; font-size: .7rem; font-weight: 600; color: var(--text-muted);
  padding: .2rem 0; border-left: 1px solid var(--border);
}

/* snabb-registrering i kalendern */
.kal-quickadd {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem .8rem; margin-bottom: 1.2rem;
}
.kal-quickadd label { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-muted); margin: 0; }
.kal-quickadd input, .kal-quickadd select { margin: 0; }
.kal-quickadd input[name="gast_namn"] { flex: 1 1 12rem; min-width: 10rem; }
.kal-quickadd .qa-num { width: 4.5rem; }
.kal-quickadd .btn { flex: none; }

/* svenska helgdagar (röda dagar) */
.kal-dayhead.is-holiday { background: #fbe3e1; color: var(--accent-deep); }
.kal-dayhead.is-holiday .kal-dom { color: var(--accent-deep); }
.kal-hd-dot { display: block; color: var(--accent-deep); font-size: .7rem; line-height: .4; }
.kal-cell.is-holiday, .kal-cell-add.is-holiday { background: rgba(201, 138, 138, 0.13); }
.kal-cell-add.is-holiday:hover { background: var(--accent-soft); }
.kal-helglista {
  margin: .9rem 0 0; font-size: .82rem; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: baseline;
}
.kal-helg-item { white-space: nowrap; }
.kal-helg-item em { color: var(--accent-deep); font-style: normal; font-weight: 500; }

/* avrese-markering: halv nubb in på avresedagen (de sover natten in mot dagen) */
.kal-depart {
  pointer-events: auto;
  justify-self: start;
  width: 42%;
  margin: 2px 0;
  background: var(--primary);
  opacity: .45;
  border-radius: 0 7px 7px 0;
}

/* händelser (Almedalsveckan, fester, etc.) — band överst i kalendern */
.kal-eventrow .kal-label { background: var(--bg-elevated); }
.kal-event {
  pointer-events: auto;
  margin: 2px 3px; padding: 0 .5rem; border-radius: 7px;
  display: flex; align-items: center;
  font-size: .73rem; font-weight: 600; overflow: hidden; white-space: nowrap;
  color: #fff; box-shadow: var(--shadow-sm);
  background: var(--kat-color, #7c6f9e);
}
.kal-event a { color: #fff; text-decoration: none; display: block; width: 100%; overflow: hidden; }
.kal-event-namn { overflow: hidden; text-overflow: ellipsis; }
.kal-event-namn em { font-style: normal; font-weight: 400; opacity: .8; }

/* kategori-färger (kalenderband + listpiller via .handelse-pill) */
.kal-event[data-kat="festival"], .handelse-pill[data-kat="festival"] { --kat-color:#7c5cbf; }
.kal-event[data-kat="fest"],     .handelse-pill[data-kat="fest"]     { --kat-color:#c2557a; }
.kal-event[data-kat="marknad"],  .handelse-pill[data-kat="marknad"]  { --kat-color:#4e8a6b; }
.kal-event[data-kat="konsert"],  .handelse-pill[data-kat="konsert"]  { --kat-color:#3f7bb0; }
.kal-event[data-kat="sport"],    .handelse-pill[data-kat="sport"]    { --kat-color:#c77f3a; }
.kal-event[data-kat="annat"],    .handelse-pill[data-kat="annat"]    { --kat-color:#6f7585; }

.handelse-pill {
  background: var(--kat-color, #6f7585); color: #fff;
  border-color: transparent;
}

/* Innehållsförteckning på /system ("Bra att veta") */
.info-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}
.info-toc .chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
}
.info-toc .chip:hover { border-color: var(--accent); background: var(--rose-tint); }
.byggnad-section { scroll-margin-top: 1rem; }

/* Flyttlistan */
.info-toc .chip small { color: var(--text-muted); margin-left: 0.25rem; }
.info-toc .chip.vald { background: var(--primary); border-color: var(--primary); color: #fff; }
.info-toc .chip.vald small { color: rgba(255,255,255,0.75); }
.info-toc .chip.obestamt:not(.vald) { border-color: var(--accent); }
.flytt-ny { margin: 0 0 1.5rem; }
.flytt-ny > summary { display: inline-block; list-style: none; cursor: pointer; }
.flytt-ny > summary::-webkit-details-marker { display: none; }
.flytt-ny[open] > summary { margin-bottom: 1rem; }
.flytt-ny form { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.flytt-matt { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flytt-lista { list-style: none; margin: 0; padding: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.flytt-rad { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); scroll-margin-top: 1rem; }
.flytt-rad:last-child { border-bottom: 0; }
.flytt-rad.obestamt { box-shadow: inset 3px 0 0 var(--accent); }
.flytt-rad:target { background: var(--rose-tint); }
.flytt-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1 1 14rem; }
.flytt-info .submeta { font-size: 0.82rem; color: var(--text-muted); }
.flytt-till { display: flex; align-items: center; gap: 0.6rem; flex: 0 1 auto; }
.flytt-till select { min-width: 11rem; }
.flytt-redigera { font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 600px) {
  .flytt-matt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flytt-till { width: 100%; }
  .flytt-till select { flex: 1; min-width: 0; }
}

/* Startsidan: "Viktiga datum" och kompakta platser */
.viktigt-card { background: var(--bg-elevated); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 0 0 2.5rem; box-shadow: var(--shadow-sm); }
.viktigt-card .section-title { margin-top: 0.1rem; }
.viktigt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.viktigt-card .varde ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.viktigt-card .varde li { margin: 0.35rem 0; }
.viktigt-card .varde p:last-child { margin-bottom: 0; }
.byggnad-grid.kompakt { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 2.5rem; }
.byggnad-grid.kompakt .byggnad-card { min-height: 0; padding: 0.9rem 1.1rem; }
.byggnad-grid.kompakt .byggnad-card .namn { font-size: 1.1rem; }
.byggnad-grid.kompakt .byggnad-card .ikon { margin-bottom: 0.35rem; }
.byggnad-grid.kompakt .byggnad-card .pil { right: 1rem; bottom: 0.9rem; font-size: 1.1rem; }

/* Flyttlistan: foton → förslag */
.foto-sektion { margin: 0 0 1.5rem; display: grid; gap: 1rem; }
.foto-upp { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }
.foto-upp .submeta { flex-basis: 100%; margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.foto-knapp { position: relative; overflow: hidden; cursor: pointer; }
.foto-knapp input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-val { display: flex; flex-wrap: wrap; gap: 0.6rem; flex: 1 1 16rem; }
.foto-val input { flex: 1 1 12rem; }
.foto-vantar { margin: 0; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); background: var(--rose-tint); font-size: 0.9rem; }
.foto-forslag { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; background: var(--bg-elevated); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1rem; }
.foto-tumme img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.foto-innehall { display: grid; gap: 0.6rem; min-width: 0; }
.foto-rubrik { margin: 0; }
.foto-rubrik .submeta { font-size: 0.85rem; color: var(--text-muted); }
.foto-knappar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.foto-forslag .flytt-lista { border-radius: var(--radius-sm); }
.flytt-tumme img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
@media (max-width: 600px) {
  .foto-forslag { grid-template-columns: 1fr; }
  .foto-tumme img { width: 100%; height: 160px; }
}
.foto-val[hidden] { display: none; }

/* Flyttlistan: inventering per rum */
.rum-inventering { margin: 0 0 1.5rem; }
.rum-inventering .submeta { font-size: 0.85rem; color: var(--text-muted); }
.rum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.rum-kort { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.8rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); text-decoration: none; }
.rum-kort .namn { font-weight: 600; font-size: 0.92rem; }
.rum-kort .submeta { font-size: 0.78rem; }
.rum-kort.paborjat { border-style: solid; background: var(--bg-elevated); }
.rum-kort.vald { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.rum-kort:hover { border-color: var(--accent); text-decoration: none; }

/* Inredning */
.inredning-budget { margin: -0.5rem 0 1.25rem; font-size: 0.9rem; color: var(--text-muted); }
.inredning-ny-i-rum { margin: -0.4rem 0 0.9rem; font-size: 0.88rem; }
.inredning-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.inredning-kort { display: flex; flex-direction: column; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.inredning-kort:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; }
.inredning-kort.status-köpt, .inredning-kort.status-beslutat { border-color: var(--primary); }
.inredning-bild { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); display: block; }
.inredning-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inredning-tom { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; color: var(--accent-deep); opacity: 0.7; }
.inredning-antal { position: absolute; right: 0.5rem; bottom: 0.5rem; background: rgba(0,0,0,0.55); color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px; }
.inredning-text { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.8rem 0.9rem 0.9rem; }
.inredning-text .submeta { font-size: 0.82rem; color: var(--text-muted); }
.inredning-etiketter { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; }
.inredning-status { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem; }
.inredning-status .chip { font: inherit; font-size: 0.9rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer; color: var(--text); }
.inredning-status .chip.vald { background: var(--primary); border-color: var(--primary); color: #fff; }
.inredning-fakta { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0 0 1rem; }
.inredning-fakta dt { color: var(--text-muted); font-size: 0.88rem; }
.inredning-fakta dd { margin: 0; overflow-wrap: anywhere; }
.inredning-bild-upp { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }
@media (max-width: 600px) {
  .inredning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .inredning-text { padding: 0.6rem 0.7rem 0.75rem; }
}

/* Flyttlistan: förslag per rum och innehåll i saker */
.foto-rumsgrupp { display: grid; gap: 0.6rem; }
.foto-rumshuvud { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.foto-rumshuvud h3 { margin: 0; font-family: var(--font-serif); font-weight: 500; font-size: 1.3rem; }
.foto-rumshuvud h3 small { font-family: var(--font-sans); font-size: 0.82rem; color: var(--text-muted); font-weight: 400; margin-left: 0.3rem; }
details.foto-forslag { display: block; padding: 0.6rem 0.8rem; }
details.foto-forslag > summary { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; list-style: none; }
details.foto-forslag > summary::-webkit-details-marker { display: none; }
details.foto-forslag > summary .submeta { font-size: 0.85rem; color: var(--text-muted); }
details.foto-forslag[open] > summary { margin-bottom: 0.75rem; }
details.foto-forslag[open] > summary .foto-mini { display: none; }
.foto-mini { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
details.foto-forslag .foto-innehall { display: grid; gap: 0.6rem; }
.flytt-innehall { flex-basis: 100%; margin: 0.15rem 0 0; }
.flytt-innehall > summary { cursor: pointer; font-size: 0.85rem; color: var(--accent-deep); width: max-content; }
.flytt-innehall[open] > summary { margin-bottom: 0.5rem; }
.flytt-innehall .flytt-lista { margin-left: 0.75rem; border-left: 3px solid var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.flytt-innehall .flytt-rad { padding: 0.5rem 0.8rem; }
.innehall-verktyg { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.6rem 0 0 0.75rem; }
.innehall-verktyg .submeta { flex-basis: 100%; margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.innehall-ny { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1 1 18rem; }
.innehall-ny input[type=text] { flex: 1 1 10rem; }
.innehall-ny input[type=number] { width: 4.5rem; }
.innehall-ny input[type=number] { width: 4.5rem; flex: 0 0 4.5rem; }
