/* ===========================
   Studio BoenkOp - Lichtplan tool
   Loaded only on /lichtplan. All classes are prefixed lp- so they never
   collide with style.css. The board itself stays light ("paper") because
   the export is meant to be printed; the chrome follows the site's dark look.
   =========================== */

.lp-app,
.lp-overlay {
    --lp-paper: #ECEDE9;
    --lp-paper-2: #E2E4DF;
    --lp-panel: #141414;
    --lp-panel-2: #1a1a1a;
    --lp-line: rgba(255, 255, 255, 0.1);
    --lp-line-strong: rgba(255, 255, 255, 0.25);
    --lp-text: #ffffff;
    --lp-text-2: #cccccc;
    --lp-text-3: #888888;
    --lp-accent: #ffd000;
    --lp-select: #2B6BE6;
}

.lp-app {
    display: grid;
    grid-template-rows: auto 1fr;
    height: min(88vh, 960px);
    min-height: 620px;
    background: var(--lp-panel);
    border: 1px solid var(--lp-line);
    color: var(--lp-text);
    font-size: 14px;
    overflow: hidden;
}
.lp-app button,
.lp-app input,
.lp-app select,
.lp-app textarea {
    font: inherit;
    color: inherit;
}
.lp-app button { cursor: pointer; }

/* --- Toolbar --- */
.lp-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--lp-line);
    background: var(--lp-panel-2);
    flex-wrap: wrap;
}
.lp-title-input {
    border: none;
    border-bottom: 1px dashed var(--lp-line-strong);
    background: transparent;
    padding: 4px 2px;
    min-width: 200px;
    flex: 1 1 200px;
    font-size: 15px;
}
.lp-title-input::placeholder { color: var(--lp-text-3); }
.lp-title-input:focus { outline: none; border-bottom-color: var(--lp-accent); }
.lp-room {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--lp-text-2);
    font-family: 'Space Mono', monospace;
    font-size: 12px;
}
.lp-room input {
    width: 56px;
    padding: 4px 6px;
    border: 1px solid var(--lp-line-strong);
    background: var(--lp-panel);
    text-align: center;
    font-family: 'Space Mono', monospace;
}
.lp-spacer { flex: 1; }

.lp-btn {
    border: 1px solid var(--lp-line-strong);
    background: transparent;
    color: var(--lp-text);
    padding: 7px 12px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lp-btn:hover { border-color: var(--lp-accent); color: var(--lp-accent); }
.lp-btn.lp-primary { background: var(--lp-accent); color: #0a0a0a; border-color: var(--lp-accent); }
.lp-btn.lp-primary:hover { background: #ffffff; border-color: #ffffff; color: #0a0a0a; }
.lp-btn.lp-toggle[aria-pressed="true"] { background: var(--lp-text); color: #0a0a0a; border-color: var(--lp-text); }
.lp-app .lp-btn:focus-visible,
.lp-app input:focus-visible,
.lp-app select:focus-visible,
.lp-app textarea:focus-visible {
    outline: 2px solid var(--lp-accent);
    outline-offset: 2px;
}

/* --- Layout --- */
.lp-main {
    display: grid;
    grid-template-columns: 230px 1fr 280px;
    min-height: 0;
}
.lp-palette,
.lp-inspector {
    background: var(--lp-panel-2);
    overflow: auto;
    min-height: 0;
}
.lp-palette { border-right: 1px solid var(--lp-line); padding: 14px 12px; }
.lp-inspector { border-left: 1px solid var(--lp-line); padding: 14px 16px; }

.lp-group { margin-bottom: 16px; }
.lp-group h3 {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--lp-accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 8px 4px;
}
.lp-pal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.lp-pal button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 6px;
    border: 1px solid var(--lp-line);
    background: var(--lp-paper);
    color: #22262B;
    font-size: 11.5px;
    line-height: 1.1;
    text-align: center;
    transition: border-color 0.15s, transform 0.1s;
}
.lp-pal button:hover { border-color: var(--lp-accent); }
.lp-pal button:active { transform: translateY(1px); }
.lp-pal svg { width: 44px; height: 34px; display: block; }

/* --- Stage --- */
.lp-stage {
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 18px 48px;
    min-height: 0;
}
svg#lp-board {
    max-width: 100%;
    max-height: 100%;
    background: var(--lp-paper);
    box-shadow: 0 12px 40px -20px rgba(0, 0, 0, 0.9);
    touch-action: none;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}
svg#lp-board .lp-item { cursor: grab; }
svg#lp-board .lp-item:active { cursor: grabbing; }
svg#lp-board .lp-handle { cursor: crosshair; }
.lp-hint {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 12px;
    line-height: 1.5;
    font-size: 12px;
    color: var(--lp-text-3);
    pointer-events: none;
}
.lp-hint kbd {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    border: 1px solid var(--lp-line-strong);
    border-bottom-width: 2px;
    padding: 0 5px;
    color: var(--lp-text-2);
}
.lp-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: var(--lp-text-3);
    font-size: 15px;
    text-align: center;
    padding: 20px;
}

/* --- Inspector --- */
.lp-inspector h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 12px;
}
.lp-inspector h2.lp-h-small {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--lp-accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 8px;
}
.lp-muted { color: var(--lp-text-3); font-size: 13px; }
.lp-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.lp-field label { font-size: 12px; color: var(--lp-text-2); }
.lp-field input[type=text],
.lp-field select,
.lp-field textarea {
    padding: 7px 9px;
    border: 1px solid var(--lp-line-strong);
    background: var(--lp-panel);
    width: 100%;
}
.lp-field select option { background: var(--lp-panel); }
.lp-field textarea { resize: vertical; min-height: 56px; }
.lp-row { display: flex; gap: 8px; align-items: center; }
.lp-row input[type=range] { flex: 1; accent-color: var(--lp-accent); }
.lp-row .lp-val {
    width: 48px;
    text-align: right;
    font-family: 'Space Mono', monospace;
    color: var(--lp-text-2);
    font-size: 11px;
}
.lp-gel { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lp-gel button {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0;
}
.lp-gel button[aria-pressed="true"] { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.lp-gel input[type=color] {
    width: 26px;
    height: 26px;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
}
.lp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lp-inspector hr { border: none; border-top: 1px solid var(--lp-line); margin: 14px 0; }
.lp-list { list-style: none; padding: 0; margin: 0; }
.lp-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    cursor: pointer;
}
.lp-list li:hover { background: rgba(255, 255, 255, 0.05); }
.lp-list li[aria-selected="true"] { background: var(--lp-accent); color: #0a0a0a; }
.lp-list .lp-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.lp-list li[aria-selected="true"] .lp-num { background: #0a0a0a; color: var(--lp-accent); }
.lp-list .lp-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-list .lp-sub { font-size: 11px; opacity: 0.7; }

/* --- PNG preview overlay --- */
.lp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.96);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
}
.lp-overlay img {
    max-width: 100%;
    max-height: 75vh;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lp-overlay-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lp-overlay-hint { color: #888; font-size: 12px; text-align: center; }

/* --- Page sections around the tool --- */
.lp-section { padding: 3rem 2rem 4rem; }
.lp-section-inner { max-width: 1400px; margin: 0 auto; }
.lp-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.lp-step {
    background: var(--darker, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.75rem;
}
.lp-step-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    color: var(--yellow, #ffd000);
    line-height: 1;
    margin-bottom: 0.75rem;
}
.lp-step h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.lp-step p { color: var(--light-gray, #ccc); font-size: 0.95rem; }
.lp-inventory {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.lp-inventory p { color: var(--light-gray, #ccc); margin-bottom: 1.5rem; }
.lp-inventory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}
.lp-inventory-tags span {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--light-gray, #ccc);
}
.lp-privacy {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--gray, #888);
    text-align: center;
    margin-top: 1rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .lp-app { height: auto; min-height: 0; }
    .lp-main { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
    .lp-palette {
        border-right: none;
        border-bottom: 1px solid var(--lp-line);
        padding: 8px 10px;
        overflow-x: auto;
        white-space: nowrap;
    }
    .lp-palette .lp-group { display: inline-block; vertical-align: top; margin: 0 10px 0 0; }
    .lp-pal { display: flex; }
    .lp-pal button { min-width: 64px; }
    .lp-stage { height: 62vh; min-height: 320px; padding: 12px; }
    .lp-inspector { border-left: none; border-top: 1px solid var(--lp-line); max-height: 48vh; }
    .lp-hint { display: none; }
    .lp-section { padding: 2rem 1rem 3rem; }
}
@media (prefers-reduced-motion: reduce) {
    .lp-btn, .lp-pal button { transition: none; }
}
