/* ═══════════════════════════════════════
   UTLAGG.SE – Stylesheet
   ═══════════════════════════════════════ */

:root {
  --ink: #1a1a2e;
  --ink-soft: #4a4a6a;
  --ink-muted: #8888aa;
  --paper: #fafaf8;
  --paper-warm: #f4f2ee;
  --accent: #1b4f8a;
  --accent-light: #e8f0fb;
  --success: #1a7a4a;
  --danger: #c0392b;
  --border: #ddddd5;
  --border-focus: #1b4f8a;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-sm: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper-warm);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ─── HEADER ─── */
header {
  background: var(--ink);
  color: white;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.header-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-title span.badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: white;
  padding: 3px 8px;
  border-radius: 20px;
}
.header-actions { display: flex; gap: 10px; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #15407a; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,79,138,0.4); }
.btn-primary:disabled,
.btn-primary.btn-loading { background: #5a82b0; cursor: not-allowed; transform: none; box-shadow: none; opacity: 0.85; }
.btn-primary.btn-loading .btn-label::before {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-ghost { background: rgba(255,255,255,0.12); color: white; border: 1px solid rgba(255,255,255,0.2); }
.btn-ghost:hover { background: rgba(255,255,255,0.2); }
.btn-danger { background: #fdedf0; color: var(--danger); border: 1px solid #f0d0cd; padding: 5px 10px; font-size: 13px; }
.btn-danger:hover { background: #f9d5d5; }
.btn-add {
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px dashed #9ab8dd;
  width: 100%;
  padding: 11px;
  margin-top: 8px;
  font-size: 14px;
  justify-content: center;
}
.btn-add:hover { background: #ddeaf7; border-style: solid; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─── MAIN LAYOUT ─── */
main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ─── CARDS ─── */
.card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.card-title .icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.icon-blue { background: var(--accent-light); }
.icon-green { background: #e8f7f0; }
.icon-amber { background: #fef7e0; }
.icon-rose { background: #fdedf0; }
.card-body { padding: 20px 24px; }

/* ─── FORM ELEMENTS ─── */
.form-grid { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input, .field select, .field textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: white;
  transition: border-color 0.15s;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(27,79,138,0.12);
}
.field input[readonly] { background: var(--paper-warm); color: var(--ink-soft); }

/* ─── DATE FIELD HIGHLIGHT ─── */
.field-date {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}
.field-date label { color: var(--accent) !important; }
.field-date input { font-weight: 700; background: white; }

/* ─── TABLE ROWS ─── */
.entry-row {
  display: grid;
  gap: 10px;
  align-items: end;
  padding: 18px 0;
  border-bottom: 2px solid #c8c8be;
  animation: slideIn 0.2s ease;
}
.entry-row:last-of-type { border-bottom: none; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.entry-row .field label { font-size: 11px; }

/* Utlägg: ta bort den heldragna linjen under inmatningsfälten –
   den streckade linjen på receipt-row utgör separator */
#expense-rows .entry-row {
  border-bottom: none;
  padding-bottom: 4px;
}

/* Tydlig avgränsning mellan varje utlägg */
#expense-rows > div {
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 2px solid #c8c8be;
}
#expense-rows > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Traktamente: flytta separatorn till wrapper-div och lägg till beräkningsrad */
#allowance-rows .entry-row {
  border-bottom: none;
  padding-bottom: 4px;
}
#allowance-rows > div {
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 2px solid #c8c8be;
}
#allowance-rows > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* ─── TRAKTAMENTE ALTERNATIV (boende) ─── */
.allowance-options {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 6px 0 2px;
}
.allowance-options .field {
  flex: 0 0 auto;
}
.allowance-options .field select,
.allowance-options .field input {
  font-size: 13px;
  padding: 7px 10px;
}

/* ─── TRAKTAMENTE MÅLTIDER ─── */
.allowance-meals {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: nowrap;
  padding: 4px 0 2px;
}
.allowance-meals .field {
  flex: 0 0 auto;
}
.allowance-meals .field label,
.allowance-meals .field input {
  font-size: 13px;
}
.allowance-meals .field input {
  padding: 7px 10px;
}
.allowance-meal-field {
  min-width: 90px;
}
.allowance-meal-field input {
  width: 90px;
}
.meal-rate {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ─── TRAKTAMENTE BELOPP + BERÄKNING + RADERA ─── */
.allowance-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 2px;
}
.allowance-amount-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1;
}
.allowance-amount-field input {
  font-size: 14px;
  font-weight: 600;
  padding: 7px 12px;
  min-width: 110px;
}

/* ─── TRAKTAMENTE BERÄKNINGSRAD ─── */
.allowance-breakdown {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.allowance-breakdown em { font-style: italic; }

/* ─── SECTION TOTALS ─── */
.section-total {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.section-total strong { font-size: 18px; font-weight: 600; color: var(--ink); }

/* ─── SUMMARY ─── */
#summary {
  background: var(--ink);
  color: white;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
}
.summary-header { padding: 20px 28px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.summary-header h2 { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; }
.summary-header p { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.summary-rows { padding: 16px 28px; display: flex; flex-direction: column; gap: 10px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.summary-row .label { color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 8px; }
.summary-row .amount { font-weight: 600; font-size: 16px; }
.summary-total-row {
  background: var(--accent);
  padding: 14px 16px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 8px;
}
.summary-total-row .label { font-weight: 600; font-size: 15px; }
.summary-total-row .amount { font-size: 26px; font-weight: 700; font-family: 'Cormorant Garamond', serif; }
.note-box {
  margin: 0 28px 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}

/* ─── INFO CHIP ─── */
.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ─── SIGNATURE PADS ─── */
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 4px; }
.sig-pad-wrap { display: flex; flex-direction: column; gap: 10px; }
.sig-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.sig-canvas-outer {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fdfdfb;
  overflow: hidden;
  cursor: crosshair;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sig-canvas-outer:hover { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(27,79,138,0.10); }
.sig-canvas-outer.active { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(27,79,138,0.15); }
.sig-canvas { display: block; width: 100%; height: 130px; touch-action: none; }
.sig-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-muted);
  pointer-events: none; transition: opacity 0.2s; gap: 6px;
}
.sig-hint::before { content: '✍'; font-size: 16px; }
.sig-canvas-outer.has-sig .sig-hint { opacity: 0; }
.sig-controls { display: flex; justify-content: flex-end; margin-top: -4px; }
.sig-meta { display: flex; gap: 10px; align-items: flex-end; }

/* ─── RECEIPT MODAL ─── */
.receipt-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 24px;
}
.receipt-modal-overlay.open { display: flex; }
.receipt-modal {
  background: white; border-radius: 12px;
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.receipt-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--paper); flex-shrink: 0;
}
.receipt-modal-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.receipt-modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--ink-muted); padding: 0 4px; line-height: 1; }
.receipt-modal-close:hover { color: var(--ink); }
.receipt-modal-body { overflow: auto; padding: 16px; display: flex; align-items: center; justify-content: center; }
.receipt-modal-img { max-width: 100%; max-height: calc(90vh - 80px); border-radius: 4px; display: block; }
.receipt-modal-pdf-pages { display: none; flex-direction: column; align-items: center; gap: 12px; overflow-y: auto; max-height: calc(88vh - 60px); width: 78vw; }
.pdf-modal-page { max-width: 100%; display: block; border: 1px solid #ddd; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.pdf-modal-loading { padding: 40px 20px; color: #777; font-size: 14px; text-align: center; }

/* ─── RECEIPT UPLOAD ─── */
.receipt-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.receipt-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.btn-receipt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  border: 1.5px dashed #9ab8dd; background: var(--accent-light);
  color: var(--accent); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn-receipt:hover { background: #ddeaf7; border-style: solid; }
.receipt-preview {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-warm); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 10px;
  font-size: 12px; color: var(--ink-soft);
}
.receipt-thumb {
  width: 32px; height: 32px; object-fit: cover;
  border-radius: 3px; border: 1px solid var(--border);
}
.receipt-pdf-thumb {
  font-size: 24px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center;
  transition: transform 0.15s;
}
.receipt-pdf-thumb:hover { transform: scale(1.15); }
.bilaga-badge {
  display: inline-flex; align-items: center;
  background: #fff3cd; border: 1px solid #ffc107;
  color: #856404; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 12px; white-space: nowrap;
}

/* ─── PRIVACY BUTTON ─── */
.btn-privacy {
  background: #f0f6ff;
  color: var(--accent);
  border: 1px solid #d0e3f7;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.btn-privacy:hover { background: #ddeaf7; border-color: #9ab8dd; }

/* ─── COFFEE BUTTON ─── */
.btn-coffee {
  display: inline-block;
  background: #fff8e7;
  color: #7a5c1e;
  border: 1px solid #f0d98a;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  text-decoration: none;
  cursor: pointer;
}
.btn-coffee:hover { background: #fef0c0; border-color: #d4aa3a; }

/* ─── PRIVACY MODAL ─── */
.privacy-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 24px;
}
.privacy-modal-overlay.open { display: flex; }
.privacy-modal {
  background: white; border-radius: 12px;
  max-width: 560px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.privacy-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: #f0f6ff;
}
.privacy-modal-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.privacy-modal-body {
  padding: 20px 24px;
  font-size: 14px; color: var(--ink-soft); line-height: 1.7;
  display: flex; flex-direction: column; gap: 14px;
}

/* ─── FOOTER ─── */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 12px; color: var(--ink-muted);
  border-top: 1px solid var(--border);
  background: var(--paper-warm);
  display: flex; justify-content: center; align-items: center;
  gap: 8px; flex-wrap: wrap;
}
.footer-sep { color: var(--border); }
.footer-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.footer-link:hover { text-decoration: underline; }

/* ─── SUPPORTRUTA ─── */
.support-box {
  background: var(--ink);
  color: white;
  padding: 28px 40px;
  display: flex;
  justify-content: center;
}
.support-box-inner {
  max-width: 1560px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.support-icon {
  font-size: 36px;
  flex-shrink: 0;
  line-height: 1;
}
.support-content {
  flex: 1;
  min-width: 200px;
}
.support-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: white;
}
.support-text {
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  line-height: 1.6;
  max-width: 60ch;
}
.support-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.support-btn-coffee {
  background: #f5a623;
  color: #1a1a2e;
  font-weight: 600;
  text-decoration: none;
}
.support-btn-coffee:hover {
  background: #e8951a;
  transform: translateY(-1px);
}
.support-btn-linkedin {
  background: #0a66c2;
  color: white;
  font-weight: 600;
  text-decoration: none;
}
.support-btn-linkedin:hover {
  background: #0958a8;
  transform: translateY(-1px);
}

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--ink); color: white;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 14px; box-shadow: var(--shadow-lg);
  transform: translateY(80px); transition: transform 0.3s ease;
  z-index: 999;
}
.toast.show { transform: translateY(0); }

/* ─── INTRO BOX ─── */
.intro-box {
  background: white; border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  margin-bottom: 20px; padding: 28px 32px;
}
.intro-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 900; color: var(--ink);
  margin-bottom: 10px; line-height: 1.2;
}
.intro-text { font-size: 16px; color: var(--ink-soft); line-height: 1.7; max-width: 72ch; margin-bottom: 20px; }
.intro-text strong { color: var(--ink); font-weight: 600; }
.intro-features { display: flex; flex-wrap: wrap; gap: 8px; }
.intro-feature {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper-warm); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px;
  font-size: 13px; color: var(--ink-soft); font-weight: 500;
}
.intro-feat-icon { font-size: 14px; }

/* ─── APPENDIX PRINT PAGES ─── */
.pv-appendix-page { page-break-before: always; break-before: page; padding-top: 4px; position: relative; }
.pv-appendix-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  background: #eef2f7; border: 1px solid #c5d0df; border-left: 4px solid #1a1a2e;
  border-radius: 4px; padding: 8px 12px; margin-bottom: 14px;
  break-inside: avoid; page-break-inside: avoid;
}
.pv-appendix-title { font-size: 13px; font-weight: 700; color: #1a1a2e; }
.pv-appendix-pagelabel { font-size: 9px; font-weight: 600; color: #555; margin-top: 3px; }
.pv-appendix-meta { font-size: 9px; color: #444; font-weight: 600; text-align: right; white-space: nowrap; }
.pv-appendix-img { max-width: 100%; max-height: 200mm; display: block; margin: 0 auto; border: 1px solid #ddd; }

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
  .support-box { padding: 20px 16px; }
  .support-box-inner { gap: 16px; }
  .support-actions { width: 100%; }
  header { padding: 16px; flex-wrap: wrap; gap: 12px; }
  .header-title { font-size: 18px; }
  .header-title span.badge { display: none; }
  .header-actions { gap: 6px; flex-wrap: wrap; }
  .btn { padding: 8px 12px; font-size: 13px; gap: 5px; }
  main { padding: 16px 12px 60px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  .card-body { padding: 14px 16px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .entry-row { grid-template-columns: 1fr 1fr !important; padding: 12px 0; gap: 8px; }
  .entry-row .field:last-child { grid-column: 1 / -1; align-items: flex-start !important; }
  .entry-row .field:last-child .btn-danger { width: 100%; justify-content: center; }
  #allowance-rows .entry-row .field:last-child { grid-column: auto !important; }
  .info-chip { font-size: 11px; padding: 3px 8px; }
  .sig-grid { grid-template-columns: 1fr; }
  .sig-meta { flex-direction: column; }
  .summary-rows { padding: 12px 16px; }
  .summary-header { padding: 16px 16px 12px; }
  .note-box { margin: 0 16px 16px; }
  .summary-total-row .amount { font-size: 20px; }
  .intro-box { padding: 20px 18px; }
  .intro-title { font-size: 22px; }
  .intro-text { font-size: 13px; }
}

@media (max-width: 480px) {
  header { padding: 12px 14px; }
  .header-title { font-size: 16px; gap: 8px; }
  .btn-ghost .btn-label { display: none; }
  .btn { padding: 8px 10px; }
  .btn-primary { padding: 8px 14px; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .form-grid-4 { grid-template-columns: 1fr; }
  .entry-row { grid-template-columns: 1fr !important; }
  .section-total { font-size: 12px; }
  .section-total strong { font-size: 16px; }
  .summary-row { font-size: 13px; padding: 8px 10px; }
  .summary-row .amount { font-size: 14px; }
  .summary-total-row { padding: 10px 12px; }
  .summary-total-row .label { font-size: 13px; }
  .summary-total-row .amount { font-size: 18px; }
  .toast { left: 14px; right: 14px; bottom: 14px; text-align: center; }
  .intro-title { font-size: 20px; }
  .intro-feature { font-size: 12px; }
}

/* ─── MOBIL LIGGANDE (LANDSCAPE) ─── */
/* Telefoner i liggande läge har typiskt ~360-500px höjd men bredare bredd */
@media (orientation: landscape) and (max-height: 500px) {
  /* Kompakt header – logotypen tar annars ~30% av skärmhöjden */
  header {
    padding: 6px 16px;
    flex-wrap: nowrap;
    position: relative; /* Sluta vara sticky för att spara vertikalt utrymme */
  }
  header img { height: 36px !important; }
  .header-title { font-size: 15px; gap: 8px; }
  .header-title span.badge { display: none; }
  .btn { padding: 6px 10px; font-size: 12px; gap: 4px; }
  .btn-ghost .btn-label { display: none; } /* Dölj textlabels, visa bara ikoner */
  .btn-primary { padding: 6px 12px; }
  .header-actions { gap: 6px; }

  /* Minska main-padding */
  main { padding: 10px 12px 40px; }

  /* Kompakt intro */
  .intro-box { padding: 12px 16px; margin-bottom: 12px; }
  .intro-title { font-size: 18px; margin-bottom: 6px; }
  .intro-text { font-size: 12px; margin-bottom: 10px; }

  /* Kompaktare kort */
  .card { margin-bottom: 12px; }
  .card-header { padding: 10px 14px; gap: 6px; }
  .card-body { padding: 10px 14px; }

  /* Underskriftsytor – lägre i landscape */
  .sig-canvas { height: 90px; }

  /* Integritetsmoodal – scrollbar i landscape */
  .privacy-modal {
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .privacy-modal-body {
    overflow-y: auto;
    max-height: calc(88vh - 60px);
  }

  /* Kvittomoodal – anpassa till liten höjd */
  .receipt-modal-img { max-height: calc(84vh - 56px); }
  .receipt-modal-pdf-pages { max-height: calc(82vh - 56px); }

  /* Toast – kompaktare placering */
  .toast { bottom: 10px; right: 12px; padding: 9px 14px; font-size: 13px; }

  /* Formulärrader – dela upp på två rader istället för en bred rad */
  .entry-row {
    grid-template-columns: repeat(4, 1fr) !important;
    padding: 10px 0;
    gap: 8px;
  }
  /* Raderaknappen – behöver inte täcka hela raden i landscape */
  .entry-row .field:last-child {
    grid-column: auto !important;
    align-items: flex-end !important;
  }
  .entry-row .field:last-child .btn-danger {
    width: auto !important;
    justify-content: center;
  }
}

/* Dölj utskriftsvyn helt på skärm – visas bara vid utskrift */
@media screen {
  #print-view { display: none !important; }
}

/* ─── FAQ / GUIDER ─── */

.site-header {
  background: var(--ink);
  padding: 0.75rem 1rem;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}
.back-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s;
}
.back-link:hover { color: #fff; }

/* ── Subnav-kategoripiller ── */
.subnav {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subnav-inner::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  white-space: nowrap;
}
.pill:hover { background: rgba(255,255,255,0.1); color: #fff; }
.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Sidinnehåll ── */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* ── Sök ── */
.search-wrap {
  background: white;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.search-wrap .icon { font-size: 1rem; color: var(--ink-muted); }
.search-wrap input {
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  flex: 1;
  font-family: inherit;
}
.search-wrap input::placeholder { color: #a0a8be; }
#clear-search {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  padding: 0;
  line-height: 1;
}

/* ── Sektionskort ── */
.section { margin-bottom: 0.75rem; }
.section-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.section-icon {
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  background: var(--paper-warm);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-header h2 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}
.section-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: var(--paper-warm);
  border-radius: 10px;
  padding: 0.1rem 0.55rem;
}

/* ── Artikelrader ── */
.article-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.article-row:last-child { border-bottom: none; }
.article-row:hover { background: #f7f8fa; }
.article-top {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.1rem;
  gap: 0.75rem;
}
.article-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  flex: 1;
  line-height: 1.35;
}
.article-preview {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.15rem;
  font-weight: 400;
}
.toggle-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 700;
  transition: transform 0.2s, background 0.15s;
}
.article-row.open .toggle-btn {
  transform: rotate(45deg);
  background: var(--accent);
  color: #fff;
}

/* ── Artikelinnehåll ── */
.article-content {
  display: none;
  padding: 0 1.1rem 1.1rem;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink);
  border-top: 1px solid var(--border);
}
.article-row.open .article-content { display: block; }
.article-content p { margin: 0.85rem 0 0; }
.article-content p:first-child { margin-top: 0.85rem; }
.article-content ul,
.article-content ol { margin: 0.6rem 0 0.6rem 1.3rem; }
.article-content li { margin-bottom: 0.25rem; }
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin: 0.85rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-content th {
  background: var(--accent);
  color: #fff;
  text-align: left;
  padding: 0.5rem 0.8rem;
  font-weight: 600;
  font-size: 0.8rem;
}
.article-content td {
  padding: 0.45rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.article-content tr:last-child td { border-bottom: none; }
.article-content tr:nth-child(even) td { background: #f5f7fb; }

.fact-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 0.85rem 0 0;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--accent);
}

/* ── CTA-kort ── */
.cta-card {
  background: var(--ink);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cta-card p {
  color: rgba(255,255,255,0.8);
  font-size: 0.88rem;
  margin: 0;
}
.cta-card a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.cta-card a:hover { background: #15407a; }

/* ── Inga träffar ── */
#no-results {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border);
}
#no-results p { color: var(--ink-muted); font-size: 0.92rem; }

/* ── Ansvarsfriskrivningsbanderoll ── */
.disclaimer-banner {
  background: #fffbea;
  border: 1px solid #e8d87a;
  border-left: 4px solid #c8962a;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: #5a4a10;
  line-height: 1.5;
}
.disclaimer-banner .disc-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem; }
.disclaimer-banner .disc-text { flex: 1; }
.disclaimer-banner .disc-text strong { color: #3d3200; }
.disclaimer-banner .btn-contact {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  align-self: center;
}
.disclaimer-banner .btn-contact:hover { background: #15407a; }

/* ── Kontaktmodal ── */
.contact-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,15,30,0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.contact-overlay.open { display: flex; }
.contact-modal {
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.contact-modal-header {
  background: var(--ink);
  color: #fff;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
}
.contact-modal-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.contact-modal-close:hover { color: #fff; }
.contact-modal-body { padding: 1.2rem; }
.contact-form-row { margin-bottom: 0.85rem; }
.contact-form-row label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.contact-form-row input,
.contact-form-row textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--paper-warm);
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.contact-form-row input:focus,
.contact-form-row textarea:focus {
  border-color: var(--border-focus);
  background: #fff;
}
.contact-form-row textarea { resize: vertical; min-height: 110px; }
.contact-modal-footer {
  padding: 0 1.2rem 1.2rem;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}
.btn-send {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-send:hover { background: #15407a; }
.btn-send:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-cancel {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-cancel:hover { border-color: var(--ink-muted); }
.contact-status {
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin: 0 1.2rem 0.8rem;
  display: none;
}
.contact-status.success { background: #edfaf3; color: #1a5c35; border: 1px solid #a3dfc0; display: block; }
.contact-status.error   { background: #fef0f0; color: #8b1a1a; border: 1px solid #f0b0b0; display: block; }

@media (max-width: 480px) {
  .disclaimer-banner { flex-wrap: wrap; }
  .disclaimer-banner .btn-contact { margin-top: 0.4rem; }
}

/* ─── PRINT ─── */
@page {
  margin: 12mm 12mm 16mm 12mm;
  @bottom-left { content: ""; }
  @bottom-right { content: counter(page) " / " counter(pages); font-family: 'Source Sans 3', sans-serif; font-size: 8pt; color: #999; }
  @bottom-center { content: ""; }
  @top-left { content: ""; }
  @top-center { content: ""; }
  @top-right { content: ""; }
}

@media print {
  body { background: white; margin: 0; min-height: 0; }
  header, #app, .toast { display: none !important; }
  .no-print { display: none !important; }
  .site-footer { display: none !important; }

  #print-view { display: block !important; font-family: 'Source Sans 3', sans-serif; font-size: 10px; color: #111; line-height: 1.4; }

  .pv-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #1a1a2e; padding-bottom: 6px; margin-bottom: 10px; }
  .pv-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 600; color: #1a1a2e; }
  .pv-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 16px; margin-bottom: 10px; }
  .pv-meta-item { display: flex; flex-direction: column; }
  .pv-meta-item span:first-child { font-size: 8px; text-transform: uppercase; letter-spacing: 0.06em; color: #444; }
  .pv-meta-item span:last-child { font-weight: 500; font-size: 10px; }
  .pv-section { margin-bottom: 10px; page-break-inside: avoid; }
  .pv-section-title {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: white; background: #1a1a2e; padding: 3px 7px; margin-bottom: 0;
    display: flex; justify-content: space-between; align-items: center;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .pv-table { width: 100%; border-collapse: collapse; }
  .pv-table th {
    background: #f0f0ec; font-size: 8px; text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 600; color: #333;
    padding: 3px 6px; border-bottom: 1px solid #ccc; text-align: left;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .pv-table td { padding: 3px 6px; border-bottom: 1px solid #eee; font-size: 9.5px; vertical-align: middle; }
  .pv-table tr:last-child td { border-bottom: none; }
  .pv-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pv-table th.num { text-align: right; }
  .pv-empty { padding: 5px 6px; font-size: 9px; color: #555; font-style: italic; }
  .pv-summary { display: flex; gap: 0; margin-bottom: 4px; border: 1px solid #ccc; page-break-inside: avoid; }
  .pv-sum-rows { flex: 1; }
  .pv-sum-row { display: flex; justify-content: space-between; padding: 4px 10px; border-bottom: 1px solid #eee; font-size: 10px; }
  .pv-sum-row:last-child { border-bottom: none; }
  .pv-sum-total {
    background: #1a1a2e; color: white;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; font-size: 11px; font-weight: 700; margin-bottom: 10px;
  }
  .pv-note { font-size: 7.5px; color: #444; border: 1px solid #ddd; padding: 5px 8px; margin-bottom: 10px; line-height: 1.6; page-break-inside: avoid; }
  .pv-sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 6px; page-break-inside: avoid; }
  .pv-sig-label { font-size: 8px; text-transform: uppercase; letter-spacing: 0.06em; color: #444; margin-bottom: 2px; }
  .pv-sig-canvas { border: 1px solid #ccc; width: 100%; height: 70px; display: block; object-fit: contain; }
  .pv-sig-line { border-top: 1px solid #333; margin-top: 4px; padding-top: 3px; font-size: 8.5px; color: #444; display: flex; justify-content: space-between; }
  .pv-intygar { font-size: 8.5px; color: #333; margin-bottom: 8px; font-style: italic; }
  .pv-print-footer { position: fixed; bottom: 0; left: 0; font-size: 7.5px; color: #999; font-family: 'Source Sans 3', sans-serif; }

  /* ── Vattenstämpel (visas enbart på bilagasidor) ── */
  .pv-watermark {
    position: absolute;
    bottom: 14mm;
    right: 0;
    text-align: right;
    pointer-events: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pv-watermark-emblem {
    width: 32px;
    height: 32px;
    display: block;
    margin-left: auto;
    margin-bottom: 4px;
  }
  .pv-watermark-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.06em;
    color: #a8cfe0;
    line-height: 1;
  }
  .pv-watermark-rule {
    height: 1px;
    background: #a8cfe0;
    margin: 3px 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pv-watermark-sub {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 6px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #a8cfe0;
  }
}
