/* Globe and lithophane makers (/gifts/globes/, /gifts/lithophanes/). Same look as
   the keychain maker: the preview on a dark tray, the settings panel beside it. */

.wm {
    --tray: #1b1d24;
    --tray-2: #262a35;
    --panel: #141716;
    --field: #1c201e;
    --ink: #eceee9;
    --muted: #9aa49e;
    --rule: rgba(236, 238, 233, 0.09);
    --accent: var(--tpa-accent, #ff8f1f);
    --gold: #d9b14a;
    font-family: 'Schibsted Grotesk', system-ui, sans-serif;
    color: var(--ink);
    max-width: 1560px;
    width: 100%;
    margin: 0 auto;
    padding: 14px 24px 56px;
    box-sizing: border-box;
}
.wm *, .wm *::before, .wm *::after { box-sizing: border-box; }
.wm h1, .wm h2, .wm h3 { font-family: inherit; color: var(--ink); }
.wm a { color: var(--gold); }
.wm-app { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }

/* ---------- the tray ---------- */
.wm-stage {
    position: sticky; top: 68px;
    display: flex; flex-direction: column;
    height: calc(100vh - 84px); min-height: 560px;
    background: #121318; border-radius: 14px; overflow: hidden;
}
.wm-stagebar { display: flex; align-items: center; gap: 14px; padding: 10px 12px; flex-wrap: wrap; }
.wm-size { color: rgba(236, 238, 233, 0.6); font-size: 0.8rem; }
.wm-view {
    position: relative; flex: 1; min-height: 0; margin: 0 10px; border-radius: 10px; overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.07), transparent 62%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px),
        linear-gradient(180deg, var(--tray-2), var(--tray));
}
.wm-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; cursor: grab; }
.wm-progress {
    position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 2;
    display: flex; align-items: center; gap: 10px;
    background: rgba(20, 23, 22, 0.9); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-size: 0.85rem;
}
.wm-progress[hidden] { display: none; }
.wm-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: var(--gold); animation: wm-spin 0.8s linear infinite; }
@keyframes wm-spin { to { transform: rotate(360deg); } }
.wm-status { margin: 0; padding: 9px 14px 11px; font-size: 0.8rem; color: rgba(236, 238, 233, 0.62); min-height: 2.4em; }

/* ---------- segmented controls ---------- */
.wm-seg { display: inline-flex; background: var(--field); border-radius: 9px; padding: 3px; gap: 2px; }
.wm-seg[hidden] { display: none !important; }
.wm-seg button {
    border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.86rem; font-weight: 500;
    padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.wm-seg button[hidden] { display: none; }
.wm-seg button:hover { color: var(--ink); }
.wm-seg button[aria-pressed="true"] { background: var(--ink); color: #141716; }
.wm-views { background: rgba(0, 0, 0, 0.3); }
.wm-sec .wm-seg { display: flex; }
.wm-sec .wm-seg button { flex: 1; }
.wm-seg-gap { margin-top: 8px; }

/* ---------- panel ---------- */
.wm-panel { background: var(--panel); border-radius: 14px; padding: 4px 18px 18px; }
.wm-intro { padding: 18px 0 16px; border-bottom: 1px solid var(--rule); }
.wm-kicker { margin: 0 0 6px; font-size: 0.82rem !important; }
.wm-search { display: flex; gap: 6px; }
.wm-search input {
    flex: 1; min-width: 0; background: var(--field); color: var(--ink); border: 1px solid transparent; border-radius: 8px;
    padding: 8px 10px; font: inherit; font-size: 0.9rem;
}
.wm-search input:focus { outline: none; border-color: var(--accent); }
.wm-results { list-style: none; margin: 6px 0 0; padding: 0; }
.wm-results button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--ink); font: inherit; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.wm-results button:hover, .wm-results button:focus-visible { background: var(--field); }
.wm-results strong { display: block; font-size: 0.9rem; font-weight: 600; }
.wm-results span { display: block; font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-res-note { font-size: 0.8rem; color: var(--muted); padding: 6px 8px; }
.wm .wm-chips a.wm-chip { text-decoration: none; }
.wm-intro h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin: 0 0 10px; }
.wm-intro p { color: var(--muted); font-size: 0.93rem; line-height: 1.5; margin: 0; }
.wm-sec { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.wm-sec:last-child { border-bottom: 0; }
.wm-sec h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }
.wm-sec h3 { font-size: 0.9rem; font-weight: 600; margin: 16px 0 8px; }
.wm-sub { margin: 14px 0 8px; font-size: 0.86rem; color: var(--muted); }
.wm-hint { font-size: 0.78rem; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.wm-hint[hidden], .wm-field[hidden], .wm-range[hidden], label[hidden] { display: none !important; }

.wm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wm .wm-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--field); color: var(--ink); font: inherit; font-size: 0.82rem;
}
.wm .wm-chip:hover { background: #262b29; }
.wm .wm-chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--ink); }
.wm-chip i {
    width: 18px; height: 18px; border-radius: 50%; flex: none; margin-left: -4px;
    background: conic-gradient(var(--a) 0 50%, var(--b) 0 80%, var(--c) 0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.wm-mapwrap { position: relative; margin: 10px auto 0; border-radius: 8px; overflow: hidden; background: var(--field); width: 100%; max-width: 320px; }
.wm-map { width: 100%; aspect-ratio: 1; }
.wm-mask { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wm-km { position: absolute; left: 8px; bottom: 8px; pointer-events: none; background: rgba(20, 23, 22, 0.82); color: var(--ink); font-size: 0.75rem; padding: 3px 8px; border-radius: 6px; }
.wm-mapwrap .maplibregl-ctrl-attrib { font-size: 10px; }


.wm-field { display: block; margin-top: 10px; }
.wm-field > span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.wm-field input, .wm-field select {
    width: 100%; min-width: 0; background: var(--field); color: var(--ink); border: 1px solid transparent; border-radius: 8px;
    padding: 8px 10px; font: inherit; font-size: 0.9rem;
}
.wm-field select { appearance: auto; }
.wm-field input:focus, .wm-field select:focus { outline: none; border-color: var(--accent); }
.wm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.wm-range { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin-top: 12px; font-size: 0.85rem; }
.wm-range output { color: var(--muted); font-size: 0.8rem; }
.wm-range input { grid-column: 1 / -1; width: 100%; accent-color: var(--gold); }

.wm-checks { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; font-size: 0.86rem; }
.wm-checks label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.35; }
.wm-checks input { accent-color: var(--gold); margin-top: 2px; }

.wm-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.wm-color { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.wm-color input { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; flex: none; }
.wm-color input::-webkit-color-swatch-wrapper { padding: 0; }
.wm-color input::-webkit-color-swatch { border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; }
.wm-color input::-moz-color-swatch { border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; }

.wm-btn {
    background: var(--field); color: var(--ink); border: 0; border-radius: 8px; padding: 9px 14px; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.wm-btn:hover:not(:disabled) { background: #2a302d; }
.wm-btn:disabled { opacity: 0.45; cursor: default; }
.wm-btn-main { background: var(--gold); color: #1d1a10; }
.wm-btn-main:hover:not(:disabled) { background: #e7c260; }
.wm-btn-sm { padding: 6px 10px; font-size: 0.8rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.wm-dl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wm-dl .wm-btn-main { flex: 1; }

.wm-info p { margin: 0 0 6px; font-size: 0.86rem; }
.wm-info[hidden] { display: none; }
.wm-check.is-ok { color: #8fd19e; }
.wm-check.is-bad { color: #ff9b8a; }
.wm-swaps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; }
.wm-swaps li { display: flex; gap: 9px; align-items: center; }
.wm-swaps i { width: 16px; height: 16px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.wm-notes { margin: 10px 0 0; padding-left: 18px; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.wm-notes li + li { margin-top: 4px; }

/* ---------- about ---------- */
.wm-about { margin-top: 36px; padding: 28px 4px 0; border-top: 1px solid var(--rule); }
.wm-about h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 18px; }
.wm-about-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.wm-about h3 { font-size: 1rem; margin: 0 0 8px; }
.wm-about p { color: var(--muted); font-size: 0.9rem; line-height: 1.55; margin: 0; }
.wm-credit { margin-top: 26px !important; font-size: 0.8rem !important; }

.wm-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; width: max-content; max-width: calc(100vw - 32px);
    background: #f2efe6; color: #17191d; padding: 10px 16px; border-radius: 10px; font-size: 0.88rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.wm-toast[hidden] { display: none; }

@media (max-width: 1100px) {
    .wm-about-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .wm { padding: 10px 16px 40px; }
    .wm-app { grid-template-columns: minmax(0, 1fr); }
    .wm-stage { position: relative; top: 0; height: 62vh; min-height: 380px; }
    .wm-intro h1 { font-size: 1.7rem; }
}
@media (max-width: 560px) {
    .wm-about-cols { grid-template-columns: minmax(0, 1fr); }
    .wm-seg button { padding: 6px 8px; font-size: 0.8rem; }
    .wm-colors { grid-template-columns: minmax(0, 1fr); }
}

/* the example links are anchors */
.wm a.wm-chip { color: var(--ink); }

/* ---------- worlds, preview switches ---------- */
.wm-worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.wm .wm-world {
    display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 9px; border: 0; cursor: pointer;
    background: var(--field); color: var(--ink); font: inherit; font-size: 0.82rem; text-align: left; min-width: 0;
}
.wm .wm-world span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm .wm-world:hover { background: #262b29; }
.wm .wm-world[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--gold); }
.wm-stagebar .wm-btn { background: rgba(0, 0, 0, 0.3); color: var(--muted); font-weight: 500; }
.wm-stagebar .wm-btn:hover { color: var(--ink); }
.wm-stagebar .wm-btn.active { background: var(--ink); color: #141716; }
.wm-stagebar .wm-btn .bx { vertical-align: -2px; margin-right: 3px; }
.wm-stagebar .wm-size { margin-left: auto; }
.wm-bands { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 0.84rem; }
.wm-bands li { display: flex; gap: 9px; align-items: center; }
.wm-bands i { width: 16px; height: 16px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.wm-tips { margin: 6px 0 0; padding-left: 18px; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.wm-tips li + li { margin-top: 4px; }
.wm-inline { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 0.85rem; }
.wm-inline .wm-color { color: var(--ink); }
.wm-linkbtn { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; font-size: 0.8rem; cursor: pointer; text-decoration: underline; }
.wm-linkbtn[hidden] { display: none; }
.wm-mapwrap.is-off { display: none; }
.wm-lampnote { font-size: 0.86rem; color: var(--muted); margin: 0; }
.wm-lampnote[hidden] { display: none; }
.wm [hidden] { display: none !important; }
.wm-world b { font-weight: 400; }
