/* Low Tide Theme — The Salted Fish Reset
   Self-hosted fonts, Light & Night tokens, iPhone safe-area layout, and Fish Token transitions. */

@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit_semibold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito_sans_regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito_sans_medium.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito_sans_bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces_variable.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Light tokens (default) */
:root,
[data-theme="light"] {
  --bg: #F4F1EA;             /* Salt */
  --card: #EDE8DE;           /* Sand */
  --panel: #DCE6E1;          /* Sea Mist */
  --shallow: #B7CBC2;        /* Shallow */
  --sage: #8FA98F;           /* Sage */
  --done-green: #5E8A6E;     /* Done green */
  --deep-tide: #2F4A47;      /* Deep Tide */
  --text: #24403C;           /* Ink */
  --text-soft: #3F5C55;      /* Ink soft */
  --text-muted: #4E625C;     /* Ink caption */
  --resting-grey: #8C9B96;   /* Resting grey */
  --sun-grain: #C9A66B;      /* Sun Grain */
  --danger-text: #8A3B2E;    /* Danger text */
  --line: #DDD6C8;           /* Card divider */
  --primary-btn-bg: #2F4A47;
  --primary-btn-text: #F4F1EA;
  --outline-btn-border: #2F4A47;
  --outline-btn-text: #2F4A47;
  color-scheme: light;
}

/* Night tokens — automatic from phone setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E3330;           /* Night (from Salt) */
    --card: #2A4542;         /* Night card (from Sand) */
    --panel: #2F4A47;        /* Night sea (from Sea Mist) */
    --shallow: #3B5A55;
    --sage: #8FA98F;
    --done-green: #5E8A6E;   /* Kept in night mode */
    --deep-tide: #2F4A47;
    --text: #F4F1EA;         /* Night text (from Ink) */
    --text-soft: #C7D2CD;    /* Night soft text */
    --text-muted: #C7D2CD;   /* Night soft text (>= 4.5:1 contrast) */
    --resting-grey: #8C9B96;
    --sun-grain: #C9A66B;    /* Kept in night mode */
    --danger-text: #E58C7C;
    --line: #4E6B64;         /* Night line */
    --primary-btn-bg: #F4F1EA;
    --primary-btn-text: #1E3330;
    --outline-btn-border: #C7D2CD;
    --outline-btn-text: #F4F1EA;
    color-scheme: dark;
  }
}

/* Explicit Night override (for preview toggle & Sleep screen) */
[data-theme="night"] {
  --bg: #1E3330;
  --card: #2A4542;
  --panel: #2F4A47;
  --shallow: #3B5A55;
  --sage: #8FA98F;
  --done-green: #5E8A6E;
  --deep-tide: #2F4A47;
  --text: #F4F1EA;
  --text-soft: #C7D2CD;
  --text-muted: #C7D2CD;
  --resting-grey: #8C9B96;
  --sun-grain: #C9A66B;
  --danger-text: #E58C7C;
  --line: #4E6B64;
  --primary-btn-bg: #F4F1EA;
  --primary-btn-text: #1E3330;
  --outline-btn-border: #C7D2CD;
  --outline-btn-text: #F4F1EA;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

/* App Shell — centered mobile column (390px iPhone baseline, expands gracefully up to 520px)
   Respects iPhone notch / Dynamic Island and Home Indicator safe areas */
.app-shell {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  padding-left: calc(env(safe-area-inset-left, 0px) + 20px);
  padding-right: calc(env(safe-area-inset-right, 0px) + 20px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 12px;
}

.app-title {
  font-family: "Outfit", sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

.icon-btn {
  min-width: 48px;
  min-height: 48px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 12px;
  font-family: "Nunito Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
}

/* Calm update banner ("New version ready — tap to refresh") */
.update-banner {
  background: var(--deep-tide);
  color: #F4F1EA;
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  cursor: pointer;
  border: 1px solid var(--sun-grain);
  width: 100%;
  text-align: left;
  font-family: "Nunito Sans", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.update-banner[hidden] {
  display: none;
}

/* Banner hero card matching 02-main-at-home / 03-welcome */
.sea-banner {
  position: relative;
  border-radius: 28px;
  background: var(--panel);
  padding: 22px 22px 64px;
  overflow: hidden;
}

.sea-banner__sun {
  position: absolute;
  right: 24px;
  top: 20px;
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: var(--bg);
  opacity: 0.9;
}

.sea-banner__band-upper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background: var(--shallow);
}

.sea-banner__band-lower {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  background: var(--sage);
}

.sea-banner__content {
  position: relative;
  z-index: 1;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sea-banner__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.sea-banner__heading {
  font-family: "Outfit", sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.sea-banner__sub {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card--deep {
  background: var(--deep-tide);
  color: #F4F1EA;
}

.card--panel {
  background: var(--panel);
}

.section-title {
  font-family: "Outfit", sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.caption {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Segmented control (like 04-report-week) — minimum 48px tap targets */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background: var(--card);
  border-radius: 26px;
  padding: 4px;
}

.segmented__btn {
  min-height: 48px;
  border-radius: 22px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: "Nunito Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.segmented__btn[aria-pressed="true"] {
  background: var(--deep-tide);
  color: #F4F1EA;
}

/* Pill buttons (54px height, 27px radius, >= 48px tap target) */
.btn-pill {
  min-height: 54px;
  border-radius: 27px;
  padding: 0 24px;
  font-family: "Nunito Sans", sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: var(--primary-btn-bg);
  color: var(--primary-btn-text);
}

.btn-pill--outline {
  background: transparent;
  border: 2px solid var(--outline-btn-border);
  color: var(--outline-btn-text);
}

.btn-pill--danger {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--danger-text);
  min-height: 48px;
  font-size: 15px;
}

/* Fish Token 400ms flip animation */
.fish-token {
  display: block;
  overflow: visible;
}

.fish-token .fish-group {
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fish-token .fish-body,
.fish-token .fish-tail,
.fish-token .fish-eye,
.fish-token .fish-diamond {
  transition:
    fill 400ms ease,
    stroke 400ms ease,
    opacity 400ms ease;
}

/* Interactive Fish tap card */
.fish-tap-area {
  min-height: 88px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: var(--text);
  font-family: "Nunito Sans", sans-serif;
}

/* 4-state Fish reference grid (00-theme-kit) */
.fish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fish-state-card {
  background: var(--bg);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fish-state-card--deep {
  background: #2F4A47;
  color: #F4F1EA;
}

.fish-state-card--deep .caption {
  color: #D8DED9;
}

/* Colour Swatches grid */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.swatch__box {
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.swatch__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.swatch__hex {
  font-size: 12px;
  color: var(--text-muted);
}

/* Typography showcase */
.type-sample-outfit {
  font-family: "Outfit", sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
}

.type-sample-fraunces {
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.type-sample-nunito {
  font-family: "Nunito Sans", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

/* Status rows */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  font-size: 14px;
}

.status-row:last-child {
  border-bottom: none;
}

.status-value {
  font-weight: 700;
  color: var(--text-soft);
  text-align: right;
}

/* Bottom Navigation Shell (48px+ tap targets, safe-area inset bottom) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  z-index: 10;
}

.bottom-nav__inner {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px 8px;
}

.bottom-nav__btn {
  min-height: 52px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "Nunito Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 14px;
  cursor: pointer;
}

.bottom-nav__btn[aria-current="page"] {
  color: var(--text);
  background: var(--panel);
}

/* Phase 2 Audio & Breathing Test Screen (Night Colours) */
.sleep-test-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.volume-note {
  background: #2A4542;
  color: #C7D2CD;
  border: 1px solid #4E6B64;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
}

.sleep-card {
  background: #2A4542;
  color: #F4F1EA;
  border: 1px solid #3E5A54;
}

.sleep-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #CDB58A;
}

.sleep-caption {
  color: #C7D2CD;
}

.sleep-stat-box {
  background: #1E3330;
  border-radius: 16px;
  padding: 6px 14px;
}

.sleep-play-btn {
  background: #E8E2D4;
  color: #1E3330;
  width: 100%;
}

.sleep-outline-btn {
  background: transparent;
  border: 1.5px solid #C7D2CD;
  color: #F4F1EA;
  width: 100%;
  font-size: 15px;
}

.timer-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.timer-chip {
  min-height: 48px;
  border-radius: 24px;
  border: 1px solid #3E5A54;
  background: transparent;
  color: #E8E2D4;
  font-family: "Nunito Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.timer-chip[aria-pressed="true"] {
  background: #7FA3A6;
  border-color: #7FA3A6;
  color: #172624;
}

/* GuideCard matching BreathingOverlay.kt */
.guide-live-card {
  background: #162321;
  border: 1px solid #3E5A54;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color 600ms ease, opacity 600ms ease;
}

.guide-live-card--dark {
  background: #0E1716;
  border-color: #1E3330;
}

.guide-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.guide-live-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-eyebrow-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #CDB58A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-main-title {
  font-family: "Outfit", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #F4F1EA;
  line-height: 1.15;
}

.guide-count-box {
  width: 64px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.guide-count-num {
  font-family: "Outfit", sans-serif;
  font-size: 44px;
  font-weight: 600;
  color: #E8DCC0;
  line-height: 1;
}

.guide-breath-track {
  height: 8px;
  border-radius: 4px;
  background: #2A4542;
  overflow: hidden;
}

.guide-breath-fill {
  height: 100%;
  border-radius: 4px;
  background: #8FA98F;
  transition: width 120ms linear;
}

.guide-jump-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sleep-jump-btn {
  background: #1E3330;
  color: #F4F1EA;
  border-color: #4E6B64;
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
}

/* Phase 3 Welcome & Today Screen Styles */
.welcome-hero {
  position: relative;
  height: 220px;
  border-radius: 28px;
  background: #DCE6E1;
  overflow: hidden;
}

.welcome-hero__sun {
  position: absolute;
  right: 28px;
  top: 24px;
  width: 72px;
  height: 72px;
  border-radius: 36px;
  background: #F4F1EA;
}

.welcome-hero__sea-upper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
  background: #B7CBC2;
}

.welcome-hero__sea-lower {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: #8FA98F;
}

.welcome-hero__arc {
  position: absolute;
  left: 22px;
  top: 22px;
}

.intro-step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  border-radius: 16px;
  padding: 12px 14px;
}

.intro-step-num {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--deep-tide);
  color: #F4F1EA;
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-steps-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-step-item {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
}

.note-textarea {
  width: 100%;
  min-height: 104px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 12px 14px;
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
}

.note-textarea:focus {
  outline: 2px solid var(--deep-tide);
  border-color: transparent;
}

.done-banner-box {
  background: var(--panel);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.day-select {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 0 14px;
  font-family: "Nunito Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
}

/* Phase 5 Flips Tracker, Milestones & Week View Styles */
.today-mini-flips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.today-mini-flip-btn {
  min-height: 76px;
  border-radius: 18px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito Sans", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  cursor: pointer;
}

.today-mini-flip-btn[aria-pressed="true"] {
  border-color: var(--done-green);
  background: var(--panel);
}

.flips-counter-pill {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 999px;
}

.flips-counter-pill--win {
  background: var(--panel);
  color: var(--text);
}

.flips-habit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flips-habit-btn {
  width: 100%;
  min-height: 72px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 12px 16px;
  font-family: "Nunito Sans", sans-serif;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.flips-habit-btn--done {
  border-color: var(--done-green);
  background: var(--panel);
}

.flips-habit-btn__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flips-habit-btn__title {
  font-family: "Outfit", sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.flips-habit-btn__fish {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.flips-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  padding-top: 2px;
}

/* Quiet Milestone Card (Deep Tide + Sun Grain) */
.flips-milestone-card {
  background: #2F4A47;
  color: #F4F1EA;
  border-radius: 24px;
  padding: 20px;
  border: 1.5px solid #C9A66B;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flips-milestone-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.flips-milestone-card__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flips-milestone-card__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #E6D2A8;
}

.flips-milestone-card__msg {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  color: #F4F1EA;
}

.flips-milestone-card__badge {
  flex-shrink: 0;
}

.flips-milestone-card__sub {
  font-size: 12px;
  color: #D8DED9;
}

.flips-milestone-dismiss {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid #C9A66B;
  background: rgba(201, 166, 107, 0.16);
  color: #F4F1EA;
  font-family: "Nunito Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Missed-Day Nudge Banner (matching 04-report-week.html lines 54-57) */
.flips-missed-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border-radius: 20px;
  padding: 14px 16px;
}

.flips-missed-banner__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

/* Week Summary Card (matching 04-report-week.html lines 26-37) */
.flips-week-summary {
  background: #2F4A47;
  color: #F4F1EA;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flips-week-summary__title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #F4F1EA;
}

.flips-week-summary__range {
  font-size: 13px;
  color: #D8DED9;
}

.flips-week-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.flips-week-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flips-week-stat__val {
  font-family: "Outfit", sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: #F4F1EA;
}

.flips-week-stat__of {
  font-size: 15px;
  font-weight: 500;
  color: #D8DED9;
}

.flips-week-stat__label {
  font-size: 13px;
  color: #D8DED9;
}

.flips-week-summary__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #E6D2A8;
}

.flips-golden-pill {
  background: rgba(201, 166, 107, 0.2);
  border: 1px solid #C9A66B;
  color: #F4F1EA;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* Week View Bar Chart (Sunday to Saturday, matching 04-report-week.html lines 39-52) */
.flips-bars-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 6px;
}

.flips-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.flips-bar-track {
  width: 100%;
  height: 136px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.flips-bar-diamond {
  flex-shrink: 0;
}

.flips-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 10px;
  transition: height 300ms ease, background-color 300ms ease;
}

.flips-bar--done {
  background: #5E8A6E;
}

.flips-bar--partial {
  background: #A9B5B0;
}

.flips-bar--resting {
  background: var(--panel);
}

.flips-bar-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.flips-bar-label--today {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.flips-bar-count {
  font-size: 11px;
}

/* ============================================================================
   Phase 6 — Full-Screen Sleep Screen (design/html/07, 10–19)
   ============================================================================ */

.sleep-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.sleep-scene-stage {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 68%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.sleep-scene-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sleep-dim-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #081110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 800ms ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(env(safe-area-inset-top, 16px) + 72px);
}

.sleep-dim-hint {
  font-size: 13px;
  color: #8FA39C;
  background: rgba(16, 32, 42, 0.75);
  border: 1px solid #3E5A54;
  padding: 6px 14px;
  border-radius: 999px;
}

.sleep-top-bar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 12px) + 10px) 16px 8px;
  transition: opacity 600ms ease;
}

.sleep-close-btn {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  border: 1px solid rgba(143, 163, 156, 0.35);
  background: rgba(19, 32, 30, 0.55);
  color: #C7D2CD;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sleep-edit-pill {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 24px;
  border: 1px solid #3E5A54;
  background: rgba(19, 32, 30, 0.65);
  color: #F4F1EA;
  font-family: "Nunito Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.sleep-bottom-sheet {
  position: relative;
  z-index: 4;
  margin-top: auto;
  border-radius: 28px 28px 0 0;
  padding: 20px 22px calc(env(safe-area-inset-bottom, 16px) + 18px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 76vh;
  overflow-y: auto;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
  transition: opacity 600ms ease;
}

.sleep-scene-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #CDB58A;
}

.sleep-scene-headline {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.12;
  color: #F4F1EA;
}

.sleep-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sleep-play-circle {
  width: 54px;
  height: 54px;
  border-radius: 27px;
  border: none;
  background: #E8E2D4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.sleep-sound-title-btn {
  min-height: 32px;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: #F4F1EA;
  font-family: "Nunito Sans", sans-serif;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.sleep-player-sub {
  font-size: 13px;
  color: #A9B8B2;
  line-height: 1.3;
}

.sleep-guide-pill {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 24px;
  border: 1px solid #3E5A54;
  background: transparent;
  color: #C7D2CD;
  font-family: "Nunito Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.sleep-timer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sleep-timer-chip {
  min-height: 48px;
  padding: 0 8px;
  border-radius: 24px;
  border: 1px solid #3E5A54;
  background: transparent;
  color: #E8E2D4;
  font-family: "Nunito Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.15;
}

.sleep-volume-line {
  font-size: 12px;
  color: #A9B8B2;
  text-align: center;
  padding-top: 2px;
}

.sleep-offline-prompt {
  background: rgba(16, 32, 42, 0.72);
  border: 1px solid #3E5A54;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sleep-guide-box {
  background: rgba(16, 32, 42, 0.76);
  border: 1px solid #3E5A54;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sleep-guide-action-btn {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 24px;
  border: 1px solid #3E5A54;
  background: rgba(30, 51, 48, 0.65);
  color: #C7D2CD;
  font-family: "Nunito Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sleep-mini-btn {
  min-height: 48px;
  padding: 0 12px;
  border-radius: 24px;
  border: 1px solid #3E5A54;
  background: transparent;
  color: #C7D2CD;
  font-family: "Nunito Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sleep-choice-btn {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 24px;
  border: 1px solid #3E5A54;
  background: transparent;
  color: #E8E2D4;
  font-family: "Nunito Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sleep-choice-btn--primary {
  border-color: transparent;
}

.sleep-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 17, 16, 0.82);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: env(safe-area-inset-top, 16px) 0 0;
}

.sleep-modal-sheet {
  position: relative;
  z-index: 51;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: #172624;
  border-top: 1px solid #3E5A54;
  border-radius: 26px 26px 0 0;
  padding: 20px 20px calc(env(safe-area-inset-bottom, 16px) + 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.5);
}

.sleep-sound-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sleep-sound-option {
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #3E5A54;
  background: rgba(16, 32, 42, 0.55);
  color: #F4F1EA;
  font-family: "Nunito Sans", sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.sleep-sound-option--selected {
  border-color: #C9A66B;
  background: rgba(46, 71, 64, 0.75);
}

.sleep-offline-box {
  margin-top: 4px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(16, 32, 42, 0.65);
  border: 1px solid #3E5A54;
}

/* Respect iPhone "Reduce Motion" setting: no animations or transitions */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  .fish-token .fish-group,
  .fish-token .fish-body,
  .fish-token .fish-tail,
  .fish-token .fish-eye,
  .fish-token .fish-diamond {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
