/* ── Inter self-hosted ── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/Inter-SemiBold.woff2') format('woff2');
}

/* ── Fraunces self-hosted (italic, variable 400–600) ── */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/Fraunces-Italic.woff2') format('woff2');
}

/* ── JetBrains Mono self-hosted (variable 400–600) ── */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/JetBrainsMono.woff2') format('woff2');
}

/* ── Brand tokens ── */
:root {
  /* Core palette */
  --brand-green:        #1B6B5A;
  --brand-green-dark:   #145248;
  --brand-green-mid:    #4A6965;
  --brand-green-light:  #EEF7F5;
  --brand-green-tint:   #F4FAF8;
  --brand-border:       #D4EAE6;
  --brand-border-warm:  #C8E0DC;
  --brand-text:         #0F2622;
  --brand-muted:        #4A6965;

  /* Time-of-day */
  --tod-morning:        #A85B00;   /* warm amber — darkened for WCAG AA (4.90:1 on surface) */
  --tod-afternoon:      #4A6965;   /* brand green-muted */
  --tod-evening:        #6B5B8A;   /* soft purple */

  /* Interactive */
  --interactive-focus:  #1B6B5A;
  --interactive-hover:  #EEF7F5;

  /* Semantic */
  --col-sep:            #D4EAE6;
  --col-sep-strong:     #1B6B5A;
  --surface:            #FAFCFB;
  --surface-tinted:     #F4FAF8;

  /* Status */
  --status-ok:          #1B6B5A;
  --status-warn:        #A85B00;   /* darkened for WCAG AA (4.90:1 on surface) */
  --status-error:       #B91C1C;

  /* Coral — primary CTA, matches landing page */
  --coral:              #d47863;   /* darkened from #E8927C — white text at 3.15:1 passes AA-large */
  --coral-hover:        #C06A55;
  --coral-text:         #AE5840;   /* darkened for text on light bgs — WCAG AA (4.92:1 on white) */
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: var(--brand-text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

/* ── Focus-visible — keyboard focus ring (WCAG 2.4.11 + 2.4.13) ── */
:focus-visible {
  outline: 2px solid var(--interactive-focus);
  outline-offset: 2px;
}

/* ── Views ── */
.view { min-height: 100dvh; }

/* ── Landing page (Sign-in view) — HYBRID DESIGN ── */
/* All rules scoped to #viewSignin to keep #viewTracker pristine (Grafta LOCKED). */

#viewSignin {
  --gh-bg:          #EEF7F5;
  --gh-sand:        #F5EFE6;
  --gh-green:       #1B6B5A;
  --gh-dark:        #0F2622;
  --gh-text:        #0F2622;
  --gh-muted:       #4A6965;
  --gh-border:      #D4E8E3;
  --gh-coral:       #d47863;
  --gh-coral-hover: #C06A55;
  --gh-coral-text:  var(--coral-text);
  --gh-f-head: 'Fraunces', Georgia, serif;
  --gh-f-body: 'DM Sans', system-ui, sans-serif;
  --gh-f-mono: 'JetBrains Mono', 'Courier New', monospace;
  --gh-radius: 14px;
  --gh-trans:  0.3s ease;

  display: block;
  overflow-y: auto;
  background: var(--gh-bg);
  color: var(--gh-text);
  font-family: var(--gh-f-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

#viewSignin .gh-signin-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* NAV */
#viewSignin .gh-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2.5rem;
  background: rgba(238,247,245,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gh-border);
}
#viewSignin .gh-nav-logo {
  font-family: var(--gh-f-head);
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--gh-green);
  text-decoration: none;
  letter-spacing: -0.02em;
}
#viewSignin .gh-nav-right { display: flex; align-items: center; gap: 0.75rem; }
#viewSignin .gh-lang-select {
  font-family: var(--gh-f-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gh-green);
  background: transparent;
  border: 1px solid var(--gh-border);
  border-radius: 40px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
#viewSignin .gh-nav-cta {
  font-family: var(--gh-f-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gh-green);
  text-decoration: none;
  border: 1px solid var(--gh-border);
  padding: 0.45rem 1.1rem;
  border-radius: 40px;
  background: transparent;
  cursor: pointer;
  transition: background var(--gh-trans), color var(--gh-trans);
}
#viewSignin .gh-nav-cta:hover { background: var(--gh-green); color: #fff; }

/* CONTAINER + BUTTONS */
#viewSignin .gh-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
}
#viewSignin .gh-btn-coral {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--gh-coral);
  color: #fff;
  font-family: var(--gh-f-body);
  font-weight: 600;
  font-size: 1.15rem;  /* ≥14pt bold = WCAG "large text" → 3:1 contrast threshold */
  padding: 0.85rem 1.8rem;
  border-radius: 40px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--gh-trans), transform 0.15s ease, box-shadow var(--gh-trans);
  box-shadow: 0 4px 18px rgba(212,120,99,0.28);
}
#viewSignin .gh-btn-coral:hover {
  background: var(--gh-coral-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(212,120,99,0.38);
}
#viewSignin .gh-btn-coral:active { transform: translateY(0); }
#viewSignin .gh-google-icon { flex-shrink: 0; }

/* HERO */
#viewSignin .gh-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 5rem;
  overflow: hidden;
}
#viewSignin .gh-blob-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 5%;
}
#viewSignin .gh-blob-svg {
  width: min(65vw, 650px);
  height: auto;
  will-change: transform;
}
#viewSignin .gh-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
#viewSignin .gh-hero-eyebrow {
  font-family: var(--gh-f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gh-muted);
  margin-bottom: 1rem;
}
#viewSignin .gh-hero-headline {
  font-family: var(--gh-f-head);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--gh-dark);
  margin-bottom: 1.4rem;
}
#viewSignin .gh-hero-headline em { color: var(--gh-green); font-style: italic; }
#viewSignin .gh-hero-sub {
  font-size: 1.1rem;
  color: var(--gh-muted);
  max-width: 440px;
  margin-bottom: 2rem;
  line-height: 1.7;
}
#viewSignin .gh-hero-fine {
  font-size: 0.8rem;
  color: var(--gh-muted);
  margin-top: 0.9rem;
  font-family: var(--gh-f-mono);
}
#viewSignin .gh-hero-right {
  display: flex;
  justify-content: center;
}

/* TICKER CARD */
#viewSignin .gh-ticker-card {
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(15,38,34,0.1);
}
#viewSignin .gh-ticker-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--gh-border);
  background: var(--gh-bg);
}
#viewSignin .gh-ticker-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76,175,80,0.2);
  animation: ghPulse 2s infinite;
}
@keyframes ghPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(76,175,80,0.2); }
  50%     { box-shadow: 0 0 0 6px rgba(76,175,80,0.05); }
}
#viewSignin .gh-ticker-label {
  font-family: var(--gh-f-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gh-green);
  flex: 1;
}
#viewSignin .gh-ticker-date {
  font-family: var(--gh-f-mono);
  font-size: 0.7rem;
  color: var(--gh-muted);
}
#viewSignin .gh-ticker-viewport {
  height: 290px;
  overflow: hidden;
  position: relative;
}
#viewSignin .gh-ticker-viewport::before,
#viewSignin .gh-ticker-viewport::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 40px;
  z-index: 2;
  pointer-events: none;
}
#viewSignin .gh-ticker-viewport::before { top: 0;    background: linear-gradient(to bottom, #fff, transparent); }
#viewSignin .gh-ticker-viewport::after  { bottom: 0; background: linear-gradient(to top,    #fff, transparent); }
#viewSignin .gh-ticker-track {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
#viewSignin .gh-ticker-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--gh-border);
  gap: 0.5rem;
}
#viewSignin .gh-ticker-entry:last-child { border-bottom: none; }
#viewSignin .gh-te-name {
  font-family: var(--gh-f-mono);
  font-size: 0.82rem;
  color: var(--gh-dark);
  font-weight: 500;
}
#viewSignin .gh-te-value {
  font-family: var(--gh-f-mono);
  font-size: 0.82rem;
  color: var(--gh-green);
  font-weight: 600;
}
#viewSignin .gh-te-time {
  font-family: var(--gh-f-mono);
  font-size: 0.72rem;
  color: var(--gh-muted);
}
#viewSignin .gh-te-check {
  font-size: 0.75rem;
  color: #4CAF50;
  font-weight: 700;
}
#viewSignin .gh-ticker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.2rem;
  border-top: 1px solid var(--gh-border);
  background: var(--gh-bg);
}
#viewSignin .gh-ticker-mono {
  font-family: var(--gh-f-mono);
  font-size: 0.65rem;
  color: var(--gh-muted);
}
#viewSignin .gh-ticker-status {
  font-family: var(--gh-f-mono);
  font-size: 0.65rem;
  color: #4CAF50;
}

/* WHAT YOU TRACK */
#viewSignin .gh-track-section {
  background: #fff;
  padding: 6rem 0;
}
#viewSignin .gh-section-headline {
  font-family: var(--gh-f-head);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  color: var(--gh-dark);
  text-align: center;
  margin-bottom: 0.75rem;
}
#viewSignin .gh-section-sub {
  font-size: 1rem;
  color: var(--gh-muted);
  text-align: center;
  max-width: 520px;
  margin: 0 auto 3.5rem;
}
#viewSignin .gh-section-headline.gh-dark { color: var(--gh-dark); }
#viewSignin .gh-section-sub.gh-dark      { color: var(--gh-muted); }

#viewSignin .gh-flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
#viewSignin .gh-flip-card {
  height: 180px;
  perspective: 1000px;
  cursor: pointer;
}
#viewSignin .gh-flip-card:focus {
  outline: 2px solid var(--gh-coral);
  outline-offset: 4px;
  border-radius: var(--gh-radius);
}
#viewSignin .gh-flip-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
  border-radius: var(--gh-radius);
}
#viewSignin .gh-flip-card:hover .gh-flip-inner,
#viewSignin .gh-flip-card:focus .gh-flip-inner,
#viewSignin .gh-flip-card.gh-flipped .gh-flip-inner {
  transform: rotateY(180deg);
}
#viewSignin .gh-flip-front,
#viewSignin .gh-flip-back {
  position: absolute;
  inset: 0;
  border-radius: var(--gh-radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 1px solid var(--gh-border);
}
#viewSignin .gh-flip-front { background: var(--gh-bg); padding: 1.5rem; }
#viewSignin .gh-flip-front:hover { background: #e5f3ef; }
#viewSignin .gh-flip-icon { font-size: 2.2rem; line-height: 1; }
#viewSignin .gh-flip-name {
  font-family: var(--gh-f-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gh-dark);
  text-align: center;
}
#viewSignin .gh-flip-back {
  background: var(--gh-green);
  transform: rotateY(180deg);
  padding: 1.4rem;
}
#viewSignin .gh-flip-back p {
  font-family: var(--gh-f-body);
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
  text-align: center;
}

/* FEATURES */
#viewSignin .gh-features-section {
  background: #fff;
  padding: 6rem 0;
}
#viewSignin .gh-feat-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 760px;
  margin: 0 auto;
}
#viewSignin .gh-feat-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--gh-border);
}
#viewSignin .gh-feat-row:nth-child(odd) { padding-right: 2.5rem; }
#viewSignin .gh-feat-row:nth-child(even) { padding-left: 2.5rem; border-left: 1px solid var(--gh-border); }
#viewSignin .gh-feat-row:nth-last-child(-n+2) { border-bottom: none; }
#viewSignin .gh-feat-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
#viewSignin .gh-feat-name {
  font-family: var(--gh-f-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gh-dark);
  margin-bottom: 0.3rem;
}
#viewSignin .gh-feat-desc {
  font-family: var(--gh-f-body);
  font-size: 0.85rem;
  color: var(--gh-muted);
  line-height: 1.55;
}

/* PRIVACY (DARK) */
#viewSignin .gh-privacy-section {
  background: var(--gh-dark);
  padding: 6rem 0;
}
#viewSignin .gh-privacy-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
#viewSignin .gh-privacy-headline {
  font-family: var(--gh-f-head);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 2rem;
}
#viewSignin .gh-privacy-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0;
  margin: 0;
}
#viewSignin .gh-privacy-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--gh-f-body);
  font-size: 1rem;
  color: rgba(255,255,255,0.82);
}
#viewSignin .gh-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gh-green);
  color: #fff;
  font-size: 0.7rem;
  flex-shrink: 0;
  font-weight: 700;
}
#viewSignin .gh-privacy-lock {
  display: flex;
  align-items: center;
  justify-content: center;
}
#viewSignin .gh-lock-svg { width: min(280px, 70%); height: auto; }
#viewSignin .gh-lock-stroke {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

/* ANALYTICS */
#viewSignin .gh-analytics-section {
  background: var(--gh-sand);
  padding: 6rem 0;
}
#viewSignin .gh-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 3rem 0 2.5rem;
}
#viewSignin .gh-analytics-col {
  background: #fff;
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 2rem;
}
#viewSignin .gh-analytics-header {
  font-family: var(--gh-f-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-bottom: 1.2rem;
}
#viewSignin .gh-we-track { color: var(--gh-green); }
#viewSignin .gh-we-never { color: var(--gh-coral-text); }
#viewSignin .gh-analytics-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
}
#viewSignin .gh-analytics-list li {
  font-family: var(--gh-f-mono);
  font-size: 0.88rem;
  color: var(--gh-text);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
#viewSignin .gh-mono-mark {
  font-weight: 700;
  font-size: 0.85rem;
  width: 18px;
  flex-shrink: 0;
  text-align: center;
}
#viewSignin .gh-mono-mark.gh-ok { color: var(--gh-green); }
#viewSignin .gh-mono-mark.gh-no { color: var(--gh-coral-text); }
#viewSignin .gh-analytics-consent {
  font-family: var(--gh-f-body);
  font-size: 0.9rem;
  color: var(--gh-muted);
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  line-height: 1.7;
}
#viewSignin .gh-analytics-consent strong { color: var(--gh-dark); }

/* FAQ */
#viewSignin .gh-faq-section {
  background: #fff;
  padding: 6rem 0;
}
#viewSignin .gh-faq-list {
  max-width: 680px;
  margin: 2.5rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
#viewSignin .gh-faq-item {
  border-bottom: 1px solid var(--gh-border);
}
#viewSignin .gh-faq-item:first-child {
  border-top: 1px solid var(--gh-border);
}
#viewSignin .gh-faq-q {
  font-family: var(--gh-f-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gh-dark);
  padding: 1.25rem 2rem 1.25rem 0;
  cursor: pointer;
  list-style: none;
  position: relative;
}
#viewSignin .gh-faq-q::-webkit-details-marker { display: none; }
#viewSignin .gh-faq-q::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--gh-muted);
  transition: transform 0.25s ease;
}
#viewSignin .gh-faq-item[open] .gh-faq-q::after {
  content: '−';
}
#viewSignin .gh-faq-a {
  font-family: var(--gh-f-body);
  font-size: 0.95rem;
  color: var(--gh-muted);
  line-height: 1.7;
  padding: 0 0 1.25rem;
}

/* ABOUT */
#viewSignin .gh-about-section {
  background: var(--gh-dark);
  padding: 6rem 0;
}
#viewSignin .gh-about-inner {
  max-width: 640px;
  margin: 0 auto;
}
#viewSignin .gh-about-headline {
  font-family: var(--gh-f-head);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 2rem;
}
#viewSignin .gh-about-body p {
  font-family: var(--gh-f-body);
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}
#viewSignin .gh-about-body a {
  color: rgba(255,255,255,0.92);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
#viewSignin .gh-about-body a:hover {
  color: #fff;
}
#viewSignin .gh-about-sign {
  font-family: var(--gh-f-head);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gh-coral);
  margin-top: 0.5rem;
}

/* CTA BAND */
#viewSignin .gh-cta-band {
  background: var(--gh-green);
  padding: 6rem 0;
}
#viewSignin .gh-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
}
#viewSignin .gh-cta-headline {
  font-family: var(--gh-f-head);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
}
#viewSignin .gh-cta-headline em { color: rgba(255,255,255,0.75); }
#viewSignin .gh-cta-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.72);
  max-width: 480px;
  line-height: 1.7;
}

/* FOOTER */
#viewSignin .gh-footer {
  background: #fff;
  border-top: 1px solid var(--gh-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem 2.5rem;
  font-family: var(--gh-f-mono);
  font-size: 0.75rem;
  color: var(--gh-muted);
  text-align: center;
}
#viewSignin .gh-footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
#viewSignin .gh-footer-links a {
  color: var(--gh-muted);
  text-decoration: none;
  transition: color 0.15s;
}
#viewSignin .gh-footer-links a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}
#viewSignin .gh-footer-sep { opacity: 0.4; }
#viewSignin .gh-footer-tagline { font-style: italic; }
#viewSignin .gh-footer-legal { opacity: 0.7; }

/* RESPONSIVE */
@media (max-width: 900px) {
  #viewSignin .gh-hero-inner { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
  #viewSignin .gh-hero-sub { max-width: 100%; margin-left: auto; margin-right: auto; }
  #viewSignin .gh-hero-left { display: flex; flex-direction: column; align-items: center; }
  #viewSignin .gh-hero-right { justify-content: center; }
  #viewSignin .gh-flip-grid { grid-template-columns: repeat(2, 1fr); }
  #viewSignin .gh-privacy-inner { grid-template-columns: 1fr; text-align: center; }
  #viewSignin .gh-privacy-list li { justify-content: center; }
  #viewSignin .gh-privacy-lock { display: none; }
  #viewSignin .gh-analytics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  #viewSignin .gh-nav { padding: 0.9rem 1.2rem; }
  #viewSignin .gh-nav-cta { display: none; }
  #viewSignin .gh-hero { padding: 7rem 1.2rem 4rem; }
  #viewSignin .gh-ticker-card { max-width: 100%; }
  #viewSignin .gh-flip-grid { grid-template-columns: 1fr; }
  #viewSignin .gh-flip-card { height: 160px; }
  #viewSignin .gh-feat-list { grid-template-columns: 1fr; max-width: 480px; }
  #viewSignin .gh-feat-row:nth-child(even) { padding-left: 0; border-left: none; }
  #viewSignin .gh-feat-row:nth-child(odd) { padding-right: 0; }
  #viewSignin .gh-feat-row:nth-last-child(1) { border-bottom: none; }
  #viewSignin .gh-feat-row:nth-last-child(2) { border-bottom: 1px solid var(--gh-border); }
  #viewSignin .gh-privacy-section,
  #viewSignin .gh-analytics-section,
  #viewSignin .gh-features-section,
  #viewSignin .gh-faq-section,
  #viewSignin .gh-about-section,
  #viewSignin .gh-cta-band,
  #viewSignin .gh-track-section { padding: 4rem 0; }
  #viewSignin .gh-footer { padding: 1.5rem 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  #viewSignin .gh-flip-inner,
  #viewSignin .gh-btn-coral { transition: none; }
  #viewSignin .gh-ticker-track { will-change: auto; }
  #viewSignin .gh-blob-svg { animation: none !important; }
  #viewSignin .gh-ticker-dot { animation: none; }
}

/* ── Reconnect banner ── */
.reconnect-banner {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--status-error);
  color: #fff;
  font-size: 13px; font-weight: 600;
  text-align: center; padding: 8px;
  z-index: 100;
}
.reconnect-banner button {
  background: #fff;
  color: var(--status-error);
  border: none; border-radius: 3px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; cursor: pointer; margin-left: 8px;
}

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  z-index: 100;
}
.loading-overlay.hidden { display: none; }

.loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--brand-border);
  border-top-color: var(--brand-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Offline banner ── */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--brand-muted);
  color: #fff; font-size: 12px; font-weight: 600;
  text-align: center; padding: 6px 8px; z-index: 100;
}

/* ── Day nav ── */
.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid var(--col-sep-strong);
  position: sticky; top: 0;
  background: #fff;
  z-index: 10; height: 48px;
}

.day-nav-right { display: flex; align-items: center; gap: 6px; }

.sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 6px;
  vertical-align: middle; background: var(--brand-border);
}
.sync-dot.ok      { background: var(--status-ok); }
.sync-dot.saving  { background: var(--status-warn); }
.sync-dot.fail    { background: var(--status-error); }
.sync-dot.offline { background: var(--brand-muted); }

.day-nav button {
  background: none;
  border: 1.5px solid var(--brand-green);
  border-radius: 4px;
  font-size: 16px; font-weight: 600;
  width: 36px; height: 30px; cursor: pointer;
  color: var(--brand-green);
  font-family: inherit;
}
.day-nav button:hover   { background: var(--brand-green-tint); }
.day-nav button:active  { background: var(--brand-green); color: #fff; }
.day-nav button:disabled { border-color: var(--brand-border); color: var(--brand-border); }

.gear-btn {
  font-size: 18px !important;
  border: none !important;
  background: none !important;
  width: auto !important;
  padding: 0 4px;
  color: var(--brand-muted) !important;
}
.gear-btn:hover  { color: var(--brand-green) !important; }
.gear-btn:active { background: none !important; color: var(--brand-green) !important; }

.day-label {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  text-align: center; flex: 1;
  color: var(--brand-text);
}
.day-label .sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-style: normal;
  font-size: 11px; font-weight: 400; color: var(--brand-muted);
}

.past-badge {
  font-size: 10px; font-weight: 600;
  color: #fff; background: var(--brand-muted);
  padding: 1px 6px; border-radius: 3px; margin-left: 6px;
}

/* ── Desktop 3-col grid ── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "meds water urine"
    "meds notes labs";
  min-height: calc(100dvh - 48px);
  align-items: start;
  background: var(--brand-green-light);
  gap: 10px;
  padding: 10px;
}

#colMeds  { grid-area: meds; }
#colWater { grid-area: water; height: 55vh; display: flex; flex-direction: column; overflow: hidden; }
#colUrine { grid-area: urine; height: 55vh; display: flex; flex-direction: column; overflow: hidden; }
#colNotes { grid-area: notes; }
#colLabs  { grid-area: labs; }

.col {
  padding: 10px;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--brand-border);
  box-shadow: 0 4px 20px rgba(15, 38, 34, 0.06);
}

/* ── Mobile tabs ── */
.mob-tabs { display: none; }

@media (max-width: 700px) {
  .mob-tabs {
    display: flex;
    border-bottom: 1px solid var(--brand-border);
    position: sticky; top: 48px;
    background: #fff; z-index: 9;
    overflow-x: auto; scrollbar-width: none;
  }
  .mob-tabs::-webkit-scrollbar { display: none; }

  .mob-tab {
    flex-shrink: 0; text-align: center;
    padding: 8px 12px; font-size: 13px; font-weight: 600;
    color: var(--brand-muted); cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.12s;
  }
  .mob-tab.active { color: var(--brand-green); border-bottom-color: var(--brand-green); }

  .grid { display: block; min-height: auto; background: none; gap: 0; padding: 0; }
  .col  { display: none; padding: 8px 12px; background: var(--surface); border-radius: 0; border: none; box-shadow: none; }
  .col.active { display: block; }

  #colNotes { display: none; border-top: none; }
  #colNotes.active { display: block; }

  #colLabs { display: none; border-top: none; }
  #colLabs.active { display: block; }
}

/* ── Column titles ── */
.col-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--col-sep-strong);
  margin-bottom: 6px;
  color: var(--brand-green);
}
.col-title-meds {
  margin-top: 10px; padding-top: 10px;
  border-top: 2px solid var(--col-sep-strong);
}
@media (max-width: 700px) { .col-title { font-size: 13px; } }

/* ── Vitals block ── */
.vitals-box { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--brand-border); }

.vital-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.vital-label { font-size: 11px; font-weight: 600; min-width: 80px; flex-shrink: 0; color: var(--brand-text); }

.vital-input {
  width: 44px;
  border: 1.5px solid var(--brand-border-warm);
  border-radius: 3px;
  font-size: 13px; font-weight: 600;
  text-align: center; padding: 3px 1px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: #fff;
  color: var(--brand-text);
  transition: border-color 0.12s;
}
.vital-input:focus { outline: none; border-color: var(--brand-green); }
.vital-input:focus-visible { outline: 2px solid var(--interactive-focus); outline-offset: 1px; }
.vital-input.wide { width: 56px; }
.vital-input:disabled { background: var(--surface-tinted); border-color: var(--brand-border); color: var(--brand-text); }

.vital-slash { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 13px; }

.vital-ok-btn {
  background: var(--brand-green);
  color: #fff; border: none; border-radius: 3px;
  font-size: 10px; font-weight: 600;
  padding: 4px 6px; cursor: pointer; margin-left: 2px;
}
.vital-ok-btn:active { background: var(--brand-green-dark); }

.vital-locked { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--brand-muted); }
.vital-locked.alert { color: var(--status-error); font-weight: 600; }

.log-del {
  background: none; border: none;
  color: var(--brand-border); font-size: 16px; cursor: pointer;
  padding: 6px 8px; min-width: 32px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
}
.log-del:active { color: var(--status-error); }

/* ── Notes ── */
.notes-box { margin-bottom: 8px; }
.notes-label {
  font-size: 10px; font-weight: 600;
  color: var(--brand-muted); margin-bottom: 4px;
}
.notes-input {
  width: 100%;
  border: 1.5px solid var(--brand-border-warm);
  border-radius: 4px;
  font-size: 12px; font-family: inherit;
  padding: 6px 8px; resize: none;
  color: var(--brand-text);
  background: #fff;
  min-height: 52px;
  transition: border-color 0.12s;
}
.notes-input:focus { outline: none; border-color: var(--brand-green); }
.notes-input:focus-visible { outline: 2px solid var(--interactive-focus); outline-offset: 1px; }

/* ── Meds ── */
.time-group { margin-bottom: 4px; border-radius: 4px; overflow: hidden; }
.time-label {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 12px;
  color: var(--brand-text);
  padding: 3px 4px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; border-radius: 4px;
  user-select: none; -webkit-user-select: none;
}
.time-label:hover  { background: var(--brand-green-tint); }
.time-label:active { background: var(--brand-green-light); }
.time-group.current > .time-label { background: var(--brand-green-tint); }
.time-group.all-done > .time-label { color: var(--brand-muted); }
.time-group.collapsed > .time-label { opacity: 0.65; }
.time-group-body { padding: 0 2px; }

.meds-count { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 400; color: var(--brand-muted); }
.time-group.collapsed .time-group-body { display: none; }
.time-progress { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; font-weight: 600; color: var(--brand-border); }
.time-progress.done { color: var(--status-ok); }

/* Time-of-day accent — brand-adjacent palette */
.time-morning   > .time-label { border-left: 2px solid var(--tod-morning);   padding-left: 6px; }
.time-afternoon > .time-label { border-left: 2px solid var(--tod-afternoon); padding-left: 6px; }
.time-evening   > .time-label { border-left: 2px solid var(--tod-evening);   padding-left: 6px; }

.med {
  display: flex; align-items: baseline; gap: 4px;
  padding: 1px 0; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; line-height: 1.3;
}
.med .box {
  width: 14px; height: 14px;
  border: 1.5px solid var(--brand-border-warm);
  border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; position: relative; top: 1px;
  transition: background 0.1s, border-color 0.1s;
}
.med .box.on { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }
.med .box.on::after { content: '\2713'; }
.med.done { color: var(--brand-muted); text-decoration: line-through; }
.med-note { font-size: 10px; color: var(--brand-muted); font-style: italic; }
.med.conditional-inactive { opacity: 0.35; pointer-events: none; }
.med.conditional-inactive .box { border-color: var(--brand-border); }
.med.conditional-inactive .med-note { color: var(--brand-border); }
.med.conditional-active .med-note { color: var(--status-error); }

.day-actions {
  display: flex; justify-content: center; gap: 8px; margin: 8px auto;
}

.reset-btn, .new-day-btn {
  background: none;
  border: 1px solid var(--brand-border);
  color: var(--brand-border);
  font-size: 10px; padding: 4px 12px; border-radius: 3px; cursor: pointer;
}
.new-day-btn { color: var(--brand-muted); border-color: var(--brand-border-warm); }
.new-day-btn:hover { background: var(--brand-green-tint); }

.expand-all-btn {
  background: none; border: none;
  color: var(--brand-border); font-size: 10px; font-weight: 600;
  padding: 0; cursor: pointer;
}
.expand-all-btn:hover { color: var(--brand-muted); }

/* ── Fluid / Urine ── */
.fluid-total { font-family: 'JetBrains Mono', monospace; text-align: center; padding: 8px 0; font-size: 28px; font-weight: 600; color: var(--brand-text); }
.fluid-sub { font-size: 11px; color: var(--brand-muted); font-weight: 400; }

.water-pace {
  text-align: center; font-size: 12px;
  padding: 4px 8px; margin-bottom: 8px; border-radius: 4px; font-weight: 600;
}
.water-pace.relaxed { color: var(--status-ok);   background: var(--brand-green-light); }
.water-pace.normal  { color: var(--brand-muted); background: var(--surface-tinted); }
.water-pace.push    { color: var(--tod-morning);  background: #FEF3C7; }
.water-pace.urgent  { color: var(--status-error); background: #FEE2E2; }
.water-pace.done    { color: var(--status-ok);   background: var(--brand-green-light); }

.fluid-btns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px;
}
.fluid-btn {
  background: #fff;
  border: 1.5px solid var(--brand-border-warm);
  font-size: 12px; font-weight: 600;
  padding: 8px 2px; border-radius: 4px; cursor: pointer;
  color: var(--brand-text);
  transition: background 0.12s, border-color 0.12s;
}
.fluid-btn:hover  { background: var(--brand-green-tint); border-color: var(--brand-green); }
.fluid-btn:active { background: var(--brand-green); color: #fff; border-color: var(--brand-green); }
.fluid-btn.misc   { border-color: var(--brand-border); color: var(--brand-muted); }

/* ── Ticker-style log card ── */
.log-scroll {
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 6px;
  flex: 1;
  min-height: 0;
}

/* Tinted header row — mirrors .ticker-header */
.log-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--brand-border);
  background: var(--brand-green-light);
}
.log-header-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--status-ok);
  box-shadow: 0 0 0 3px rgba(27, 107, 90, 0.18);
  animation: pulse-log 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-log {
  0%,100% { box-shadow: 0 0 0 3px rgba(27, 107, 90, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(27, 107, 90, 0.05); }
}
.log-header-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--brand-green);
  flex: 1;
}
.log-header-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--brand-muted);
}

/* Entry rows — mirrors .ticker-entry */
.log-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--brand-border);
  cursor: pointer;
  transition: background 0.1s;
}
.log-entry:last-child { border-bottom: none; }
.log-entry:active { background: var(--brand-green-tint); }

.log-time   { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--brand-muted); flex-shrink: 0; }
.log-label  { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--brand-text); font-weight: 500; flex: 1; }
.log-amount { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--brand-green); font-weight: 600; }
.pulse-display { color: var(--tod-morning); font-weight: 600; }

/* ── Fluid edit dialog ── */
.edit-fluid-overlay {
  position: fixed; inset: 0; background: rgba(15,38,34,.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.edit-fluid-dialog {
  background: #fff; border-radius: 12px; padding: 20px;
  width: 90%; max-width: 320px;
  box-shadow: 0 4px 32px rgba(15,38,34,.18);
  border: 1px solid var(--brand-border);
}
.edit-fluid-header {
  font-weight: 600; font-size: 15px; margin-bottom: 12px; text-align: center;
  color: var(--brand-text);
}
.edit-fluid-types {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; justify-content: center;
}
.edit-fluid-amount-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px; justify-content: center;
}
.edit-fluid-input {
  width: 80px; text-align: center; font-size: 18px; font-weight: 600;
  border: 1.5px solid var(--brand-border-warm); border-radius: 8px; padding: 8px;
  font-family: inherit;
}
.edit-fluid-input:focus { outline: none; border-color: var(--brand-green); }
.edit-fluid-input:focus-visible { outline: 2px solid var(--interactive-focus); outline-offset: 1px; }
.edit-fluid-actions { display: flex; gap: 8px; justify-content: center; }
.edit-fluid-cancel, .edit-fluid-save {
  padding: 8px 24px; border-radius: 8px;
  border: 1px solid var(--brand-border-warm);
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.edit-fluid-save {
  background: var(--brand-green); color: #fff; border-color: var(--brand-green); font-weight: 600;
}
.edit-fluid-save:active { background: var(--brand-green-dark); }

/* ── Drink type selector ── */
.fluid-type-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.fluid-type-btn {
  background: #fff;
  border: 1.5px solid var(--brand-border);
  border-radius: 12px; font-size: 11px; font-weight: 600;
  padding: 3px 8px; cursor: pointer;
  color: var(--brand-muted); white-space: nowrap;
  transition: background 0.1s, border-color 0.1s;
}
.fluid-type-btn:hover { background: var(--brand-green-tint); border-color: var(--brand-green); }
.fluid-type-btn.active {
  background: var(--brand-green); border-color: var(--brand-green); color: #fff;
  font-size: 12px; padding: 4px 10px;
}

/* ── Labs ── */
.labs-form {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--brand-border);
}
.labs-form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.labs-input-group { display: flex; align-items: center; gap: 4px; }
.labs-label { font-size: 11px; font-weight: 600; color: var(--brand-muted); flex-shrink: 0; }

.labs-input {
  border: 1.5px solid var(--brand-border-warm);
  border-radius: 3px; font-size: 13px; font-weight: 600;
  text-align: center; padding: 3px 4px;
  font-family: 'JetBrains Mono', 'Courier New', monospace; width: 72px;
  background: #fff; color: var(--brand-text);
  transition: border-color 0.12s;
}
.labs-input:focus { outline: none; border-color: var(--brand-green); }
.labs-input:focus-visible { outline: 2px solid var(--interactive-focus); outline-offset: 1px; }
.labs-input.date-input { width: 120px; text-align: left; }

.labs-add-btn {
  background: var(--coral); color: #fff;
  border: none; border-radius: 40px;
  font-size: 12px; font-weight: 600;
  padding: 7px 18px; cursor: pointer; align-self: flex-end;
  font-family: inherit;
  box-shadow: 0 3px 10px rgba(212, 120, 99, 0.25);
  transition: background 0.3s ease, transform 0.15s ease;
}
.labs-add-btn:hover  { background: var(--coral-hover); transform: translateY(-1px); }
.labs-add-btn:active { background: var(--coral-hover); transform: translateY(0); }

.labs-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--brand-border);
  transition: background 0.1s;
}
.labs-entry:last-child { border-bottom: none; }

.labs-entry-date  { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 400; color: var(--brand-muted); min-width: 72px; flex-shrink: 0; }
.labs-entry-vals  { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--brand-muted); flex: 1; }
.labs-entry-vals strong { color: var(--brand-green); font-weight: 600; }
.labs-entry-notes { font-size: 0.72rem; color: var(--brand-muted); font-style: italic; flex-shrink: 0; }

.labs-trend { margin-top: 12px; font-size: 11px; color: var(--brand-muted); }

/* ── Editor overlay ── */
.view-editor {
  position: fixed; inset: 0;
  background: var(--surface);
  z-index: 50;
  display: flex; flex-direction: column; overflow: hidden;
}
.view-editor.hidden { display: none !important; }

.editor-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--brand-border);
  position: sticky; top: 0;
  background: rgba(238, 247, 245, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10; flex-shrink: 0;
}

.editor-back {
  background: none; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0;
  color: var(--brand-green); font-family: inherit;
}

.editor-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  color: var(--brand-text);
}

.editor-bar-actions { display: flex; align-items: center; gap: 8px; }

.editor-save {
  background: var(--coral); color: #fff;
  border: none; border-radius: 40px;
  font-size: 13px; font-weight: 600;
  padding: 7px 20px; cursor: pointer; font-family: inherit;
  box-shadow: 0 3px 12px rgba(212, 120, 99, 0.28);
  transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
}
.editor-save:hover  { background: var(--coral-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212, 120, 99, 0.38); }
.editor-save:active { background: var(--coral-hover); transform: translateY(0); }

.editor-body { overflow-y: auto; flex: 1; padding: 0 0 60px; }

.editor-section { padding: 12px 14px 0; }

.editor-time-group {
  border-bottom: 1px solid var(--brand-border);
  padding-bottom: 8px; margin-bottom: 4px;
}

.editor-time-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 4px;
}

.editor-time-label {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-text);
}

.editor-add-med-btn {
  background: none;
  border: 1.5px solid var(--brand-green);
  border-radius: 3px; font-size: 12px; font-weight: 600;
  padding: 2px 10px; cursor: pointer;
  color: var(--brand-green); font-family: inherit;
}
.editor-add-med-btn:hover { background: var(--brand-green-tint); }

.editor-med-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
}

.editor-med-name { font-size: 13px; flex: 1; color: var(--brand-text); }
.editor-med-dose { font-size: 12px; color: var(--brand-muted); }
.editor-med-cond { font-size: 11px; color: var(--status-error); font-style: italic; }
.editor-med-alt  { font-size: 11px; color: var(--brand-muted); font-style: italic; }

.editor-med-menu-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  padding: 0 4px; color: var(--brand-muted); line-height: 1;
}
.editor-med-menu-btn:hover { color: var(--brand-green); }

.editor-inline {
  background: var(--surface-tinted);
  border: 1px solid var(--brand-border);
  border-radius: 6px; padding: 10px 12px;
  margin: 4px 0 8px;
  display: flex; flex-direction: column; gap: 8px;
}

.editor-field { display: flex; align-items: center; gap: 8px; }

.editor-field label {
  font-size: 11px; font-weight: 600;
  color: var(--brand-muted);
  width: 76px; flex-shrink: 0;
}

.editor-field input,
.editor-field select {
  flex: 1;
  border: 1.5px solid var(--brand-border-warm);
  border-radius: 3px; font-size: 13px;
  font-family: inherit; padding: 5px 8px;
  background: #fff; color: var(--brand-text);
  transition: border-color 0.12s;
}
.editor-field input:focus,
.editor-field select:focus { outline: none; border-color: var(--brand-green); }
.editor-field input:focus-visible,
.editor-field select:focus-visible { outline: 2px solid var(--interactive-focus); outline-offset: 1px; }

.editor-delete-btn {
  background: none;
  border: 1px solid var(--status-error); color: var(--status-error);
  border-radius: 3px; font-size: 11px; font-weight: 600;
  padding: 4px 10px; cursor: pointer; align-self: flex-start;
  font-family: inherit;
}
.editor-delete-btn:hover { background: #FEE2E2; }

.editor-add-slot-btn {
  display: block; width: calc(100% - 28px);
  margin: 12px 14px; background: none;
  border: 1.5px dashed var(--brand-border-warm);
  border-radius: 4px; font-size: 13px; font-weight: 600;
  color: var(--brand-muted); padding: 10px; cursor: pointer; text-align: center;
  font-family: inherit; transition: border-color 0.12s, color 0.12s;
}
.editor-add-slot-btn:hover { border-color: var(--brand-green); color: var(--brand-green); }

.editor-settings {
  padding: 12px 14px;
  border-top: 2px solid var(--col-sep-strong); margin-top: 8px;
}
.editor-settings h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--brand-green);
}

.editor-settings .editor-field label { width: auto; flex-shrink: 0; white-space: nowrap; }
.editor-settings .editor-field input { flex: none; width: 80px; }
.editor-field-toggle { justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--brand-border-warm); }
.editor-field-toggle input[type="checkbox"] { width: auto; flex: none; }

/* ── Info tooltip icon + popup ── */
.tip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--brand-border); color: var(--brand-muted);
  font-size: 9px; font-weight: 600; font-style: italic;
  cursor: pointer; vertical-align: middle; margin-left: 3px;
  flex-shrink: 0; user-select: none; -webkit-user-select: none;
}
.tip-icon:hover, .tip-icon:active { background: var(--brand-green); color: #fff; }

.tip-popup {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(15,38,34,0.92); color: #fff;
  font-size: 13px; font-weight: 400; line-height: 1.5;
  padding: 10px 16px; border-radius: 8px;
  width: 300px; max-width: calc(100vw - 32px);
  text-align: center; z-index: 9999; cursor: pointer;
}

/* ── Error toast ── */
.error-toast {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%);
  background: var(--status-error); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.4;
  padding: 10px 16px; border-radius: 8px;
  max-width: calc(100vw - 32px); text-align: center; z-index: 9999; cursor: pointer;
}

/* ── Language select ── */
.lang-select {
  appearance: none; -webkit-appearance: none;
  background: none;
  border: 1px solid var(--brand-border); border-radius: 4px;
  padding: 2px 20px 2px 6px;
  font-size: 11px; font-weight: 600; color: var(--brand-muted);
  cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%234A6965' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 5px center;
}
.lang-select:focus-visible { outline: 2px solid var(--interactive-focus); outline-offset: 1px; }
.lang-select:hover { border-color: var(--brand-green); color: var(--brand-green); }

/* ── Overlay views (Charts + Reports) ── */
.view-overlay {
  position: fixed; inset: 0;
  background: var(--surface); z-index: 50;
  display: flex; flex-direction: column; overflow: hidden;
}
.view-overlay.hidden { display: none !important; }

.overlay-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--brand-border);
  flex-shrink: 0;
  background: rgba(238, 247, 245, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.overlay-back {
  background: none; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0;
  color: var(--brand-green); font-family: inherit;
}

.overlay-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  color: var(--brand-text);
}

.overlay-action {
  background: var(--coral); color: #fff;
  border: none; border-radius: 40px;
  font-size: 12px; font-weight: 600;
  padding: 7px 18px; cursor: pointer; font-family: inherit;
  box-shadow: 0 3px 12px rgba(212, 120, 99, 0.28);
  transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
}
.overlay-action:hover  { background: var(--coral-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212, 120, 99, 0.38); }
.overlay-action:active { background: var(--coral-hover); transform: translateY(0); }

/* ── Charts ── */
.charts-range-bar {
  display: flex; gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--brand-border);
  flex-shrink: 0; overflow-x: auto; scrollbar-width: none;
}
.charts-range-bar::-webkit-scrollbar { display: none; }

.range-btn {
  background: #fff;
  border: 1.5px solid var(--brand-border);
  border-radius: 40px; font-size: 12px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 14px; cursor: pointer;
  color: var(--brand-muted); white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.range-btn:hover { background: var(--brand-green-tint); border-color: var(--brand-green); color: var(--brand-green); }
.range-btn.active {
  background: var(--brand-green); border-color: var(--brand-green); color: #fff;
}

.charts-body { flex: 1; overflow-y: auto; padding: 10px 14px 32px; background: var(--brand-green-light); display: flex; flex-direction: column; gap: 10px; }

.charts-empty { padding: 32px 16px; text-align: center; color: var(--brand-muted); font-size: 14px; }

.chart-section {
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 16px 16px 12px;
  box-shadow: 0 4px 16px rgba(15, 38, 34, 0.06);
}

.chart-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  color: var(--brand-green);
  margin-bottom: 12px;
}

.chart-wrap { position: relative; height: 210px; }
@media (max-width: 700px) { .chart-wrap { height: 220px; } }

/* ── Reports ── */
.reports-controls {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--brand-border); flex-shrink: 0;
}
.reports-controls select {
  border: 1.5px solid var(--brand-border-warm);
  border-radius: 4px; font-size: 13px;
  font-family: inherit; padding: 6px 8px; background: #fff;
  color: var(--brand-text);
}
.reports-date-range { display: flex; align-items: center; gap: 6px; }
.reports-date-range input[type="date"] {
  border: 1.5px solid var(--brand-border-warm);
  border-radius: 4px; font-size: 12px;
  font-family: inherit; padding: 5px 6px;
}
.reports-controls button {
  background: var(--coral); color: #fff;
  border: none; border-radius: 40px;
  font-size: 13px; font-weight: 600;
  padding: 7px 20px; cursor: pointer; font-family: inherit;
  box-shadow: 0 3px 12px rgba(212, 120, 99, 0.28);
  transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
}
.reports-controls button:hover  { background: var(--coral-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212, 120, 99, 0.38); }
.reports-controls button:active { background: var(--coral-hover); transform: translateY(0); }

.report-body { flex: 1; overflow-y: auto; padding: 0 0 48px; }

/* Report document */
.report { max-width: 720px; margin: 0 auto; padding: 16px 14px; font-size: 13px; }

.report-header { padding-bottom: 12px; border-bottom: 2px solid var(--col-sep-strong); margin-bottom: 16px; }
.report-title  {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--brand-text);
}
.report-meta   { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--brand-muted); }

.report-section { margin-bottom: 20px; }
.report-section h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  color: var(--brand-green);
  border-bottom: 1px solid var(--brand-border);
  padding-bottom: 4px; margin-bottom: 8px;
}
.report-sub-title { font-size: 11px; font-weight: 600; color: var(--brand-muted); margin: 10px 0 6px; }

.report-table { border-collapse: collapse; width: 100%; margin-bottom: 4px; font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.report-table td, .report-table th { padding: 4px 8px; border: 1px solid var(--brand-border); }
.report-table th { background: var(--brand-green-light); font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 11px; color: var(--brand-green); }
.report-table td:first-child { color: var(--brand-muted); }
.report-table-full { width: 100%; }

.report-flag-row td { color: var(--status-error); font-weight: 600; }

.report-alerts { list-style: none; padding: 0; }
.report-alerts li { padding: 4px 0; font-size: 12px; color: var(--status-error); border-bottom: 1px solid #FEE2E2; }
.report-alerts li:last-child { border-bottom: none; }

.report-ok { font-size: 13px; color: var(--status-ok); font-weight: 600; }

/* ── Fluid ring ── */
.fluid-ring-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 10px 0 6px;
}
.fluid-ring { width: 120px; height: 120px; flex-shrink: 0; }
.fluid-ring-label {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; pointer-events: none;
}
.fluid-ring-num { font-size: 22px; font-weight: 600; line-height: 1; color: var(--brand-text); }
.fluid-ring-sub { font-size: 10px; color: var(--brand-muted); margin-top: 3px; }

/* ── Responsive mobile tweaks ── */
@media (max-width: 700px) {
  .fluid-total { font-size: 36px; }
  .fluid-btns { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .fluid-btn  { padding: 12px 4px; font-size: 14px; min-height: 44px; }
  .med        { padding: 6px 0; font-size: 14px; min-height: 36px; align-items: center; }
  .med .box   { width: 22px; height: 22px; font-size: 14px; }
  .time-label { font-size: 13px; padding: 5px 4px; }
  .fluid-ring { width: 140px; height: 140px; }
  .fluid-ring-num { font-size: 26px; }
  .vital-input { width: 44px; font-size: 15px; padding: 6px 2px; min-height: 36px; }
  .vital-label { font-size: 13px; }
  .vital-input.wide { width: 56px; }
  .vital-ok-btn { min-width: 36px; min-height: 36px; font-size: 12px; }
  .log-entry  { font-size: 13px; padding: 6px 0; min-height: 36px; }
  .log-del    { font-size: 18px; padding: 8px 10px; min-width: 36px; min-height: 36px; }
  .fluid-type-btn { font-size: 13px; padding: 6px 12px; }
  .labs-input { font-size: 15px; padding: 6px 6px; }
  .labs-add-btn { padding: 10px 18px; font-size: 14px; min-height: 40px; }
}

/* ── Analytics consent banner ── */
.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--brand-text); color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; line-height: 1.4;
}
.consent-banner.hidden { display: none; }
.consent-btns { display: flex; gap: 8px; margin-left: auto; }
.consent-btn { border: none; border-radius: 4px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.consent-btn.accept  { background: #fff; color: var(--brand-text); }
.consent-btn.decline { background: transparent; color: rgba(255,255,255,0.6); text-decoration: underline; }
