:root {
  --bg: #f6f3ec;
  --text: #1b1b1b;
  --muted: #4a4a4a;
  --green: #1d6b3a;
  --green-dark: #144d29;
  --blue: #2f6f95;
  --circle-in: #7fbbd9;
  --circle-out: #a9d3b5;
  --circle-rest: #d9d3c3;
  --warn: #8a1c1c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 28px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.vy {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.vy[hidden] { display: none; }

h1 {
  font-size: clamp(36px, 9vw, 48px);
  margin: 8px 0 0;
  text-align: center;
}

.stor { font-size: 36px; text-align: center; margin: 0; }
.liten { font-size: 24px; color: var(--muted); }

.fel {
  color: var(--warn);
  border: 3px solid var(--warn);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
}

/* Buttons */
.knapp {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 16px 32px;
  border-radius: 24px;
  border: none;
  font: inherit;
  font-size: 32px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}

.knapp-gron { background: var(--green); color: #fff; }
.knapp-gron:active { background: var(--green-dark); }

/* Voice choice */
.rostval { width: 100%; }
.rostknappar { display: flex; gap: 16px; }
.rostknapp {
  flex: 1;
  min-height: 80px;
  border-radius: 20px;
  border: 4px solid var(--blue);
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-weight: 600;
}
.rostknapp[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* Session list */
.passlista { width: 100%; display: flex; flex-direction: column; gap: 20px; }
.pass-knapp {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 120px;
  padding: 20px 28px;
  border: none;
  border-radius: 24px;
  background: var(--green);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pass-knapp:active { background: var(--green-dark); }
.pass-knapp .namn { font-size: 40px; font-weight: 700; }
.pass-knapp .info { font-size: 28px; }

.sakerhet {
  font-size: 28px;
  border-left: 8px solid var(--warn);
  padding: 8px 0 8px 20px;
  margin: 0;
  width: 100%;
}

.diskret {
  margin-top: auto;
  font-size: 20px;
  color: var(--muted);
}

/* Session */
#pass { justify-content: space-between; }
.rubrik { font-size: 32px; font-weight: 700; margin: 0; min-height: 1.4em; text-align: center; }

.scen {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.cirkel-ram {
  width: min(70vw, 42vh, 460px);
  height: min(70vw, 42vh, 460px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cirkel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--circle-rest);
  border: 6px solid rgba(0, 0, 0, 0.15);
  transform: scale(0.55);
  will-change: transform;
}
.cirkel[data-fas="in"] { background: var(--circle-in); }
.cirkel[data-fas="ut"] { background: var(--circle-out); }

.texter { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.instruktion { font-size: 44px; font-weight: 700; margin: 0; min-height: 1.3em; }
.varv { font-size: 32px; margin: 0; min-height: 1.3em; color: var(--muted); }
.undertext { font-size: 28px; margin: 0; color: var(--muted); max-width: 30ch; }

.kontroller { display: flex; gap: 16px; width: 100%; }
.knapp-paus { background: var(--blue); color: #fff; flex: 2; }
.knapp-paus[aria-pressed="true"] { background: var(--green); }
.knapp-avsluta { background: #fff; color: var(--text); border: 4px solid var(--text); flex: 1; }

/* Settings */
.rad {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 80px;
  gap: 24px;
}
.rad input[type="checkbox"] { width: 48px; height: 48px; }
.rad input[type="range"] { flex: 1; height: 48px; }

/* Landscape tablets: circle beside the text */
@media (orientation: landscape) and (min-width: 700px) {
  .scen { flex-direction: row; gap: 48px; }
  .cirkel-ram { width: min(55vh, 420px); height: min(55vh, 420px); }
  .texter { text-align: left; max-width: 45%; }
}
