
.atem-app {
  --bg-a: #edf4ef;
  --bg-b: #d6e8dc;
  --panel: rgba(255,255,255,.76);
  --text: #23352b;
  --muted: #68786f;
  --accent: #5f8f77;
  --accent-soft: #a8cdb8;
  --accent-rgb: 95,143,119;
  width: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}

.atem-app.theme-ocean {
  --bg-a: #edf7f8;
  --bg-b: #cfe5ea;
  --text: #20353d;
  --muted: #667b82;
  --accent: #5a91a2;
  --accent-soft: #a9d1dc;
  --accent-rgb: 90,145,162;
}

.atem-app.theme-night {
  --bg-a: #171d2d;
  --bg-b: #29334a;
  --panel: rgba(25,31,48,.78);
  --text: #f4f6fb;
  --muted: #bbc3d3;
  --accent: #9b9ad6;
  --accent-soft: #7476b7;
  --accent-rgb: 155,154,214;
}

.atem-app.theme-minimal {
  --bg-a: #f7f7f5;
  --bg-b: #e8e8e3;
  --panel: rgba(255,255,255,.9);
  --text: #252525;
  --muted: #737373;
  --accent: #77776e;
  --accent-soft: #c7c7be;
  --accent-rgb: 119,119,110;
}

.atem-app * {
  box-sizing: border-box;
}

.atem-app {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(145deg, var(--bg-a), var(--bg-b));
  box-shadow: 0 25px 70px rgba(32,57,44,.15);
}

.atem-background-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--accent-rgb),.20), transparent 35%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.34), transparent 34%);
  transform: scale(.9);
  transition: transform 2s ease-in-out, opacity .8s ease;
  pointer-events: none;
}

.atem-app.is-breathing .atem-background-glow {
  animation: atem-background-breathe 10s ease-in-out infinite;
}

@keyframes atem-background-breathe {
  0%,100% { transform: scale(.9); opacity: .72; }
  50% { transform: scale(1.08); opacity: 1; }
}

.atem-shell {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 34px;
}

.atem-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.atem-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.atem-topbar h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
  font-weight: 600;
}

.atem-theme-control {
  min-width: 160px;
}

.atem-theme-control,
.atem-settings-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}

.atem-theme-control select,
.atem-settings-panel select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(var(--accent-rgb),.23);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  color: #26352e;
  font: inherit;
}

.theme-night .atem-theme-control select,
.theme-night .atem-settings-panel select {
  background: rgba(255,255,255,.10);
  color: #fff;
}

.theme-night option {
  color: #222;
}

.atem-main {
  display: grid;
  grid-template-columns: 250px minmax(0,1fr);
  gap: 24px;
  align-items: stretch;
}

.atem-settings-panel,
.atem-visual-panel {
  border: 1px solid rgba(var(--accent-rgb),.16);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(40,64,51,.08);
}

.atem-settings-panel {
  padding: 20px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.atem-volume-row input {
  width: 100%;
  accent-color: var(--accent);
}

.atem-check {
  flex-direction: row !important;
  align-items: center;
  gap: 9px !important;
}

.atem-check input {
  accent-color: var(--accent);
}

.atem-visual-panel {
  min-height: 560px;
  padding: 26px 20px 24px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.atem-progress-wrap {
  position: relative;
  width: min(340px, 80vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.atem-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.atem-progress-track,
.atem-progress-value {
  fill: none;
  stroke-width: 3;
}

.atem-progress-track {
  stroke: rgba(var(--accent-rgb),.14);
}

.atem-progress-value {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 861;
  stroke-dashoffset: 861;
  transition: stroke-dashoffset .25s linear;
}

.atem-blob-wrap {
  position: relative;
  width: 155px;
  height: 155px;
  display: grid;
  place-items: center;
}

.atem-blob {
  width: 100%;
  height: 100%;
  border-radius: 48% 52% 58% 42% / 48% 42% 58% 52%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.96), transparent 24%),
    linear-gradient(145deg, var(--accent-soft), var(--accent));
  box-shadow:
    0 0 0 18px rgba(var(--accent-rgb),.08),
    0 28px 70px rgba(var(--accent-rgb),.28);
  transform: scale(.78);
  will-change: transform, border-radius;
  animation: atem-blob-morph 8s ease-in-out infinite;
  animation-play-state: paused;
}

.atem-app.is-breathing .atem-blob {
  animation-play-state: running;
}

.atem-app.is-paused .atem-blob,
.atem-app.is-paused .atem-background-glow {
  animation-play-state: paused;
}

@keyframes atem-blob-morph {
  0% {
    transform: scale(.78) rotate(0deg);
    border-radius: 48% 52% 58% 42% / 48% 42% 58% 52%;
  }
  50% {
    transform: scale(1.68) rotate(5deg);
    border-radius: 58% 42% 48% 52% / 42% 58% 44% 56%;
  }
  100% {
    transform: scale(.78) rotate(0deg);
    border-radius: 48% 52% 58% 42% / 48% 42% 58% 52%;
  }
}

.atem-inner-glow {
  position: absolute;
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: rgba(255,255,255,.26);
  filter: blur(16px);
  pointer-events: none;
}

.atem-instruction {
  min-height: 42px;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
}

.atem-phase-detail {
  min-height: 24px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.atem-timer {
  margin-top: 12px;
  font-size: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.atem-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.atem-buttons button {
  min-width: 118px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.atem-buttons button:hover {
  transform: translateY(-1px);
}

.atem-buttons button:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}

.atem-start {
  background: var(--accent);
  color: #fff;
}

.atem-pause,
.atem-reset {
  background: rgba(var(--accent-rgb),.13);
  color: var(--text);
}

.atem-note {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.atem-cycle-row.is-hidden {
  display: none;
}

@media (max-width: 780px) {
  .atem-shell {
    padding: 22px 16px;
  }

  .atem-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .atem-main {
    grid-template-columns: 1fr;
  }

  .atem-settings-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .atem-visual-panel {
    min-height: 500px;
  }
}

@media (max-width: 520px) {
  .atem-settings-panel {
    grid-template-columns: 1fr;
  }

  .atem-progress-wrap {
    width: min(290px, 82vw);
  }

  .atem-visual-panel {
    min-height: 460px;
  }

  .atem-buttons button {
    min-width: 100px;
  }
}


.atem-box-row.is-hidden {
  display: none;
}

.atem-box-visual {
  display: none;
  width: min(340px, 80vw);
  aspect-ratio: 1;
  margin-bottom: 6px;
}

.atem-box-visual svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.atem-box-track {
  fill: none;
  stroke: rgba(var(--accent-rgb), .16);
  stroke-width: 5;
}

.atem-box-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 880;
  stroke-dashoffset: 880;
}

.atem-box-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), .55));
}

.atem-app.box-mode .atem-box-visual {
  display: block;
}

.atem-app.box-mode .atem-progress-wrap {
  display: none;
}

.atem-app.box-mode .atem-visual-panel {
  justify-content: center;
}

.atem-description {
  margin-top: 24px;
  padding: 24px 26px;
  border: 1px solid rgba(var(--accent-rgb), .16);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 42px rgba(40,64,51,.07);
  text-align: left;
}

.atem-description-title {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 21px;
  line-height: 1.25;
}

.atem-description-text {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.atem-description-text p {
  margin: 0 0 12px;
}

.atem-description-text p:last-child {
  margin-bottom: 0;
}

.atem-reminder {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(var(--accent-rgb), .16);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 44px rgba(40,64,51,.07);
}

.atem-reminder-copy h3 {
  margin: 3px 0 7px;
  font-size: 21px;
  color: var(--text);
}

.atem-reminder-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.atem-reminder-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.atem-reminder-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 17px;
}

.atem-reminder-controls label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 145px;
  font-size: 13px;
  font-weight: 600;
}

.atem-reminder-time {
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--accent-rgb), .23);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  color: #26352e;
  font: inherit;
}

.theme-night .atem-reminder-time {
  background: rgba(255,255,255,.10);
  color: #fff;
  color-scheme: dark;
}

.atem-calendar-button {
  min-height: 43px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.atem-calendar-button:hover {
  transform: translateY(-1px);
}

.atem-reminder-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.atem-reminder-status {
  min-height: 20px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 520px) {
  .atem-reminder-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .atem-calendar-button,
  .atem-reminder-controls label {
    width: 100%;
  }
}
