/* DrawMate profile page: layout only. Colour, type and every control come from the kit (kit/kit.css,
   glyphs.css); nothing here is a colour value and nothing animates. One column, sections separated by
   space (the kit's 11 px grid: 33 between sections, 11 inside), no cards. */

[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

/* Header bar: the same one the app has. */
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 2ch;
  min-height: 49px; padding: max(4px, env(safe-area-inset-top)) 16px 4px; background: var(--bg); border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; }
.barBtn { min-height: 44px; min-width: 44px; padding: 0 12px; font-size: var(--t-xs); border-color: var(--line); }

/* Prose: sentences are set in the sans. */
.headline, .readout, .fine, .banner, .measured p, .groupLine, .nextLine, .sub { font-family: var(--sans); text-wrap: pretty; }
.fine { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 65ch; }

/* A text button: sentence case, underlined, a 44 px target. */
.textLink {
  min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--muted);
  font-family: var(--sans); font-size: 15px; text-transform: none; text-decoration: underline; text-underline-offset: 3px;
}
a.textLink { display: inline-flex; align-items: center; }
@media (hover: hover) and (pointer: fine) { .textLink:hover:not(:disabled) { color: var(--text); background: none; } }
.textLink:active:not(:disabled) { color: var(--text); background: none; }
a { color: inherit; text-underline-offset: 3px; }

/* ---------- the column ---------- */
.pf { max-width: 640px; margin: 0 auto; padding: 22px 16px max(44px, env(safe-area-inset-bottom)); display: grid; gap: 33px; }
@media (min-width: 768px) { .pf { padding-inline: 24px; } }
.pf > section { min-width: 0; scroll-margin-top: 60px; }
.pf h2 { display: block; margin: 0 0 11px; font-size: var(--t-s); text-transform: none; overflow: visible; white-space: normal; }
.pf h2::before, .pf h2::after { content: none; }

/* Sections that have a title and a figure on the right. */
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 2ch; margin-bottom: 11px; }
.head h2 { margin: 0; }
.head .figure { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.head .figure .glyph { margin-right: 0.5ch; }

/* ---------- identity ---------- */
.who { display: grid; grid-template-columns: auto 1fr auto; gap: 0 16px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.disc {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  background: var(--surface-2); color: var(--text); font-size: var(--t-s); line-height: 1; text-transform: uppercase;
}
.disc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.disc .glyph { margin: 0; }
.name { margin: 0; font-size: var(--t-m); line-height: 1.2; overflow-wrap: anywhere; }
.name .unset { color: var(--muted); }
.sub { margin: 2px 0 0; font-size: var(--t-xs); color: var(--muted); font-family: var(--mono); }
.whoText { min-width: 0; }

/* ---------- banner and notices ---------- */
.banner, .note { margin: 0; }
.pf .k-notice { background: var(--surface); padding: 8px 12px; }
.pf .k-notice a, .pf .k-notice button { color: var(--text); font: inherit; text-transform: none; text-decoration: underline; text-underline-offset: 3px; min-height: 0; padding: 0; border: 0; background: none; display: inline; }
.pf .k-notice.fineOnly { background: none; padding-left: 0; color: var(--muted); }
.pf .k-notice.fineOnly::before { content: none; }
.k-state a.button, .k-state button { justify-self: start; }

/* ---------- this week ---------- */
.week { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 2ch; }
.days { display: grid; grid-template-columns: repeat(7, 4ch); gap: 0; font-family: var(--mono); }
.day { display: grid; justify-items: center; gap: 2px; }
.day small { font-size: var(--t-xs); line-height: 1.5; color: var(--muted); }
.day.today small { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.day i { font-style: normal; font-size: var(--t-s); line-height: 1; white-space: pre; }
.reps { margin: 0; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-faint { color: var(--faint); }

/* ---------- 12 weeks ---------- */
.k-heat.year { font-size: var(--t-s); line-height: 1; padding: 8px 12px; }
.k-heat.year .months { color: var(--muted); font-size: var(--t-xs); line-height: 22px; display: block; }
.caption { margin: 8px 0 0; font-size: var(--t-xs); color: var(--muted); }

/* ---------- progress ---------- */
.headline { margin: 0 0 16px; font-size: var(--t-s); line-height: 1.45; min-height: 2.9em; }
.chartPanel { padding-top: 11px; }
.chart { display: block; width: 100%; height: 132px; overflow: visible; touch-action: pan-y; }
.chart:focus-visible { outline: 2px solid var(--mark); outline-offset: 4px; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.chart .dot { fill: var(--muted); }
.chart .ring { fill: none; stroke: var(--muted); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; }
.chart .last { fill: var(--ok); }
.chart .pick { fill: none; stroke: var(--text); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.readout { margin: 6px 0 0; min-height: 1.5em; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.groupLine { display: flex; align-items: center; flex-wrap: wrap; gap: 0 1ch; margin: 11px 0 0; font-size: 14px; color: var(--muted); }
.groupPick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 11px; margin-top: 8px; }
.empty { margin: 0; }

/* ---------- best so far and next ---------- */
.rows { display: grid; margin: 0; }
.rows > div { display: grid; grid-template-columns: 16ch 1fr auto; gap: 0 2ch; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.rows > div:first-child { border-top: 0; padding-top: 0; }
.rows dt { font-size: var(--t-xs); color: var(--muted); }
.rows dd { margin: 0; font-size: var(--t-s); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows dd.when { font-size: var(--t-xs); color: var(--muted); text-align: right; }
.rows dd .k-tag { margin-left: 1ch; }
@media (max-width: 520px) { .rows > div { grid-template-columns: 1fr auto; } .rows dt { grid-column: 1 / -1; } .rows dd { white-space: normal; } }
.nextLine { margin: 0; font-family: var(--mono); font-size: var(--t-s); }

/* ---------- heat map ---------- */
.heatSub { margin: -5px 0 11px; font-size: var(--t-xs); color: var(--muted); }
.heatBody { display: flex; flex-wrap: wrap; gap: 16px 3ch; align-items: flex-start; }
.heatSide { flex: 1 1 180px; min-width: 0; display: grid; gap: 16px; }
.heatStats { display: grid; grid-template-columns: auto 1fr; gap: 4px 2ch; margin: 0; font-size: var(--t-xs); text-transform: uppercase; }
.heatStats dt { color: var(--muted); }
.heatStats dd { margin: 0; font-variant-numeric: tabular-nums; }
.heatLegend { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: var(--t-xs); text-transform: uppercase; color: var(--muted); }
.heatLegend li { display: flex; gap: 1ch; align-items: baseline; }
.heatLegend li > i { font-style: normal; width: 5ch; text-align: center; }
.heatLegend .k-heatRamp { width: 5ch; white-space: pre; }
.heatSeg { margin-bottom: 11px; }
@media (max-width: 520px) { .heatSeg span::before { content: none !important; } .heatSeg span { padding-inline: 4px; } }
@media (max-width: 520px) { .heatBody { flex-direction: column; flex-wrap: nowrap; } .heatSide { display: contents; } }

/* ---------- folds ---------- */
#sFolds { display: grid; gap: 0; border-top: 1px solid var(--line); }
#sFolds .k-disc { border-bottom: 1px solid var(--line); }
.measured p { margin: 0 0 8px; }
.remind { display: grid; gap: 16px; color: var(--text); font-family: var(--mono); font-size: var(--t-s); justify-items: start; }
.remind .fine { margin: 0; }
.seg.days { width: 100%; margin-bottom: 0; }
.seg.days span { padding-inline: 2px; font-size: var(--t-xs); text-transform: uppercase; }
.seg.days input + span::before, .seg.days input:checked + span::before { content: none; }
.remind .field { width: 100%; max-width: 220px; }
.field input[type=text], .field input[type=time] {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 0; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: var(--t-s); text-transform: none;
}
.fieldHint { font-family: var(--sans); font-size: 13px; text-transform: none; color: var(--muted); }
.earned { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.earned li { display: flex; justify-content: space-between; gap: 2ch; }
.earned time { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- recent ---------- */
.recent { display: grid; margin: 0; padding: 0; list-style: none; }
.recent a { display: grid; grid-template-columns: auto 1fr auto; gap: 0 2ch; align-items: baseline; min-height: 44px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; font-variant-numeric: tabular-nums; }
.recent li:first-child a { border-top: 0; }
.recent .meta { font-size: var(--t-xs); color: var(--muted); }
.recent .time { text-align: right; }
@media (hover: hover) and (pointer: fine) { .recent a:hover .time { text-decoration: underline; text-underline-offset: 3px; } }
.recent li.saved a { padding-inline: 8px; margin-inline: -8px; background: var(--surface); }
.recent + p { margin: 6px 0 0; }

/* ---------- the edit sheet ---------- */
.sheet {
  margin: 0 0 0 auto; padding: 0; width: min(520px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  border: 0; border-left: 1px solid var(--line); background: var(--bg); color: var(--text); overscroll-behavior: contain;
}
.sheet::backdrop { background: var(--scrim); }
.sheetHead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 2ch; padding: max(4px, env(safe-area-inset-top)) 16px 4px; min-height: 57px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sheetHead h2 { margin: 0; }
.sheetBody { display: grid; gap: 33px; padding: 22px 16px max(32px, env(safe-area-inset-bottom)); }
.photoRow { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: center; }
.photoRow .fine { grid-column: 1 / -1; margin: 0; }
.photoActs { display: flex; flex-wrap: wrap; gap: 8px 2ch; align-items: center; }
#photoPick:has(input:focus-visible) { outline: 2px solid var(--mark); outline-offset: 2px; }
#editAccount { display: grid; gap: 16px; justify-items: start; }
.k-line b { font-weight: inherit; overflow-wrap: anywhere; }
