/* The theme menu (theme.js). Shared by 1stroyalmarines.com, the wiki and the dashboard:
   each site sets the --tm-* colours to its own. */
.theme-menu { position: relative; display: inline-block; }
.theme-menu > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    min-height: 36px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--tm-line, rgba(201, 168, 76, 0.4)); color: var(--tm-muted, #c9c2b3);
    font: 500 13px/1 var(--tm-font, Inter, system-ui, sans-serif); letter-spacing: 0.02em;
    background: transparent; user-select: none;
}
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu > summary:hover, .theme-menu[open] > summary {
    color: var(--tm-ink, #f5f2ed); border-color: var(--tm-accent, #c9a84c); background: var(--tm-hover, rgba(201, 168, 76, 0.1));
}
.theme-menu > summary:focus-visible { outline: 2px solid var(--tm-accent, #c9a84c); outline-offset: 2px; }
.tm-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tm-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 268px; max-width: calc(100vw - 24px);
    padding: 14px; border-radius: 12px; text-align: left;
    background: var(--tm-bg, #162744); color: var(--tm-ink, #f5f2ed);
    border: 1px solid var(--tm-line, rgba(201, 168, 76, 0.4)); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
    font: 400 14px/1.4 var(--tm-font, Inter, system-ui, sans-serif);
}
.tm-panel fieldset { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.tm-panel legend {
    padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--tm-muted, #c9c2b3);
}
.tm-segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tm-seg, .tm-swatch { position: relative; cursor: pointer; }
.tm-seg input, .tm-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tm-seg span {
    display: flex; align-items: center; justify-content: center; text-align: center; min-height: 34px; padding: 4px;
    border-radius: 8px; border: 1px solid var(--tm-line, rgba(201, 168, 76, 0.4)); font-size: 12.5px; line-height: 1.15;
}
.tm-seg input:checked + span { background: var(--tm-accent, #c9a84c); border-color: var(--tm-accent, #c9a84c); color: var(--tm-on-accent, #0b1629); font-weight: 600; }
.tm-seg input:focus-visible + span, .tm-swatch input:focus-visible ~ span:last-child { outline: 2px solid var(--tm-accent, #c9a84c); outline-offset: 2px; }
.tm-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.tm-swatch { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 3px 6px; border-radius: 8px; font-size: 13px; }
.tm-swatch:hover { background: var(--tm-hover, rgba(201, 168, 76, 0.1)); }
.tm-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.tm-swatch input:checked + .tm-dot { box-shadow: 0 0 0 2px var(--tm-bg, #162744), 0 0 0 4px var(--tm-ink, #f5f2ed); }
.tm-note { margin: 0; font-size: 12px; color: var(--tm-muted, #c9c2b3); }
@media (max-width: 600px) {
    .theme-menu > summary { padding: 6px 8px; }
    .theme-menu .tm-label { display: none; }
    .tm-panel { position: fixed; left: 12px; right: 12px; top: auto; width: auto; max-width: none; margin-top: 8px; }
}
