/* Виджеты 9.3: погода, курс, календарь, витрина, радио */
.wdg.is-drag { cursor: grabbing; z-index: 4; }
.wdg--wx, .wdg--fx, .wdg--cal, .wdg--show, .wdg--radio { width: 230px; }
.wdg--wx, .wdg--fx { padding: 14px 16px; }

.wx__city { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx__now { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px; }
.wx__ic svg { width: 44px; height: 44px; display: block; }
.wx__t { font: 300 44px/1 var(--brand); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wx__d { margin: 0 0 10px; font-size: var(--fs-s); color: var(--ink-2); line-height: 1.35; }
.wx__days { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.wx__days li { display: grid; justify-items: center; gap: 1px; font-size: var(--fs-s); }
.wx__days span { color: var(--ink-3); text-transform: capitalize; }
.wx__days svg { width: 24px; height: 24px; }
.wx__days small { color: var(--ink-3); }

.fx__h { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.fx__h b { font: 700 13px var(--brand); }
.fx__code { padding: 2px 8px; border-radius: 99px; background: var(--blue); color: #fff; font: 700 var(--fs-xs)/1.5 var(--mono); }
.fx__rate { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.fx__rate b { font: 700 18px var(--brand); color: var(--ink); font-variant-numeric: tabular-nums; }
.fx__rate span { display: block; font-size: var(--fs-s); }
.fx__conv { display: flex; gap: 6px; }
.fx__conv input { flex: 1; min-width: 0; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.85); padding: 0 10px; font: 600 14px var(--ui); color: var(--ink); outline: 0; user-select: text; }
.fx__conv input:focus { border-color: var(--blue); }
.fx__sw { width: 34px; height: 34px; border-radius: 10px; background: rgba(26, 43, 111, 0.08); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.fx__out { margin: 6px 0 4px; font-size: 13px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.fx__more { margin: 0; font-size: var(--fs-xs); color: var(--ink-3); }

.wdg--cal { padding: 12px 14px 14px; }
.cal__h { margin: 0 0 6px; display: flex; align-items: center; justify-content: space-between; }
.cal__h b { font: 700 14px var(--brand); }
.cal__h button { width: 26px; height: 26px; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.cal__h button:hover { background: rgba(26, 43, 111, 0.08); }
.cal__g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.cal__g span { height: 23px; display: grid; place-items: center; border-radius: 50%; }
.cal__g .cal__wd { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.cal__g .is-we { color: #e5397a; }
.cal__g .is-today { background: var(--blue); color: #fff; font-weight: 700; }

.wdg--show { height: 170px; overflow: hidden; padding: 0; cursor: pointer; }
.show__v, .show__v img { position: absolute; inset: 0; width: 100%; height: 100%; }
.show__v { border-radius: inherit; overflow: hidden; }
.show__v img { object-fit: cover; opacity: 0; scale: 1.08; transition: opacity 0.9s, scale 5s linear; }
.show__v img.is-on { opacity: 1; scale: 1; }
.show__v::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(8, 12, 24, 0.72)); }
.show__c { position: absolute; left: 14px; right: 14px; bottom: 22px; margin: 0; color: #fff; display: grid; }
.show__c b { font: 800 17px/1.1 var(--brand); }
.show__c small { font-size: var(--fs-s); opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show__dots { position: absolute; left: 14px; bottom: 10px; display: flex; gap: 4px; }
.show__dots i { width: 5px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.5); transition: width 0.3s; }
.show__dots i.is-on { width: 14px; background: #fff; }

.wdg--radio { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.rw__b { width: 42px; height: 42px; flex: none; border-radius: 50%; background: linear-gradient(140deg, #ff7ac3, #6d3bff 60%, #0066ff); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 18px -8px rgba(109, 59, 255, 0.7); }
.rw__b .rw__s, .wdg--radio.is-on .rw__p { display: none; }
.wdg--radio.is-on .rw__s { display: inline; }
.rw__t { display: grid; min-width: 0; flex: 1; }
.rw__t b { font: 700 13px var(--brand); }
.rw__t small { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wdg--radio canvas { position: absolute; right: 12px; bottom: 8px; width: 80px; height: 30px; opacity: 0.8; pointer-events: none; }
.wdg--radio:not(.is-on) canvas { display: none; }

/* телефон: погода и курс на домашнем экране */
.home-wdg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.home-wdg > div { padding: 14px; border-radius: 22px; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8); border: 1px solid rgba(255, 255, 255, 0.7); min-width: 0; }
.wx--c .wx__t { font-size: 36px; }
.wx--c .wx__ic svg { width: 34px; height: 34px; }
.wx--c .wx__days { display: none; }
.wx--c .wx__d { margin: 0; font-size: var(--fs-s); }
.fx--c .fx__more, .fx--c .fx__conv, .fx--c .fx__out { display: none; }
.fx--c .fx__rate { margin: 0; }
.fx--c .fx__rate b { font-size: 16px; }
.fx--c .fx__h { margin-bottom: 8px; }

html[data-theme='brutal'] .home-wdg > div, html[data-theme='brutal'] .fx__conv input, html[data-theme='brutal'] .fx__sw { border-radius: 0; border: 2px solid #0d1117; background: #fff; }
html[data-theme='brutal'] .cal__g span, html[data-theme='brutal'] .rw__b { border-radius: 0; }
html[data-theme='swiss'] .home-wdg > div { border-radius: 2px; border: 1px solid #0d1117; background: #fff; }
html[data-theme='clay'] .home-wdg > div { border-radius: 26px; border: 0; background: #f6f3ff; box-shadow: 8px 10px 24px rgba(108, 92, 180, 0.2), -6px -6px 16px rgba(255, 255, 255, 0.9); }

/* 9.4: калькулятор, рынок, батарея, таймер, мировое время */
.wdg--calc, .wdg--mk, .wdg--tm, .wdg--wc, .wdg--bat { width: 230px; }
.wdg--calc { padding: 12px; }
.calc__d { display: grid; justify-items: end; padding: 4px 6px 10px; min-height: 58px; }
.calc__e { font-size: var(--fs-s); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.calc__v { font: 300 32px/1.1 var(--brand); font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; }
.calc__k { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc__k button { height: 38px; border-radius: 12px; background: rgba(255, 255, 255, 0.75); font: 600 16px var(--ui); color: var(--ink); cursor: pointer; box-shadow: inset 0 -1px 0 rgba(26, 43, 111, 0.1); }
.calc__k button:hover { background: #fff; }
.calc__k .fn { background: rgba(26, 43, 111, 0.1); }
.calc__k .op, .calc__k .eq { background: var(--blue); color: #fff; }
.calc__k .zero { grid-column: span 2; }

.wdg--mk { padding: 12px 14px; }
.mk__h { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: baseline; }
.mk__h b { font: 700 13px var(--brand); }
.mk__h small { font-size: var(--fs-xs); color: var(--ink-3); }
.mk__l { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mk__l li { display: grid; grid-template-columns: 1fr 56px auto; align-items: center; gap: 8px; padding: 4px 0; }
.mk__l li + li { border-top: 1px solid var(--line); }
.mk__l span { display: grid; line-height: 1.15; }
.mk__l b { font-size: 13px; }
.mk__l small { font-size: var(--fs-xs); color: var(--ink-3); }
.mk__l svg { width: 56px; height: 22px; }
.mk__l path { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mk__p { text-align: right; justify-items: end; font-variant-numeric: tabular-nums; }
.mk__l .is-up path { stroke: #0aa86a; } .mk__l .is-up .mk__p small { color: #0aa86a; font-weight: 700; }
.mk__l .is-dn path { stroke: #e5397a; } .mk__l .is-dn .mk__p small { color: #e5397a; font-weight: 700; }

.wdg--wc { padding: 12px 14px; }
.wc__h { margin: 0 0 6px; }
.wc__h b { font: 700 13px var(--brand); }
.wc__l { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wc__l li { display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.wc__l small { color: var(--ink-3); font-size: var(--fs-xs); }
.wc__l em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.wc__d { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(#ffd25e 50%, #2b3f8f 50%); position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(26, 43, 111, 0.15); }
.wc__d i { position: absolute; inset: 0; background: conic-gradient(from 180deg, #1a2b6f 0 50%, #ffcf4d 50% 100%); border-radius: 50%; }
.wc__l .is-night b { color: var(--ink-2); }
html[data-theme='brutal'] :is(.calc__k button, .tm__m, .tm__m button, .bat__i) { border-radius: 0; }

/* Телефон: размытие стекла поверх живых обоев пересчитывается каждый кадр и сильнее всего грузит слабые GPU.
   Обои и так мягкие, поэтому заменяем размытие плотной полупрозрачной заливкой: выглядит почти так же, а работает плавно. */
@media (max-width: 760px) {
  .home-wdg > div, .widget, .dock, .cc, .nc, .spot, .alba, .dropdown, .ctx, .toast, .menubar, .switch, .ql, .lp input { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  html[data-theme='glass'] .home-wdg > div, html[data-theme='glass'] .widget { background: rgba(255, 255, 255, 0.8); }
  html[data-theme='glass'] .dock { background: rgba(250, 252, 255, 0.86); }
  html[data-theme='glass'] :is(.cc, .nc, .spot, .alba, .dropdown, .ctx, .toast) { background: rgba(252, 253, 255, 0.95); }
  .ql { background: rgba(233, 241, 255, 0.85); }
}
