/* ============================================================
   //habits — app-specific layout. Consumes packages/design
   (.in-* components + tokens). No hard-coded token values.
   ============================================================ */

.hidden { display: none !important; }

html, body { min-height: 100%; }
body { background: var(--chassis); color: var(--ink); }

/* ---------------- shell ---------------- */
#app { display: flex; flex-direction: column; min-height: 100vh; }
.sidebar { display: none; } /* mobile: hidden; revealed at ≥900px */
.app__col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app__main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 calc(var(--sp-8) + var(--sp-6) + var(--safe-bottom));
  position: relative;
  overflow-x: hidden;
}

/* page wrapper for transitions */
.page { padding: 0 var(--sp-5); }
.page__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4);
  padding: calc(var(--safe-top) + var(--sp-5)) 0 var(--sp-3);
}
.page__title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.05; margin: 2px 0 0; }

/* ---------------- banner (offline / sync) ---------------- */
.banner-slot { padding: 0 var(--sp-5); }
.banner-slot .in-banner { margin: calc(var(--safe-top) + var(--sp-3)) 0 0; }

/* ---------------- Aujourd'hui ---------------- */
.today__streak { text-align: right; }
.today__streak .in-odo { color: var(--live); justify-content: flex-end; }

.today__ring {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) 0 var(--sp-3);
}
.today__ring .in-ring__label .in-tnum { font-size: 22px; font-weight: 600; }
.today__ring .in-ring__label .frac { color: var(--ink-3); font-size: 15px; }
.today__ring-head { font-size: 17px; font-weight: 700; line-height: 1.2; }
.today__ring-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.checklist { border-top: 1px solid var(--hairline); }
.checkrow {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--hairline);
}
.checkrow__idx {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--ink-3); width: 20px; flex: none;
  font-variant-numeric: tabular-nums;
}
.checkrow__body { flex: 1; min-width: 0; }
.checkrow__name {
  font-size: 16px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.checkrow.is-done .checkrow__name { color: var(--ink-3); }
.checkrow__target { margin-top: 1px; }
.checkrow__check { flex: none; }
.in-check.is-popping { animation: in-popCheck var(--d-3) var(--ease-spring); }

/* ---------------- Registre ---------------- */
.tiles { display: flex; gap: var(--sp-2); }
.tiles .in-tile { flex: 1; padding: var(--sp-3); }
.tiles .in-tile__value { font-size: 28px; }

.section { margin-top: var(--sp-5); }
.section__lbl { margin-bottom: var(--sp-2); display: block; }

.heatcard { padding: var(--sp-3); }

.consist { }
.consist__row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.consist__info { flex: 1; min-width: 0; }
.consist__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.consist__track { height: 6px; border-radius: var(--r-pill); background: var(--recess); margin-top: 5px; overflow: hidden; }
.consist__fill { height: 100%; border-radius: var(--r-pill); background: var(--live); transform-origin: left; animation: in-barGrow var(--d-4) var(--ease-out); }
.consist__pct { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none; }

/* ---------------- Configuration ---------------- */
.cfg-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.cfg-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-3);
  background: var(--panel);
  transition: box-shadow var(--d-2), opacity var(--d-2), transform var(--d-2);
}
.cfg-row.is-dragging { opacity: .55; box-shadow: var(--e-3); }
.cfg-row.is-over { box-shadow: 0 0 0 2px var(--live-wash), var(--e-1); }
.cfg-row__grip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 44px; flex: none;
  color: var(--ink-3); cursor: grab; touch-action: none;
}
.cfg-row__grip:active { cursor: grabbing; }
.cfg-row__grip .in-glyph { width: 18px; height: 18px; }
.cfg-row__body { flex: 1; min-width: 0; cursor: pointer; background: none; border: none; text-align: left; padding: 0; font: inherit; color: inherit; }
.cfg-row__name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-row__target { margin-top: 1px; }

/* create/edit sheet form */
.sheet-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.sheet-form .in-segment { width: 100%; }
.sheet-form .in-segment__opt { flex: 1; padding: 0 var(--sp-2); }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick .in-chip { height: 40px; padding: 0 var(--sp-3); min-width: 44px; justify-content: center; }
.sheet-form__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); }
.sheet-form__actions .in-btn { flex: 1; }

/* system / settings block at the foot of Configuration */
.sys { margin-top: var(--sp-6); border-top: 1px solid var(--hairline); padding-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.sys__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }

/* ---------------- bottom nav glyph fill ---------------- */
.in-bottomnav .in-navitem .in-glyph--fill { fill: currentColor; stroke: none; }

/* ---------------- LOGIN ---------------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-5); }
.login__card { width: 100%; max-width: 360px; }
.login__mark { display: block; margin-bottom: var(--sp-3); }
.login__word { font-family: var(--font-mono); font-weight: 600; font-size: 44px; letter-spacing: -2px; line-height: .95; }
.login__sub { margin: var(--sp-3) 0 var(--sp-6); max-width: 40ch; }
.login__form { display: flex; flex-direction: column; gap: var(--sp-4); }
.field-block { display: flex; flex-direction: column; }
.login__note { margin-top: var(--sp-3); min-height: 1em; }
.login__note.is-error { color: var(--sig-red); }

/* ---------------- desktop (≥900px): sidebar + two-column home ---------------- */
.in-sidebar__wordmark { font-family: var(--font-mono); font-weight: 600; font-size: 22px; letter-spacing: -1px; padding: 0 var(--sp-2); margin-bottom: var(--sp-5); }

@media (min-width: 900px) {
  #app { flex-direction: row; }
  .sidebar { display: flex; } /* revealed on desktop */
  #bottomnav { display: none; }
  .app__main { max-width: 1100px; padding: var(--sp-4) var(--sp-6) var(--sp-8); }
  .page { padding: 0; }
  .page__head { padding-top: var(--sp-4); }
  .page__title { font-size: 32px; letter-spacing: -.8px; }

  /* Home = Aujourd'hui + Registre side by side */
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: var(--sp-5);
    align-items: start;
  }
  .home-grid > * { min-width: 0; }
  .home-grid__panel {
    border: 1px solid var(--hairline);
    border-radius: var(--r-4);
    background: var(--panel);
    padding: var(--sp-5);
  }
}

/* hide desktop-only right panel on mobile */
.home-aside { display: none; }
@media (min-width: 900px) { .home-aside { display: block; } }
