@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f1e9dc;
  --bg-top: #fcfaf5;
  --ink-strong: #163330;
  --ink-soft: #5a6c6a;
  --accent-strong: #1d5b55;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', 'Segoe UI', sans-serif;

  font-family: var(--font-body);
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink-strong);
  background:
    radial-gradient(circle at top, var(--bg-top) 0%, rgba(252, 250, 245, 0) 45%),
    linear-gradient(180deg, #efe5d4 0%, var(--bg) 100%);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
select {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

#root {
  min-height: 100vh;
}

::selection {
  background: rgba(29, 91, 85, 0.22);
}

.app-shell {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.detail-summary,
.detail-body,
.stage-copy p,
.helper-note {
  color: var(--ink-soft);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
}

.panel {
  padding: 24px;
  border: 1px solid rgba(19, 69, 63, 0.14);
  border-radius: 28px;
  background: rgba(255, 251, 245, 0.74);
  box-shadow: 0 20px 45px rgba(29, 48, 46, 0.08);
  backdrop-filter: blur(16px);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  color: var(--ink-strong);
  font-size: 1.95rem;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(22, 69, 63, 0.08);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-running {
  background: rgba(29, 91, 85, 0.16);
}

.status-paused {
  background: rgba(163, 116, 39, 0.16);
  color: #8a5a16;
}

.status-completed {
  background: rgba(56, 121, 80, 0.16);
  color: #2f6b46;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.progress-copy span,
.meta-card span,
.phase-row span,
.time-row,
.helper-note {
  font-size: 0.88rem;
}

.field span {
  font-weight: 700;
  color: var(--ink-strong);
}

.field select {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(19, 69, 63, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-strong);
}

.field select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.breath-stage {
  margin-top: 18px;
  padding: 26px 22px 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 250, 241, 0.9), rgba(255, 250, 241, 0) 55%),
    linear-gradient(180deg, rgba(29, 91, 85, 0.08), rgba(248, 209, 157, 0.18));
  border: 1px solid rgba(19, 69, 63, 0.1);
}

.orb-rail {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
}

.orb-ring,
.orb-core {
  position: absolute;
  border-radius: 999px;
}

.orb-ring {
  width: 180px;
  height: 180px;
  border: 1px solid rgba(29, 91, 85, 0.18);
}

.orb-core {
  width: 180px;
  height: 180px;
  background:
    radial-gradient(circle at top, rgba(255, 250, 241, 0.94), rgba(255, 250, 241, 0.18)),
    linear-gradient(180deg, rgba(29, 91, 85, 0.9), rgba(248, 209, 157, 0.58));
  box-shadow: 0 20px 50px rgba(25, 80, 74, 0.2);
  transition: transform 120ms linear;
}

.phase-inhale .orb-core {
  background:
    radial-gradient(circle at top, rgba(255, 250, 241, 0.94), rgba(255, 250, 241, 0.18)),
    linear-gradient(180deg, rgba(29, 91, 85, 0.9), rgba(248, 209, 157, 0.58));
}

.phase-hold .orb-core {
  background:
    radial-gradient(circle at top, rgba(255, 250, 241, 0.94), rgba(255, 250, 241, 0.18)),
    linear-gradient(180deg, rgba(34, 76, 112, 0.9), rgba(111, 173, 197, 0.58));
}

.phase-exhale .orb-core {
  background:
    radial-gradient(circle at top, rgba(255, 250, 241, 0.94), rgba(255, 250, 241, 0.18)),
    linear-gradient(180deg, rgba(163, 116, 39, 0.9), rgba(248, 209, 157, 0.72));
}

.stage-copy {
  text-align: center;
}

.phase-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.phase-timer {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 0.92;
  color: var(--ink-strong);
}

.progress-block {
  margin-top: 18px;
}

.progress-copy,
.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-copy strong,
.meta-card strong,
.phase-row strong {
  color: var(--ink-strong);
}

.progress-bar {
  height: 12px;
  margin: 10px 0 12px;
  border-radius: 999px;
  background: rgba(29, 91, 85, 0.1);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(29, 91, 85, 1), rgba(90, 163, 142, 0.92));
}

.time-row {
  color: var(--ink-soft);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.action {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(19, 69, 63, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-strong);
  font-weight: 700;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    opacity 140ms ease;
}

.action:hover,
.action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(19, 69, 63, 0.4);
}

.action:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.action-primary {
  background: var(--accent-strong);
  color: #fff9f1;
  border-color: transparent;
}

.error-banner {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(184, 75, 42, 0.12);
  color: #8a3d22;
}

.helper-note {
  margin-top: 16px;
}

.detail-summary {
  margin-top: -4px;
  font-size: 1.04rem;
}

.detail-body {
  margin-top: 14px;
}

.meta-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.meta-card,
.phase-row {
  padding: 14px 16px;
  border: 1px solid rgba(19, 69, 63, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.meta-card strong {
  display: block;
  margin-top: 6px;
  line-height: 1.3;
}

.phase-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phase-row strong,
.phase-row small {
  display: block;
  margin-top: 4px;
}

.phase-row small {
  color: var(--ink-soft);
}

.phase-row-active {
  border-color: rgba(29, 91, 85, 0.36);
  box-shadow: inset 0 0 0 1px rgba(29, 91, 85, 0.16);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100%, calc(100% - 16px));
    padding: 20px 0 36px;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .panel-heading {
    flex-direction: column;
    align-items: start;
  }

  .orb-rail {
    min-height: 220px;
  }

  .orb-ring,
  .orb-core {
    width: 150px;
    height: 150px;
  }

  .time-row,
  .progress-copy,
  .phase-row {
    flex-direction: column;
    align-items: start;
  }
}
