/* ============================================
   Cena bytu Praha — Leadcore
   Sage/eucalyptus paleta, light/dark toggle, mírně oblé (4-8px)
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* === Themes === */
html[data-theme="dark"] body {
    --bg: #131715;
    --bg-2: #1b201e;
    --bg-3: #232a27;
    --panel: #1e2522;
    --border: #2d3633;
    --border-strong: #3d4845;
    --text: #e8ebe9;
    --text-dim: #a0aaa6;
    --text-mute: #6a7470;
    --accent: #d4ff3f;
    --accent-soft: #b8e636;
    --sage: #7da894;
    --sage-dim: #5a7d6c;
    --warn: #e8a93f;
}

html[data-theme="light"] body {
    --bg: #f4f3ee;
    --bg-2: #ebe9e0;
    --bg-3: #e0ddcf;
    --panel: #ffffff;
    --border: #d8d3c1;
    --border-strong: #b8b1a0;
    --text: #1a1f1c;
    --text-dim: #555c58;
    --text-mute: #8a8f8c;
    --accent: #5a8c70;
    --accent-soft: #7da894;
    --sage: #4a7560;
    --sage-dim: #3a6450;
    --warn: #c47a1a;
}

body {
    font-family: 'Geist', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.byt-app {
    padding: 24px 16px 48px;
    position: relative;
    overflow-x: hidden;
}

.byt-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* === Header === */
.byt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.byt-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.byt-brand-mark {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border-radius: 6px;
    flex-shrink: 0;
}

.byt-brand-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
}

.byt-brand-text span {
    color: var(--text-mute);
    font-weight: 400;
}

.byt-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.byt-toggle {
    display: flex;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.byt-toggle button {
    background: transparent;
    border: 0;
    color: var(--text-mute);
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 5px;
    font-family: inherit;
    transition: all 0.15s;
    font-weight: 500;
    min-height: 32px;
}

.byt-toggle button.active {
    background: var(--panel);
    color: var(--text);
}

.byt-toggle button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* === Hero === */
.byt-hero { margin-bottom: 32px; }

.byt-eyebrow {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.byt-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--text-mute);
}

.byt-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(32px, 6vw, 64px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 12px;
    color: var(--text);
}

.byt-title em {
    font-style: italic;
    color: var(--accent);
}

.byt-subtitle {
    color: var(--text-dim);
    font-size: 16px;
    max-width: 580px;
    line-height: 1.5;
}

/* === Grid === */
.byt-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 940px) {
    .byt-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .byt-app { padding: 16px 12px 32px; }
    .byt-grid { gap: 16px; }
}

/* === Panel === */
.byt-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

@media (max-width: 480px) {
    .byt-panel { padding: 18px; }
}

.byt-section-label {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* === Field === */
.byt-field { margin-bottom: 18px; }

.byt-field-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 8px;
}

/* === Select === */
.byt-select {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3e%3cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a8f8c' stroke-width='1.5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.byt-select:focus { border-color: var(--accent); }

@media (max-width: 480px) {
    .byt-select { font-size: 16px; padding: 12px; }
}

/* === Segments === */
.byt-segments {
    display: grid;
    gap: 4px;
    background: var(--bg-2);
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.byt-segments.two { grid-template-columns: repeat(2, 1fr); }
.byt-segments.four { grid-template-columns: repeat(2, 1fr); }

.byt-segment {
    background: transparent;
    border: 0;
    color: var(--text-mute);
    padding: 9px 6px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s;
    text-align: center;
    line-height: 1.2;
    min-height: 38px;
}

.byt-segment.active {
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.byt-segment:hover:not(.active) {
    color: var(--text);
}

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

/* === Slider === */
.byt-slider-wrap {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
}

.byt-slider-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 12px;
}

.byt-slider-val {
    font-family: 'Geist Mono', monospace;
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
}

.byt-slider-val .unit {
    color: var(--text-mute);
    font-weight: 400;
    font-size: 11px;
    margin-left: 3px;
}

.byt-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border);
    outline: none;
    cursor: pointer;
    border-radius: 100px;
    touch-action: pan-y;
}

.byt-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--bg);
    transition: transform 0.15s;
}

.byt-slider::-webkit-slider-thumb:hover,
.byt-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.byt-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--bg);
}

.byt-slider:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

@media (pointer: coarse) {
    .byt-slider { height: 6px; }
    .byt-slider::-webkit-slider-thumb { width: 22px; height: 22px; }
    .byt-slider::-moz-range-thumb { width: 22px; height: 22px; }
}

/* === Checkbox === */
.byt-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s;
    margin-bottom: 6px;
    min-height: 44px;
}

.byt-checkbox-row:hover { border-color: var(--border-strong); }

.byt-checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.byt-checkbox-row span {
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
}

/* === Output === */
.byt-output { min-height: 200px; }

/* === Locked === */
.byt-locked {
    padding: 48px 32px;
    background: var(--panel);
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 480px) {
    .byt-locked { padding: 36px 20px; }
}

.byt-locked-badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--accent);
    color: var(--bg);
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 18px;
}

.byt-locked-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(22px, 3.5vw, 30px);
    font-weight: 400;
    letter-spacing: -0.015em;
    margin-bottom: 12px;
    line-height: 1.15;
}

.byt-locked-title em {
    font-style: italic;
    color: var(--accent);
}

.byt-locked-desc {
    color: var(--text-dim);
    font-size: 14px;
    max-width: 480px;
    margin: 0 auto 24px;
    line-height: 1.55;
}

/* === Buttons === */
.byt-btn {
    font-family: 'Geist', sans-serif;
    background: var(--accent);
    color: var(--bg);
    border: 0;
    padding: 13px 24px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.byt-btn:hover {
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.byt-btn:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.byt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.byt-btn-block { width: 100%; }

/* === Unlock banner === */
.byt-unlock-banner {
    padding: 12px 16px;
    background: rgba(125, 168, 148, 0.1);
    border-left: 3px solid var(--sage);
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--sage);
    font-weight: 500;
}

html[data-theme="light"] .byt-unlock-banner {
    background: rgba(74, 117, 96, 0.08);
}

/* === Result panel === */
.byt-result-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .byt-result-panel { padding: 22px; }
}

.byt-result-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(212, 255, 63, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

html[data-theme="light"] .byt-result-panel::after {
    background: radial-gradient(circle, rgba(90, 140, 112, 0.05) 0%, transparent 70%);
}

.byt-result-label {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 12px;
}

.byt-result-big {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(40px, 8vw, 84px);
    font-weight: 400;
    letter-spacing: -0.025em;
    color: var(--text);
    line-height: 0.95;
    margin-bottom: 8px;
    word-break: break-word;
}

.byt-result-big em {
    font-style: italic;
    color: var(--accent);
}

.byt-result-sub {
    font-family: 'Geist Mono', monospace;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.byt-result-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .byt-result-meta { grid-template-columns: 1fr; gap: 14px; }
}

.byt-meta-label {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 6px;
}

.byt-meta-value {
    font-family: 'Geist Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.byt-meta-value.accent { color: var(--accent); }
.byt-meta-value.warn { color: var(--warn); }
.byt-meta-value.sage { color: var(--sage); }

.byt-meta-sub {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 2px;
}

/* === Rank block === */
.byt-rank-block {
    padding: 0 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.byt-rank-value {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 32px;
    font-style: italic;
    color: var(--accent);
    margin-top: 8px;
}

.byt-rank-of {
    font-style: normal;
    font-family: 'Geist Mono', monospace;
    font-size: 16px;
    color: var(--text-dim);
}

/* === Lists === */
.byt-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 720px) {
    .byt-lists { grid-template-columns: 1fr; gap: 28px; }
}

.byt-list-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
}

.byt-list-title em {
    font-style: italic;
    color: var(--accent);
}

.byt-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.byt-list-row.active {
    background: var(--bg-2);
    padding: 11px 8px;
}

.byt-list-row:last-child { border-bottom: 0; }

.byt-list-rank {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--text-mute);
    width: 28px;
    flex-shrink: 0;
}

.byt-list-name {
    flex: 1;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.byt-list-price {
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

.byt-list-price .unit {
    color: var(--text-mute);
    font-weight: 400;
    font-size: 10px;
    margin-left: 3px;
}

/* === Footer === */
.byt-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.05em;
    flex-wrap: wrap;
    gap: 12px;
}

.byt-footer a {
    color: var(--accent);
    text-decoration: none;
}

.byt-footer a:hover { text-decoration: underline; }

/* === Modal === */
.byt-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
}

.byt-modal[hidden] { display: none; }

.byt-modal-content {
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 36px;
    max-width: 460px;
    width: 100%;
    position: relative;
    margin: auto;
}

@media (max-width: 520px) {
    .byt-modal { padding: 0; align-items: flex-start; }
    .byt-modal-content {
        padding: 28px 20px;
        min-height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
}

.byt-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--bg-2);
    border: 0;
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s;
}

.byt-modal-close:hover {
    background: var(--bg-3);
    color: var(--text);
}

.byt-modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.byt-modal-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.byt-modal-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 22px;
    line-height: 1.55;
}

/* === Form === */
.byt-form-group { margin-bottom: 12px; }

.byt-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 380px) {
    .byt-form-row { grid-template-columns: 1fr; gap: 0; }
}

.byt-form-label {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 6px;
    display: block;
}

.byt-form-input {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    border-radius: 6px;
    transition: border-color 0.15s;
}

.byt-form-input:focus { border-color: var(--accent); }

.byt-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.byt-form-error {
    background: rgba(232, 169, 63, 0.12);
    border-left: 3px solid var(--warn);
    padding: 10px 12px;
    font-size: 12px;
    color: var(--warn);
    margin-bottom: 14px;
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

html[data-theme="light"] .byt-form-error {
    color: #8a4a0a;
    background: rgba(196, 122, 26, 0.1);
}

.byt-form-disclaimer {
    font-size: 10px;
    color: var(--text-mute);
    margin-top: 14px;
    line-height: 1.5;
    text-align: center;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
