/* Ὁρμή widgets — sizes come from the home grid (s = 2×2, m = 4×2, l = 4×4 cells). */
.tile.widget { position: relative; min-width: 0; min-height: 0; }
.grid .ws-s { grid-column: span 2; grid-row: span 2; }
.grid .ws-m { grid-column: span 4; grid-row: span 2; }
.grid .ws-l { grid-column: span 4; grid-row: span 4; }
.tile.widget > .wg {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  padding: 12px; padding: clamp(12px, 7cqmin, 20px); border-radius: 18px; border-radius: clamp(18px, 9cqmin, 28px);
  background: linear-gradient(150deg, rgba(56, 61, 84, 0.42), rgba(16, 21, 36, 0.4));
  border: 1px solid rgba(220, 224, 250, 0.13);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 14px 50px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(26px) saturate(1.15); backdrop-filter: blur(26px) saturate(1.15);
  color: var(--fg); text-align: left; transition: transform var(--pop-ms, 0.45s) var(--ease-pop, var(--ease)), filter 0.18s;
}
.tile.widget { container-type: size; }
.wst-solid > .wg { background: linear-gradient(150deg, rgba(30, 34, 50, 0.96), rgba(14, 17, 28, 0.96)); -webkit-backdrop-filter: none; backdrop-filter: none; }
.wst-outline > .wg { background: rgba(10, 12, 20, 0.12); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-color: rgba(225, 230, 255, 0.28); }
body.noblur .tile.widget:not(.wst-solid):not(.wst-outline):not(.bare) > .wg { background: linear-gradient(150deg, rgba(44, 49, 68, 0.9), rgba(17, 21, 34, 0.92)); }
body.noblur .wst-outline > .wg { background: rgba(10, 12, 20, 0.55); }
.tile.widget.bare > .wg { background: none; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding-left: 2px; }
body.editing .tile.widget.bare > .wg { border: 1px dashed rgba(225, 230, 255, 0.22); }
.tile.widget.pressing > .wg { transform: scale(0.965); transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1); }
body.fx-tilt .tile.widget.pressing > .wg { transform: perspective(900px) rotateX(calc(var(--ty, 0) * -5deg)) rotateY(calc(var(--tx, 0) * 5deg)) scale(0.965); }

.wg-head { display: flex; align-items: center; gap: 8px; min-height: 20px; flex: none; }
.wg-kicker { flex: 1; min-width: 0; font-size: 11px; letter-spacing: 0.14em; font-weight: 650; color: #b6b9cf; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-glyph { width: 17px; height: 17px; color: color-mix(in srgb, var(--accent2) 60%, #c8cde4); }
.wg-count { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wg-big { font-size: 30px; font-size: clamp(30px, 26cqmin, 64px); font-weight: 300; letter-spacing: -0.04em; line-height: 1; margin-top: auto; font-variant-numeric: tabular-nums; }
.wg-big small { font-size: 0.34em; letter-spacing: 0; margin-right: 6px; color: var(--sub); font-weight: 500; }
.wg-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--sub); flex: none; }
.wg-foot b { color: var(--fg); font-weight: 560; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--sub); font-size: 13.5px; text-align: center; }
.mini-btn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); flex: none; color: var(--fg); }
.mini-btn .g { width: 16px; height: 16px; stroke-width: 2; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); font-size: 13px; color: var(--fg); }
.chip .g { width: 15px; height: 15px; }

/* hero clock */
.wt-hero > .wg { justify-content: center; gap: 4px; }
.hero-eyebrow { display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: 0.18em; font-weight: 640; color: #b4b2c8; white-space: nowrap; overflow: hidden; }
.hero-eyebrow .star { font-size: 15px; color: #d4d7ee; letter-spacing: 0; }
.hairline { display: inline-block; width: 26px; height: 1px; background: rgba(192, 193, 220, 0.3); flex: none; }
.hero-page { color: var(--muted); }
.hero-time { font-size: 64px; font-size: clamp(64px, min(54cqh, 26cqw), 200px); line-height: 1.04; font-weight: 200; letter-spacing: -0.065em; color: #f3f3fa; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 3px 50px rgba(220, 205, 255, 0.07); margin-left: -0.04em; }
.hero-time .colon { opacity: 0.6; font-weight: 200; margin: 0 0.02em; }
body[data-motion="on"][data-power="smooth"] .hero-time .colon { animation: blink 2s steps(1, end) infinite; }
.hero-time .ap { font-size: 0.22em; letter-spacing: 0; margin-right: 0.3em; font-weight: 400; color: var(--sub); vertical-align: 0.2em; }
@keyframes blink { 50% { opacity: 0.2; } }
.hero-meta { display: flex; align-items: center; gap: 16px; color: #c0c2d2; font-size: 13px; font-size: clamp(13px, 4.6cqh, 16px); white-space: nowrap; overflow: hidden; }
.hero-meta i { width: 1px; height: 17px; background: rgba(199, 201, 230, 0.28); flex: none; }
.hero-meta em { font-family: var(--font-serif); font-style: italic; color: #a3a6bc; overflow: hidden; text-overflow: ellipsis; }
body[data-clock="serif"] .hero-time, body[data-clock="serif"] .wg-big, body[data-clock="serif"] .timer-time { font-family: var(--font-serif); font-weight: 300; letter-spacing: -0.03em; }
body[data-clock="mono"] .hero-time, body[data-clock="mono"] .wg-big, body[data-clock="mono"] .timer-time { font-family: var(--font-mono); font-weight: 300; letter-spacing: -0.06em; }
body[data-clock="rounded"] .hero-time, body[data-clock="rounded"] .wg-big, body[data-clock="rounded"] .timer-time { font-family: var(--font-round); font-weight: 300; letter-spacing: -0.04em; }

/* analog clock */
.analog { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }
.analog svg { width: 100%; width: min(100%, 100cqh - 26px); height: auto; max-height: 100%; aspect-ratio: 1; }
.analog .face { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.14); stroke-width: 1; }
.analog .ticks line { stroke: rgba(230, 232, 250, 0.55); stroke-width: 1.4; stroke-linecap: round; }
.analog .hand-h { stroke: #eceef8; stroke-width: 3.4; stroke-linecap: round; }
.analog .hand-m { stroke: #eceef8; stroke-width: 2.2; stroke-linecap: round; }
.analog .hand-s { stroke: var(--accent2); stroke-width: 1; stroke-linecap: round; }
.analog .pin { fill: var(--accent2); }
.analog-label { position: absolute; bottom: 0; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

/* focus */
.focus-title { font-size: 18px; font-size: clamp(18px, 13cqmin, 28px); line-height: 1.16; letter-spacing: -0.025em; font-weight: 500; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.focus-bottom { display: flex; align-items: center; gap: 10px; flex: none; }
.progress { flex: 1; height: 3px; border-radius: 3px; background: rgba(214, 218, 254, 0.17); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.3s var(--ease); }
.focus-bottom .num { font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.steps { display: flex; gap: 6px; flex: none; }
.step { flex: 1; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.08); }
.step.on { background: color-mix(in srgb, var(--accent) 70%, transparent); border-color: transparent; }

/* todo */
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; flex: 1; min-height: 0; overflow: hidden; align-content: start; }
.todo li { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 14px; }
.todo li > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo li.done > span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }
.todo li.more, .todo li.empty { color: var(--muted); font-size: 12.5px; min-height: 26px; }
.chk { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.6px solid rgba(220, 225, 250, 0.45); display: grid; place-items: center; position: relative; }
.chk::before { content: ""; position: absolute; inset: -8px; }
.done .chk { background: var(--accent); border-color: transparent; color: #11131b; }
.chk .g { width: 15px; height: 15px; stroke-width: 2.6; }

/* memo */
.memo { flex: 1; min-height: 0; overflow: hidden; font-size: 14.5px; line-height: 1.5; color: #e4e5ef; word-break: keep-all; overflow-wrap: anywhere; }
.memo.quote { font-family: var(--font-serif); font-style: italic; font-size: 17px; font-size: clamp(17px, 10cqmin, 26px); line-height: 1.35; display: flex; align-items: center; }
.memo .placeholder { color: var(--muted); font-style: normal; font-family: var(--font); font-size: 13.5px; }

/* D-day */
.dday-num { color: #f6f6fb; }
.dday-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; flex: 1; align-content: center; }
.dday-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.dday-list li:last-child { border-bottom: 0; }
.dday-list .t { display: grid; min-width: 0; font-size: 14px; }
.dday-list .t small { color: var(--muted); font-size: 11.5px; }
.dday-list b { font-size: 20px; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* timer */
.timer-s, .timer-m { flex: 1; min-height: 0; display: flex; align-items: center; gap: 12px; }
.timer-s { flex-direction: column; justify-content: center; gap: 6px; }
.timer-ring { position: relative; display: grid; place-items: center; height: 100%; max-height: 100%; aspect-ratio: 1; min-height: 0; }
.timer-s .timer-ring { height: auto; width: 100%; width: min(64cqh, 80cqw); flex: 1; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring .track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 5; }
.ring .bar { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.ring .bar.break { stroke: var(--accent2); }
.timer-time { position: relative; font-size: 18px; font-size: clamp(18px, 13cqmin, 34px); font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.timer-btns { display: flex; gap: 8px; }
.round-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #11131b; }
.round-btn .g { width: 17px; height: 17px; stroke-width: 2.2; }
.round-btn.ghost { background: rgba(255, 255, 255, 0.1); color: var(--fg); }
.timer-side { display: grid; gap: 8px; }
.timer-side .phase { font-size: 22px; font-weight: 500; }
.timer-side .phase.break { color: var(--accent2); }
.rounds { font-size: 12px; color: var(--muted); }
.timer-m .timer-ring { height: 100%; }

/* weather */
.wx-main { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.wx-icon { width: 30px; width: clamp(30px, 22cqmin, 48px); height: 30px; height: clamp(30px, 22cqmin, 48px); stroke-width: 1.4; color: #eef0f8; }
.wx-temp { font-size: 34px; font-size: clamp(34px, 28cqmin, 60px); font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.wx-sub { display: grid; gap: 1px; font-size: 12.5px; color: var(--sub); }
.wx-sub b { color: var(--fg); font-weight: 560; font-size: 14px; }
.wx-m { flex: 1; display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; align-items: end; min-height: 0; }
.wx-m > div { display: flex; flex-direction: column; gap: 8px; height: 100%; justify-content: flex-end; }
.wx-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-self: end; }
.wx-days li { display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--sub); }
.wx-days li .g { width: 22px; height: 22px; color: #e9ebf6; }
.wx-days b { color: var(--fg); font-weight: 500; font-size: 14px; }
.wx-days small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* calendar */
.cal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 1px 2px; font-size: 9.5px; font-size: clamp(9.5px, 5.4cqmin, 13px); text-align: center; align-items: center; font-variant-numeric: tabular-nums; }
.cal-grid .dow { color: var(--muted); font-size: 0.9em; font-weight: 600; }
.cal-grid .sun { color: #f0a3a3; }
.cal-grid .day { position: relative; border-radius: 50%; aspect-ratio: 1; max-height: 100%; display: grid; place-items: center; margin: 0 auto; width: min(100%, 2.1em); }
.cal-grid .day.today { background: var(--accent); color: #10121a; font-weight: 700; }
.cal-grid .day.mark::after { content: ""; position: absolute; bottom: 6%; width: 4px; height: 4px; border-radius: 50%; background: var(--accent2); }
.cal-m { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.cal-m .cal-grid { font-size: 10px; font-size: clamp(10px, 6cqh, 13px); }
.cal-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cal-today { display: flex; align-items: baseline; gap: 8px; }
.cal-today b { font-size: 30px; font-size: clamp(30px, 26cqh, 52px); font-weight: 300; line-height: 1; letter-spacing: -0.04em; }
.cal-today span { color: var(--sub); font-size: 13px; }
.cal-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.cal-side li { display: flex; justify-content: space-between; gap: 8px; }
.cal-side li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sub); }
.cal-side li.muted { color: var(--muted); font-size: 12px; }

/* timetable */
.tt-status { font-size: 14px; flex: none; }
.tt-status b { font-weight: 560; }
.tt-status .now { color: var(--accent); }
.tt-status small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.tt-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; align-content: start; overflow: hidden; }
.tt-list li { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.tt-list li small { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.tt-list li.now { background: color-mix(in srgb, var(--accent) 80%, transparent); color: #10121a; font-weight: 600; }
.tt-list li.now small { color: rgba(16, 18, 26, 0.6); }
.tt-list li.past { opacity: 0.45; }
.tt-table { width: 100%; height: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: 10.5px; font-size: clamp(10.5px, 3.4cqmin, 13.5px); flex: 1; }
.tt-table th { color: var(--muted); font-weight: 600; font-size: 0.92em; }
.tt-table th small { display: block; font-size: 0.8em; font-weight: 400; font-variant-numeric: tabular-nums; }
.tt-table th.today { color: var(--accent); }
.tt-table td { background: rgba(255, 255, 255, 0.05); border-radius: 7px; text-align: center; padding: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-table td.today { background: rgba(255, 255, 255, 0.1); }
.tt-table td.now { background: color-mix(in srgb, var(--accent) 80%, transparent); color: #10121a; font-weight: 650; }

/* photo */
.wt-photo > .wg { padding: 0; }
.photo-stack { position: absolute; inset: 0; }
.photo-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s ease; pointer-events: none; -webkit-user-drag: none; }
.photo-stack img.on { opacity: 1; }
.photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 16px 12px; font-size: 13px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); color: #fff; }
.wt-photo .wg-empty { padding: 16px; }
.wt-photo .wg-head { padding: 14px 16px 0; }

/* link */
.link-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 0; }
.link-glyph { width: 26px; width: clamp(26px, 20cqmin, 40px); height: 26px; height: clamp(26px, 20cqmin, 40px); color: var(--accent); margin-bottom: auto; stroke-width: 1.5; }
.link-body b { font-size: 16px; font-size: clamp(16px, 10cqmin, 22px); font-weight: 560; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-body small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ambient */
.wave-bars { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 3px; min-height: 0; }
.wave-bars i { display: block; width: 3px; height: 22%; border-radius: 3px; background: linear-gradient(#d8d7ea, #9cb1c9); opacity: 0.8; transform-origin: center; }
.wave-bars i:nth-child(4n) { height: 62%; }
.wave-bars i:nth-child(5n) { height: 36%; }
.wave-bars i:nth-child(7n) { height: 84%; }
/* compositor-only animation (no blur behind it in glass-lite); paused in power saver */
body[data-motion="on"]:not([data-power="saver"]) .wave-bars:not(.paused) i { animation: wave 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * -110ms); }
@keyframes wave { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1.15); } }

/* ---------- previews of widgets inside sheets (editor & gallery) ---------- */
.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 78px; gap: 14px 12px; --cols: 4; }
.preview-grid .ws-s { grid-column: span 2; grid-row: span 2; }
.preview-grid .ws-m { grid-column: span 4; grid-row: span 2; }
.preview-grid .ws-l { grid-column: span 4; grid-row: span 4; }
.preview-grid .tile.widget { pointer-events: none; }
.editor-preview { padding: 18px; margin: -4px 0 18px; border-radius: 22px; background: radial-gradient(circle at 20% 20%, var(--glow1), transparent 60%), radial-gradient(circle at 80% 80%, var(--glow2), transparent 60%), #0b0e16; border: 1px solid var(--line); }
.editor-preview .preview-grid { max-width: 360px; margin: 0 auto; }
.wgal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.wgal-card { display: grid; gap: 12px; padding: 14px; border-radius: 22px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.wgal-preview { padding: 12px; border-radius: 16px; background: radial-gradient(circle at 20% 20%, var(--glow1), transparent 60%), #0b0e16; min-height: 200px; display: grid; align-content: center; }
.wgal-preview .preview-grid { grid-auto-rows: 68px; gap: 10px; }
.wgal-info { display: grid; gap: 6px; }
.wgal-info b { font-size: 16px; }
.wgal-info small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.wgal-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

/* editor lists */
.edit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.edit-list li { display: flex; align-items: center; gap: 8px; }
.edit-list .input { min-height: 42px; }
.edit-list .input.date { flex: none; width: 160px; }
.chk-input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.photo-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .icon-btn { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; background: rgba(0, 0, 0, 0.55); }
.ph .icon-btn .g { width: 15px; height: 15px; }
.ph.add { display: grid; place-content: center; justify-items: center; gap: 4px; border: 1.5px dashed var(--line-strong); color: var(--sub); font-size: 12px; cursor: pointer; }
.place-now { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.place-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.place-pick { width: 100%; text-align: left; display: grid; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.place-pick small { color: var(--muted); }
.tt-edit { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.tt-edit table { border-collapse: separate; border-spacing: 4px; min-width: 520px; }
.tt-edit th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.tt-edit th b { display: block; color: var(--fg); }
.tt-edit .input { min-height: 38px; padding: 6px 8px; font-size: 15px; text-align: center; }
.tt-edit .input.time { width: 96px; font-size: 13px; padding: 4px; margin-top: 2px; }
