:root {
  --bg0: #e8eef8;
  --bg1: #d5e2f5;
  --ink: #142033;
  --ink-soft: #3a4a63;
  --muted: #6b7c94;
  --card: rgba(255, 255, 255, 0.78);
  --card-solid: #ffffff;
  --line: rgba(20, 32, 51, 0.1);
  --teal: #1d4ed8;
  --teal-mid: #2563eb;
  --mint: #7dd3fc;
  --sand: #fbbf24;
  --coral: #fb7185;
  --ok: #0f9f6e;
  --shadow: 0 22px 50px rgba(29, 78, 216, 0.12);
  --radius: 24px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(125, 211, 252, 0.45), transparent 55%),
    radial-gradient(700px 420px at 95% 8%, rgba(251, 191, 36, 0.28), transparent 50%),
    linear-gradient(165deg, #edf3fb 0%, #e2ebf8 42%, #d9e4f4 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.5;
  animation: floaty 14s ease-in-out infinite alternate;
}

.orb-a {
  width: 420px;
  height: 420px;
  left: -90px;
  top: -70px;
  background: radial-gradient(circle, #93c5fd, transparent 68%);
}

.orb-b {
  width: 340px;
  height: 340px;
  right: -70px;
  top: 16%;
  background: radial-gradient(circle, #fcd34d, transparent 70%);
  animation-delay: -4s;
}

.orb-c {
  width: 280px;
  height: 280px;
  left: 28%;
  bottom: 8%;
  background: radial-gradient(circle, #fda4af, transparent 70%);
  animation-delay: -7s;
  opacity: 0.35;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes floaty {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(18px) scale(1.04);
  }
}

.shell {
  width: min(440px, 100%);
  height: 100%;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.welcome {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 32, 51, 0.28);
  backdrop-filter: blur(10px);
}

.welcome[hidden] {
  display: none !important;
}

.welcome-card {
  width: min(420px, 100%);
  padding: 22px 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #f4faf7);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 6px 8px 6px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.08);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
}

.chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(42vw, 168px);
  min-width: 0;
  height: 36px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.14);
  transition: transform 0.15s ease, background 0.2s ease;
}

.chat-pill:hover {
  background: rgba(37, 99, 235, 0.14);
}

.chat-pill:active {
  transform: scale(0.98);
}

.chat-pill.is-open {
  background: rgba(37, 99, 235, 0.18);
}

.chat-pill-icon {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.chat-pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: left;
  color: var(--ink-soft);
}

.bell-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 0 0 0 2px #fff;
}

.bell-dot[hidden] {
  display: none !important;
}

.chat {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  /* Cap to visible viewport so Android keyboard doesn't shove the sheet off-screen */
  height: 100%;
  max-height: 100dvh;
}

.chat[hidden] {
  display: none !important;
}

.chat-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 32, 51, 0.28);
  backdrop-filter: blur(6px);
}

.chat-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(78dvh, 640px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #ffffff, #f8faff);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-bottom: 0;
  box-shadow: 0 -18px 40px rgba(29, 78, 216, 0.14);
  overflow: hidden;
  animation: chat-up 0.28s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@keyframes chat-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(29, 78, 216, 0.08);
}

.chat-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.chat-close {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--teal-mid);
  font-size: 0.78rem;
  font-weight: 750;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.chat-bubble.is-bot {
  align-self: flex-start;
  background: rgba(37, 99, 235, 0.1);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}

.chat-bubble.is-user {
  align-self: flex-end;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #f4faf7;
  border-bottom-right-radius: 6px;
}

.chat-bubble.is-pending {
  opacity: 0.7;
  font-style: italic;
}

.chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(29, 78, 216, 0.08);
  background: rgba(247, 250, 247, 0.7);
}

.chat-compose input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 11px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}

.chat-compose input:focus {
  border-color: rgba(37, 99, 235, 0.35);
}

.chat-compose .btn {
  flex-shrink: 0;
  padding-inline: 16px;
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8 58%, #1e3a8a);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 8px 16px rgba(29, 78, 216, 0.24);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-mark.lg {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.welcome-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.welcome-brand-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.device-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.device-note.inline {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.settings {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.settings a {
  color: var(--teal-mid);
  font-weight: 700;
}

.health {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 25;
  width: min(92vw, 420px);
  padding: 10px 12px;
  border-radius: 14px;
  background: #1e3a8a;
  color: #eff6ff;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.28);
}

.health[hidden] {
  display: none !important;
}

.lang select {
  max-width: 118px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 8px 8px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--ink-soft);
  outline: none;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.tab {
  padding: 9px 6px;
  border-radius: 11px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.tab.is-active {
  background: var(--card-solid);
  color: #1e3a8a;
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.12);
}

.card {
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 255, 0.95)),
    radial-gradient(500px 180px at 80% -10%, rgba(147, 197, 253, 0.25), transparent 60%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#panel-timer.is-active {
  overflow: hidden;
}

#panel-next.is-active,
#panel-today.is-active {
  overflow: visible;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #1d4ed8, #38bdf8 45%, #fbbf24);
  opacity: 0.9;
}

.panel {
  display: none;
  animation: rise 0.38s ease;
}

.panel.is-active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-hero {
  margin-bottom: 8px;
}

.panel-hero.tight {
  margin-bottom: 4px;
}

#panel-timer .panel-hero.tight .eyebrow {
  display: none;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-mid);
}

.panel-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.panel-title.small {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.panel-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.unstick-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background:
    linear-gradient(105deg, rgba(37, 99, 235, 0.1), rgba(216, 184, 122, 0.16));
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.unstick-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal-mid);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.unstick-dot.soft {
  opacity: 0.45;
  box-shadow: none;
}

.unstick-line {
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.05));
}

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.field span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-size: 0.9rem;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field.compact {
  margin-bottom: 6px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.chip {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-soft);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.chip:active {
  transform: scale(0.97);
}

.chip.is-selected {
  background: var(--teal);
  border-color: var(--teal);
  color: #f4faf7;
}

.custom-row.is-hidden {
  display: none;
}

.timer-stage {
  position: relative;
  width: min(260px, 72vw);
  aspect-ratio: 1;
  margin: 8px auto 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.timer-stage.is-live {
  cursor: default;
}

#panel-timer {
  display: none;
}

#panel-timer.is-active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#panel-timer .timer-dock {
  margin-top: 0;
  padding-top: 4px;
  flex-shrink: 0;
}

.focus-fill {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 10px;
  padding: 12px 12px 10px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(37, 99, 235, 0.07), rgba(125, 211, 252, 0.12));
  border: 1px solid rgba(37, 99, 235, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.focus-pulse {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.focus-pulse-stat {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.focus-pulse-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--teal-mid);
  line-height: 1.1;
}

.focus-pulse-label {
  margin: 2px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: lowercase;
}

.focus-tip-title {
  margin: 4px 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.focus-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.focus-tip {
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.focus-tip:active {
  transform: scale(0.98);
}

.focus-tip-note {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.header-logout {
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.timer-glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126, 184, 164, 0.35), transparent 70%);
  filter: blur(8px);
  animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.tide-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.tide-track {
  fill: none;
  stroke: rgba(29, 78, 216, 0.1);
  stroke-width: 11;
}

.tide-progress {
  fill: none;
  stroke: var(--teal-mid);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 528;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s linear;
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.28));
}

.timer-core {
  text-align: center;
  z-index: 1;
  padding: 20px;
}

.phase-label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-mid);
}

.time-big {
  margin: 4px 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}

.time-sub {
  margin: 0 auto;
  font-size: 0.78rem;
  color: var(--ink-soft);
  max-width: 20ch;
  font-weight: 650;
  line-height: 1.25;
}

.timer-core {
  padding: 14px !important;
}

.phase-label {
  font-size: 0.7rem !important;
}

.timer-stage.is-running .tide-progress {
  animation: tide-breathe 3.2s ease-in-out infinite;
}

.timer-stage.is-running .timer-glow {
  animation-duration: 2.4s;
}

@keyframes tide-breathe {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.22));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(37, 99, 235, 0.4));
  }
}

.soft-start,
.drift-card,
.next-result,
.api-box {
  margin: 6px 0 8px;
  padding: 10px 12px;
  border-radius: 14px;
  animation: rise 0.3s ease;
}

.soft-start {
  text-align: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.soft-start-text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.soft-start-count {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--teal);
  animation: count-pop 0.45s ease;
}

@keyframes count-pop {
  from {
    transform: scale(0.7);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.soft-start-hint {
  margin: 0;
  color: var(--ink-soft);
}

.drift-card {
  background: linear-gradient(160deg, #fff8f2, #fffdf9);
  border: 1px solid rgba(184, 90, 61, 0.22);
  box-shadow: 0 14px 34px rgba(184, 90, 61, 0.08);
}

.drift-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.drift-body {
  margin: 6px 0 14px;
  color: var(--ink-soft);
}

.drift-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#timer-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#timer-actions .btn.ghost,
#timer-actions .btn.quiet {
  width: 100%;
  text-align: center;
}

.btn {
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.86rem;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.wide {
  width: 100%;
}

.btn.primary {
  background: linear-gradient(160deg, #3b82f6, #1d4ed8);
  color: #f4faf7;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.22);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  color: var(--teal);
}

.btn.quiet {
  color: var(--muted);
  font-weight: 600;
}

.btn.is-hidden,
.is-hidden {
  display: none !important;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.footnote {
  margin: 8px 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}

.api-box {
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(37, 99, 235, 0.35);
}

.api-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.api-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.api-status {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--coral);
}

.api-status.is-ready {
  color: var(--ok);
}

.ai-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.ai-status.is-error {
  color: var(--coral);
}

.next-result {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.next-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-mid);
}

.step-options {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.step-option {
  text-align: left;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(247, 250, 247, 0.95);
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.35;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.step-option:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.step-option.is-selected {
  border-color: var(--teal-mid);
  background: rgba(37, 99, 235, 0.1);
}

.step-option .step-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-mid);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--teal);
}

.stat-label {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.session-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  animation: rise 0.3s ease;
}

.session-task {
  margin: 0;
  font-weight: 650;
}

.session-meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.session-mins {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--teal-mid);
  font-size: 1.1rem;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  background: rgba(37, 99, 235, 0.12);
  color: var(--teal-mid);
  vertical-align: middle;
}

.badge.partial {
  background: rgba(184, 90, 61, 0.12);
  color: var(--coral);
}

.empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  font-weight: 500;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: var(--teal);
  color: #f4faf7;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 650;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 20;
  max-width: min(90vw, 360px);
  text-align: center;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 380px) {
  .shell {
    padding-inline: 12px;
  }

  .tab {
    font-size: 0.8rem;
  }

  .card {
    padding-inline: 12px;
  }
}
