/* ============================================
   OneHabit — Premium Wellness App Styles
   ============================================ */

:root {
  --bg: #FAFAF7;
  --bg-warm: #F4F1EB;
  --bg-dark: #1A1917;
  --text: #1A1917;
  --text-soft: #5C5A54;
  --text-faint: #9C9A94;
  --green: #6B8F71;
  --green-light: #8FB196;
  --green-deep: #4A6E50;
  --green-bg: rgba(107,143,113,0.07);
  --terra: #B8846C;
  --terra-light: #D4A990;
  --amber: #C9A84C;
  --cream: #F7F4EE;
  --white: #FFFFFF;
  --border: rgba(26,25,23,0.06);
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Outfit', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(26,25,23,0.04), 0 1px 2px rgba(26,25,23,0.03);
  --shadow-md: 0 4px 16px rgba(26,25,23,0.06), 0 1px 3px rgba(26,25,23,0.04);
  --shadow-lg: 0 12px 40px rgba(26,25,23,0.08), 0 4px 12px rgba(26,25,23,0.04);
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg-warm);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

/* ---- Grain overlay ---- */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ---- App container ---- */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 80px rgba(26,25,23,0.06);
}

@media (min-width: 481px) {
  .app-container {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ---- Screens ---- */
.screen {
  padding: 72px 20px 100px;
  animation: screenFadeIn 0.4s var(--ease);
}

.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--bg);
  overflow-y: auto;
  padding: 20px;
  padding-top: 24px;
  max-width: 480px;
  margin: 0 auto;
}

.screen-timer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-dark);
  max-width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-content {
  padding-bottom: 24px;
}

/* ---- Top nav ---- */
.top-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 500;
  background: rgba(250,250,247,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo .logo-accent,
.logo-accent {
  color: #6B8F71 !important;
}

.nav-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-soft);
  transition: background 0.2s, color 0.2s;
}

.nav-icon-btn:hover {
  background: var(--green-bg);
  color: var(--green);
}

.burger-menu-wrapper {
  position: relative;
}

.burger-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  min-width: 180px;
  padding: 6px 0;
  z-index: 9000;
  border: 1px solid var(--border);
  animation: fadeIn 0.15s ease;
}

.burger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.burger-item:hover {
  background: var(--green-bg);
}

.guide-section {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
}

.guide-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--text);
}

.guide-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
}

/* ---- Bottom nav ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 50;
  background: rgba(250,250,247,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 6px 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-tab svg {
  transition: color 0.2s, transform 0.2s;
}

.nav-tab.active {
  color: var(--green);
}

.nav-tab.active svg {
  transform: translateY(-1px);
}

/* ---- Typography ---- */
.screen-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.25s var(--ease);
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--text-faint);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-full {
  width: 100%;
}

.btn-done {
  flex: 1;
  background: var(--green);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
}

.btn-done:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-skip {
  flex: 1;
  background: var(--bg-warm);
  color: var(--text-soft);
  padding: 14px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border);
}

.btn-skip:hover {
  background: #EDE9E2;
  transform: translateY(-1px);
}

.btn-timer {
  width: 100%;
  background: var(--bg-dark);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  margin-top: 12px;
}

.btn-timer:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-link {
  color: var(--green);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
}

.btn-link:hover {
  color: var(--green-deep);
}

.btn-link-secondary {
  color: var(--text-faint);
}

.btn-link-secondary:hover {
  color: var(--text-soft);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-soft);
}

.btn-icon:hover {
  background: var(--green-bg);
  color: var(--green);
}

.btn-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-warm);
  color: var(--text-soft);
  z-index: 10;
  transition: all 0.2s;
}

.btn-close:hover {
  background: #EDE9E2;
  color: var(--text);
}

.btn-close-light {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  position: fixed;
  top: 16px;
  right: 16px;
}

.btn-close-light:hover {
  background: rgba(255,255,255,0.2);
  color: var(--white);
}

.btn-danger {
  background: none;
  color: #C45C5C;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
}

.btn-danger:hover {
  color: #A44040;
}

/* ---- Inputs ---- */
.input-field {
  width: 100%;
  padding: 16px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}

.input-field::placeholder {
  color: var(--text-faint);
}

.input-group {
  margin-bottom: 24px;
}

.input-time {
  width: 100%;
  padding: 16px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}

.input-time:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}

/* ---- Onboarding ---- */
.onboarding-step {
  min-height: calc(100vh - 172px);
  min-height: calc(100dvh - 172px);
  display: flex;
  align-items: center;
}

.onboarding-lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 8px;
}
.lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s;
}
/* ---- ToS checkbox ---- */
.tos-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
  cursor: pointer;
}
.tos-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}
.tos-checkbox a {
  color: var(--green);
  text-decoration: underline;
}
.onboarding-login-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 16px;
}
.onboarding-login-hint a {
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Auth screens ---- */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 80px);
  padding: 32px 24px;
}
.otp-input-group {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}
.otp-digit {
  width: 56px;
  height: 64px;
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--green);
}
.verify-email-display {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-top: 4px;
}
.auth-error {
  color: var(--terra);
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}
.auth-screen .btn-primary {
  margin-bottom: 16px;
}

/* ---- ToS modal ---- */
.tos-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tos-modal-content {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.tos-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.tos-modal-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
}
.btn-close-tos {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-soft);
  cursor: pointer;
  padding: 4px 8px;
}
.tos-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
}
.tos-modal-body h3 {
  font-size: 14px;
  color: var(--text);
  margin: 16px 0 6px;
}
.tos-modal-body h3:first-child {
  margin-top: 0;
}

.lang-btn.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.onboarding-content {
  width: 100%;
  animation: stepFadeIn 0.5s var(--ease);
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboarding-progress {
  margin-bottom: 32px;
}

.progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s var(--ease);
}

.progress-dots .dot.active {
  background: var(--green);
  width: 24px;
  border-radius: 4px;
}

.progress-dots .dot.done {
  background: var(--green-light);
}

.onboarding-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 8px;
}

.onboarding-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 32px;
}

/* Goals grid */
.goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.goal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s var(--ease);
  color: var(--text-soft);
}

.goal-card:hover {
  border-color: rgba(107,143,113,0.2);
  background: var(--green-bg);
}

.goal-card.selected {
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--green-deep);
}

.goal-card-wide {
  grid-column: 1 / -1;
}

.goal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-label {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* Mode options */
.mode-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.mode-card:hover {
  border-color: rgba(107,143,113,0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mode-icon {
  color: var(--green);
  margin-bottom: 4px;
}

.mode-label {
  font-size: 18px;
  font-weight: 600;
}

.mode-desc {
  font-size: 14px;
  color: var(--text-soft);
}

.coming-soon-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--amber);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coming-soon-msg {
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius);
  animation: stepFadeIn 0.3s var(--ease);
}

/* Time pickers */
.time-pickers {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.time-picker-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.time-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
}

/* Welcome */
.onboarding-welcome {
  text-align: center;
}

.welcome-icon {
  margin-bottom: 20px;
}

.welcome-text {
  text-align: left;
  margin-bottom: 32px;
}

.welcome-text p {
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.7;
}

.welcome-text strong {
  color: var(--text);
  font-weight: 600;
}

.welcome-hint {
  font-style: italic;
  color: var(--text-faint) !important;
  font-size: 14px !important;
  margin-top: 8px;
}

.welcome-principle {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--green-bg);
  border-radius: 12px;
  border: 1px solid rgba(107,143,113,0.1);
}
.welcome-principle-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}
.welcome-principle strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.welcome-principle p {
  font-size: 13px !important;
  color: var(--text-soft);
  margin-bottom: 0 !important;
  line-height: 1.5;
}

/* ---- Greeting ---- */
.greeting {
  font-family: var(--font-display);
  font-size: 26px;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* ---- Habit card ---- */
.habit-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.habit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.habit-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  background: var(--green-bg);
  padding: 5px 12px;
  border-radius: 100px;
}

.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
}

.evidence-badge.strong {
  background: rgba(107,143,113,0.1);
  color: var(--green-deep);
}

.evidence-badge.moderate {
  background: rgba(201,168,76,0.12);
  color: #8B7430;
}

.evidence-badge.weak {
  background: rgba(156,154,148,0.12);
  color: var(--text-faint);
}

.time-of-day-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(142,120,90,0.1);
  color: var(--text-soft);
}

.evidence-badge-lg {
  font-size: 12px;
  padding: 6px 14px;
  margin-bottom: 16px;
  display: inline-flex;
}

.habit-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.habit-instruction {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Habit progress */
.habit-progress {
  margin-bottom: 20px;
}

.progress-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 8px;
  display: block;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-warm);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-light), var(--green));
  border-radius: 100px;
  transition: width 0.5s var(--ease);
  width: 0%;
}

/* Period selector */
.period-selector {
  margin-bottom: 20px;
  animation: stepFadeIn 0.3s var(--ease);
}

.period-label {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 12px;
  text-align: center;
}

.period-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-period {
  padding: 12px 8px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  transition: all 0.2s var(--ease);
}

.btn-period:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
}

.btn-period.selected {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

/* Habit actions */
.habit-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

/* Feedback buttons */
.feedback-buttons {
  margin-bottom: 16px;
  animation: stepFadeIn 0.3s var(--ease);
}

.feedback-label {
  font-size: 14px;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 10px;
}

.feedback-options {
  display: flex;
  gap: 8px;
}

/* Daily check — unified action + feedback */
.daily-check {
  margin-top: 4px;
}
.daily-check-label {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}
.daily-check-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-check {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: var(--font-body);
}
.btn-check-emoji {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}
.btn-check-text {
  font-size: 15px;
  font-weight: 500;
}
.btn-check-better {
  background: rgba(107,143,113,0.08);
  border: 1.5px solid rgba(107,143,113,0.2);
  color: var(--green-deep);
}
.btn-check-better:hover {
  background: rgba(107,143,113,0.15);
  border-color: var(--green);
  transform: translateY(-1px);
}
.btn-check-same {
  background: rgba(201,168,76,0.06);
  border: 1.5px solid rgba(201,168,76,0.18);
  color: #8A7020;
}
.btn-check-same:hover {
  background: rgba(201,168,76,0.12);
  border-color: var(--amber);
  transform: translateY(-1px);
}
.btn-check-worse {
  background: rgba(196,92,92,0.06);
  border: 1.5px solid rgba(196,92,92,0.18);
  color: #A04040;
}
.btn-check-worse:hover {
  background: rgba(196,92,92,0.12);
  border-color: #C45C5C;
  transform: translateY(-1px);
}
.btn-check-skip {
  background: var(--bg-warm);
  border: 1.5px solid var(--border);
  color: var(--text-faint);
  margin-top: 4px;
}
.btn-check-skip:hover {
  border-color: var(--text-faint);
  color: var(--text-soft);
}
.btn-check-skip .btn-check-text {
  font-weight: 400;
  font-size: 14px;
}

.today-done-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(107,143,113,0.06);
  border: 1px solid rgba(107,143,113,0.15);
  border-radius: 12px;
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}
.today-done-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* Habit links */
.habit-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Congrats overlay */
.congrats-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(250,250,247,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: screenFadeIn 0.4s var(--ease);
}

.congrats-card {
  text-align: center;
  max-width: 360px;
}

.congrats-icon {
  margin-bottom: 20px;
  animation: conratsPop 0.5s var(--ease) 0.2s both;
}

@keyframes conratsPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.congrats-title {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 10px;
}

.congrats-text {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ---- Adopted habits ---- */
.adopted-section {
  margin-top: 8px;
}

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

.adopted-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.adopted-item-clickable {
  cursor: pointer;
}
.adopted-item-clickable:hover {
  border-color: var(--green-light);
  background: var(--green-bg);
  transform: translateY(-1px);
}
.adopted-arrow {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: color 0.2s;
}
.adopted-item-clickable:hover .adopted-arrow {
  color: var(--green);
}

.adopted-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.adopted-info {
  flex: 1;
  min-width: 0;
}

.adopted-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adopted-stats {
  font-size: 12px;
  color: var(--text-faint);
}

.empty-state {
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  padding: 24px 16px;
}

/* ---- Evidence card ---- */
.evidence-card {
  position: relative;
  padding: 52px 4px 40px;
  animation: screenFadeIn 0.4s var(--ease);
}

.evidence-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  line-height: 1.3;
}

.evidence-section {
  margin-bottom: 24px;
}

.evidence-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.evidence-section p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-soft);
}

.evidence-source {
  display: block;
  font-size: 13px;
  color: var(--green);
  margin-bottom: 6px;
  word-break: break-all;
}

.evidence-source:hover {
  color: var(--green-deep);
  text-decoration: underline;
}

.evidence-timer {
  margin-top: 20px;
}

/* ---- Timer screen ---- */
.timer-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px 40px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--white);
}

/* Timer habit info */
.timer-habit-info {
  text-align: center;
  margin-bottom: 16px;
  padding: 0 16px;
}
.timer-habit-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 6px;
}
.timer-habit-desc {
  font-size: 0.8rem;
  color: rgba(247,244,238,0.45);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

.timer-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-preset {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}

.btn-preset:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.25);
}

.btn-preset.active {
  color: var(--white);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
}

.timer-custom-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 4px;
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 100px;
  transition: border-color 0.2s;
}
.timer-custom-wrap:focus-within {
  border-color: var(--green-light);
  background: rgba(255,255,255,0.04);
}
.timer-custom-input {
  width: 36px;
  padding: 4px 2px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--white);
  background: transparent;
  border: none;
  text-align: center;
  -moz-appearance: textfield;
}
.timer-custom-input::placeholder {
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}
.timer-custom-input:focus {
  outline: none;
}
.timer-custom-input::-webkit-inner-spin-button,
.timer-custom-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.timer-custom-label {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}

/* Breathing ball */
.timer-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.breath-ball {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, var(--green-light), var(--green-deep));
  box-shadow: 0 0 60px rgba(107,143,113,0.35);
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(.4,0,.2,1);
  transform: scale(1);
  opacity: 0.7;
}

.breath-ball.inhale {
  transform: scale(1.8);
  opacity: 0.95;
}

.breath-ball.exhale {
  transform: scale(0.6);
  opacity: 0.4;
}

.breath-ball.hold {
  transform: scale(1.8);
  opacity: 0.85;
}

/* Timer info */
.timer-phase {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 8px;
  min-height: 38px;
  text-align: center;
}

.timer-countdown {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.timer-status {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 36px;
  text-align: center;
  min-height: 22px;
}

/* Timer controls */
.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

.btn-sound {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}

.btn-sound:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.3);
}

.btn-timer-start {
  padding: 16px 48px;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 500;
  color: var(--bg-dark);
  background: var(--white);
  transition: all 0.25s var(--ease);
}

.btn-timer-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255,255,255,0.2);
}

.btn-timer-start.running {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

/* Timer done */
.timer-done {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  animation: screenFadeIn 0.5s var(--ease);
}

.timer-done-icon {
  margin-bottom: 20px;
}

.timer-done-text {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--white);
  margin-bottom: 32px;
}

/* ---- Progress screen ---- */
/* Progress blocks */
.progress-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
}
.progress-block-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
}
.progress-block-habit {
  font-size: 0.85rem;
  color: var(--green-deep);
  font-weight: 500;
  margin-bottom: 14px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--green);
}

.stat-label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}

/* Calendar */
.calendar-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-month {
  font-weight: 600;
  font-size: 15px;
  text-transform: capitalize;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  border-radius: 8px;
}

.cal-day.today {
  font-weight: 700;
  color: var(--text);
}

.cal-day .cal-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.cal-dot.done {
  background: var(--green);
}

.cal-dot.skipped {
  background: #C45C5C;
}

.calendar-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.done { background: var(--green); }
.legend-dot.skipped { background: #C45C5C; }

/* Mood chart */
.mood-section {
  margin-bottom: 20px;
}
.section-hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: -4px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.mood-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.mood-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-soft);
}
.mood-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.mood-dot.mood-better { background: var(--green); }
.mood-dot.mood-same { background: var(--amber); }
.mood-dot.mood-worse { background: var(--terra); }

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

.mood-empty {
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 20px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mood-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
.mood-entry-emoji {
  font-size: 18px;
  flex-shrink: 0;
}
.mood-entry-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}
.mood-entry-date {
  font-size: 12px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.mood-entry-better {
  background: rgba(107,143,113,0.06);
  border-color: rgba(107,143,113,0.18);
  color: var(--green-deep);
}
.mood-entry-same {
  background: rgba(201,168,76,0.06);
  border-color: rgba(201,168,76,0.18);
  color: #8A7020;
}
.mood-entry-worse {
  background: rgba(196,92,92,0.06);
  border-color: rgba(196,92,92,0.18);
  color: #A04040;
}

/* ---- Journal ---- */
/* Journal intro */
.journal-intro {
  background: var(--green-bg);
  border: 1px solid rgba(107,143,113,0.12);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.journal-intro p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.journal-intro-hint {
  margin-top: 8px;
  font-size: 0.8rem !important;
  color: var(--text-faint) !important;
  font-style: italic;
}

.journal-form {
  margin-bottom: 24px;
}

.journal-input-wrap {
  position: relative;
}

.btn-mic {
  position: absolute;
  right: 10px;
  bottom: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-warm);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-mic:hover {
  background: var(--green-bg);
  color: var(--green);
}
.btn-mic.recording {
  background: #e74c3c;
  color: white;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
}

.mic-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #e74c3c;
  margin-bottom: 8px;
  padding: 0 4px;
}
.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e74c3c;
  animation: micPulse 1s ease-in-out infinite;
}

.journal-textarea {
  width: 100%;
  padding: 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.journal-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}

.journal-textarea::placeholder {
  color: var(--text-faint);
}

.journal-entries {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journal-entry {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: stepFadeIn 0.3s var(--ease);
}

.journal-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.journal-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

.journal-habit {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-bg);
  padding: 2px 8px;
  border-radius: 100px;
}

.journal-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ---- Settings ---- */
.settings-list {
  display: flex;
  flex-direction: column;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item-action {
  justify-content: center;
  padding-top: 24px;
}

.settings-label {
  font-size: 15px;
  color: var(--text-soft);
}

.settings-hint {
  font-size: 13px;
  color: var(--text-faint);
  margin: 4px 0 12px;
}

.settings-section {
  margin-top: 16px;
}

.telegram-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--green-deep);
  margin-bottom: 12px;
}

.telegram-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.btn-sm {
  font-size: 13px;
  padding: 8px 16px;
}

.btn-ghost.btn-sm {
  color: var(--text-faint);
  border: 1px solid var(--border);
  margin-top: 8px;
}

.settings-value {
  font-size: 15px;
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.settings-item-edit {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.settings-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}
.settings-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.settings-goals-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.goal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.goal-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

/* ---- Habit proposal flow ---- */
.proposal-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.proposal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* Ghost / outline button */
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  transition: all 0.25s var(--ease);
}

.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: translateY(0);
}

/* "Взять новую привычку" button placed outside the card */
.btn-new-habit-outer {
  display: block;
  width: 100%;
  margin: 12px 0 24px;
  padding: 14px 24px;
  background: transparent;
  color: var(--terra);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: 2px solid var(--terra-light);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.btn-new-habit-outer:hover {
  background: rgba(184,132,108,0.08);
  border-color: var(--terra);
  transform: translateY(-1px);
}

/* Habit card appear animation */
.habit-card-appear {
  animation: habitAppear 0.5s var(--ease) both;
}
@keyframes habitAppear {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Habit search animation */
.habit-search-animation {
  text-align: center;
  padding: 48px 16px;
}
.search-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--green);
  animation: spinnerRotate 1s linear infinite;
}
.spinner-icon {
  font-size: 28px;
  color: var(--green);
  animation: spinnerPulse 1.2s ease-in-out infinite;
}
@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}
@keyframes spinnerPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}
.search-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 6px;
}
.search-subtext {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* Evidence detail button — subtle but clickable */
.btn-evidence-prominent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  margin: 8px 0 0;
  background: none;
  color: var(--green);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.btn-evidence-prominent:hover {
  color: var(--green-deep);
  text-decoration: underline;
}
.btn-evidence-prominent svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* Confirm dialog overlay */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,25,23,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: slideUp 0.3s var(--ease);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.confirm-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 10px;
}
.confirm-message {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Confetti celebration */
.confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  animation: confettiFly 1.1s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes confettiFly {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), calc(var(--dy) + 200px)) rotate(var(--rot)) scale(0.3);
    opacity: 0;
  }
}

/* ---- Utilities ---- */
.hidden { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 360px) {
  .onboarding-title {
    font-size: 26px;
  }
  .habit-title {
    font-size: 20px;
  }
  .timer-countdown {
    font-size: 36px;
  }
  .timer-container {
    padding: 40px 16px 24px;
  }
  .timer-habit-info {
    margin-bottom: 8px;
  }
  .timer-habit-title {
    font-size: 1rem;
  }
  .timer-habit-desc {
    font-size: 0.75rem;
    line-height: 1.4;
  }
  .timer-visual {
    min-height: 180px;
  }
  .breath-ball {
    width: 110px;
    height: 110px;
  }
  .breath-ball.inhale {
    transform: scale(1.5);
  }
  .timer-phase {
    font-size: 22px;
    margin-bottom: 4px;
    min-height: 30px;
  }
  .timer-status {
    margin-bottom: 20px;
    font-size: 12px;
  }
  .timer-presets {
    margin-bottom: 24px;
    gap: 6px;
  }
  .timer-controls {
    gap: 12px;
    padding-bottom: 16px;
  }
  .btn-timer-start {
    padding: 12px 36px;
    font-size: 15px;
  }
  .btn-sound {
    width: 40px;
    height: 40px;
  }
  .period-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile timer compactness (standard phones 375-480px) */
@media (max-width: 480px) {
  .timer-container {
    padding: 44px 16px 24px;
  }
  .timer-habit-info {
    margin-bottom: 6px;
  }
  .timer-habit-desc {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  .timer-visual {
    min-height: 160px;
  }
  .breath-ball {
    width: 120px;
    height: 120px;
  }
  .timer-phase {
    font-size: 24px;
    margin-bottom: 4px;
  }
  .timer-countdown {
    font-size: 40px;
  }
  .timer-status {
    margin-bottom: 16px;
    font-size: 12px;
  }
  .timer-presets {
    margin-bottom: 20px;
    gap: 6px;
  }
  .timer-controls {
    gap: 12px;
    padding-bottom: 16px;
  }
  .btn-timer-start {
    padding: 12px 36px;
    font-size: 15px;
  }
}

/* Extra small screens (iPhone SE, 375px and below) */
@media (max-height: 700px) {
  .timer-container {
    padding: 32px 12px 16px;
  }
  .timer-habit-info {
    margin-bottom: 4px;
  }
  .timer-habit-desc {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  .timer-visual {
    min-height: 140px;
  }
  .breath-ball {
    width: 90px;
    height: 90px;
  }
  .timer-phase {
    font-size: 18px;
    min-height: 24px;
  }
  .timer-countdown {
    font-size: 32px;
  }
  .timer-status {
    margin-bottom: 12px;
    font-size: 11px;
  }
  .timer-presets {
    margin-bottom: 16px;
    gap: 4px;
  }
  .btn-preset {
    padding: 6px 10px;
    font-size: 12px;
  }
  .timer-controls {
    gap: 10px;
    padding-bottom: 12px;
  }
  .btn-timer-start {
    padding: 10px 28px;
    font-size: 14px;
  }
  .btn-sound {
    width: 36px;
    height: 36px;
  }
  .btn-timer-close {
    top: 12px;
    right: 12px;
  }
}

@media (min-width: 481px) {
  .screen-overlay {
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ---- Feature 1: Two-step daily check ---- */
.daily-check-buttons-two {
  display: flex;
  gap: 10px;
}
.daily-check-buttons-two .btn-check-done {
  flex: 1;
  background: var(--green);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s var(--ease);
}
.daily-check-buttons-two .btn-check-done:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.daily-check-buttons-two .btn-check-skip {
  flex: 0 0 auto;
  background: transparent;
  color: var(--text-faint);
  padding: 14px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  transition: all 0.25s var(--ease);
}
.daily-check-buttons-two .btn-check-skip:hover {
  border-color: var(--text-faint);
  color: var(--text-soft);
  transform: translateY(-1px);
}

.pair-tracking {
  display: flex;
  gap: 10px;
}
.pair-tracking .btn-check-done {
  flex: 1;
  background: var(--green);
  color: var(--white);
  padding: 14px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.pair-tracking .btn-partner-done {
  background: var(--green-bg);
  color: var(--green-deep);
  border: 1.5px solid var(--green);
}
.pair-tracking .btn-check-done:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pair-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(196,140,180,0.15);
  color: #9B5E8A;
}

/* ---- Feedback overlay ---- */
.feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}
.feedback-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.3s var(--ease);
  text-align: center;
}
.feedback-question {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 20px;
  color: var(--text);
}
.feedback-overlay .feedback-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.btn-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: 1.5px solid;
}
.btn-feedback-worse {
  background: rgba(232,139,139,0.1);
  border-color: rgba(232,139,139,0.3);
  color: #A04040;
}
.btn-feedback-worse:hover {
  background: rgba(232,139,139,0.2);
  border-color: #E88B8B;
  transform: translateY(-1px);
}
.btn-feedback-same {
  background: rgba(232,201,107,0.1);
  border-color: rgba(232,201,107,0.3);
  color: #8A7020;
}
.btn-feedback-same:hover {
  background: rgba(232,201,107,0.2);
  border-color: #E8C96B;
  transform: translateY(-1px);
}
.btn-feedback-better {
  background: rgba(107,143,113,0.1);
  border-color: rgba(107,143,113,0.3);
  color: var(--green-deep);
}
.btn-feedback-better:hover {
  background: rgba(107,143,113,0.2);
  border-color: var(--green);
  transform: translateY(-1px);
}
.btn-feedback-later {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s;
}
.btn-feedback-later:hover {
  color: var(--text-soft);
}
.feedback-later-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
  text-align: center;
}

/* ---- Pending feedback in progress screen ---- */
.pending-feedback-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.pending-feedback-item:last-child {
  border-bottom: none;
}
.pending-feedback-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.pending-feedback-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pending-feedback-date {
  font-size: 12px;
  color: var(--text-faint);
}
.pending-feedback-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-feedback-mini {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: 1.5px solid var(--border);
  background: var(--white);
}
.btn-feedback-mini:hover {
  transform: scale(1.15);
}
.btn-feedback-mini.btn-feedback-worse:hover {
  border-color: #E88B8B;
  background: rgba(232,139,139,0.12);
}
.btn-feedback-mini.btn-feedback-same:hover {
  border-color: #E8C96B;
  background: rgba(232,201,107,0.12);
}
.btn-feedback-mini.btn-feedback-better:hover {
  border-color: var(--green);
  background: rgba(107,143,113,0.12);
}

/* ---- Feature 2: Return habit button ---- */
.btn-return-habit {
  background: none;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-return-habit:hover {
  color: var(--terra);
  border-color: var(--terra-light);
  background: rgba(184,132,108,0.06);
}

/* ---- Skipped (irrelevant) habits ---- */
.skipped-check {
  background: var(--bg-warm);
  color: var(--text-faint);
}

/* ---- Feature 3: Expandable adopted habit cards ---- */
.adopted-item {
  flex-direction: column;
  align-items: stretch;
}
.adopted-header {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.adopted-expanded {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease), opacity 0.25s var(--ease), padding 0.35s var(--ease);
  padding: 0;
}
.adopted-item.expanded .adopted-expanded {
  max-height: 400px;
  opacity: 1;
  padding: 14px 0 4px;
}
.adopted-item.expanded {
  border-color: var(--green-light);
  background: rgba(107,143,113,0.02);
}
.adopted-item.expanded .adopted-arrow svg {
  transform: rotate(90deg);
}
.adopted-arrow svg {
  transition: transform 0.25s var(--ease);
}
.adopted-instruction {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}
.adopted-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.adopted-actions-secondary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.adopted-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.adopted-timer-btn {
  background: var(--bg-dark);
  color: var(--white);
  border: none;
}
.adopted-timer-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.adopted-mark-done {
  background: var(--green);
  color: var(--white);
  border: none;
}
.adopted-mark-done:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
}
.adopted-done-label {
  background: rgba(107,143,113,0.08);
  color: var(--green-deep);
  border: 1px solid rgba(107,143,113,0.2);
  cursor: default;
}
.adopted-evidence-btn {
  background: none;
  color: var(--green);
  border: 1px solid rgba(107,143,113,0.2);
}
.adopted-evidence-btn:hover {
  background: var(--green-bg);
  border-color: var(--green);
}

/* ---- Language selector ---- */
.settings-select {
  padding: 8px 32px 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C5A54' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.settings-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.settings-select:hover {
  border-color: var(--green-light);
}
