/* Daily checks (checks-ui.js): Home card, + tile and sheets. Builds on the
   food log's fd-* buttons, chips, fields and dark hero. */
:root { --ck-violet: #8b5cf6; --ck-violet-soft: rgba(139, 92, 246, 0.12); }
.ck-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-tile .ck-ico { width: 22px; height: 22px; color: #fff; }
.card-link > .ck-ico:last-child { margin-left: auto; color: var(--muted); }
button.card-link { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }

/* ring */
.ck-ring { width: 100%; height: 100%; }
.ck-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ck-ring .trk { stroke: var(--fd-hair); }
.ck-ring .bar { stroke: var(--ck-violet); transition: stroke-dasharray 0.3s ease; }
.ck-ring.full .bar { stroke: var(--fd-green); filter: drop-shadow(0 0 5px rgba(var(--acc-400-rgb), 0.55)); }

/* Home card */
.ck-home { flex-direction: column; align-items: stretch !important; gap: 12px; }
.ck-home-top { display: flex; align-items: center; gap: 14px; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ck-home-top > .ck-ico { color: var(--muted); }
.ck-home-dial { position: relative; width: 64px; height: 64px; flex-shrink: 0; display: grid; place-items: center; }
.ck-home-dial svg { position: absolute; inset: 0; }
.ck-home-dial b { font-size: 16px; font-weight: 700; }
.ck-home-dial small, .ck-hero-dial small { font-size: 0.7em; color: var(--muted); font-weight: 600; }
.ck-home-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ck-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ck-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.ck-chip i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #c3c7cd; display: grid; place-items: center; flex-shrink: 0; }
.ck-chip i .ck-ico { width: 14px; height: 14px; stroke-width: 3; }
.ck-chip.done { background: var(--accent-soft); border-color: rgba(var(--acc-500-rgb), 0.45); color: var(--fd-green-ink); }
.ck-chip.done i { background: var(--fd-green); border-color: var(--fd-green); color: var(--acc-deep); box-shadow: 0 0 8px rgba(var(--acc-400-rgb), 0.5); }

/* sheet hero */
.ck-hero { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: 24px; }
.ck-hero-dial { position: relative; width: 96px; height: 96px; flex-shrink: 0; display: grid; place-items: center; }
.ck-hero-dial svg { position: absolute; inset: 0; }
.ck-hero .ck-ring .trk { stroke: rgba(255, 255, 255, 0.1); }
.ck-hero-dial b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.ck-hero-dial small { color: var(--n-line); }
.ck-hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ck-hero-text b { font-size: 18px; font-weight: 700; }
.ck-hero-text .fd-dim { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ck-hero-text .ck-ico { width: 16px; height: 16px; color: #fbbf24; }

/* rows */
.ck-list { display: flex; flex-direction: column; border-radius: 20px; background: var(--panel-2); overflow: hidden; }
.ck-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border: 0; border-top: 1px solid var(--fd-hair); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.ck-row:first-child { border-top: 0; }
.ck-row:active { background: rgba(var(--n-ink-rgb), 0.04); }
.ck-box { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c3c7cd; display: grid; place-items: center; flex-shrink: 0; transition: background 0.15s, border-color 0.15s; }
.ck-box .ck-ico { width: 16px; height: 16px; stroke-width: 3; }
.ck-row.done .ck-box { background: var(--fd-green); border-color: var(--fd-green); color: var(--acc-deep); box-shadow: 0 0 10px rgba(var(--acc-400-rgb), 0.5); }
.ck-box.ic { border: 0; background: var(--ck-violet-soft); color: var(--ck-violet); border-radius: 12px; width: 36px; height: 36px; }
.ck-box.ic.habit { background: rgba(var(--acc-500-rgb), 0.12); color: var(--fd-green-ink); }
.ck-box.ic .ck-ico { width: 18px; height: 18px; stroke-width: 2; }
.ck-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ck-row-text b { font-size: 15px; font-weight: 600; }
.ck-row.done .ck-row-text b { color: var(--muted); }
.ck-at { flex-shrink: 0; }
.ck-row.edit > .ck-ico { color: var(--muted); }
.ck-intro { margin: 0; line-height: 1.5; font-size: 14px; }

/* grid */
.ck-grid { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; }
.ck-grid i { aspect-ratio: 1; border-radius: 6px; background: var(--panel-2); }
.ck-grid i.full { background: var(--fd-green); box-shadow: 0 0 6px rgba(var(--acc-400-rgb), 0.35); }
.ck-grid i.part { background: rgba(139, 92, 246, var(--a, 0.5)); }
.ck-grid i.miss { background: #f3d6d6; }
.ck-grid i.today { outline: 2px solid var(--text); outline-offset: 1px; }
.ck-grid-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 500; }
.ck-grid-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ck-grid-legend i { width: 10px; height: 10px; border-radius: 3px; }
.ck-grid-legend i.full { background: var(--fd-green); } .ck-grid-legend i.part { background: rgba(139, 92, 246, 0.55); } .ck-grid-legend i.miss { background: #f3d6d6; }

/* adherence */
.ck-adh { display: flex; flex-direction: column; gap: 10px; }
.ck-adh-row { display: grid; grid-template-columns: minmax(0, 38%) 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.ck-adh-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ck-adh-row b { font-size: 13px; font-weight: 700; text-align: right; }
.ck-bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.ck-bar i { display: block; height: 100%; border-radius: 999px; background: var(--ck-violet); }

/* item form */
.ck-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ck-days button { height: 42px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel); font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ck-days button.on { background: var(--fd-dark); border-color: var(--fd-dark); color: #fff; }
.ck-sheet .fd-seg { grid-auto-columns: minmax(0, 1fr); }
.ck-sheet .fd-seg button { font-size: 12px; padding: 0 4px; }
.ck-sheet .fd-chip .ck-ico { width: 15px; height: 15px; stroke-width: 2.6; }
.fd-btn .ck-ico { width: 18px; height: 18px; }

:root[data-theme="dark"] .ck-grid i.miss, :root[data-theme="dark"] .ck-grid-legend i.miss { background: #4a2a2e; }
:root[data-theme="dark"] .ck-box, :root[data-theme="dark"] .ck-chip i { border-color: #4b5058; }

/* ---------- amount checks (water, reading…) ---------- */
.ck-row.ck-amt { cursor: default; align-items: center; }
.ck-amt .ck-row-text { min-width: 0; }
.ck-amt-bar { display: block; height: 4px; margin-top: 6px; border-radius: 99px; background: var(--u-tile, #f4f5f7); overflow: hidden; }
.ck-amt-bar i { display: block; height: 100%; border-radius: inherit; background: #38bdf8; transition: width .3s ease; }
.ck-amt.done .ck-amt-bar i { background: var(--accent); }
.ck-amt-btns { display: flex; gap: 6px; flex: none; }
.ck-amt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 34px; height: 34px; padding: 0 10px; border: 0; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text); background: var(--u-tile, #f4f5f7); cursor: pointer; }
.ck-amt-btn .ck-ico { width: 14px; height: 14px; }
.ck-amt-btn.plus { color: #fff; background: var(--accent); box-shadow: 0 4px 12px -4px rgba(var(--acc-500-rgb), .55); }
.ck-amt-btn:disabled { opacity: .4; cursor: default; }
.ck-amt-btn:active:not(:disabled) { transform: scale(.95); }
.ck-amt-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ck-chip-amt .muted { font-weight: 500; margin-left: 2px; }
:root[data-theme="dark"] .ck-amt-btn:not(.plus) { background: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .ck-amt-bar { background: rgba(255, 255, 255, .08); }

/* Avoid items: kept unless you log a slip */
.ck-avoid { cursor: default; }
.ck-avoid.done .ck-box.ic { color: #fff; }
.ck-avoid.slipped .ck-box.ic { color: #dc2626; background: rgba(220, 38, 38, .1); }
.ck-slip-btn { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--u-tile, #f1f2f4); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ck-avoid.slipped .ck-slip-btn { background: transparent; color: var(--muted); text-decoration: underline; }
.ck-chip-avoid.slipped { color: #dc2626; }
:root[data-theme="dark"] .ck-slip-btn { background: rgba(255, 255, 255, .08); }

/* Streak freeze (shared/streak.js): one missed day a week keeps the streak. */
.ck-grid i.fz, .ck-grid-legend i.fz { background: #bfe3f7; box-shadow: inset 0 0 0 1.5px #7cc4ea; }
:root[data-theme="dark"] .ck-grid i.fz, :root[data-theme="dark"] .ck-grid-legend i.fz { background: #1d3a4d; box-shadow: inset 0 0 0 1.5px #3b7fa6; }
.ck-freeze { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; font-weight: 600; color: #8fd0f2; }
.ck-freeze.used { color: #c9ccd1; opacity: .75; }
.ck-freeze svg { width: 13px; height: 13px; }
