/* ============================================================
   alana — Sağlıkta Dönüşüm Programı
   Design tokens extracted from "Alana Akis.dc.html"
   ============================================================ */

:root {
  /* Brand */
  --ink:            #17323F;
  --primary:        #439DC1;
  --primary-dark:   #2C7CA0;
  --primary-tint:   #F2F8FB;
  --primary-tint-2: #F7FBFD;
  --primary-line:   #D5E7EF;
  --primary-pale:   #DCEDF4;
  --primary-paler:  #EAF4F9;

  /* Text */
  --text:           #17323F;
  --text-muted:     #3F5A66;
  --text-soft:      #6C8592;
  --text-faint:     #8A9BA5;
  --on-primary:     #FFFFFF;

  /* Surfaces */
  --canvas:         #E9EFF2;
  --surface:        #FFFFFF;
  --fill:           #F4F7F9;
  --fill-2:         #EDF2F4;

  /* Lines */
  --line:           #DDE6EA;
  --line-canvas:    #CBD6DC;
  --line-strong:    #A9BBC4;
  --line-arrow:     #9DB2BC;
  --dot-idle:       #C3D2D9;

  /* Semantic — success / habit green */
  --green:          #8BA84A;
  --green-dark:     #4F7A22;
  --green-bg:       #F7FAF1;
  --green-line:     #DCE7C4;
  --green-chip:     #E4EED0;

  /* Semantic — warning / symptom */
  --amber:          #E8951B;
  --amber-bg:       #FDF6EA;
  --amber-text:     #8A5A08;

  /* Semantic — alert / fat mass */
  --red:            #E94D1A;
  --red-bg:         #FDF3EF;
  --red-line:       #F3C0AE;
  --red-text:       #93290A;

  /* Radii */
  --r-phone:  34px;
  --r-xl:     22px;
  --r-lg:     20px;
  --r-md:     18px;
  --r-sm:     16px;
  --r-xs:     14px;
  --r-2xs:    12px;
  --r-pill:   999px;

  /* Device */
  --app-w: 390px;
  --app-h: 844px;

  --shadow-phone: 0 18px 40px rgba(23, 50, 63, .10);
  --shadow-focus: 0 0 0 3px rgba(67, 157, 193, .18);
  --shadow-card:  0 8px 22px rgba(67, 157, 193, .16);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--canvas);
  color: var(--text);
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Device frame
   ============================================================ */

.device {
  position: relative;
  width: var(--app-w);
  height: var(--app-h);
  background: var(--surface);
  border: 1px solid var(--line-canvas);
  border-radius: var(--r-phone);
  box-shadow: var(--shadow-phone);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: none;
}

/* Full-bleed on real phones */
@media (max-width: 460px), (max-height: 880px) {
  .device {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
}

/* ============================================================
   Status bar
   ============================================================ */

.statusbar {
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font: 600 12px/1 'Open Sans', sans-serif;
  color: var(--ink);
}

.statusbar .battery {
  width: 16px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.statusbar--onPrimary {
  background: var(--primary);
  color: var(--on-primary);
}

/* ============================================================
   Screen scaffolding
   ============================================================ */

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.screen__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.screen__body::-webkit-scrollbar { width: 0; }

.pad     { padding: 14px 22px 16px; }
.pad-lg  { padding: 16px 24px 24px; }
.pad-tight { padding: 8px 20px 16px; }

.spacer { flex: 1; min-height: 12px; }

/* Screen transitions */
.screen[data-anim="forward"] { animation: slideIn .28s var(--ease) both; }
.screen[data-anim="back"]    { animation: slideBack .28s var(--ease) both; }
.screen[data-anim="fade"]    { animation: fadeIn .22s var(--ease) both; }

@keyframes slideIn   { from { opacity: 0; transform: translateX(18px); } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-18px); } }
@keyframes fadeIn    { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .screen[data-anim] { animation: none; }
}

/* ============================================================
   Typography
   ============================================================ */

.t-display { font: 700 29px/1.24 'Open Sans', sans-serif; letter-spacing: -.015em; }
.t-title   { font: 700 26px/1.26 'Open Sans', sans-serif; letter-spacing: -.01em; }
.t-h2      { font: 700 24px/1.2   'Open Sans', sans-serif; letter-spacing: -.01em; }
.t-h3      { font: 700 19px/1.3   'Open Sans', sans-serif; }
.t-lead    { font: 400 18px/1.6   'Open Sans', sans-serif; color: var(--text-muted); text-wrap: pretty; }
.t-body    { font: 400 17px/1.55  'Open Sans', sans-serif; color: var(--text-muted); text-wrap: pretty; }
.t-sm      { font: 400 15px/1.5   'Open Sans', sans-serif; color: var(--text-muted); }
.t-xs      { font: 400 14px/1.5   'Open Sans', sans-serif; color: var(--text-soft); }
.t-label   { font: 600 14px/1.4   'Open Sans', sans-serif; color: var(--text-muted); }
.t-cardTitle { font: 600 16px/1.3 'Open Sans', sans-serif; color: var(--text-muted); }

.t-eyebrow {
  font: 700 12px/1 'Open Sans', sans-serif;
  letter-spacing: .1em;
  color: var(--text-soft);
}
.t-eyebrow--primary { color: var(--primary-dark); }

.t-brandline {
  font: 600 12px/1 'Open Sans', sans-serif;
  letter-spacing: .14em;
  color: var(--primary);
}

.num { font-variant-numeric: tabular-nums; }

.link {
  font: 600 15px/1.4 'Open Sans', sans-serif;
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  min-height: 56px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: 600 19px/1 'Open Sans', sans-serif;
  width: 100%;
  transition: transform .12s var(--ease), filter .12s var(--ease);
}

.btn:active { transform: scale(.975); filter: brightness(.96); }

.btn--primary   { background: var(--primary); color: var(--on-primary); }
.btn--secondary { border: 2px solid var(--primary); color: var(--primary-dark); }
.btn--ghost     { color: var(--primary-dark); }
.btn--tall      { min-height: 58px; }
.btn--compact   { min-height: 52px; font-size: 17px; }
.btn--spaced    { margin-top: 14px; }

.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--fill-2);
  color: var(--text-faint);
  pointer-events: none;
}

/* Back / nav row */
.navrow {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.navrow__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.chev-left {
  width: 12px;
  height: 12px;
  border-left: 2.5px solid var(--primary);
  border-bottom: 2.5px solid var(--primary);
  transform: rotate(45deg);
}

/* Close / cancel cross, used on the dark camera and analysis screens. */
.glyph-x {
  width: 15px;
  height: 15px;
  position: relative;
  display: block;
}

.glyph-x::before,
.glyph-x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
}

.glyph-x::before { transform: translateY(-50%) rotate(45deg); }
.glyph-x::after  { transform: translateY(-50%) rotate(-45deg); }

.navrow__label {
  font: 600 16px/1 'Open Sans', sans-serif;
  color: var(--primary-dark);
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}

.card--tint {
  border: 2px solid var(--primary);
  background: var(--primary-tint);
  border-radius: var(--r-lg);
  padding: 18px;
}

.card--soft {
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 14px;
  font: 400 15px/1.55 'Open Sans', sans-serif;
  color: var(--text-muted);
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.divider { height: 1px; background: var(--primary-line); margin: 14px 0; }
.divider--plain { background: var(--line); }

/* Stat tiles */
.stats { display: flex; gap: 10px; }

.stat {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px;
}

.stat__k { font: 600 13px/1.3 'Open Sans', sans-serif; color: var(--text-soft); }
.stat__v {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
  font: 700 26px/1 'Open Sans', sans-serif;
  font-variant-numeric: tabular-nums;
}
.stat__u { font: 600 13px/1 'Open Sans', sans-serif; color: var(--text-soft); }

.is-green { color: var(--green); }
.is-red   { color: var(--red-text); }

/* ============================================================
   Selectable rows / options
   ============================================================ */

/* Selected and unselected must share an identical content box or the card
   contents jump when you switch between them. The design's own strokes are
   kept (2px selected / 1.5px unselected) and the padding compensates, so both
   states inset content by exactly 22px and only colour changes. */
.option {
  border: 1.5px solid var(--line);
  border-radius: var(--r-xl);
  padding: 2.5px;
  display: block;
  width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

/* Must be a block: it is a <span> (buttons only take phrasing content) and
   would otherwise lay out inline, breaking its background box and padding. */
.option__inner {
  display: block;
  border-radius: 20px;
  padding: 18px;
  transition: background .15s var(--ease);
}

.option__row { display: flex; align-items: flex-start; gap: 14px; }

.option__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-xs);
  background: var(--fill);
  border: 1px solid var(--line);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option__glyph {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2.5px solid var(--text-faint);
}

.option__title { font: 700 19px/1.3 'Open Sans', sans-serif; color: var(--text); }
.option__desc  { font: 400 15px/1.5 'Open Sans', sans-serif; color: var(--text-muted); margin-top: 4px; }

.option.is-selected {
  border: 2px solid var(--primary);
  padding: 2px;
  box-shadow: var(--shadow-card);
}

.option.is-selected > .option__inner { background: var(--primary-tint); }

.option.is-selected .option__icon {
  background: var(--primary);
  border-color: var(--primary);
}
.option.is-selected .option__glyph { border-color: var(--on-primary); }

/* Radio / check indicator */
.radio {
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  border: 2.5px solid var(--line-strong);
  flex: none;
}

.radio.is-on {
  background: var(--primary);
  border-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tick {
  width: 10px;
  height: 5px;
  border-left: 2.4px solid var(--on-primary);
  border-bottom: 2.4px solid var(--on-primary);
  transform: rotate(-45deg);
  margin-top: -2px;
}

.tick--lg {
  width: 12px;
  height: 7px;
  border-left-width: 3px;
  border-bottom-width: 3px;
  margin-top: -3px;
}

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

.bullet {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 15px/1.4 'Open Sans', sans-serif;
  color: var(--text);
}

.bullet__dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--primary);
  flex: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--primary-line);
  font: 600 13px/1 'Open Sans', sans-serif;
  color: var(--primary-dark);
  margin-top: 14px;
}

/* Consent card */
.consent {
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  width: 100%;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}

.consent.is-on { border-color: var(--primary); background: var(--primary-tint-2); }

.consent__box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2.5px solid var(--line-strong);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.consent.is-on .consent__box { background: var(--primary); border-color: var(--primary); }
.consent__title { font: 600 17px/1.4 'Open Sans', sans-serif; }

/* ============================================================
   Habit rows (Su / Protein / Egzersiz / Uyku)
   ============================================================ */

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

.habit {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  min-height: 64px;
  width: 100%;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}

.habit.is-done { border-color: var(--green); background: var(--green-bg); }

.habit__icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--fill-2);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}

.habit.is-done .habit__icon { background: var(--green-chip); color: var(--green-dark); }

.habit__name { flex: 1; font: 600 17px/1.3 'Open Sans', sans-serif; }

.habit__check {
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  border: 2.5px solid var(--line-strong);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.habit.is-done .habit__check { background: var(--green); border-color: var(--green); }

.habit__check .tick {
  width: 11px;
  height: 6px;
  border-left-width: 2.6px;
  border-bottom-width: 2.6px;
  opacity: 0;
}

.habit.is-done .habit__check .tick { opacity: 1; }

/* Compact variant used in onboarding preview */
.habit--sm { min-height: 44px; padding: 10px 12px; border-radius: var(--r-xs); background: var(--surface); }
.habit--sm .habit__icon { width: 26px; height: 26px; border-radius: 9px; }
.habit--sm .habit__name { font-size: 15px; }
.habit--sm .habit__check { width: 24px; height: 24px; border-width: 2.2px; }
.habit--sm .habit__check .tick { width: 9px; height: 5px; border-left-width: 2.2px; border-bottom-width: 2.2px; }

/* ============================================================
   Chips (symptoms, goals)
   ============================================================ */

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* Chips sit in a wrapping flex row, so any width change on toggle nudges every
   chip after it. The design's 1.5px/2px strokes are kept and the padding
   compensates, holding the border box identical in both states. */
.chip {
  min-height: 48px;
  padding: 0 18.5px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  font: 600 16px/1 'Open Sans', sans-serif;
  color: var(--text-muted);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}

.chip.is-on {
  border: 2px solid var(--amber);
  padding: 0 18px;
  background: var(--amber-bg);
  color: var(--amber-text);
}

/* Segmented severity picker */
.segmented { display: flex; gap: 8px; }

.segmented__item {
  flex: 1;
  min-height: 56px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 16px/1 'Open Sans', sans-serif;
  color: var(--text-muted);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}

.segmented__item.is-on {
  border: 2px solid var(--amber);
  background: var(--amber-bg);
  color: var(--amber-text);
}

.segmented--primary .segmented__item.is-on {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary-dark);
}

/* ============================================================
   Inputs & keypad
   ============================================================ */

.field {
  min-height: 60px;
  border: 2px solid var(--line);
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.field.is-focus { border-color: var(--primary); box-shadow: var(--shadow-focus); }
.field__prefix { font: 700 20px/1 'Open Sans', sans-serif; }
.field__sep { width: 1px; height: 26px; background: var(--line); }
.field__value { font: 400 20px/1 'Open Sans', sans-serif; font-variant-numeric: tabular-nums; }
.field__value:empty::before { content: attr(data-placeholder); color: var(--text-faint); }

.otp { display: flex; gap: 9px; margin-top: 24px; }

.otp__cell {
  flex: 1;
  height: 64px;
  border: 2px solid var(--line-strong);
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 26px/1 'Open Sans', sans-serif;
}

.otp__cell.is-filled { border-color: var(--primary); }
.otp__cell.is-active { border-color: var(--primary); box-shadow: var(--shadow-focus); }

.keypad {
  flex: none;
  background: var(--fill);
  border-top: 1px solid var(--line);
  padding: 10px 12px 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.keypad__key {
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 50, 63, .18);
  font: 400 24px/1 'Open Sans', sans-serif;
  color: var(--ink);
  transition: background .1s var(--ease);
}

.keypad__key:active { background: var(--line); }
.keypad__key--blank { background: none; box-shadow: none; pointer-events: none; }
.keypad__key--action { background: none; box-shadow: none; font-size: 20px; }

/* Stepper — value with − / + controls (ölçüm, doz, porsiyon) */

.stepper { display: flex; align-items: center; gap: 12px; }

.stepper__btn {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 24px/1 'Open Sans', sans-serif;
  color: var(--text-muted);
  transition: background .12s var(--ease), transform .12s var(--ease);
}

.stepper__btn:active { transform: scale(.94); background: var(--fill); }

.stepper__btn--add {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.stepper__value {
  flex: 1;
  min-height: 60px;
  border: 2px solid var(--primary);
  border-radius: var(--r-xs);
  box-shadow: var(--shadow-focus);
  display: flex;
  align-items: center;      /* centre the block in the field … */
  justify-content: center;
}

.stepper__inner {
  display: flex;
  align-items: baseline;    /* … while value and unit share a baseline */
  gap: 6px;
}

.stepper__num  { font: 700 28px/1 'Open Sans', sans-serif; }
.stepper__unit { font: 600 15px/1 'Open Sans', sans-serif; color: var(--text-soft); }

/* ============================================================
   Tab bar
   ============================================================ */

.tabbar {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 8px 20px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font: 600 12px/1 'Open Sans', sans-serif;
  color: var(--text-faint);
  transition: color .16s var(--ease);
}

.tabbar__item.is-on { color: var(--primary-dark); }

.tabbar__icon {
  width: 24px;
  height: 24px;
  transition: transform .16s var(--ease), stroke-width .16s var(--ease);
}

.tabbar__item.is-on .tabbar__icon { stroke-width: 2.25; }

/* Press feedback — fires immediately on touch, before navigation. */
.tabbar__item:active .tabbar__icon { transform: scale(.84); }

/* Accent parts scale about their own centre, not the SVG origin. */
.tabbar__icon [class^="ti-"] {
  transform-box: fill-box;
  transform-origin: center;
}

/* ---- Becoming active: shared pop + one accent flourish per icon ---- */

.tabbar__icon.is-entering { animation: tabPop .42s var(--ease); }

@keyframes tabPop {
  0%   { transform: scale(.82); }
  55%  { transform: scale(1.13); }
  100% { transform: scale(1); }
}

/* Bugün: the tick draws itself in. İlerleme: the trend line does. */
.tabbar__icon.is-entering .ti-draw {
  stroke-dasharray: 30;
  animation: tabDraw .46s var(--ease) .05s both;
}

@keyframes tabDraw {
  from { stroke-dashoffset: 30; }
  to   { stroke-dashoffset: 0; }
}

/* İlerleme: the end point lands after the line arrives. */
.tabbar__icon.is-entering .ti-dot { animation: tabDot .28s var(--ease) .38s both; }

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

/* Kalori: the inner flame flares up. */
.tabbar__icon.is-entering .ti-core { animation: tabFlame .55s var(--ease) both; }

@keyframes tabFlame {
  0%   { transform: scaleY(.45); opacity: .35; }
  60%  { transform: scaleY(1.15); opacity: 1; }
  100% { transform: scaleY(1); opacity: 1; }
}

/* Profil: the head settles onto the shoulders. */
.tabbar__icon.is-entering .ti-head { animation: tabHead .42s var(--ease) both; }
.tabbar__icon.is-entering .ti-body { animation: tabBody .42s var(--ease) .08s both; }

@keyframes tabHead {
  0%   { transform: translateY(-3px) scale(.7); opacity: .4; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes tabBody {
  0%   { transform: scaleX(.55); opacity: .4; }
  100% { transform: scaleX(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tabbar__icon,
  .tabbar__icon.is-entering,
  .tabbar__icon.is-entering * { animation: none; transition: none; }
}

/* ============================================================
   Misc pieces
   ============================================================ */

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

.dots__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--dot-idle);
  transition: width .25s var(--ease), background .25s var(--ease);
}

.dots__dot.is-on { width: 26px; background: var(--primary); }

.hero {
  height: 246px;
  flex: none;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--primary-line);
  background: var(--primary-tint);
}

.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; display: block; }

.hero--pad { padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }

.bellwrap {
  width: 42px;
  height: 42px;
  border-radius: var(--r-xs);
  background: var(--primary-tint);
  border: 1px solid var(--primary-line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: none;
  color: var(--primary-dark);
}

.badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--red);
  border: 2px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 11px/1 'Open Sans', sans-serif;
  color: var(--on-primary);
}

.progressbar {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--primary-line);
  overflow: hidden;
}

.progressbar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-pill);
  transition: width .4s var(--ease);
}

.legend { display: flex; gap: 14px; margin-top: 12px; }

.legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 13px/1 'Open Sans', sans-serif;
  color: var(--text-muted);
}

.legend__swatch { width: 14px; height: 3px; border-radius: 2px; }
.legend__swatch--dashed { height: 0; border-top: 2px dashed var(--green); }

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font: 600 12px/1 'Open Sans', sans-serif;
  color: var(--text-faint);
}

.axis--grid { display: grid; }
.axis--grid > div { text-align: center; }

.note {
  font: 400 14px/1.5 'Open Sans', sans-serif;
  color: var(--text-soft);
  margin-top: 8px;
}

.infobar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-tint);
  border: 1px solid var(--primary-line);
  border-radius: var(--r-2xs);
  padding: 12px 14px;
  font: 600 14px/1.4 'Open Sans', sans-serif;
  color: var(--primary-dark);
}

.listrow {
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 12px 14px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.listrow__label { font: 600 16px/1.3 'Open Sans', sans-serif; }
.listrow__value { font: 600 16px/1 'Open Sans', sans-serif; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.sheet {
  flex: none;
  background: var(--surface);
  border-radius: 30px 30px 0 0;
  margin-top: -28px;
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.hero-primary {
  flex: 1;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 44px 30px 56px;
  text-align: center;
}

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.steps__seg {
  flex: 1;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
}

.steps__seg.is-on { background: var(--primary); }

/* "Analiz ediliyor" — loading placeholders. Their children carry inline
   width/height, which only takes effect once they are block boxes. */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}

.skeleton-row > span { display: block; }

@keyframes skeletonPulse {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}

/* Sweep across the meal photo while it is being analysed. */
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 34%;
  background: linear-gradient(to bottom,
    rgba(67, 157, 193, 0), rgba(67, 157, 193, .40), rgba(67, 157, 193, 0));
  animation: scanSweep 1.9s ease-in-out infinite;
}

@keyframes scanSweep {
  0%   { transform: translateY(-45%); }
  50%  { transform: translateY(240%); }
  100% { transform: translateY(-45%); }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-row, .scanline { animation: none; }
}

/* Toast */
.toast {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 84px;
  background: var(--ink);
  color: var(--on-primary);
  border-radius: var(--r-xs);
  padding: 14px 16px;
  font: 600 15px/1.4 'Open Sans', sans-serif;
  box-shadow: 0 12px 30px rgba(23, 50, 63, .3);
  animation: toastIn .3s var(--ease) both;
  z-index: 40;
}

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* Flow-map overlay (developer aid, toggled with the map button) */
.maptoggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-canvas);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  font: 600 13px/1 'Open Sans', sans-serif;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(23, 50, 63, .12);
}

.maptoggle svg { width: 15px; height: 15px; flex: none; }

/* On a full-bleed phone there is no room to float a labelled pill over the app's
   own footer — whether that footer is the tab bar or a primary CTA. It collapses
   to a small icon button pinned to the top-right corner instead. Dev aid, not chrome. */
@media (max-width: 460px), (max-height: 880px) {
  .maptoggle {
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    right: 8px;
    bottom: auto;
    width: 34px;
    height: 34px;
    padding: 0;
    gap: 0;
    justify-content: center;
    opacity: .55;
    box-shadow: 0 2px 8px rgba(23, 50, 63, .16);
  }
  .maptoggle span { display: none; }
  .maptoggle svg { width: 16px; height: 16px; }
  .maptoggle:active { opacity: 1; }
}

.map {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(233, 239, 242, .97);
  overflow: auto;
  padding: 72px 24px 40px;
  display: none;
}

.map.is-open { display: block; }

.map__section { margin-bottom: 28px; }

.map__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.map__num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 15px/1 'Open Sans', sans-serif;
  flex: none;
}

.map__title { font: 700 20px/1.2 'Open Sans', sans-serif; letter-spacing: -.01em; }
.map__rule { height: 1px; flex: 1; background: var(--line-canvas); }

.map__grid { display: flex; flex-wrap: wrap; gap: 8px; }

.map__node {
  border: 1px solid var(--line-canvas);
  background: var(--surface);
  border-radius: var(--r-2xs);
  padding: 10px 14px;
  font: 600 14px/1 'Open Sans', sans-serif;
  color: var(--text-muted);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}

.map__node:hover { border-color: var(--primary); color: var(--primary-dark); }
.map__node.is-current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
