.card { background: var(--clr-surface); border-radius: var(--radius); padding: 1rem; box-shadow: 0 1px 3px rgba(18, 48, 46, .08); display: grid; gap: .9rem; }
.card h2 { font-size: 1.2rem; }
.card p { margin: 0; }
.muted { color: var(--clr-muted); font-size: .88rem; }
.info { margin: 0; padding: .75rem 1rem; border-radius: var(--radius); background: #FCF3E3; color: #5A4010; font-size: .9rem; }

/* Calendar */
.cal__nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cal__nav h2 { text-align: center; }
.cal__nav h2::first-letter { text-transform: uppercase; }
.cal__arrow { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--clr-bg); color: var(--clr-base-strong); cursor: pointer; }
.cal__arrow svg { width: 22px; height: 22px; }
.cal__arrow:disabled { opacity: .35; cursor: default; }
.cal__dow, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__dow span { text-align: center; font-size: .75rem; font-weight: 600; color: var(--clr-muted); padding-bottom: .25rem; }
.day {
  position: relative; aspect-ratio: 1 / 1.1; display: grid; place-items: center;
  padding: 0; border: 1.5px solid transparent; border-radius: 10px; background: var(--clr-bg); cursor: pointer; font-weight: 600; color: var(--clr-muted);
}
.day__num { position: absolute; top: 3px; left: 5px; font-size: .7rem; line-height: 1; }
.day__marks { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; align-items: center; height: 10px; }
.mk { width: 7px; height: 7px; border-radius: 50%; }
.mk--temp { background: var(--clr-base-strong); }
.mk--mucus { background: #4F93BD; }
.mk--lh { width: 8px; height: 8px; background: var(--clr-accent-strong); transform: rotate(45deg); border-radius: 1px; }
.day--flow { color: var(--clr-accent-strong); }
.day--flow2 { background: #FBE0D8; }
.day--flow3 { background: #F6C3B5; }
.day--flow4 { background: #F0A28F; color: #6B2415; }
.day--spot { background: #FDEFEA; }
.day--est { border: 1.5px dashed var(--clr-accent-strong); }
.day[aria-current="date"] { border-color: var(--clr-base-strong); border-style: solid; }
.day:disabled { opacity: .4; cursor: default; }
.day.pad { visibility: hidden; pointer-events: none; }

/* Chart */
.chart__title { font-size: 1rem !important; }
.chart { display: grid; grid-template-columns: 40px 1fr; align-items: start; }
.chart__scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.chart svg { display: block; }
.chart__axis { width: 40px; height: 232px; }
#plot { height: 232px; max-width: none; }
.ch-grid { stroke: var(--clr-border); stroke-width: 1; }
.ch-line { fill: none; stroke: var(--clr-base-strong); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: #fff; stroke: var(--clr-base-strong); stroke-width: 2.5; }
.ch-flow { fill: var(--clr-accent); }
.ch-today { fill: none; stroke: var(--clr-dark); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ch-txt { font: 10px var(--font); fill: var(--clr-muted); text-anchor: middle; }
.ch-txt--end { text-anchor: end; }
.ch-txt--cd { font-weight: 600; }
.ch-empty { font: 13px var(--font); fill: var(--clr-muted); text-anchor: middle; }
.ch-lh { fill: var(--clr-accent-strong); }
.ch-lhneg { fill: none; stroke: var(--clr-muted); stroke-width: 1.5; }
.ch-hit { fill: transparent; cursor: pointer; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--clr-muted); }
.legend li { display: flex; align-items: center; gap: .4rem; }
.lg { display: inline-block; width: 12px; height: 12px; }
.lg--temp { border-radius: 50%; border: 2.5px solid var(--clr-base-strong); background: #fff; }
.lg--flow { background: var(--clr-accent); opacity: .5; border-radius: 2px; }
.lg--mucus { border-radius: 50%; background: #4F93BD; }
.lg--lh { background: var(--clr-accent-strong); transform: rotate(45deg) scale(.8); border-radius: 1px; }

/* Stats */
.stats { margin: 0; display: grid; gap: .6rem; }
.stats div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; border-bottom: 1px solid var(--clr-border); padding-bottom: .5rem; }
.stats dt { color: var(--clr-muted); }
.stats dd { margin: 0; font-weight: 700; text-align: right; }
.nudge { display: grid; gap: .6rem; padding: .8rem; border-radius: 12px; background: #FCF3E3; }

/* Data section */
.data summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.data__actions { display: grid; gap: .6rem; }
.data__actions .btn { width: 100%; }
.status { color: var(--clr-base-strong); font-weight: 600; }
.status:empty { display: none; }

/* Entry sheet */
.sheet { width: min(100%, 560px); max-height: 100dvh; margin: auto; padding: 0; border: 0; border-radius: 22px; color: var(--clr-dark); background: var(--clr-surface); overflow: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: rgba(18, 48, 46, .6); }
.sheet form { padding: 0 1.1rem 1.1rem; display: grid; gap: 1.25rem; }
.sheet__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: calc(var(--safe-top) + .9rem) 0 .7rem; background: var(--clr-surface); }
.sheet__head h2 { font-size: 1.1rem; }
.sheet__head h2::first-letter { text-transform: uppercase; }
.sheet__sub { margin: 0; color: var(--clr-muted); font-size: .85rem; }
.sheet__sub:empty { display: none; }
.sheet__close { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--clr-bg); cursor: pointer; }
.sheet__close svg { width: 20px; height: 20px; }
.sheet fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sheet legend { padding: 0; margin-bottom: .6rem; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .9rem; border: 1.5px solid var(--clr-border); border-radius: 999px; font-size: .92rem; background: #fff; }
.chip input:checked + span { background: var(--clr-base-strong); border-color: var(--clr-base-strong); color: #fff; font-weight: 600; }
.chips--multi .chip input:checked + span { background: var(--clr-dark); border-color: var(--clr-dark); }
.chip:has(input:focus-visible) span { outline: 3px solid var(--clr-focus); outline-offset: 2px; }
.field { display: grid; gap: .4rem; }
.field__label { font-weight: 700; }
.field small { font-weight: 400; color: var(--clr-muted); }
#temp, textarea { width: 100%; padding: .7rem .8rem; border: 1.5px solid var(--clr-border); border-radius: 12px; background: #fff; }
#temp { max-width: 11rem; min-height: 48px; }
textarea { resize: vertical; }
.form__error { margin: 0; color: var(--clr-accent-strong); font-weight: 600; }
.sheet__actions { position: sticky; bottom: 0; display: grid; gap: .6rem; padding: .75rem 0 var(--safe-bottom); background: var(--clr-surface); }
@media (max-width: 599px) { .sheet { height: 100dvh; border-radius: 0; } }
