:root {
    --primary-color: #2c3e50;
    --accent-color: #27ae60;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Visible only to screen readers — for headers that carry no visual label. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* "Back to the list" link sitting above a detail page's heading. */
.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--accent-color);
    text-decoration: underline;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-color);
}

.lang-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
}

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

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.recommendation-box {
    background-color: #e8f8f5;
    border-left: 5px solid var(--accent-color);
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 0 4px 4px 0;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px;
}

th, td {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
}

th {
    background-color: var(--primary-color);
    color: white;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.section-title {
    background-color: #eaeded !important;
    color: #2c3e50;
    font-weight: bold;
}

.highlight-total {
    font-weight: bold;
    background-color: #e8f8f5 !important;
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* --- SURVEY RESULTS AND FORM FEEDBACK ---
   Both live here rather than in one page's stylesheet because two pages draw
   them: a survey's own page, and the list, which shows the result of a finished
   survey in the row instead of opening it. */

/* --- THE COUNT ---
   Shown once this browser has voted, and to everybody once the survey is closed.
   Each option carries its share as a number and as a bar; the option the reader
   voted for keeps the highlight a chosen row has on the ballot. */

.vote-results {
    margin: 0;
}

.vote-results-total {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #667;
}

.vote-results-total strong {
    color: var(--primary-color);
}

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

.vote-result {
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.vote-result-chosen {
    border-color: var(--accent-color);
    background-color: #e8f8f5;
    font-weight: 600;
}

.vote-result-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.vote-result-share {
    flex: none;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.vote-result-count {
    font-weight: 400;
    color: #667;
}

/* The bar is the same number again, for reading the result at a glance. A share
   of nothing still leaves the track visible, which is what says "no votes here". */
.vote-result-bar {
    height: 8px;
    background-color: #eef0f2;
    border-radius: 999px;
    overflow: hidden;
}

.vote-result-bar span {
    display: block;
    height: 100%;
    background-color: #98a6b3;
    border-radius: 999px;
}

.vote-result-chosen .vote-result-bar span {
    background-color: var(--accent-color);
}

/* --- FEEDBACK AFTER SUBMITTING --- */

.vote-message {
    margin: 0 0 20px;
    padding: 14px 16px;
    border-left: 5px solid;
    border-radius: 0 4px 4px 0;
    font-weight: 600;
}

.vote-message-ok {
    background-color: #e8f8f5;
    border-left-color: var(--accent-color);
    color: #1e8449;
}

.vote-message-error {
    background-color: #fdecea;
    border-left-color: #c0392b;
    color: #a93226;
}

@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 15px; }
    .tabs { flex-direction: column; gap: 0; }
    .tab-btn { text-align: left; padding: 10px 5px; }
    th, td { padding: 10px; font-size: 14px; }
}