/* Réglages > Widgets (applications.md, rules 19 to 22; maquettes/widgets-par-ecran.html). */
.widget-rows .app-row.is-soon .app-dot { filter: grayscale(1); opacity: 0.5; }
.widget-rows .app-row.is-soon .app-row-text b { color: var(--text-2); }
.widget-rows + .app-group-title, form + .app-group-title { margin-top: 24px; }

/* The window of a screen: two tabs on the left (ecrans.md, rule 49). */
.screen-tabs { flex: none; gap: 20px; margin-top: -8px; }
.screen-tabs label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; color: var(--text-2); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.screen-tabs label:hover { color: var(--text); }
.screen-tabs input:checked + label { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.screen-tabs input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.screen-tabs .count { font-weight: 400; }
.tab-settings { display: contents; }
.tab-widgets { display: flex; flex-direction: column; gap: 12px; }
.screen-modal:has(#screen-tab-widgets:checked) .tab-settings, .screen-modal:not(:has(#screen-tab-widgets:checked)) .tab-widgets { display: none; }
.screen-widgets-empty { padding: 32px 20px; }

/* The widgets of the screen, one picked at a time. */
.wg-list { display: flex; flex-direction: column; gap: 10px; }
.wg-item { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.wg-item:has(> .wg-pick:checked) { border-color: #f2a81d; box-shadow: 0 0 0 1px #f2a81d; }
.wg-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.wg-name { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.wg-item:has(> .wg-pick:focus-visible) .wg-name { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.wg-item:has(.wg-head [role="switch"]:not(:checked)) .app-dot { filter: grayscale(1); opacity: 0.55; }
.wg-item:has(.wg-head [role="switch"]:not(:checked)) .wg-name b { color: var(--text-2); }
.wg-inline { display: none; flex-direction: column; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.wg-item:has(> .wg-pick:checked):has(.wg-head [role="switch"]:checked) .wg-inline { display: flex; }
.wg-inline textarea { height: auto; min-height: 84px; resize: vertical; }
.wg-inline .meta { display: flex; justify-content: space-between; gap: 8px; }
.wg-inline .counter { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.two-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.wg-copy { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; cursor: pointer; }
.wg-manage { align-self: flex-end; }
.copy-widget .modal-body { gap: 14px; }
.copy-list { display: flex; flex-direction: column; gap: 8px; }
.copy-list .check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.copy-list small { margin-left: auto; color: var(--text-3); font-size: 12px; }

/* On the preview: the picked widget outlined, its places dotted, the taken ones red with « no ». */
.screen-modal:has(#screen-tab-widgets:checked) .wd-layer > * { pointer-events: auto; cursor: grab; }
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Clock:checked) .wd-layer > [data-wd="clock"],
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Ticker:checked) .wd-layer > [data-wd="ticker"],
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Message:checked) .wd-layer > [data-wd="message"] { outline: calc(0.6 * var(--u)) solid #f2a81d; outline-offset: calc(0.5 * var(--u)); }
.wd-layer > .wd-band { outline-offset: calc(-0.6 * var(--u)) !important; }
.wd-slots-layer { position: absolute; inset: 0; pointer-events: none; }
.wd-slots, .wd-bar { display: none; }
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Clock:checked):has(#won-Clock:checked) [data-slots="Clock"],
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Ticker:checked):has(#won-Ticker:checked) [data-slots="Ticker"],
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Message:checked):has(#won-Message:checked) [data-slots="Message"] { display: block; }
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Clock:checked):has(#won-Clock:checked) [data-bar="Clock"],
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Ticker:checked):has(#won-Ticker:checked) [data-bar="Ticker"],
.screen-modal:has(#screen-tab-widgets:checked):has(#wsel-Message:checked):has(#won-Message:checked) [data-bar="Message"] { display: flex; }
.screen-modal:has([name="Input.W.Clock.Place"][value^="Band"]:checked) [data-bar="Clock"] .wd-bar-size,
.screen-modal:has([name="Input.W.Ticker.Place"][value^="Band"]:checked) [data-bar="Ticker"] .wd-bar-size,
.screen-modal:has([name="Input.W.Message.Place"][value^="Band"]:checked) [data-bar="Message"] .wd-bar-size { display: none; }
.wd-bar .wd-bar-align { display: none; }
.screen-modal:has([name="Input.W.Clock.Place"][value^="Band"]:checked) [data-bar="Clock"] .wd-bar-align,
.screen-modal:has([name="Input.W.Message.Place"][value^="Band"]:checked) [data-bar="Message"] .wd-bar-align { display: inline-flex; }
.wd-slots { position: absolute; inset: 0; }
.wd-slot { position: absolute; pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: calc(1.2 * var(--u)); border: 2px dashed rgba(255, 255, 255, 0.6); border-radius: calc(1.8 * var(--u)); background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.92); font-size: calc(2.6 * var(--u)); text-align: center; line-height: 1.1; cursor: pointer; }
.wd-slot:hover, .wd-slot.is-over { border-style: solid; border-color: #f2a81d; background: rgba(242, 168, 29, 0.22); }
.wd-slot:has(input:checked) { visibility: hidden; }
.wd-slot:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.wd-slot.is-taken { pointer-events: none; border: 2px solid #e5484d; background: rgba(150, 28, 34, 0.78); color: #fff; font-weight: 500; }
.wd-slots.is-dragging .wd-slot.is-taken { pointer-events: auto; cursor: not-allowed; }
.wd-slot-ban { display: none; }
.wd-slot.is-taken .wd-slot-ban { display: block; flex: none; width: calc(4 * var(--u)); height: calc(4 * var(--u)); padding: calc(0.5 * var(--u)); border-radius: 50%; background: #e5484d; color: #fff; stroke-width: 2.6; }
.wd-slot-top-left, .wd-slot-top-right, .wd-slot-bottom-left, .wd-slot-bottom-right { width: 26%; height: 20%; }
.wd-slot-top-left { left: calc(3 * var(--u)); top: calc(3 * var(--u)); }
.wd-slot-top-right { right: calc(3 * var(--u)); top: calc(3 * var(--u)); }
.wd-slot-bottom-left { left: calc(3 * var(--u)); bottom: calc(3 * var(--u)); }
.wd-slot-bottom-right { right: calc(3 * var(--u)); bottom: calc(3 * var(--u)); }
.wd-stage:has(.wd-layer > .wd-band-top:not([hidden])) :is(.wd-slot-top-left, .wd-slot-top-right) { top: calc(12 * var(--u)); }
.wd-stage:has(.wd-layer > .wd-band-bottom:not([hidden])) :is(.wd-slot-bottom-left, .wd-slot-bottom-right) { bottom: calc(12 * var(--u)); }
.wd-slot-band-top, .wd-slot-band-bottom { left: 32%; right: 32%; height: calc(9 * var(--u)); }
.wd-slot-band-top { top: 0; }
.wd-slot-band-bottom { bottom: 0; }

/* Under the preview: the settings of the picked widget that are seen rather than written. */
.wd-bar { flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
.wd-bar-who { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 14px; font-weight: 500; }
.wd-bar-group { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; font-size: 12px; color: var(--text-2); }
.wd-bar .seg-field { margin: 0; padding: 0; border: 0; }
.wd-swatch { display: block; width: 26px; height: 26px; border: 1px solid var(--border-strong); border-radius: 6px; cursor: pointer; }
.wd-swatch-dark { background: #1b2430; }
.wd-swatch-light { background: #fff; }
.wd-swatch-color { background: #0b1f3a; }
.wd-swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus); }
.wd-swatch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 4px; }

/* The screen of the preview: what it shows, and the widgets laid on it. 1u is 1 % of the smaller side, as on the player (vmin). */
.wd-stage { container-type: size; --u: 1cqmin; background: #111821; }
.wd-stage[hidden] { display: none; }
.wd-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: inset 0.2s; }
.wd-stage:has(.wd-layer > .wd-band-top:not([hidden])) .wd-content { top: calc(9 * var(--u)); }
.wd-stage:has(.wd-layer > .wd-band-bottom:not([hidden])) .wd-content { bottom: calc(9 * var(--u)); }
.wd-layer { position: absolute; inset: 0; pointer-events: none; }

.wd-corner[hidden], .wd-band[hidden] { display: none; }
.wd-corner, .wd-band { position: absolute; display: flex; align-items: center; overflow: hidden; color: #fff; background: rgba(10, 16, 24, 0.72); line-height: 1.1; }
.wd-light { background: rgba(255, 255, 255, 0.92); color: #0b1f3a; }
.wd-color { background: #0b1f3a; color: #fff; }
.wd-dark { background: rgba(10, 16, 24, 0.72); color: #fff; }
.is-faint { opacity: 0.4; }

.wd-corner { --s: 8; max-width: 44%; gap: calc(1.6 * var(--u)); padding: calc(1.4 * var(--u)) calc(2.2 * var(--u)); border-radius: calc(1.8 * var(--u)); font-size: calc(var(--s) * var(--u)); }
.wd-corner.wd-small { --s: 6; }
.wd-corner.wd-large { --s: 11; }
.wd-top-left { left: calc(3 * var(--u)); top: calc(3 * var(--u)); }
.wd-top-right { right: calc(3 * var(--u)); top: calc(3 * var(--u)); }
.wd-bottom-left { left: calc(3 * var(--u)); bottom: calc(3 * var(--u)); }
.wd-bottom-right { right: calc(3 * var(--u)); bottom: calc(3 * var(--u)); }
.wd-layer:has(> .wd-band-top:not([hidden])) > .wd-top-left, .wd-layer:has(> .wd-band-top:not([hidden])) > .wd-top-right { top: calc(12 * var(--u)); }
.wd-layer:has(> .wd-band-bottom:not([hidden])) > .wd-bottom-left, .wd-layer:has(> .wd-band-bottom:not([hidden])) > .wd-bottom-right { bottom: calc(12 * var(--u)); }

.wd-band { left: 0; right: 0; height: calc(9 * var(--u)); font-size: calc(4.4 * var(--u)); white-space: nowrap; }
.wd-band-top { top: 0; }
.wd-band-bottom { bottom: 0; }
.wd-band.wd-align-center { justify-content: center; }
.wd-band.wd-align-right { justify-content: flex-end; }
.wd-band > .wd-clock, .wd-band > .wd-text { padding: 0 calc(3 * var(--u)); }
.wd-band .wd-dial { display: none; }
.wd-band .wd-col { flex-direction: row; align-items: baseline; gap: calc(2 * var(--u)); }
.wd-band .wd-date { font-size: 1em; }
.wd-label { flex: none; align-self: stretch; display: flex; align-items: center; padding: 0 calc(2.4 * var(--u)); background: #f2a81d; color: #0b1f3a; font-weight: 500; }
.wd-label[hidden] { display: none; }
.wd-run { flex: 1; min-width: 0; overflow: hidden; }
.wd-run > span { display: inline-block; padding-left: 100%; white-space: pre; animation: wd-scroll var(--wd-time, 30s) linear infinite; }
@keyframes wd-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .wd-run > span { animation: none; padding-left: calc(3 * var(--u)); } }

.wd-clock { display: flex; align-items: center; gap: calc(1.6 * var(--u)); }
.wd-col { display: flex; flex-direction: column; gap: 0.1em; min-width: 0; }
.wd-time { font-size: 1em; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wd-date { font-size: 0.36em; opacity: 0.8; white-space: nowrap; }
.wd-date:empty { display: none; }
.wd-dial { width: 1.9em; height: 1.9em; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; }
.wd-dial circle { stroke-width: 4; opacity: 0.5; }
.wd-dial .h { stroke-width: 7; }
.wd-dial .m { stroke-width: 4.5; }
.wd-clock[data-face="digital"] .wd-dial { display: none; }
.wd-clock[data-face="analog"] .wd-time { display: none; }
.wd-clock[data-face="analog"] .wd-date { font-size: 0.42em; }
.wd-corner > .wd-text { font-size: 0.6em; font-weight: 500; overflow-wrap: anywhere; white-space: normal; }

.wd-qr { display: block; width: 1.8em; height: 1.8em; background-color: #0b1f3a;
  -webkit-mask: conic-gradient(#000 25%, transparent 0 50%, #000 0 75%, transparent 0) 0 0 / 25% 25%;
  mask: conic-gradient(#000 25%, transparent 0 50%, #000 0 75%, transparent 0) 0 0 / 25% 25%; }
