:root {
    --bg: #f9f9fb;
    --panel: #ffffff;
    --border: #d7d7de;
    --text: #1f1f29;
    --muted: #4a4a55;
    --accent: #2f6fed;
    --pass: #1a8f3d;
    --fail: #c62828;
}
* { box-sizing: border-box; }
body {
    font-family: "Helvetica Neue", Helvetica, "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 32px 16px 64px;
}
.page {
    max-width: 940px;
    margin: 0 auto;
}
h1 { margin: 0 0 12px; }
h2 { margin: 0 0 10px; font-size: 1.05em; }
p { margin: 0 0 10px; color: var(--muted); }
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 18px;
    margin-bottom: 18px;
}
#dropzone {
    border: 3px dashed var(--border);
    padding: 46px;
    text-align: center;
    margin-bottom: 20px;
    background: #fff;
    transition: 0.15s ease border-color, 0.15s ease background, 0.15s ease color;
    font-size: 1.05em;
}
#dropzone.drag-over {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.muted { color: var(--muted); }
.hint { margin: 10px 0; font-size: 0.95em; }
.pass { color: var(--pass); }
.fail { color: var(--fail); }
.hidden { display: none; }
#results { white-space: pre-wrap; }
#summary {
    font-size: 1.05em;
    font-weight: bold;
    margin: 14px 0 6px;
    padding: 12px;
    background: #f3f5ff;
    border: 1px solid var(--border);
}
.footer {
    text-align: center;
    margin-top: 28px;
    font-size: 0.95em;
}
button {
    font-family: inherit;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: 0.15s ease transform, 0.15s ease box-shadow;
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -12px rgba(0,0,0,0.35); }
button:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; transform: none; }
#output {
    background: var(--panel);
    color: var(--text);
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
    min-height: 120px;
    margin-bottom: 18px;
}

#output > * + * {
    margin-top: 18px;
}

.result-block {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

/* Larger font for possible scales in output */
#output .possible-scales-header {
    font-size: 1.15em;
    font-weight: bold;
    margin: 0 0 12px 0;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.scale-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.scale-item {
    background: var(--panel);
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1.02em;
}

.scale-item.best {
    border-color: var(--accent);
    background: var(--bg);
}

.scale-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.scale-name {
    font-weight: bold;
    color: var(--text);
}

.scale-tag {
    font-size: 0.85em;
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}

.scale-meta {
    font-size: 0.9em;
    color: var(--muted);
}

.notes-section {
    margin-top: 0;
}

.notes-header {
    font-size: 1.1em;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: bold;
}

.notes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.note-chip {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 92px;
    background: var(--panel);
}

.note-name {
    font-weight: bold;
    color: var(--text);
}

.note-meta {
    font-size: 0.85em;
    color: var(--muted);
    margin-top: 2px;
}

.hint-text {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-style: italic;
}

.why-details {
    margin-top: 10px;
}

.why-details summary {
    cursor: pointer;
    color: var(--text);
    font-weight: bold;
    padding: 8px 0;
}

.why-details summary:hover {
    color: var(--accent);
}

.why-section {
    background: var(--bg);
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-top: 10px;
}

.why-meaning {
    color: var(--muted);
    font-size: 0.95em;
}

.why-title {
    font-weight: bold;
    color: var(--text);
    margin-bottom: 10px;
}

.why-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.why-list li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    color: var(--text);
}

.why-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* File name styling in dropzone */
.file-name {
    margin-top: 12px;
    font-size: 0.95em;
    color: var(--muted);
}

.file-name.hidden {
    display: none;
}

/* Mode selector styles */
.mode-selector {
    border: 1px solid var(--border);
    padding: 14px 18px;
    margin-bottom: 18px;
}
.mode-selector legend {
    font-weight: bold;
    padding: 0 8px;
}
.mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    cursor: pointer;
}
.mode-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}
.mode-option span:first-of-type {
    font-weight: bold;
    min-width: 80px;
}
.mode-desc {
    color: var(--muted);
    font-size: 0.9em;
}
