/* Theme Manager (FW-UI-104; FW-UI-179 the Apple design, ThemeWindow P101 and
   HomeBanner P89): colour rows, the preview inspector, the tone scale, the
   preview's sample page, the standard mark and the Home banner.
   Loaded after org-chart.css (the order is in base.css). */
/* ---------- Theme Manager: colour rows ---------- */
/* A colour row: its light value and contrast, then its dark value and
   contrast; each value is the system's picker drawn as a swatch and its
   code (ThemeWindow) */
.theme-colours{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px 14px}
.theme-mode{display:inline-flex;align-items:center;gap:6px}
.theme-colour{display:inline-flex;align-items:center;gap:6px}
.value-cells .settings-card>.settings-row>div:not([popover]) .theme-colour>input.color-pick[type=color],.theme-colour>input.color-pick[type=color]{flex:none;width:18px;min-width:18px;height:18px;min-height:18px;margin:0;padding:0;border:0;border-radius:5px;background:none;box-shadow:inset 0 0 0 1px var(--separator);cursor:pointer}
.theme-colour>input.color-pick::-webkit-color-swatch-wrapper{padding:0}
.theme-colour>input.color-pick::-webkit-color-swatch{border:0;border-radius:5px}
.theme-colour>input.color-pick::-moz-color-swatch{border:0;border-radius:5px}
.value-cells .settings-card>.settings-row>div:not([popover]) .theme-colour>input[type=text],.theme-colour>input[type=text]{flex:none;width:76px;min-width:0;margin:0;padding:2px 7px;font:var(--type-mac-callout);font-family:var(--font-mono)}
.theme-colour>input[type=text]::placeholder{color:var(--label-3)}
.theme-mode>.badge{min-width:52px;justify-content:center;font-variant-numeric:tabular-nums}
/* The logo chosen or kept, small beside its file field (ThemeWindow) */
.theme-logo-prev{display:inline-block;width:auto;height:22px;max-width:120px;margin-right:8px;border-radius:5px;object-fit:contain;vertical-align:middle}
.theme-logo-prev[hidden]{display:none}
/* ---------- Theme Manager: the preview inspector ---------- */
/* The window's aside is the mockup's glass inspector beside the sections,
   one width (inspector); below them at phone width */
.settings-body.has-aside{grid-template-columns:var(--sidebar) minmax(0,1fr) 300px}
.window-aside{min-width:0;min-height:0;display:flex;flex-direction:column;margin:var(--gap-window);overflow-y:auto;border-radius:var(--r-sidebar);background:var(--glass);box-shadow:inset 0 0 0 .5px var(--glass-edge),var(--glass-shadow);-webkit-backdrop-filter:blur(24px) saturate(1.6);backdrop-filter:blur(24px) saturate(1.6)}
.theme-preview{flex:none;display:flex;flex-direction:column;gap:10px;padding:12px}
.theme-preview-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
.theme-preview-as{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font:var(--type-mac-callout);color:var(--label-2)}
.theme-preview-as select,.theme-preview-as input{flex:1 1 140px;width:auto;min-width:0;margin:0}
/* The sample is the inspector's width, no scaling, and tall enough for
   the whole sample in either language; the inspector scrolls */
.theme-preview-view{position:relative;flex:none;height:620px;border-radius:var(--r-group);background:var(--window);box-shadow:0 0 0 .5px var(--group-line);overflow:hidden}
.theme-preview-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:var(--window)}
@media(min-width:701px) and (max-width:1180px){
 .settings-body.has-aside{grid-template-columns:var(--sidebar) minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(320px,52%)}
 .settings-body.has-aside>.settings-side{grid-row:1 / span 2}
 .settings-body.has-aside>.window-aside{grid-column:2;grid-row:2}
}
.theme-preview-contrast,.theme-preview-status{margin:0;font:var(--type-mac-caption);color:var(--label-2)}
.theme-preview-contrast:empty{display:none}
.theme-preview-contrast.is-refused,.theme-preview-status.is-refused{color:var(--red-text)}
/* The tone scale (Generate): the tones the theme uses and 50-900, light and dark */
.theme-scale{display:grid;gap:14px;padding:12px 14px;border-radius:var(--r-group);background:var(--group);box-shadow:0 0 0 .5px var(--group-line)}
.theme-scale-mode{min-width:0}
.theme-scale-title{margin:0 0 6px;font:var(--type-mac-caption);color:var(--label-2)}
.theme-tones{display:flex;flex-wrap:wrap;gap:8px 14px;margin:0 0 8px;padding:0;list-style:none}
.theme-tones li{display:flex;align-items:center;gap:6px;font:var(--type-mac-caption)}
.theme-tones svg{flex:none;width:22px;height:22px;border-radius:5px;box-shadow:inset 0 0 0 .5px var(--separator)}
.theme-tones span{display:flex;flex-direction:column}
.theme-tones code{font-family:var(--font-mono);color:var(--label-2)}
.theme-steps{display:block;width:100%;max-width:400px;height:22px;border-radius:5px}
/* ---------- Theme Manager: the preview's sample page ---------- */
/* In the iframe: the browser tab's favicon and name, then the mockup's
   sample - the Home banner, buttons and a link, a table, Home cards, the
   chart palette - or the sign-in card */
body.theme-sample-page{min-height:100vh;margin:0;background:var(--window);color:var(--label);font:var(--type-mac-body)}
.theme-tab{display:flex;align-items:center;gap:6px;margin:10px 12px 0;padding:4px 10px;border-radius:var(--r-capsule);background:var(--fill);font:var(--type-mac-caption);color:var(--label-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme-tab img{flex:none;width:14px;height:14px}
.theme-sample{display:flex;flex-direction:column;gap:10px;padding:2px 12px 14px}
.theme-sample .home-banner{margin:8px 0 2px}
.theme-sample-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.theme-sample-buttons .primary-button,.theme-sample-buttons .quiet-button{border-radius:var(--r-capsule)}
.theme-sample-table{border-radius:var(--r-group);box-shadow:0 0 0 .5px var(--group-line);overflow:hidden}
.theme-sample-table table.grid{width:100%;table-layout:fixed}
.theme-sample-table table.grid :is(th,td){overflow-wrap:anywhere;white-space:normal}
.theme-sample-table table.grid .cell-check{width:34px}
.theme-sample-cards{display:flex;gap:8px}
.theme-sample-card{flex:1;min-width:0;padding:8px 10px;border-radius:10px;background:var(--home-card);color:var(--on-home-card);box-shadow:0 0 0 .5px var(--group-line)}
.theme-sample-card b{display:block;font:var(--type-display-numeral);font-size:18px}
.theme-sample-card span{font:var(--type-mac-caption);opacity:.86}
.theme-chart svg{display:block;width:100%;height:auto}
.chart-1{fill:var(--chart-1)}.chart-2{fill:var(--chart-2)}.chart-3{fill:var(--chart-3)}.chart-4{fill:var(--chart-4)}.chart-5{fill:var(--chart-5)}.chart-6{fill:var(--chart-6)}
/* The sign-in card on the sign-in ground (its image under its scrim) */
.theme-sample-page.is-login{display:flex;flex-direction:column;background:linear-gradient(var(--login-scrim),var(--login-scrim)),var(--login-image) center/cover no-repeat,var(--login-desk)}
.theme-login{flex:1;display:grid;place-items:center;padding:20px 14px}
.theme-login-card{display:grid;justify-items:center;gap:10px;width:100%;max-width:260px;padding:20px 16px;border-radius:var(--r-window);background:var(--sheet);box-shadow:var(--sheet-shadow)}
.theme-login-card h1{margin:0;font:var(--type-mac-title)}
.theme-login-card .brand-standard{flex-direction:column;gap:6px;font:var(--type-mac-emphasis)}
.theme-login-card .brand-mark{width:40px;height:40px;margin:0;border-radius:9px}
.theme-login-card .brand-logo{height:40px;max-width:180px;object-fit:contain}
.theme-login-fields{display:grid;gap:4px;width:100%}
.theme-login-fields label{font:var(--type-mac-caption);color:var(--label-2)}
.theme-login-fields input{width:100%;margin:0 0 4px}
.theme-login-button{width:100%;justify-content:center;border:0;border-radius:var(--r-capsule);background:var(--login-button);color:var(--on-login-button)}
.theme-login-card a{font:var(--type-mac-callout);color:var(--link)}
/* The standard mark and name as one piece, where a theme's logo may stand */
.brand-standard{display:inline-flex;align-items:center;gap:.28em}
/* ---------- Home banner (HomeBanner, P89) ---------- */
/* A card as wide as the page. Without a theme image: a quiet card on the
   banner's ground (the window's, a theme's brand or its own), the greeting
   as the large title. With one (has-image): the image covers the card, the
   scrim darkens its top a little and its foot more, the words in the
   banner's text colour (on-image white unless the theme gives its own); the
   logo at the top trailing corner */
.home-banner{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:18px;min-height:132px;margin:10px 0 18px;padding:16px 22px 18px;border-radius:var(--r-window);background:var(--banner-bg);box-shadow:0 0 0 .5px var(--group-line),0 1px 3px #0000000d;overflow:hidden;color:var(--on-banner)}
.home-banner-text{min-width:0}
.home-banner h1{margin:0;font:var(--type-mac-large-title);letter-spacing:var(--type-mac-large-title-tracking);color:var(--on-banner);overflow-wrap:anywhere}
.home-banner p{margin:4px 0 0;font:var(--type-mac-body);color:var(--on-banner);opacity:.86}
.home-banner-logo{order:-1;align-self:flex-end;display:inline-flex;align-items:center;gap:7px;color:var(--on-banner);font:var(--type-mac-emphasis)}
.home-banner-logo .brand-mark{width:22px;height:22px;margin:0;border-radius:5px}
.home-banner-logo .brand-logo{height:22px;max-width:160px;object-fit:contain}
.home-banner-logo .brand-light{font-weight:400;color:inherit}
.home-banner-logo[hidden]{display:none}
.home-banner.has-image{min-height:188px;background:linear-gradient(180deg,var(--banner-scrim) -45%,transparent 32%,transparent 38%,var(--banner-scrim) 100%),var(--banner-image) center/cover no-repeat,var(--banner-bg);box-shadow:none}
.home-banner:not(:has(.home-banner-logo:not([hidden]))){justify-content:flex-end}
/* The banner's Auto-delegation toggle (FW-WORKFLOW-033; PO 2026-11-23: «давай на баннере сделаем только иконку … в правый нижний угол»): Apple's toggle on imagery - off raised glass, on a pressed opaque capsule (glass-raised, glass-pressed, glass-lift, on-glass-pressed); the count badge when rules need attention. */
.home-banner .hb-toggle{position:absolute;right:22px;bottom:18px;display:flex;align-items:center;height:32px;padding:0 2px;border-radius:var(--r-capsule);background:var(--glass);-webkit-backdrop-filter:blur(20px) brightness(1.12) saturate(180%);backdrop-filter:blur(20px) brightness(1.12) saturate(180%);box-shadow:var(--glass-raised);transition:transform .18s ease,box-shadow .18s ease,background-color .18s ease}
.home-banner .hb-toggle .tb-btn{height:var(--tb-item);min-width:32px;font:var(--type-mac-body);color:var(--label);transition:color .18s ease}
.home-banner .hb-toggle .tb-btn svg{width:17px;height:17px}
.home-banner .hb-toggle .tb-btn:hover{background:none}
.home-banner .hb-toggle:not(.is-on):hover{transform:translateY(-1px)}
.home-banner .hb-toggle .tb-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.home-banner.has-image .hb-toggle{background:var(--glass-lift)}
.home-banner.has-image .hb-toggle .tb-btn{color:var(--on-image)}
.home-banner .hb-toggle.is-on{background:var(--label);box-shadow:var(--glass-pressed);transform:scale(.96)}
.home-banner .hb-toggle.is-on .tb-btn{color:var(--window)}
.home-banner.has-image .hb-toggle.is-on{background:var(--on-image)}
.home-banner.has-image .hb-toggle.is-on .tb-btn{color:var(--on-glass-pressed)}
.home-banner .hb-toggle .sb-badge{position:absolute;top:-6px;right:-6px}
.home-banner:has(.hb-toggle) .home-banner-text{padding-right:44px}
@media(max-width:700px){
 .settings-form[data-mobile-view=pane] .settings-body.has-aside{display:block;overflow:auto}
 .settings-form[data-mobile-view=pane] .settings-body.has-aside>.settings-panes{overflow:visible;min-height:0}
 .settings-form[data-mobile-view=list] .window-aside{display:none}
 .window-aside{margin:var(--gap-window) 12px 16px}
 .theme-colours{justify-content:flex-start}
 /* iPhone's banner; the theme preview's sample is narrow too, but it
    shows the Mac's card, as the mockup's inspector does */
 body:not(.theme-sample-page) .home-banner{min-height:118px;border-radius:22px;padding:14px 16px 16px;margin:6px 0 16px}
 body:not(.theme-sample-page) .home-banner h1{font:var(--type-ios-large-title);font-size:28px}
 body:not(.theme-sample-page) .home-banner p{font:var(--type-ios-subhead)}
 body:not(.theme-sample-page) .home-banner.has-image{min-height:168px}
}
@media(max-width:700px){.home-banner .hb-toggle{right:16px;bottom:16px}}
@media(prefers-reduced-motion:reduce){.home-banner .hb-toggle,.home-banner .hb-toggle .tb-btn{transition:none}.home-banner .hb-toggle:not(.is-on):hover,.home-banner .hb-toggle.is-on{transform:none}}
