/* Word template customizer (/customize-word-template).
   Layout: the shared header bar (customize-template.css), then a top bar and
   a two-pane workspace - the page on a grey canvas (left, scrolls on its own)
   and the settings panel (right, resizable, scrolls on its own). Visual
   reference: Documentation/word_customizer/mockup.html. Every class here is
   wc- prefixed so nothing collides with the site or PDF-customizer sheets. */

.wc-app {
    --wc-bg: #e7e9ed;
    --wc-panel: #f7f8fa;
    --wc-raise: #ffffff;
    --wc-ink: #1c2028;
    --wc-muted: #5d6472;
    --wc-line: #d2d6de;
    --wc-accent: #2d55c8;
    --wc-accent-soft: #e6ecfb;
    --wc-accent-ink: #ffffff;
    --wc-warn: #a4400f;
    --wc-warn-bg: #fbe9df;
    --wc-ok: #276a3f;
    --wc-ok-bg: #e2f1e7;
    --wc-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--wc-bg);
    color: var(--wc-ink);
    font-size: 13px;
    line-height: 1.45;
}

.wc-app *,
.wc-app *::before,
.wc-app *::after {
    box-sizing: border-box;
}

/* ---------- shared controls (scoped so site rules never leak in) ---------- */
.wc-app select,
.wc-app input[type="text"],
.wc-app input[type="number"],
.wc-app textarea {
    font: inherit;
    color: var(--wc-ink);
    background: var(--wc-raise);
    border: 1px solid var(--wc-line);
    border-radius: 4px;
    padding: 3px 6px;
    min-width: 0;
    margin: 0;
}

.wc-app input[type="number"] {
    width: 66px;
    font-family: var(--wc-mono);
    font-size: 12px;
}

.wc-app button {
    font: inherit;
    color: var(--wc-ink);
    background: var(--wc-raise);
    border: 1px solid var(--wc-line);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    line-height: 1.3;
}

.wc-app button:hover:not(:disabled) {
    border-color: var(--wc-muted);
}

.wc-app button[aria-pressed="true"] {
    background: var(--wc-ink);
    color: var(--wc-panel);
    border-color: var(--wc-ink);
}

.wc-app button:disabled {
    opacity: 0.5;
    cursor: default;
}

.wc-app :focus-visible {
    outline: 2px solid var(--wc-accent);
    outline-offset: 1px;
}

.wc-app .wc-btn.is-primary {
    background: var(--wc-accent);
    color: var(--wc-accent-ink);
    border-color: var(--wc-accent);
    font-weight: 600;
}

.wc-app .wc-btn-quiet {
    align-self: flex-start;
    font-size: 12px;
    color: var(--wc-muted);
}

.wc-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    margin-right: 5px;
    vertical-align: -2px;
}

.wc-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- top bar ---------- */
.wc-bar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 9px 16px;
    background: var(--wc-panel);
    border-bottom: 1px solid var(--wc-line);
}

.wc-bar-name {
    font-weight: 600;
}

.wc-bar-field {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--wc-muted);
}

.wc-bar-field select {
    max-width: 240px;
}

/* Template picker: a button naming the template, opening a panel of the
   output editor's template cards (modules/word-template-card.js). */
.wc-tpl {
    position: relative;
}

.wc-tpl-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 280px;
    padding: 3px 8px 3px 4px;
    font: inherit;
    font-size: 13px;
    color: var(--wc-ink);
    background: var(--wc-raise);
    border: 1px solid var(--wc-line);
    border-radius: 6px;
    cursor: pointer;
}

.wc-tpl-btn:hover,
.wc-tpl-btn[aria-expanded="true"] {
    border-color: var(--wc-accent);
}

.wc-tpl-btn-thumb {
    width: 20px;
    aspect-ratio: 17 / 22;
    object-fit: cover;
    object-position: top;
    border-radius: 2px;
    background: #eef1f5;
}

.wc-tpl-btn-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wc-tpl-caret {
    margin-right: 0;
    color: var(--wc-muted);
}

.wc-tpl-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(760px, calc(100vw - 32px));
    max-height: min(70vh, 640px);
    padding: 12px;
    color: var(--wc-ink);
    background: var(--wc-raise);
    border: 1px solid var(--wc-line);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.wc-tpl-panel[hidden] {
    display: none;
}

.wc-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 12px;
    /* Room for the hover lift and the selected card's check badge. */
    padding: 8px 8px 4px;
    overflow-y: auto;
}

.wc-tpl-grid .word-strip-card {
    width: auto;
}

.wc-editing {
    font-size: 12px;
    color: var(--wc-muted);
}

.wc-status {
    font-size: 12px;
    color: var(--wc-muted);
}

.wc-status[data-state="dirty"] {
    color: var(--wc-warn);
}

.wc-spacer {
    flex: 1;
}

/* ---------- workspace ---------- */
.wc-work {
    --wc-panel-default: clamp(440px, 30vw, 520px);
    position: relative;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--wc-panel-w, var(--wc-panel-default));
}

.wc-stage {
    min-width: 0;
    overflow: auto;
    padding: 14px 16px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.wc-stage-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
    justify-content: center;
    color: var(--wc-muted);
    font-size: 12px;
}

.wc-stage-tools label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.wc-stage-note {
    margin: 0;
    max-width: 60ch;
    text-align: center;
    color: var(--wc-muted);
    font-size: 12px;
}

/* The sheet: the iframe is page-width and as tall as its content; it is
   scaled to fit (fitSheet), with the wrapper sized to the scaled box. */
.wc-sheet-wrap {
    flex: none;
}

.wc-sheet {
    transform-origin: top left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 8px 28px rgba(0, 0, 0, 0.10);
    background: #ffffff;
}

.wc-sheet iframe {
    display: block;
    border: 0;
    background: #ffffff;
}

/* ---------- panel ---------- */
.wc-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: var(--wc-panel);
    border-left: 1px solid var(--wc-line);
}

.wc-panel-scroll {
    position: absolute;
    inset: 0;
    overflow: auto;
}

.wc-grip {
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    z-index: 5;
}

.wc-grip::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 50%;
    width: 2px;
    height: 36px;
    margin-top: -18px;
    border-radius: 1px;
    background: var(--wc-line);
}

.wc-grip:hover::after,
.wc-grip.is-dragging::after,
.wc-grip:focus-visible::after {
    background: var(--wc-accent);
    height: 56px;
    margin-top: -28px;
}

body.wc-resizing {
    cursor: col-resize;
    user-select: none;
}

/* The page iframe would swallow pointer events mid-drag. */
body.wc-resizing .wc-sheet iframe {
    pointer-events: none;
}

.wc-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 12px;
    background: var(--wc-panel);
    border-bottom: 1px solid var(--wc-line);
}

.wc-app .wc-tabs button {
    padding: 3px 6px;
    font-size: 12px;
    white-space: nowrap;
}

/* Preview mode (no Premium): the strip above the tabs. */
.wc-preview-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--wc-accent-soft);
    border-bottom: 1px solid var(--wc-line);
    font-size: 12.5px;
    line-height: 1.35;
}

.wc-preview-mode-icon {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--wc-accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wc-preview-mode-btn {
    flex: none;
    margin-left: auto;
    padding: 3px 10px;
    border: 0;
    border-radius: 4px;
    background: var(--wc-accent);
    color: var(--wc-accent-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.wc-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--wc-line);
}

.wc-app .wc-chip {
    font-size: 11.5px;
    padding: 1px 8px;
    border: 0;
    border-radius: 10px;
    background: var(--wc-ok-bg);
    color: var(--wc-ok);
}

.wc-app .wc-chip.is-bad {
    background: var(--wc-warn-bg);
    color: var(--wc-warn);
}

.wc-panel-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 40px;
}

/* ---------- cards and fields ---------- */
.wc-card {
    border: 1px solid var(--wc-line);
    border-radius: 5px;
    background: var(--wc-raise);
    scroll-margin-top: 90px;
    transition: box-shadow 0.3s;
}

.wc-card.is-flash {
    box-shadow: 0 0 0 2px var(--wc-accent);
}

.wc-card > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.wc-card > summary::-webkit-details-marker {
    display: none;
}

.wc-card > summary::before {
    content: "\25B8";
    color: var(--wc-muted);
    font-size: 10px;
}

.wc-card[open] > summary::before {
    content: "\25BE";
}

.wc-card-on {
    margin: 0 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    font-size: 12px;
    color: var(--wc-muted);
}

.wc-card.is-off > summary {
    color: var(--wc-muted);
    font-weight: 400;
}

.wc-card.is-off .wc-fields {
    opacity: 0.45;
    pointer-events: none;
}

/* Preview mode (no Premium): an off card's fields can be explored; any
   change still opens the upsell, like everywhere else. */
.wc-app[data-locked="1"] .wc-card.is-off .wc-fields {
    opacity: 0.7;
    pointer-events: auto;
}

.wc-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 10px 10px;
}

.wc-f {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.wc-lab {
    color: var(--wc-muted);
    font-size: 12px;
}

.wc-ctl {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 360px;
}

.wc-ctl select {
    max-width: 230px;
}

.wc-range {
    flex: 1;
    min-width: 80px;
    accent-color: var(--wc-accent);
}

.wc-unit {
    color: var(--wc-muted);
    font-family: var(--wc-mono);
    font-size: 11px;
}

.wc-dflt {
    color: var(--wc-muted);
    font-size: 11px;
    font-style: italic;
}

.wc-note {
    margin: 0;
    color: var(--wc-muted);
    font-size: 12px;
}

.wc-hint {
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--wc-accent-soft);
    color: var(--wc-muted);
    font-size: 12px;
}

.wc-hint-warn {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 3px solid var(--wc-warn);
    background: var(--wc-warn-bg);
    color: inherit;
}

.wc-hint-text {
    margin: 0;
}

.wc-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Paired short fields share a row when the panel is wide enough. */
.wc-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 14px;
}

.wc-pair .wc-f {
    grid-template-columns: 78px minmax(0, 1fr);
}

.wc-levels {
    padding: 2px 0 2px;
}

/* Each button carries its own border, overlapped by 1px, so a group that
   wraps in a narrow panel still reads as a grid of cells. */
.wc-seg {
    display: inline-flex;
    flex-wrap: wrap;
    padding: 0 1px 1px 0;
}

.wc-app .wc-seg button {
    margin: 0 -1px -1px 0;
    border: 1px solid var(--wc-line);
    border-radius: 0;
    padding: 2px 7px;
    font-size: 12px;
    white-space: nowrap;
}

.wc-app .wc-seg button:first-child {
    border-radius: 4px 0 0 4px;
}

.wc-app .wc-seg button:last-child {
    border-radius: 0 4px 4px 0;
}

.wc-app .wc-seg button[aria-pressed="true"] {
    position: relative;
    z-index: 1;
}

.wc-toggles {
    display: inline-flex;
    gap: 4px;
}

/* Bullet shapes: a grid of glyph cells. */
.wc-app .wc-bullet-chars button {
    min-width: 28px;
    font-family: Arial, 'Segoe UI', sans-serif;
    font-size: 13px;
}

.wc-app .wc-bullet-chars button:first-child {
    font-family: inherit;
    font-size: 12px;
}

.wc-app .wc-marker-text {
    width: 72px;
}

.wc-app .wc-toggle {
    min-width: 32px;
    padding: 2px 8px;
}

/* Colour override control */
.wc-app .wc-colour-pick {
    width: 34px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--wc-line);
    border-radius: 4px;
    background: none;
    cursor: pointer;
}

.wc-app .wc-hex {
    width: 84px;
    font-family: var(--wc-mono);
    font-size: 12px;
}

.wc-warn {
    display: inline-flex;
    color: var(--wc-warn);
    cursor: help;
}

.wc-warn .wc-icon {
    margin: 0;
}

.wc-app .wc-clear {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-color: transparent;
    background: transparent;
    color: var(--wc-muted);
}

.wc-clear .wc-icon {
    margin: 0;
}

/* Palette swatches */
.wc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wc-app .wc-swatch {
    width: 44px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
}

.wc-app .wc-swatch[aria-pressed="true"] {
    outline: 2px solid var(--wc-ink);
    outline-offset: 1px;
    border-color: var(--wc-ink);
}

/* ---------- header & footer builder ---------- */
.wc-hf-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: var(--wc-panel);
    border: 1px solid var(--wc-line);
    border-radius: 4px;
}

.wc-app .wc-hf-toolbar button {
    padding: 2px 7px;
    font-size: 12px;
}

.wc-app .wc-hf-toolbar select {
    font-size: 12px;
    padding: 2px 4px;
}

.wc-hf-bold {
    font-weight: 700;
}

.wc-hf-italic {
    font-style: italic;
}

.wc-hf-div {
    width: 1px;
    height: 18px;
    margin: 0 2px;
    background: var(--wc-line);
}

.wc-hf-imgh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--wc-muted);
    white-space: nowrap;
}

.wc-hf-tokens {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
}

.wc-hf-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.wc-hf-zones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.wc-hf-zones.is-full {
    grid-template-columns: 1fr;
}

.wc-hf-zone {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.wc-hf-zone-label {
    font-size: 11px;
    color: var(--wc-muted);
}

.wc-app .wc-hf-input {
    width: 100%;
    min-height: 44px;
    resize: vertical;
    font-size: 12px;
    overflow: hidden;
}

.wc-hf-zone[data-zone="center"] .wc-hf-input {
    text-align: center;
}

.wc-hf-zone[data-zone="right"] .wc-hf-input {
    text-align: right;
}

.wc-app .wc-hf-zone.is-active .wc-hf-input {
    border-color: var(--wc-accent);
    box-shadow: 0 0 0 2px var(--wc-accent-soft);
}

/* Zone image chip above the textarea: aligns to the zone position; click to
   select, x or Delete removes. */
.word-hf-thumb-wrap {
    padding: 2px 0;
}

.wc-hf-zone[data-zone="center"] .word-hf-thumb-wrap {
    text-align: center;
}

.wc-hf-zone[data-zone="right"] .word-hf-thumb-wrap {
    text-align: right;
}

.word-hf-thumb {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

.word-hf-thumb.is-selected {
    border-color: var(--wc-accent);
    box-shadow: 0 0 0 3px var(--wc-accent-soft);
}

.word-hf-thumb-img {
    display: block;
    max-height: 40px;
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 3px;
}

/* Wide banner: the thumbnail spans the zone like the banner spans the page. */
.word-hf-thumb-wrap[data-banner] .word-hf-thumb {
    display: block;
}

.word-hf-thumb-wrap[data-banner] .word-hf-thumb-img {
    width: 100%;
    max-height: none;
}

.wc-app .word-hf-thumb-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 13px;
    line-height: 16px;
    text-align: center;
    display: none;
}

.word-hf-thumb:hover .word-hf-thumb-remove,
.word-hf-thumb.is-selected .word-hf-thumb-remove {
    display: block;
}

/* ---------- image picker (a light modal over the page) ---------- */
.word-hf-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    padding: 20px;
}

.word-hf-picker {
    width: min(680px, 100%);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.word-hf-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eeeeee;
    font-weight: 600;
    color: #333333;
}

.word-hf-picker-close {
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #888888;
}

.word-hf-picker-close:hover {
    color: #333333;
}

.word-hf-picker-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-hf-picker-upload {
    border: none;
    border-radius: 6px;
    background: #2d55c8;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
}

.word-hf-picker-upload:hover {
    background: #2447aa;
}

.word-hf-picker-upload:disabled {
    opacity: 0.6;
    cursor: default;
}

.word-hf-picker-status {
    padding: 8px 16px;
    font-size: 13px;
    color: #555555;
    background: #f7f7f9;
    border-bottom: 1px solid #eeeeee;
}

.word-hf-picker-status.is-error {
    color: #b42318;
    background: #fef3f2;
}

.word-hf-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: min-content;
    align-content: start;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}

/* Square tiles from percentage bottom padding, NOT aspect-ratio: when the
   grid flex-shrinks (large library), Chrome sizes the auto rows without the
   transferred height and the cells collapse to slivers. */
.word-hf-picker-cell {
    padding: 0 0 100% 0;
    border: 1px solid #dddddd;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.word-hf-picker-cell:hover {
    border-color: #2d55c8;
    box-shadow: 0 0 0 2px rgba(45, 85, 200, 0.25);
}

/* Absolutely positioned so the image never drives the cell's size. */
.word-hf-picker-cell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.word-hf-picker-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 24px 8px;
    text-align: center;
    color: #777777;
    font-size: 14px;
}

/* ---------- narrow screens (tablet portrait): the page stacks above the
   panel and the column is the ONE scroll area - a scroll box nested inside
   it left touch scrolling stuck on tablets. ---------- */
@media (max-width: 860px) {
    .wc-work {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .wc-stage {
        flex: none;
        overflow: visible;
    }

    .wc-panel {
        flex: none;
        border-left: 0;
        border-top: 1px solid var(--wc-line);
    }

    .wc-panel-scroll {
        position: static;
        overflow: visible;
    }

    .wc-grip {
        display: none;
    }

    .wc-f {
        grid-template-columns: 90px minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wc-card {
        transition: none;
    }
}

/* Colour reference control (ref-colour.js) and the symbol picker
   (Headings > Decoration). */
.wc-ref {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* The slider gives way first, so the tone label stays on its line. */
.wc-ref .wc-ref-tone {
    flex: 1 1 50px;
    min-width: 50px;
    max-width: 130px;
}

.wc-ref-tone-label {
    min-width: 58px;
    white-space: nowrap;
    color: var(--wc-muted);
    font-family: var(--wc-mono);
    font-size: 11px;
}

.wc-app .wc-symbols button {
    min-width: 28px;
    padding: 2px 0;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Pool font picker and embedded-font budget (static/js/word-customizer/fonts.js). */
.wc-fontpick {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 260px;
}

.wc-app .wc-fontpick-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 3px 8px;
    text-align: left;
}

.wc-fontpick-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wc-fontpick-caret::before {
    content: "\25BE";
    color: var(--wc-muted);
    font-size: 10px;
}

.wc-fontpick-pop {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    width: max(100%, 280px);
    max-width: calc(100vw - 32px);
    padding: 6px;
    border: 1px solid var(--wc-line);
    border-radius: 5px;
    background: var(--wc-raise);
    box-shadow: 0 6px 20px rgba(28, 32, 40, 0.16);
}

.wc-app .wc-fontpick-search {
    width: 100%;
    margin-bottom: 6px;
}

.wc-fontpick-list {
    max-height: 320px;
    overflow-y: auto;
}

.wc-fontpick-group {
    padding: 6px 6px 2px;
    color: var(--wc-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wc-fontpick-opt {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
}

.wc-fontpick-opt:hover,
.wc-fontpick-opt:focus {
    background: var(--wc-accent-soft);
    outline: none;
}

.wc-fontpick-opt[aria-selected="true"] {
    box-shadow: inset 2px 0 0 var(--wc-accent);
}

.wc-fontpick-opt[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}

.wc-fontpick-opt[aria-disabled="true"]:hover {
    background: none;
}

.wc-fontpick-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wc-fontpick-meta {
    flex: none;
    color: var(--wc-muted);
    font-family: var(--wc-mono);
    font-size: 11px;
}

.wc-fontbudget {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.wc-fontbudget-text {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--wc-muted);
}

.wc-fontbudget-kb {
    font-family: var(--wc-mono);
    font-size: 11px;
}

.wc-fontbudget-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--wc-line);
    overflow: hidden;
}

.wc-fontbudget-bar > span {
    display: block;
    height: 100%;
    background: var(--wc-ok);
}

.wc-fontbudget[data-state="high"] .wc-fontbudget-bar > span {
    background: var(--wc-warn);
}

.wc-fontbudget[data-state="over"] .wc-fontbudget-kb {
    color: var(--wc-warn);
}

.wc-fontbudget-names {
    color: var(--wc-muted);
    font-size: 11px;
}
