/* Habits — this feature's styles. Use the tokens from style.css
   (--bg --surface --text --muted --line --accent --on-accent --user --ja --danger
   --high --mid --low --poor --font --font-ja --mono); never redefine them. */

.hb { padding-top: 14px; }

.hb-lede {
  margin: 0;
  font-family: var(--font-ja);
  font-size: 15px;
}
.hb-lede b { font-family: var(--font); font-size: 19px; font-variant-numeric: tabular-nums; }
.hb-sub {
  margin: 4px 0 0;
  font-family: var(--font-ja);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- the kinds ---------- */

.hb-list { margin: 16px 0 0; padding: 0; list-style: none; }
.hb-item {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.hb-item.open { border-color: var(--accent); }

.hb-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 12px;
  width: 100%;
  min-height: 62px;
  padding: 11px 14px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hb-row:active { background: var(--ja); }
.hb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.hb-name {
  grid-column: 1;
  font-family: var(--font-ja);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
/* The coach's own label: the word he will see again in the next correction. */
.hb-name i {
  display: block;
  margin-top: 2px;
  font-family: var(--font);
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hb-trend {
  grid-column: 1;
  align-self: start;
  font-family: var(--font-ja);
  font-size: 12px;
  color: var(--muted);
}
.hb-trend b {
  margin-left: 4px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hb-trend.up { color: var(--poor); }
.hb-trend.fresh { color: var(--mid); }
.hb-trend.down { color: var(--high); }

.hb-n {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.hb-n i {
  margin-left: 2px;
  font-family: var(--font-ja);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- the one he opened ---------- */

.hb-open { padding: 0 14px 14px; }
.hb-what {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-ja);
  font-size: 13px;
  color: var(--muted);
}
.hb-when {
  margin: 6px 0 0;
  font-family: var(--font-ja);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.hb-when b {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hb-ex { margin-top: 14px; }
.hb-kicker {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.hb-kicker i {
  margin-left: 6px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

/* What he said, then what it should have been. The marks are the whole point of showing
   both, so they carry a colour and a shape - never colour alone. */
.hb-said, .hb-fixed {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.hb-said { background: var(--user); }
.hb-fixed { background: var(--ja); border-left: 3px solid var(--accent); }
.hb-said del {
  text-decoration-line: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--poor);
  color: var(--poor);
}
.hb-fixed ins {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--high) 20%, transparent);
  text-decoration: none;
  font-weight: 700;
  color: var(--high);
}

.hb-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.hb-tip {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--ja);
  font-family: var(--font-ja);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* ---------- notes, and the view with nothing in it ---------- */

.hb-note {
  margin: 10px 0 0;
  font-family: var(--font-ja);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.hb-note.warn { color: var(--danger); }
.hb-foot {
  margin: 20px 2px 0;
  font-family: var(--font-ja);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

/* Answering one question is allowed to leave this view nearly empty: it has to read as a
   beginning, not as something that failed to load. */
.hb-blank {
  margin: 28px 0 22px;
  padding: 26px 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
}
.hb-blank-jp { margin: 0; font-family: var(--font-ja); font-size: 19px; font-weight: 600; }
.hb-blank-en { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.hb-blank .hb-note { margin-top: 14px; text-align: left; }
