@import url('designer-base.css');
/* Themeship tool chrome. Everything chrome-related is scoped under .ts so it never mixes with MudBlazor styles. */
html, body { margin: 0; padding: 0; }
.ts *, .ts *::before, .ts *::after { box-sizing: border-box; }
.ts button { font: inherit; color: inherit; cursor: pointer; }
.ts input, .ts select { font: inherit; color: var(--t-text); }
.ts .main { min-height: 0; }
.ts .left, .ts .right .rbody { overflow-y: auto; }
.ts .left { overflow-y: auto; }
.ts button.pill, .ts button.btn-s, .ts .seg button, .ts button.tab { border-style: solid; }
.ts .seg button { display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:6px;color:var(--t-muted);font-weight:500;white-space:nowrap;border:0;background:transparent }
.ts .seg button.on { background:var(--t-panel);color:var(--t-text);box-shadow:0 1px 2px rgba(0,0,0,.08),0 0 0 1px var(--t-border) }
.ts button.tab { background: transparent; border-width: 0 0 2px 0; border-color: transparent; }
.ts button.tab.on { border-color: var(--t-ink); }
.ts .pill:hover, .ts .btn-s:hover { filter: brightness(.97); }
.ts.t-dark .pill:hover, .ts.t-dark .btn-s:hover { filter: brightness(1.15); }
.ts .field input.hex { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; }
.ts .field:focus-within { border-color: var(--t-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-focus) 18%, transparent); }
.ts input[type=color].sw { padding: 0; border: 0; cursor: pointer; background: none; -webkit-appearance: none; appearance: none; overflow: hidden; }
.ts input[type=color].sw::-webkit-color-swatch-wrapper { padding: 0; }
.ts input[type=color].sw::-webkit-color-swatch { border: 0; border-radius: 5px; }
.ts input[type=color].sw::-moz-color-swatch { border: 0; border-radius: 5px; }
.ts .iconbtn { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 6px; color: var(--t-faint); padding: 0; }
.ts .iconbtn:hover { background: var(--t-hover); color: var(--t-text); }
.ts .iconbtn.on { color: var(--t-text); }
.ts .iconbtn svg { width: 15px; height: 15px; fill: currentColor; }
.ts .chip-btn { display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 9px;border:1px solid var(--t-border);border-radius:8px;background:var(--t-panel);font-size:12px;color:var(--t-muted) }
.ts .note { font-size: 11.5px; color: var(--t-faint); line-height: 1.4; }
.ts .srow { display:flex;align-items:center;gap:8px;font-size:12px;padding:2px 0 }
.ts .srow .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts .srow input.hex { width: 74px; border: 1px solid transparent; border-radius: 5px; background: transparent; padding: 1px 4px; color: var(--t-muted); }
.ts .srow input.hex:hover, .ts .srow input.hex:focus { border-color: var(--t-border); outline: 0; color: var(--t-text); }
.ts .srow input[type=color].sw { width: 16px; height: 16px; border-radius: 4px; }
.ts .semc input[type=color].sw { width: 22px; height: 22px; }
.ts .semc input.hex { width: 64px; border: 0; background: transparent; padding: 0; font-size: 11px; color: var(--t-muted); outline: 0; }
.ts .semc .iconbtn { position: absolute; right: 0; bottom: 0; width: 24px; height: 24px; }
.ts .semc .dot { right: 8px; top: 8px; }
.ts .ctl { display: grid; grid-template-columns: 92px 1fr; gap: 8px 10px; align-items: center; font-size: 12px; }
.ts .ctl label, .ts .ctl .lbl2 { color: var(--t-muted); }
.ts .ctl select, .ts .ctl input[type=text] { height: 30px; border: 1px solid var(--t-border); border-radius: 7px; background: var(--t-panel); padding: 0 8px; min-width: 0; width: 100%; }
.ts .ctl input[type=range] { width: 100%; accent-color: var(--t-ink); }
.ts .linkbtn { border: 0; background: none; color: var(--t-muted); font-size: 12px; padding: 0; }
.ts .linkbtn:hover { color: var(--t-text); text-decoration: underline; }
.ts .stage { overflow: auto; }
.ts .frame { min-height: 100%; height: auto; }
.ts .toast { position: fixed; }
/* Footer: one small line, its own grid row (designer-base sets rows 52px 1fr). Text is --t-faint on --t-panel:
   5.9:1 light, 6.0:1 dark (AA). */
.ts { grid-template-rows: 52px 1fr auto; }
.ts .ts-foot { padding: 4px 14px; font-size: 11px; line-height: 16px; color: var(--t-faint); background: var(--t-panel); border-top: 1px solid var(--t-border); text-align: center; }
/* Narrow screens: the editor grid is wider than the viewport, so keep the line inside the viewport (wraps to 2 lines). */
@media (max-width: 768px) { .ts .ts-foot { justify-self: start; width: 100vw; max-width: 100vw; text-align: left; } }
.ts .toast button { background: none; border: 0; }
.ts .scale .strip i { cursor: default; }
.ts .fixall { width:100%;height:34px;border-radius:8px;border:1px solid var(--t-ink);background:var(--t-ink);color:var(--t-ink-text);font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px }
.ts .fixall:disabled { opacity: .5; cursor: default; }
.ts .fixall svg { width: 16px; height: 16px; fill: currentColor; }
.ts .pair .fix .sw { width: 14px; height: 14px; }
.ts .pair.warn { border-color: color-mix(in srgb, var(--t-amber) 40%, var(--t-border)); }
.ts .modetag { font-size: 10px; font-weight: 600; color: var(--t-muted); border: 1px solid var(--t-border); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.ts .code { overflow: auto; }
.ts .codebox { min-height: 0; }
.ts .code .ln { white-space: pre; }
.ts .empty-ok { display:flex;align-items:center;gap:8px;padding:10px;border-radius:8px;background:var(--t-green-bg);color:var(--t-green);font-weight:500;font-size:12.5px }
.ts .version { font-size: 12px; color: var(--t-muted); }

/* ---------- Preview (MudBlazor, scoped palette vars) ---------- */
.pv-root { background: var(--mud-palette-background); color: var(--mud-palette-text-primary); font-family: var(--mud-typography-default-family); font-size: var(--mud-typography-default-size); line-height: 1.5; min-height: 100%; display: flex; flex-direction: column; }
.pv-root .pv-body { display: flex; flex: 1; min-height: 0; }
.pv-root .pv-drawer { width: 200px; flex: none; background: var(--mud-palette-drawer-background); color: var(--mud-palette-drawer-text); border-right: 1px solid var(--mud-palette-lines-default); padding: 8px 0; }
.pv-root .pv-drawer .mud-nav-link { color: var(--mud-palette-drawer-text); }
.pv-root .pv-drawer .mud-nav-link .mud-nav-link-icon { color: var(--mud-palette-drawer-icon); }
.pv-root .pv-drawer .pv-sub { padding: 14px 16px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mud-palette-text-secondary); }
.pv-root .pv-main { flex: 1; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.pv-root .pv-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pv-root .pv-grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.pv-root .pv-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.pv-root .pv-bars .g { flex: 1; display: flex; gap: 2px; align-items: flex-end; height: 100%; }
.pv-root .pv-bars .g i { flex: 1; display: block; border-radius: 3px 3px 0 0; }
.pv-root .pv-legend { display: flex; gap: 12px; font-size: 12px; color: var(--mud-palette-text-secondary); }
.pv-root .pv-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.pv-root .pv-matrix { display: grid; grid-template-columns: 72px repeat(8, 1fr); gap: 8px; align-items: center; }
.pv-root .pv-matrix .h { font-size: 11px; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.pv-root .pv-matrix .mud-button-root { min-width: 0; width: 100%; padding-left: 4px; padding-right: 4px; }
.pv-root .pv-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pv-root a.pv-link { color: var(--mud-palette-primary); text-decoration: none; font-weight: 600; }
.pv-root .mud-table-head th { color: var(--mud-palette-text-secondary); font-weight: 600; }
/* Zoom-to-fit: the preview renders at real MudBlazor sizes, scaled to fit the center column. */
.ts .frame > .pv-root { zoom: var(--pv-zoom, .8); }

/* a11y helpers (launch fixes) */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ---------- Keyboard focus (pre-launch fixes) ----------
   One visible ring for all tool-chrome controls. --t-focus is #2563EB (light) / #60A5FA (dark): at least 4.5:1
   against every chrome surface (--t-panel, --t-bg, --t-sunk). The live preview (.pv-scope) keeps MudBlazor's own focus styles. */
.ts :is(button, a, select, summary, input[type=color], input[type=range]):not(.pv-scope *):focus-visible,
.ts .srow input.hex:focus-visible, .ts .semc input.hex:focus-visible, .ts .crumb input:focus-visible {
  outline: 2px solid var(--t-focus); outline-offset: 2px;
}
.ts .srow input.hex:focus-visible, .ts .semc input.hex:focus-visible, .ts .crumb input:focus-visible { outline-offset: 1px; }
.ts .field:focus-within { box-shadow: 0 0 0 1px var(--t-focus), 0 0 0 4px color-mix(in srgb, var(--t-focus) 18%, transparent); }
.ts .center:focus-visible { outline: 2px solid var(--t-focus); outline-offset: -2px; }
.ts .center:focus:not(:focus-visible) { outline: 0; }

/* Skip links: hidden until focused; out of the grid flow. */
.ts .skip-links { position: absolute; top: 0; left: 0; z-index: 60; }
.ts .skip-links a { position: absolute; left: 12px; top: -100px; white-space: nowrap; padding: 8px 12px; border-radius: 8px;
  background: var(--t-ink); color: var(--t-ink-text); font-weight: 600; text-decoration: none; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }
.ts .skip-links a:focus { top: 10px; }

/* "Best on desktop" note: only at 768px and below; fixed, so it never shifts layout. Not modal. */
.ts .narrow-note { display: none; }
@media (max-width: 768px) {
  .ts .narrow-note { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
    padding: 14px; border: 1px solid var(--t-border); border-radius: 12px; background: var(--t-panel); color: var(--t-text);
    box-shadow: 0 16px 40px -12px rgba(15,23,42,.45); }
  .ts .narrow-note .logo-mark { flex: none; margin-top: 2px; }
  .ts .narrow-note .nn-body { flex: 1; min-width: 0; }
  .ts .narrow-note h2 { margin: 0 0 4px; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
  .ts .narrow-note p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--t-muted); }
  .ts .narrow-note .pill { width: 100%; justify-content: center; height: 36px; }
}

/* Blazor's error bar: hidden until the framework shows it. */
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 10px 16px; background: #FEF2F2; color: #7F1D1D; font: 13px system-ui, sans-serif; box-shadow: 0 -1px 4px rgba(0,0,0,.15); }
#blazor-error-ui .reload { color: #7F1D1D; font-weight: 600; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }

/* The skip-link list receives programmatic focus on load (FocusOnNavigate); it is not a control, so no ring. */
.ts .skip-links:focus { outline: none; }

/* "Aa" swatches are decorative samples of the pair (the row text states the ratio). Drawn as generated content so
   failing samples are not reported as page text by axe/Lighthouse colour-contrast checks. */
.ts .aa::before, .ts .plist .mini::before { content: "Aa"; }

/* Fix-all states without a fix to apply: clear "all pass" (green) or "nothing auto-fixable" (neutral). */
.ts .fixall.fixall-ok { background: var(--t-green-bg); border-color: var(--t-green); color: var(--t-green); }
.ts .fixall.fixall-none { background: var(--t-sunk); border-color: var(--t-border); color: var(--t-muted); font-weight: 500; }

/* C# code: the right column keeps its width on the code tab; long lines wrap inside the panel with a hanging
   indent under the line-number gutter (22px number + 10px gap). Copy/Download use the source text, not the DOM. */
.ts .code .ln { white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 32px; text-indent: -32px; }
.ts .code { overflow-x: hidden; }
/* The code view scrolls, so it is a focusable region (keyboard scrolling); ring drawn inside the dark box. */
.ts .code:focus-visible { outline: 2px solid var(--t-focus); outline-offset: -2px; }

/* Kit "Get Themeship updates" signup (Components/KitSignup.razor), last block of the left panel. */
.ts .kit .kit-sub { margin: -2px 0 8px; }
.ts .kit-row { display: flex; gap: 6px; }
.ts .kit-row input { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--t-border); border-radius: 7px; background: var(--t-panel); padding: 0 8px; font-size: 12.5px; }
.ts .kit-row input::placeholder { color: var(--t-faint); opacity: 1; }
.ts .kit-row input[aria-invalid="true"] { border-color: var(--t-red); }
.ts .kit-btn { height: 32px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ts .kit-btn[aria-disabled="true"] { opacity: .65; cursor: progress; }
.ts .kit-err { margin: 6px 0 0; font-size: 12px; font-weight: 500; color: var(--t-red); }
.ts .kit-form .note { margin: 6px 0 0; }
.ts .kit-tbd { display: inline-block; margin-top: 6px; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--t-amber); background: var(--t-amber-bg); border: 1px dashed var(--t-amber); border-radius: 5px; padding: 1px 6px; }
.ts .kit-ok, .ts .kit-fb { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; }
.ts .kit-ok { background: var(--t-green-bg); color: var(--t-text); }
.ts .kit-ok .kit-ok-h { font-weight: 600; color: var(--t-green); }
.ts .kit-fb { background: var(--t-sunk); border: 1px solid var(--t-border); color: var(--t-text); }
.ts .kit-fb form { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.ts .kit-ok p, .ts .kit-fb p { margin: 0; }
.ts .kit-ok .linkbtn { align-self: flex-start; margin-top: 2px; text-decoration: underline; }
.ts .kit-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ts .ts-foot a { color: inherit; text-decoration: underline; }
.ts .ts-foot-sep { margin: 0 4px; }

/* Not-found view (App.razor) for unknown paths. */
.ts-404 { max-width: 32rem; margin: 15vh auto; padding: 0 24px; font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: #111827; }
.ts-404 h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
.ts-404 p { margin: 0 0 1rem; color: #374151; }
.ts-404 a { color: #4338CA; font-weight: 600; }
.ts-404 a:focus-visible { outline: 2px solid #4338CA; outline-offset: 2px; border-radius: 2px; }

/* AA badge next to Export (Components/AaBadge.razor): live WCAG AA result for light + dark, opens the failing pairs. */
.ts .aa-wrap { position: relative; display: inline-flex; }
.ts .aa-badge { position: relative; z-index: 46; gap: 7px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ts .aa-badge .aa-mark { display: inline-flex; align-items: center; gap: 4px; letter-spacing: .02em; }
.ts .aa-badge .aa-mark svg.i { width: 15px; height: 15px; }
.ts .aa-badge .aa-count { font-weight: 500; opacity: .9; }
.ts .aa-badge.ok { color: var(--t-green); background: var(--t-green-bg); border-color: color-mix(in srgb, var(--t-green) 35%, var(--t-border)); }
.ts .aa-badge.warn { color: var(--t-amber); background: var(--t-amber-bg); border-color: color-mix(in srgb, var(--t-amber) 45%, var(--t-border)); }
.ts .aa-scrim { position: fixed; inset: 0; z-index: 45; }
.ts .aa-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: 340px; padding: 14px; border: 1px solid var(--t-border);
  border-radius: 12px; background: var(--t-panel); color: var(--t-text); box-shadow: 0 16px 40px -12px rgba(15,23,42,.35), 0 2px 6px rgba(15,23,42,.08); }
.ts.t-dark .aa-pop { box-shadow: 0 16px 40px -12px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.02); }
.ts .aa-pop h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.ts .aa-pop .aa-sub { margin: 3px 0 10px; font-size: 12px; color: var(--t-muted); font-variant-numeric: tabular-nums; }
.ts .aa-pop .aa-ok { margin: 0 0 12px; padding: 9px 10px; border-radius: 8px; background: var(--t-green-bg); color: var(--t-green); font-size: 12.5px; font-weight: 550; }
.ts .aa-list { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--t-border); border-radius: 10px; overflow: hidden; }
.ts .aa-list li { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-bottom: 1px solid var(--t-border2); font-size: 12px; }
.ts .aa-list li:last-child { border-bottom: 0; }
.ts .aa-list .mini { flex: none; width: 26px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 650; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ts .aa-list .mini::before { content: "Aa"; }
.ts .aa-list .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts .aa-list .modetag { margin-left: 0; flex: none; }
.ts .aa-list .m { color: var(--t-red); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ts .aa-pop .aa-more { margin: 0 0 10px; font-size: 12px; color: var(--t-muted); }
.ts .aa-actions { display: flex; gap: 8px; justify-content: flex-end; }
/* Narrow screens: the top bar is wider than the viewport, so the badge moves next to the logo where it stays visible. */
@media (max-width: 768px) {
  .ts .top > .logo { order: -2; }
  .ts .top > .aa-wrap { order: -1; }
  .ts .aa-pop { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
}
.ts .chip-btn { white-space: nowrap; }
/* Top bar above the panels, so the AA popover and its scrim sit over the live preview (MudBlazor's app bar uses z-index 1300). */
.ts .top { position: relative; z-index: 1400; }
