/* Display formats represent launcher cells; the phone controls the real size. */
.widget-designer { display:grid; gap:26px; min-width:0; }
.wd-save-note,.wd-format-note { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.wd-preview-stage { display:grid; justify-items:center; gap:18px; padding:16px; min-width:0; border:1px solid var(--line); border-radius:22px; background:var(--surface-2); }
.wd-preview-stage>header { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-width:0; }
.wd-preview-stage>header>div { display:grid; gap:4px; min-width:0; }
.wd-preview-stage header small { color:var(--muted); font-size:10px; line-height:1.4; }
.wd-preview-stage header strong { color:var(--text); font-size:12px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wd-preview-stage [data-widget-format-caption] { flex:none; padding:6px 9px; border:1px solid var(--line); border-radius:8px; color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.wd-preview-stage>[data-widget-preview] { width:100%; min-width:0; display:flex; justify-content:center; }
.wd-preview-stage>p { margin:0; text-align:center; font-size:11px; color:var(--muted); }
.wd-widget { --wd-card:#17171d; --wd-ink:#f2f2f6; --wd-muted:#a6a7b3; --wd-tint:var(--accent); --wd-line:#303139; --wd-dot:#ffffff0b; --wd-missed:#4c313a; display:grid; align-content:center; gap:12px; width:100%; max-width:420px; min-width:0; padding:16px; border:1px solid var(--wd-line); border-radius:20px; background:var(--wd-card); color:var(--wd-ink); font-family:inherit; box-sizing:border-box; overflow:hidden; }
.wd-theme-light,:root[data-mode=light] .wd-theme-app { --wd-card:#ffffff; --wd-ink:#24262d; --wd-muted:#60636e; --wd-tint:var(--accent); --wd-line:#dcdde4; --wd-dot:#24262d08; --wd-missed:#f2dde2; }
.wd-widget svg { width:18px; height:18px; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; fill:none; }
.wd-widget h3 { margin:0; color:var(--wd-ink); font-size:17px; font-weight:600; line-height:1.3; letter-spacing:-.2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wd-widget-heading { display:flex; align-items:center; gap:8px; min-width:0; }
.wd-widget-heading>h3 { flex:1; min-width:0; font-size:15px; }
.wd-widget-symbol { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:10px; color:var(--wd-ink); background:var(--wd-dot); }
.wd-widget-symbol svg { width:21px; height:21px; }
.wd-widget-menu { flex:none; color:var(--wd-ink); font-size:18px; line-height:1; }
.wd-widget-value { display:block; min-width:0; font-size:23px; font-weight:600; line-height:1.4; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-variant-numeric:tabular-nums; letter-spacing:-.5px; }
.wd-widget-meta { margin:0; min-width:0; font-size:10px; line-height:1.5; color:var(--wd-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wd-progress { position:relative; display:grid; place-items:center; flex:none; width:62px; height:62px; }
.wd-progress>span { max-width:80%; font-size:28px; font-weight:600; text-align:center; line-height:1.35; font-variant-numeric:tabular-nums; }
.wd-progress>span>small { font-size:.52em; font-weight:400; }
.wd-widget .wd-ring { position:absolute; inset:0; width:100%; height:100%; stroke-width:3; transform:rotate(-90deg); }
.wd-ring circle:first-child { stroke:var(--wd-line); }
.wd-ring circle:last-child { stroke:var(--wd-tint); }
.wd-tiny-progress { display:block; height:3px; width:100%; flex:none; overflow:hidden; border-radius:3px; background:var(--wd-line); }
.wd-tiny-progress i { display:block; height:100%; border-radius:inherit; background:var(--wd-tint); }
.wd-plan-list { display:grid; gap:6px; min-width:0; }
.wd-plan-row { display:flex; align-items:center; gap:7px; min-width:0; font-size:11px; line-height:1.5; }
.wd-plan-row>span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wd-plan-time { width:33px; min-height:18px; flex:none; display:grid; place-items:center; font-size:10px; color:var(--wd-muted); }
.wd-plan-time>i { width:4px; height:4px; border-radius:50%; background:currentColor; }
.wd-plan-time svg { width:14px; height:14px; color:var(--wd-tint); }
.wd-plan-row.is-done>span:last-child { text-decoration:line-through; color:var(--wd-muted); }
.wd-plan-empty { margin:0; font-size:11px; line-height:1.5; color:var(--wd-muted); }
.wd-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
.wd-week>div { display:grid; justify-items:center; gap:6px; min-width:0; }
.wd-week small { font-size:10px; color:var(--wd-muted); }
.wd-day-square { display:grid; place-items:center; width:100%; aspect-ratio:1; max-width:38px; border:1px solid var(--wd-line); border-radius:7px; color:var(--wd-muted); background:var(--wd-dot); font-size:11px; box-sizing:border-box; justify-self:center; }
.wd-day-square>b { width:3px; height:3px; border-radius:50%; background:currentColor; opacity:.4; }
.wd-day-square svg { width:16px; height:16px; }
.wd-day-square.wd-day-completed { border-color:var(--wd-tint); color:var(--wd-tint-contrast); background:var(--wd-tint); font-weight:600; }
.wd-day-square.wd-day-future { background:transparent; opacity:.45; border-style:dashed; }
.wd-day-square.wd-day-partial { border-color:color-mix(in srgb,var(--wd-tint) 50%,var(--wd-line)); background:color-mix(in srgb,var(--wd-tint) 50%,var(--wd-line)); color:var(--wd-ink); }
.wd-day-square.wd-day-missed { background:var(--wd-missed); border-color:var(--wd-missed); color:var(--wd-ink); }
.wd-day-square.wd-day-paused,.wd-day-square.wd-day-optional,.wd-day-square.wd-day-rest { background:transparent; opacity:.6; }
.wd-day-square.is-today { outline:1px solid var(--wd-tint); outline-offset:2px; }
.wd-calendar-layout { display:grid; gap:12px; min-width:0; }
.wd-month-heading { display:flex; align-items:baseline; justify-content:space-between; gap:8px; min-width:0; }
.wd-month-heading>strong { min-width:0; font-size:11px; font-weight:500; text-transform:capitalize; }
.wd-month-heading>span { flex:none; color:var(--wd-muted); font-size:9px; }
.wd-month-heading>span>b { color:var(--wd-ink); font-size:inherit; font-weight:600; font-variant-numeric:tabular-nums; }
.wd-size-large .wd-calendar-layout { grid-template-columns:82px minmax(0,1fr); gap:18px; align-items:center; }
.wd-size-large .wd-month-heading { display:grid; gap:14px; align-content:center; }
.wd-size-large .wd-month-heading>span { display:grid; gap:4px; font-size:10px; }
.wd-size-large .wd-month-heading>span>b { font-size:46px; line-height:1; letter-spacing:-1px; }
.wd-month { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; min-width:0; }
.wd-month>small { padding-bottom:4px; font-size:9px; color:var(--wd-muted); text-align:center; }
.wd-month .wd-day-square { max-width:none; height:24px; aspect-ratio:auto; border-radius:5px; font-size:10px; }
.wd-size-small .wd-month .wd-day-square { height:19px; font-size:9px; border-radius:4px; }
.wd-size-small .wd-month { gap:3px; }
.wd-size-small .wd-month-heading { flex-wrap:wrap; row-gap:2px; }
.wd-next { display:grid; gap:7px; min-width:0; }
.wd-next>p { margin:0; color:var(--wd-muted); font-size:10px; line-height:1.4; }
.wd-series-heading { display:flex; align-items:center; gap:8px; min-width:0; }
.wd-series-heading>h3 { flex:1; min-width:0; font-size:13px; }
.wd-series-value { display:grid; gap:2px; min-width:0; }
.wd-series-value>strong { font-size:50px; font-weight:600; letter-spacing:-1.5px; line-height:1.1; font-variant-numeric:tabular-nums; }
.wd-series-value>span { font-size:11px; line-height:1.4; color:var(--wd-muted); }
.wd-series-mark { flex:none; display:flex; color:var(--wd-tint); }
.wd-series-mark svg { width:28px; height:28px; }
.wd-day-progress { display:grid; justify-items:center; gap:8px; text-align:center; min-width:0; }
.wd-day-progress .wd-progress { width:110px; height:110px; }
.wd-day-progress .wd-progress>span { font-size:31px; max-width:80px; }
.wd-day-progress>p { margin:0; font-size:10px; line-height:1.3; color:var(--wd-muted); }
.wd-size-compact { max-width:220px; min-height:110px; padding:12px; gap:7px; }
.wd-size-small { max-width:220px; min-height:220px; padding:14px; gap:12px; }
.wd-size-large { min-height:210px; }
.wd-size-wide { min-height:105px; gap:5px; padding:12px; }
.wd-size-compact .wd-widget-heading h3,.wd-size-wide .wd-widget-heading h3 { font-size:13px; }
.wd-size-compact .wd-widget-value { font-size:14px; }
.wd-size-wide .wd-plan-list { gap:3px; }
.wd-size-wide .wd-plan-row { font-size:10px; line-height:1.3; }
.wd-size-wide .wd-plan-time { min-height:13px; }
.wd-size-compact .wd-week { gap:3px; }
.wd-size-compact .wd-week small { font-size:8px; }
.wd-size-wide .wd-day-square { max-width:25px; }
.wd-size-wide .wd-week>div { gap:3px; }
.wd-size-small .wd-week { gap:4px; }
.wd-size-small .wd-day-square svg { width:13px; height:13px; }
.wd-size-compact .wd-widget-symbol { width:25px; height:25px; border-radius:8px; }
.wd-size-compact .wd-widget-symbol svg { width:17px; height:17px; }
.wd-size-compact .wd-series-value>strong,.wd-size-wide .wd-series-value>strong { font-size:19px; }
.wd-size-compact .wd-day-progress,.wd-size-wide .wd-day-progress { justify-items:start; gap:3px; text-align:left; }
.wd-controls { display:grid; gap:26px; min-width:0; }
.wd-controls fieldset { margin:0; padding:0; border:0; min-width:0; }
.wd-controls legend { margin-bottom:9px; padding:0; font-size:14px; font-weight:600; }
.wd-group-note { margin:-3px 0 12px; color:var(--muted); font-size:11px; line-height:1.5; }
.wd-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.wd-option { position:relative; display:block; min-width:0; cursor:pointer; }
.wd-option>input { position:absolute; inset:0; width:1px; height:1px; opacity:0; }
.wd-option>span { display:flex; align-items:center; justify-content:center; gap:7px; min-height:48px; padding:10px 8px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); color:var(--muted); }
.wd-option>span b { font-size:12px; font-weight:500; line-height:1.4; }
.wd-option>input:checked+span { border-color:var(--accent-border,var(--accent)); background:var(--accent-soft); color:var(--accent-ink); }
.wd-option>input:focus-visible+span { outline:2px solid var(--accent-ink); outline-offset:3px; }
.wd-variant-option>span { display:grid; justify-items:start; justify-content:stretch; gap:5px; padding:12px; height:100%; box-sizing:border-box; }
.wd-variant-options>.wd-variant-option:last-child:nth-child(odd),.wd-variant-options>.wd-unavailable-option:last-child:nth-child(odd) { grid-column:1/-1; }
.wd-variant-option small { font-size:10px; line-height:1.4; opacity:.8; }
.wd-variant-art { width:100%; height:43px; display:flex; gap:4px; align-items:center; justify-content:center; margin-bottom:6px; border-radius:9px; background:var(--surface); color:var(--accent-ink); }
.wd-variant-art em { display:block; width:27px; height:2px; border-radius:2px; background:currentColor; }
.wd-art-plan-wide { flex-direction:column; gap:4px; }
.wd-art-plan-compact em:not(:first-child),.wd-art-habit-compact em:not(:first-child) { display:none; }
.wd-art-plan-compact em:first-child,.wd-art-habit-compact em:first-child { width:46px; }
.wd-art-day-progress em { width:22px; height:22px; border:2px solid currentColor; border-top-color:transparent; border-radius:50%; background:none; }
.wd-art-habit-week em { width:8px; height:8px; border-radius:50%; background:none; border:1px solid currentColor; }
.wd-art-streak svg,.wd-art-day-streak svg { width:24px; height:24px; stroke:currentColor; stroke-width:1.5; stroke-linejoin:round; fill:none; }
.wd-art-calendar,.wd-art-habit-heatmap { display:grid; grid-template-columns:repeat(7,7px); grid-template-rows:repeat(3,7px); gap:3px; align-content:center; }
.wd-art-calendar em,.wd-art-habit-heatmap em { width:7px; height:7px; border-radius:2px; background:var(--accent-ink); opacity:.3; }
.wd-art-calendar em:nth-child(3n),.wd-art-habit-heatmap em:nth-child(3n) { opacity:1; }
.wd-art-calendar em:nth-child(4n),.wd-art-habit-heatmap em:nth-child(4n) { opacity:.55; }
.wd-size-options .wd-option>span { display:grid; grid-template-columns:28px 1fr; gap:2px 8px; text-align:left; }
.wd-size-demo { grid-row:span 2; justify-self:center; width:23px; height:23px; border:1px solid currentColor; border-radius:5px; }
.wd-demo-compact { height:12px; }
.wd-demo-wide { width:28px; height:8px; border-radius:3px; }
.wd-demo-large { width:28px; height:15px; }
.wd-size-options small { font-size:10px; opacity:.8; line-height:1.4; }
.wd-format-note { margin-top:9px; font-size:11px; }
.wd-theme-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.wd-theme-options .wd-option>span { display:grid; gap:6px; padding:10px 4px; }
.wd-theme-options .wd-option b { font-size:11px; text-align:center; }
.wd-swatch { width:20px; height:20px; border-radius:50%; justify-self:center; border:1px solid var(--line); }
.wd-swatch-app { background:var(--surface); border-color:var(--accent-ink); }
.wd-swatch-dark { background:#1b1c21; border-color:#303139; }
.wd-swatch-light { background:#f5f5f8; border-color:#dcdde4; }
.wd-unavailable-option { display:grid; align-content:center; justify-items:start; gap:4px; padding:12px; border:1px dashed var(--line); border-radius:14px; color:var(--muted); }
.wd-unavailable-option span { font-size:12px; }
.wd-unavailable-option small { font-size:10px; }
.wd-controls .field { margin:0; }
.wd-controls .field>span small { font-size:11px; font-weight:400; color:var(--muted); }
.wd-habit-field[hidden] { display:none!important; }
.wd-save-note { min-height:20px; }
.wd-reset-button { justify-self:start; padding:0!important; min-height:44px; font-size:12px; }
.wd-native { display:grid; gap:12px; padding-top:18px; border-top:1px solid var(--line); }
.wd-phone-status { display:flex; gap:9px; }
.wd-status-dot { flex:none; width:5px; height:5px; margin-top:6px; border-radius:50%; background:var(--muted); }
.wd-status-dot.is-available { background:var(--accent-ink); }
.wd-phone-status strong { font-size:12px; font-weight:500; }
.wd-phone-status p,.wd-capability-note { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.6; }
.wd-pin-button { width:100%; font-size:12px; }
.widget-designer-form .sheet-content { overflow-x:hidden; }
.widget-designer-form .sheet-footer button { width:100%; }
@media(max-width:359px) {
 .wd-preview-stage { padding:16px 8px; }
 .wd-variant-option>span { padding:10px; }
 .wd-variant-option small { font-size:9px; }
 .wd-size-options .wd-option>span { grid-template-columns:25px 1fr; padding:10px 6px; column-gap:5px; }
 .wd-option>span b { font-size:11px; }
 .wd-size-wide .wd-widget-heading h3 { font-size:12px; }
}
/* The preview scrolls with the form, so it cannot cover editing controls. */
.wd-preview-stage { position:relative; top:auto; z-index:auto; }
@media(prefers-reduced-motion:no-preference) {
 .wd-option>span { transition:background .18s,border-color .18s,color .18s; }
 .wd-widget { animation:wd-preview-in .16s ease-out; }
 @keyframes wd-preview-in { from { opacity:.7; transform:translateY(2px); } to { opacity:1; transform:none; } }
}

/* One solid palette for the preview and the native home screen rendering. */
.wd-widget {border-radius:24px;box-shadow:0 8px 22px #00000014;--wd-dot:#292932;--wd-line:#383842;--wd-muted:#bfc0cf}
.wd-theme-light,:root[data-mode=light] .wd-theme-app {--wd-dot:#f0f1f6;--wd-line:#e2e3ec;--wd-muted:#58596b}
.wd-widget-symbol {background:var(--wd-tint);color:var(--wd-tint-contrast);border-radius:50%}
.wd-widget .wd-ring {stroke-width:7;stroke-linecap:round}
.wd-day-progress .wd-progress {width:118px;height:118px}
.wd-day-progress .wd-progress>span {font-size:34px;font-weight:700}
.wd-tiny-progress {height:6px;border-radius:6px}
.wd-widget-value,.wd-series-value>strong {font-weight:750}
.wd-series-mark svg {width:34px;height:38px;fill:var(--wd-tint);stroke:none}
.wd-day-square.wd-day-completed {color:var(--wd-tint-contrast)}
.wd-day-square.wd-day-partial {background:#ffc247;border-color:#ffc247;color:#211800}
.wd-day-square.wd-day-missed {background:#ff6478;border-color:#ff6478;color:#260009}
.wd-day-square.wd-day-future,.wd-day-square.wd-day-rest,.wd-day-square.wd-day-optional {opacity:1;color:var(--wd-muted);border-style:solid}
.wd-day-square.wd-day-skipped {background:var(--wd-line);color:var(--wd-muted)}
.wd-plan-row {font-size:12px}
.wd-series-value>strong {color:var(--wd-ink)}
