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

body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: #2a2a2a;
    height: 100vh;
    background: #fafafa;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.search-panel {
    width: 33.333%;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.pdf-panel {
    width: 66.667%;
    background: #f0f0f0;
}

.search-panel-title {
    font-family: "Press Start 2P", monospace;
    font-size: 16px;
    padding: 14px 12px 10px;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-btn {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 18px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.info-btn:hover {
    color: #222;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 6px;
    padding: 24px 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    position: relative;
    font-size: 14px;
    line-height: 1.6;
    color: #2a2a2a;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #bbb;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #555;
}

.search-form {
    padding: 10px;
    border-bottom: 1px solid #e8e8e8;
    position: relative;
}

input[type="text"] {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 15px;
    padding: 7px 28px 7px 10px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    color: #2a2a2a;
    outline: none;
    transition: border-color 0.15s;
}

input[type="text"]:focus {
    border-color: #aaa;
    background: #fff;
}

#clearBtn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 15px;
    line-height: 1;
    padding: 0;
    display: none;
}

#clearBtn:hover {
    color: #666;
}

.results-count {
    padding: 5px 10px;
    font-size: 12px;
    color: #999;
    border-bottom: 1px solid #eee;
}

.results-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
}

.result {
    padding: 8px;
    margin: 0 -8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
}

.result:last-child {
    border-bottom: none;
}

.result:hover {
    background: #ebebeb;
}

.result-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 5px;
    color: #1a1a1a;
}

.result-id {
    display: none;
}

.snippet {
    margin: 3px 0;
    line-height: 1.5;
    font-size: 13px;
    color: #555;
}

.snippet em {
    background: #fff176;
    font-style: normal;
    padding: 1px 2px;
    border-radius: 2px;
}

.error {
    color: #c00;
    padding: 8px 10px;
    font-size: 13px;
}

.loading,
.no-results {
    color: #aaa;
    padding: 8px 0;
    font-size: 13px;
}

.loading {
    font-style: italic;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #bbb;
    font-size: 13px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
    background: #fff;
}

.pagination button {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 13px;
    padding: 3px 9px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.pagination button:hover {
    background: #f0f0f0;
}

.pagination button.active {
    background: #2a2a2a;
    color: #fff;
    border-color: #2a2a2a;
}

.pagination button:disabled {
    opacity: 0.35;
    cursor: default;
}

.back-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #555;
    width: 100%;
    text-align: left;
}

.back-btn:hover {
    background: #f5f5f5;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .search-panel {
        width: 100%;
        border-right: none;
    }

    .pdf-panel {
        width: 100%;
        display: none;
        flex-direction: column;
    }

    .pdf-panel.mobile-active {
        display: flex;
        height: 100vh;
    }

    .search-panel.mobile-hidden {
        display: none;
    }

    .back-btn {
        display: flex;
    }
}
