*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Arial, sans-serif;
  background: #f7f6f2;
  color: #1f1f1d;
  line-height: 1.5;
  padding: 24px 16px 60px;
}
.container { max-width: 1000px; margin: 0 auto; }

header { margin-bottom: 18px; }
h1 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 6px; font-weight: 600; letter-spacing: -0.01em; }
.subtitle { color: #5f5e5a; font-size: 14px; margin: 0; max-width: 700px; }

.info-banner {
  background: #fff;
  border: 1px solid #e5e3da;
  border-left: 3px solid #185fa5;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 22px;
  font-size: 13px;
  color: #444441;
}
.info-banner strong { color: #1f1f1d; font-weight: 600; }

.controls {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.controls label {
  font-size: 14px;
  font-weight: 500;
  color: #1f1f1d;
}
.controls input[type=range] {
  flex: 1;
  min-width: 240px;
  height: 32px;
  accent-color: #185fa5;
}
.ph-value {
  font-size: 28px;
  font-weight: 600;
  color: #1f1f1d;
  min-width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.visualization { display: flex; flex-direction: column; gap: 22px; }

.ph-bar {
  height: 50px;
  border-radius: 6px;
  background: linear-gradient(to right,
    #d50000 0%,    /* pH 0 - rød */
    #ff5e00 7%,    /* pH 1 */
    #ff8c00 14%,   /* pH 2 */
    #ffaa00 21%,   /* pH 3 */
    #ffcc00 28%,   /* pH 4 */
    #ffff00 35%,   /* pH 5 */
    #c8e000 42%,   /* pH 6 */
    #5cb85c 50%,   /* pH 7 - grøn */
    #2eb872 57%,   /* pH 8 */
    #1d9e75 64%,   /* pH 9 */
    #1a7a8a 71%,   /* pH 10 */
    #1565c0 78%,   /* pH 11 */
    #4527a0 85%,   /* pH 12 */
    #311b92 92%,   /* pH 13 */
    #1a0070 100%   /* pH 14 - mørk lilla */
  );
  position: relative;
  margin-bottom: 4px;
}
.ph-bar::after {
  content: "0       1       2       3       4       5       6       7       8       9      10      11      12      13      14";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  font-size: 11px;
  color: #5f5e5a;
  display: flex;
  justify-content: space-between;
  padding: 4px 8px 0;
}
.ph-marker {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 4px;
  background: #1f1f1d;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.1s;
  pointer-events: none;
}

.indicator-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.indicator {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.indicator-label {
  font-size: 11px;
  color: #5f5e5a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 8px;
}
.indicator-color {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 8px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: inset 0 -8px 12px rgba(0,0,0,0.08);
  transition: background 0.2s;
}
.indicator-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f1f1d;
}

.substances-section, .all-substances {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 18px 22px;
}
.substances-section h2, .all-substances h2 {
  font-size: 16px;
  margin: 0 0 12px;
  font-weight: 600;
  color: #1f1f1d;
}

.substance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.substance-pill {
  background: #f7f6f2;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: #1f1f1d;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.substance-pill .ph-tag {
  font-size: 11px;
  color: #5f5e5a;
  font-variant-numeric: tabular-nums;
}
.substance-pill.empty {
  color: #888780;
  font-style: italic;
}

.ph-scale {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scale-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
}
.scale-ph {
  font-size: 13px;
  font-weight: 600;
  color: #1f1f1d;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 8px;
  border-right: 2px solid;
}
.scale-substances {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}
.scale-substance {
  font-size: 12.5px;
  color: #1f1f1d;
}

footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid #e5e3da;
  font-size: 12.5px;
  color: #5f5e5a;
  line-height: 1.6;
}
footer .brand { font-weight: 600; color: #1f1f1d; }
