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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
}

/* Document info */
.document-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.document-info label {
    font-weight: 500;
    color: #666;
}

.document-info input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.document-info input:focus {
    outline: none;
    border-color: #2c3e50;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.color-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.color-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-btn.active {
    border-color: #333;
}

.color-btn .shortcut {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 4px;
}

.color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.2);
}

/* Color schemes */
.color-btn.yellow { background: #fff9c4; }
.color-btn.yellow .color-swatch { background: #ffeb3b; }

.color-btn.green { background: #c8e6c9; }
.color-btn.green .color-swatch { background: #4caf50; }

.color-btn.purple { background: #e1bee7; }
.color-btn.purple .color-swatch { background: #9c27b0; }

.color-btn.orange { background: #ffe0b2; }
.color-btn.orange .color-swatch { background: #ff9800; }

.color-btn.blue-light { background: #bbdefb; }
.color-btn.blue-light .color-swatch { background: #64b5f6; }

.color-btn.blue-dark { background: #90caf9; }
.color-btn.blue-dark .color-swatch { background: #1976d2; }

.color-btn.clear { background: #f5f5f5; }
.color-btn.clear .color-swatch {
    background: linear-gradient(135deg, #fff 45%, #ff0000 45%, #ff0000 55%, #fff 55%);
}

.actions {
    display: flex;
    gap: 8px;
}

.actions button {
    padding: 8px 16px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.actions button:hover {
    background: #34495e;
}

/* Main content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.editor-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

#editor {
    min-height: 600px;
    padding: 20px;
    font-size: 1rem;
    line-height: 1.8;
    outline: none;
}

#editor:empty:before {
    content: attr(placeholder);
    color: #999;
}

/* Highlight styles */
#editor .highlight-yellow { background: #ffeb3b; }
#editor .highlight-green { background: #81c784; }
#editor .highlight-purple { background: #ce93d8; }
#editor .highlight-orange { background: #ffb74d; }
#editor .highlight-blue-light { background: #64b5f6; }
#editor .highlight-blue-dark { background: #1976d2; color: white; }

/* Summary panel */
.summary-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.summary-panel h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.stat {
    padding: 12px;
    border-radius: 6px;
    text-align: center;
}

.stat .count {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat.yellow { background: #fff9c4; }
.stat.green { background: #c8e6c9; }
.stat.purple { background: #e1bee7; }
.stat.orange { background: #ffe0b2; }
.stat.blue { background: #bbdefb; }
.stat.total {
    background: #eceff1;
    grid-column: span 2;
}

.claims-list {
    max-height: 400px;
    overflow-y: auto;
}

.claim-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.1s;
}

.claim-item:hover {
    transform: translateX(3px);
}

.claim-item.yellow { background: #fff9c4; border-left: 4px solid #ffeb3b; }
.claim-item.green { background: #c8e6c9; border-left: 4px solid #4caf50; }
.claim-item.purple { background: #e1bee7; border-left: 4px solid #9c27b0; }
.claim-item.orange { background: #ffe0b2; border-left: 4px solid #ff9800; }
.claim-item.blue-light { background: #bbdefb; border-left: 4px solid #64b5f6; }
.claim-item.blue-dark { background: #90caf9; border-left: 4px solid #1976d2; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-options button {
    padding: 12px;
    border: 2px solid #2c3e50;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.export-options button:hover {
    background: #2c3e50;
    color: white;
}

/* Audit modal */
.audit-claim {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 1rem;
    line-height: 1.6;
}

.audit-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.audit-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.audit-actions .verified {
    background: #4caf50;
    color: white;
}

.audit-actions .failed {
    background: #f44336;
    color: white;
}

.audit-actions #audit-next {
    background: #2c3e50;
    color: white;
}

.audit-progress-bar {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Keyboard help */
.keyboard-help {
    margin-top: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.keyboard-help h4 {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.keyboard-help ul {
    list-style: none;
    font-size: 0.8rem;
    color: #666;
}

.keyboard-help li {
    margin-bottom: 5px;
}

.keyboard-help kbd {
    display: inline-block;
    padding: 2px 6px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Empty message */
.empty-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Verified claim indicator */
.claim-item.verified {
    position: relative;
}

.claim-item.verified::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #4caf50;
    font-weight: bold;
}

/* Load modal */
.load-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.load-option {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.load-option.fallback {
    background: #f0f0f0;
}

.load-option h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.load-option p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
}

.load-option .note {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin-top: 8px;
    margin-bottom: 0;
}

.primary-btn {
    padding: 10px 20px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #34495e;
}

.url-input-row {
    display: flex;
    gap: 8px;
}

.url-input-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.url-input-row input:focus {
    outline: none;
    border-color: #2c3e50;
}

.converter-links {
    list-style: none;
    padding: 0;
}

.converter-links li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.converter-links a {
    color: #2980b9;
    text-decoration: none;
    font-weight: 500;
}

.converter-links a:hover {
    text-decoration: underline;
}

/* Load modal needs wider width */
#load-modal .modal-content {
    max-width: 600px;
}

/* Clear all button */
#btn-clear-all {
    background: #e74c3c;
}

#btn-clear-all:hover {
    background: #c0392b;
}
