/* Divvy-up — app tokens (COSY, from landing v2 Cosy) */
:root {
  /* Cosy palette — cream paper, warm bark ink, soft terracotta */
  --bg:           #F4ECDD;   /* warm cream, almost linen */
  --bg-elev:      #E9DEC7;   /* oat — elevated surfaces */
  --bg-card:      #FAF5EA;   /* softest paper — cards */
  --bg-sink:      #EADFCA;   /* slightly darker than bg for chrome */

  --ink:          #2A2118;   /* deep warm bark */
  --cream:        #2A2118;   /* keep alias semantics — "text on bg" */
  --taupe:        #6B5C49;   /* walnut — secondary */
  --taupe-dim:    #968671;   /* lighter walnut — tertiary */

  --rule:         rgba(42, 33, 24, 0.12);
  --rule-bright:  rgba(42, 33, 24, 0.22);

  --ember:        #C9633D;   /* soft terracotta */
  --ember-dim:    #A74F2D;   /* deep terracotta / hover */
  --sage:         #7A8F63;   /* darker sage to work on cream */

  --ff-display:   'Bricolage Grotesque', serif;
  --ff-mono:      'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: #EADFCA;
  color: var(--ink);
  font-family: var(--ff-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; overflow-x: hidden; }

/* -------------------------------------------------------------
   App shared primitives
   ------------------------------------------------------------- */
.app-root {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-display);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Typography */
.ff-display { font-family: var(--ff-display); }
.ff-mono { font-family: var(--ff-mono); }

.h-disp {
  font-family: var(--ff-display);
  font-variation-settings: 'wdth' 78, 'wght' 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ink);
}
.h-disp-reg {
  font-family: var(--ff-display);
  font-variation-settings: 'wdth' 82, 'wght' 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.h-med {
  font-family: var(--ff-display);
  font-variation-settings: 'wdth' 88, 'wght' 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}
.mono-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--taupe);
  font-weight: 450;
}
.mono-label.ink { color: var(--ink); }
.mono-label.ember { color: var(--ember); }

.body-text {
  font-family: var(--ff-display);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -0.005em;
  font-variation-settings: 'wdth' 100, 'wght' 400;
}
.body-dim { color: var(--taupe); }

/* Structural */
.hairline { height: 1px; background: var(--rule); border: 0; }
.hairline-bright { height: 1px; background: var(--rule-bright); border: 0; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.card-alt {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.chip {
  display: inline-flex; align-items: center;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--rule-bright);
  font-family: var(--ff-mono); font-size: 8px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--taupe); font-weight: 450;
}
.chip.ember { color: var(--ember); border-color: var(--ember); }
.chip.ink { color: var(--ink); }
.chip.filled { background: var(--ember); color: var(--bg); border-color: var(--ember); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 16px; border-radius: 6px;
  font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer; border: 1px solid var(--ember);
  background: var(--ember); color: #FAF5EA;
  transition: all 180ms ease;
  user-select: none; font-weight: 450;
}
.btn:hover { background: var(--ember-dim); border-color: var(--ember-dim); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border-color: var(--rule-bright);
}
.btn.ghost:hover { background: var(--bg-card); border-color: var(--ink); }
.btn.wide { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 9px; }

/* Member avatar */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-elev); border: 1px solid var(--rule-bright);
  display: grid; place-items: center;
  font-family: var(--ff-mono); font-size: 10px; font-weight: 450;
  color: var(--ink); flex: 0 0 28px;
  letter-spacing: 0.02em;
}
.avatar.ember { background: var(--ember); color: #FAF5EA; border-color: var(--ember); }
.avatar.sage  { background: var(--sage);  color: #FAF5EA; border-color: var(--sage); }
.avatar.ink   { background: var(--ink);   color: #FAF5EA; border-color: var(--ink); }
.avatar.lg { width: 48px; height: 48px; font-size: 14px; flex: 0 0 48px; }
.avatar.xl { width: 64px; height: 64px; font-size: 18px; flex: 0 0 64px; }

/* Tab bar */
.tabbar {
  display: flex; justify-content: space-around;
  padding: 10px 16px 6px;
  border-top: 1px solid var(--rule);
  background: var(--bg);
  flex-shrink: 0;
}
.tabbar .tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: var(--ff-mono); font-size: 7px; font-weight: 450;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--taupe); cursor: pointer;
  padding: 4px 8px;
  transition: color 120ms ease;
}
.tabbar .tab.on { color: var(--ember); }
.tabbar .tab .glyph {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-size: 15px; line-height: 1;
}

/* Header inside screens */
.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 10px;
  flex-shrink: 0;
}

.scroll-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 6px 20px 24px;
  display: flex; flex-direction: column; gap: 14px;
  -webkit-overflow-scrolling: touch;
}

/* Hover-clickable */
[data-nav] {
  cursor: pointer;
  transition: opacity 140ms ease;
  -webkit-tap-highlight-color: transparent;
}
[data-nav]:hover { opacity: 0.85; }
[data-nav]:active { opacity: 0.7; }

/* Scrollbar quiet */
.scroll-body::-webkit-scrollbar { width: 0; }
.scroll-body { scrollbar-width: none; }

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-card);
}
.stat .k {
  font-family: var(--ff-display);
  font-variation-settings: 'wdth' 78, 'wght' 500;
  font-size: 26px; letter-spacing: -0.04em; line-height: 1;
  color: var(--ink);
}
.stat .l {
  font-family: var(--ff-mono); font-size: 7px; font-weight: 450;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--taupe);
}

/* Task row */
.task {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}
.task:first-child { border-top: 0; }
.task .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.3px solid var(--taupe);
  flex: 0 0 14px;
  transition: all 140ms ease;
  background: transparent;
}
.task.done .dot { background: var(--ember); border-color: var(--ember); }
.task.done .label { color: var(--taupe); text-decoration: line-through; text-decoration-color: var(--taupe-dim); }
.task .label { flex: 1; color: var(--ink); }
.task .who {
  font-family: var(--ff-mono); font-size: 8px; font-weight: 450;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--taupe);
}

/* Progress bar */
.bar {
  height: 4px; background: var(--rule);
  border-radius: 2px; overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--ember); }

/* Input */
.input {
  width: 100%; background: transparent;
  border: 0; border-bottom: 1px solid var(--rule-bright);
  padding: 10px 0; color: var(--ink);
  font-family: var(--ff-display);
  font-size: 18px; outline: none;
  letter-spacing: -0.02em;
  font-variation-settings: 'wdth' 92, 'wght' 400;
}
.input::placeholder { color: var(--taupe-dim); }
.input:focus { border-bottom-color: var(--ember); }

/* Big numeric */
.big-num {
  font-family: var(--ff-display);
  font-variation-settings: 'wdth' 76, 'wght' 500;
  font-size: 64px; letter-spacing: -0.05em; line-height: 0.9;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
