* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Arial, Helvetica, sans-serif; background: var(--bg,#f6f1e7); color: var(--text,#221f1b); }
[hidden] { display: none !important; }
.widget { padding: clamp(16px,3vw,24px); max-width: 1040px; margin: auto; min-height: 100vh; display: flex; flex-direction: column; gap: 14px; }
header { display: flex; justify-content: space-between; gap: 8px 16px; align-items: center; flex-wrap: wrap; }
.date-heading { display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.day-count { font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
h1 { font: italic 1.25rem Georgia,serif; margin: 0; overflow-wrap: anywhere; }
.year-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.year { font: 3.4rem/.95 Georgia,serif; letter-spacing: -.05em; }
.year-caption { display: block; margin-top: 6px; font: italic .875rem Georgia,serif; color: var(--muted); }
.year-number { text-align: right; display: flex; flex-direction: column; gap: 6px; }
.year-number strong { font-size: 1.75rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--accent); }
.year-number>span { font-size: .75rem; color: var(--muted); }
.dot-chart { display: grid; gap: 4px; outline-offset: 4px; border-radius: 4px; }
.month-row { display: grid; grid-template-columns: 32px repeat(31,minmax(0,1fr)); align-items: center; gap: 3px; }
.month-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.current-month { color: var(--accent); font-weight: 700; }
.dot { height: var(--dot-height,14px); position: relative; min-width: 0; display: flex; justify-content: center; align-items: center; cursor: pointer; border-radius: 4px; }
.dot:before { content: ''; display: block; width: var(--dot-diameter,6px); height: var(--dot-diameter,6px); background: var(--track); border-radius: 50%; min-height: 3px; min-width: 3px; }
.dot.past:before { background: var(--accent); }
.dot.today:before { background: var(--accent); box-shadow: 0 0 0 1px var(--bg),0 0 0 2px var(--accent); }
.dot.selected { outline: 1px dashed var(--text); outline-offset: 1px; }
.dot-chart:focus-visible { outline: 2px solid var(--accent); }
.chart-bottom { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: .75rem; color: var(--muted); }
.legend { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.legend i,.future-dot { height: 7px; width: 7px; display: inline-block; border-radius: 50%; background: var(--accent); }
.legend i { box-shadow: 0 0 0 1px var(--bg),0 0 0 2px var(--accent); margin-right: 2px; }
.future-dot { background: var(--track); margin-left: 8px; }
.chart-hint { text-align: right; }
.date-explorer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--track); }
#selection { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#selected-date { font-size: .875rem; font-weight: 600; }
#selected-detail { font-size: .75rem; color: var(--muted); }
.date-actions { display: flex; gap: 5px; flex-shrink: 0; }
.date-actions button { font: inherit; font-size: .875rem; color: var(--text); background: transparent; border: 1px solid var(--track); border-radius: 7px; min-height: 44px; min-width: 44px; padding: 5px 8px; cursor: pointer; touch-action: manipulation; }
.date-actions button:first-child,.date-actions button:last-child { font-size: 1.5rem; line-height: 1; }
.date-actions button:disabled { opacity: .35; cursor: default; }
.date-actions button:hover:not(:disabled) { background: var(--track); }
.period { padding: 12px 0; border-top: 1px solid var(--track); min-width: 0; }
.period-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.period-name { font-size: .875rem; overflow-wrap: anywhere; }
.percent { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.track { height: 5px; border-radius: 5px; background: var(--track); margin: 10px 0 7px; overflow: hidden; }
.fill { height: 100%; background: var(--accent); border-radius: 5px; }
.detail { color: var(--muted); font-size: .75rem; line-height: 1.5; overflow-wrap: anywhere; }
.periods-dots { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.periods-dots .period-top { align-items: flex-start; flex-direction: column; gap: 7px; }
.periods-dots .percent { font-size: 1.5rem; }
.periods-rings { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 20px; }
.ring { width: 110px; height: 110px; position: relative; margin: 12px auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--track); stroke-width: 5; }
.ring .arc { stroke: var(--accent); stroke-linecap: round; }
.ring .percent { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.4rem; }
.periods-rings .period { text-align: center; }
.periods-rings .period-top { justify-content: center; }
.periods-bars .percent { font-size: 1.625rem; }
.periods-bars .period { padding: 19px 0; }
.periods-bars .track { height: 9px; margin: 15px 0 10px; }
footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .75rem; color: var(--muted); padding-top: 4px; }
footer a { color: var(--text); text-decoration: none; padding: 12px; border: 1px solid var(--track); border-radius: 30px; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
a:focus-visible,button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#zone-label { overflow-wrap: anywhere; line-height: 1.4; }
/* Compact is deliberate, not scaled-down text. The middle row stays centered in short embeds. */
.compact .widget { padding: 16px 20px; gap: 10px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.compact #year-view { display: none; }
.compact #periods { align-self: center; width: 100%; }
.compact .period { padding: 9px 0; }
.compact .periods-dots,.compact .periods-bars { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.compact .period-top { flex-direction: column; gap: 6px; align-items: flex-start; }
.compact .percent { font-size: 1.25rem; }
.compact .track { margin: 8px 0 6px; height: 5px; }
.compact .periods-rings { grid-template-columns: repeat(auto-fit,minmax(95px,1fr)); gap: 12px; }
.compact .periods-rings .period-top { align-items: center; }
.compact .ring { width: 70px; height: 70px; margin: 6px auto; }
.compact .ring .percent { font-size: 1rem; }
/* In a narrow or medium-height day-dot embed, the calendar is the useful summary.
   Hide the duplicate progress cards and tighten spacing so Notion does not need a scrollbar. */
.calendar-focus .widget { padding: 12px 16px; gap: 8px; }
.calendar-focus #periods { display: none; }
.calendar-focus .year-heading { margin-bottom: 8px; }
.calendar-focus .year { font-size: 2.75rem; }
.calendar-focus .year-caption { margin-top: 3px; }
.calendar-focus .dot-chart { gap: 2px; }
.calendar-focus .chart-bottom { margin-top: 6px; }
.calendar-focus .date-explorer { margin-top: 6px; padding-top: 6px; }
.calendar-focus footer { padding-top: 0; }
.tiny .widget { padding: 12px 18px; gap: 8px; }
.tiny .period:nth-child(n+2) { display: none; }
.tiny header h1 { font-size: 1rem; }
.tiny #periods { display: block; }
.tiny .period-top { flex-direction: row; }
.tiny .periods-rings .period { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tiny .periods-rings .detail { max-width: 90px; }
.tiny .ring { margin: 4px 0; flex-shrink: 0; }
@media(max-width:430px) {
 .widget { gap: 12px; }
 .year { font-size: 3rem; }
 .year-number strong { font-size: 1.5rem; }
 .month-row { gap: 2px; grid-template-columns: 29px repeat(31,minmax(0,1fr)); }
 .periods-dots { gap: 10px; }
 .periods-dots .percent { font-size: 1.25rem; }
 .chart-hint { display: none; }
 .date-explorer { align-items: flex-start; flex-wrap: wrap; }
 .date-actions { margin-left: auto; }
}
@media(max-width:310px) { .periods-dots { grid-template-columns: repeat(2,minmax(0,1fr)); } .year-caption { display: none; } }
@media(prefers-reduced-motion:no-preference) { .fill { transition: width .3s ease; } }
