:root {
  --accent: #02ccab;
  --accent-dark: #01a98e;
  --ink: #10222b;
  --muted: #5b6b74;
  --bg: #eef4f4;
  --card: #ffffff;
  --danger: #e53935;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(10, 40, 50, 0.10);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  touch-action: manipulation;
}

p { font-weight: 300; }

/* ---------- App bar ---------- */
.appBar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(150deg, #0c2b33, #10454a);
  color: #fff;
}
.appBar .logo {
  font-weight: 700;
  font-size: 1.25em;
  letter-spacing: -0.5px;
}
.appBar .logo span { color: var(--accent); }
.barCheck { color: rgba(255, 255, 255, 0.9); }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 14px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Klockan ---------- */
.clockSection {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.activeName {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 8px;
}
.clockChips {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.clockChips::-webkit-scrollbar { display: none; }
.clockChips .chip { flex: 0 0 auto; }

#klocka { display: flex; justify-content: center; }
#svgreloj {
  width: 100%;
  max-width: 480px;
  height: auto;
  touch-action: none;
  cursor: pointer;
}
#svgreloj .seg { transition: fill 0.1s; }
.clockHint {
  font-size: 0.82em;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ---------- Paneler ---------- */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel h3 {
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel h3 small { font-weight: 400; color: var(--muted); }
.step {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.hint {
  font-size: 0.8em;
  color: var(--muted);
  line-height: 1.55;
  margin: 8px 0;
}

/* Färgval */
.swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
  min-height: 40px;
}
.swatch.selected {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.pickerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 12px;
}
.pickerRow input[type="color"] {
  width: 56px;
  height: 40px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: none;
  padding: 2px;
}
.chipRow { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.chip.danger:active { border-color: var(--danger); color: var(--danger); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  cursor: pointer;
}
.check input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }

/* Aktiviteter */
.legendRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.legendRow input[type="color"] {
  width: 42px;
  height: 38px;
  flex: 0 0 42px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: none;
  padding: 2px;
}
.legendRow input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9em;
  outline: none;
}
.legendRow input[type="text"]:focus { border-color: var(--accent); }
.removeRow {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.15em;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

/* Mina klockor */
.clockRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
}
.clockRow.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(2, 204, 171, 0.25);
}
.clockRow .useBtn {
  border: 0;
  background: none;
  font-size: 1.25em;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}
.clockRow input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  font-size: 0.95em;
  font-weight: 600;
  outline: none;
  padding: 8px 4px;
  background: transparent;
}
.clockRow .iconBtn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.05em;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}
.clockRow .iconBtn:active { color: var(--ink); }
.clockRow .iconBtn.delete:active { color: var(--danger); }

.copyrightText {
  text-align: center;
  padding: 10px 10px calc(16px + env(safe-area-inset-bottom));
}
.copyrightText p { color: var(--muted); font-size: 0.78em; }
.copyrightText .swishLine {
  font-size: 0.88em;
  color: var(--ink);
  max-width: 340px;
  margin: 0 auto 8px;
  line-height: 1.5;
}
.copyrightText .swishLine strong { color: var(--accent-dark); white-space: nowrap; }
