:root {
  /* Neutral brand */
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-divider: #f1f5f9;
  --c-text: #0f172a;
  --c-text-muted: #475569;
  --c-text-faint: #94a3b8;
  --c-primary: #0f172a;
  --c-primary-text: #ffffff;
  --c-accent: #f97316;

  /* Fiberstropp colors (EN 1492) */
  --c-fiolett: #8b4fbf;
  --c-gronn:   #3a9b3a;
  --c-gul:     #e6c200;
  --c-graa:    #9ca3af;
  --c-rod:     #dc2626;
  --c-brun:    #92400e;
  --c-bla:     #2563eb;
  --c-oransje: #f97316;

  /* Result card / warning */
  --c-result-start:  #fff7ed;
  --c-result-end:    #ffedd5;
  --c-result-border: #fed7aa;
  --c-result-label:  #9a3412;
  --c-warn-bg:     #fef9c3;
  --c-warn-border: #fde047;
  --c-warn-text:   #713f12;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

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

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-stack);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--c-surface);
  position: relative;
  padding-bottom: 72px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-divider);
  position: sticky;
  top: 0;
  background: var(--c-surface);
  z-index: 10;
}
.app-header h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  flex: 1;
}
.back-arrow {
  width: 36px; height: 36px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted);
  font-size: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.back-arrow:hover { background: var(--c-divider); }
.icon-button {
  width: 36px; height: 36px;
  border-radius: 18px;
  background: var(--c-divider);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted);
  border: none;
  cursor: pointer;
  font-size: 14px;
}

main {
  padding: 16px;
}

.lead {
  font-size: 13px;
  color: var(--c-text-muted);
  margin: 0 0 16px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.bottom-nav a,
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--c-text-faint);
  text-decoration: none;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
}
.bottom-nav .nav-icon {
  width: 22px;
  height: 22px;
  display: block;
  color: inherit;
}
.bottom-nav .nav-icon svg { display: block; width: 100%; height: 100%; }
.bottom-nav .is-active {
  color: var(--c-text);
  font-weight: 600;
}
.bottom-nav .is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  min-height: 100px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
}
.tile--primary {
  background: var(--c-primary);
  color: var(--c-primary-text);
  border-color: var(--c-primary);
}
.tile--disabled {
  opacity: 0.5;
}
.tile-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--c-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.tile--primary .tile-icon { background: var(--c-accent); }
.tile-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.tile-sub { font-size: 11px; color: var(--c-text-muted); line-height: 1.3; }
.tile--primary .tile-sub { color: #cbd5e1; }
.tile-tag {
  font-size: 9px;
  background: rgba(0,0,0,0.05);
  color: var(--c-text-muted);
  padding: 2px 6px;
  border-radius: 10px;
  align-self: flex-start;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.search-field {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--c-text-faint);
  margin-bottom: 14px;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.list-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-text-muted);
  font-weight: 600;
  margin: 18px 0 4px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--c-divider);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
}
.list-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  flex-shrink: 0;
}
.list-icon--fiberstropper {
  background: linear-gradient(135deg, var(--c-fiolett), var(--c-oransje));
}
.list-text { flex: 1; }
.list-title { font-size: 14px; font-weight: 500; }
.list-sub { font-size: 11px; color: var(--c-text-faint); }
.list-item--disabled { opacity: 0.5; }
.chevron { color: var(--c-text-faint); font-size: 18px; }

.color-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.color-strip > span {
  display: block;
  height: 18px;
  border-radius: 4px;
}

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-text-muted);
  font-weight: 600;
  margin: 18px 0 8px;
}
.numbered-list {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  margin: 0;
  padding-left: 20px;
}
.numbered-list li { margin-bottom: 4px; }

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  padding: 6px 0;
}
.check-box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--c-border-strong);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.cta {
  display: block;
  background: var(--c-primary);
  color: var(--c-primary-text);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 24px;
}
.input-row { margin-bottom: 18px; }
.input-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-text-muted);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}
.color-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.color-swatch {
  height: 48px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  font-family: inherit;
}
.color-swatch[data-color="gul"] { color: #1f2937; }
.color-swatch.is-selected {
  box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 4px var(--c-primary);
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--c-divider);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 3px;
}
.segmented button {
  background: transparent;
  border: none;
  padding: 9px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.segmented button.is-selected {
  background: var(--c-surface);
  color: var(--c-text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
select.dropdown {
  width: 100%;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  padding: 11px 12px;
  font-size: 13px;
  background: var(--c-surface);
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2394a3b8' d='M6 9L1.5 4h9z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.result-card {
  background: linear-gradient(180deg, var(--c-result-start), var(--c-result-end));
  border: 1px solid var(--c-result-border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-top: 8px;
}
.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-result-label);
  font-weight: 600;
}
.result-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.1;
  margin: 4px 0;
}
.result-detail { font-size: 12px; color: var(--c-text-muted); }
.result-faktor {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--c-result-border);
}
.warning {
  background: var(--c-warn-bg);
  border: 1px solid var(--c-warn-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--c-warn-text);
  margin-top: 12px;
}
.warning--snaring {
  background: #fef3c7;
  border-color: #fbbf24;
}
.info-note {
  font-size: 11px;
  color: var(--c-text-muted);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  margin: -4px 0 18px;
  line-height: 1.4;
}
.info-block {
  font-size: 11px;
  color: var(--c-text-muted);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-top: 12px;
  line-height: 1.5;
}
.info-block p { margin: 0; }
.info-block p + p { margin-top: 4px; }
[hidden] { display: none !important; }

/* Kasseringsregler — two-column checklist */
.kassering-intro {
  font-size: 12px;
  color: var(--c-text-muted);
  margin: 0 0 12px;
  line-height: 1.4;
}
.kassering-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.kassering-col {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.kassering-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 6px;
}
.kassering-col-title--standalone {
  margin: 6px 0 8px;
}
.kassering-col .checklist li {
  font-size: 12px;
  padding: 4px 0;
  gap: 8px;
}

/* Damage examples grid */
.damage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.damage-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.damage-image {
  height: 80px;
  background: #fafafa;
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}
.damage-image svg {
  display: block;
  width: 100%;
  height: 100%;
}
.damage-title {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px 2px;
  color: var(--c-text);
}
.damage-desc {
  font-size: 10px;
  color: var(--c-text-muted);
  padding: 0 10px 10px;
  line-height: 1.4;
}
