:root {
    --primary: #2d5a27;
    --primary-light: #e8f0e6;
    --accent: #d4af37;
    --dark: #222;
    --light: #f9f9f9;
    --border: #ddd;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f4f6f4;
    margin: 0;
    padding: 0;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
header {
    background-color: var(--primary);
    color: white;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 5px solid var(--accent);
}
header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}
header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 25px;
    margin-bottom: 25px;
}
h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
    margin-top: 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}
th.sortable:hover {
    background-color: #d8ebd4;
}
th.sortable::after {
    content: ' ↕';
    font-size: 0.8em;
    color: #999;
    position: absolute;
    right: 8px;
}
th.sortable.asc::after {
    content: ' ▲';
    color: var(--primary);
}
th.sortable.desc::after {
    content: ' ▼';
    color: var(--primary);
}
tr:hover {
    background-color: #fcfdfc;
}
.rating {
    color: var(--accent);
    font-weight: bold;
}
.badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}
a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
a:hover {
    text-decoration: underline;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}
.ranking-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
}
.ranking-card h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.1em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}
.ranking-list {
    padding-left: 20px;
    margin: 10px 0 0 0;
}
.ranking-list li {
    margin-bottom: 6px;
}
.notes-list {
    padding-left: 20px;
}
.notes-list li {
    margin-bottom: 10px;
}
.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
}
.back-btn:hover {
    background-color: #1e3d1a;
    text-decoration: none;
}
.details-table th {
    width: 30%;
}
.additional-details h2:first-child,
.additional-details h3:first-child,
.additional-details p:first-child {
    margin-top: 0;
}
.additional-details ul,
.additional-details ol {
    padding-left: 24px;
}
.additional-details li {
    margin-bottom: 8px;
}

/* ── Destination selection checkboxes ──────────────────────────────────── */
.sel-col {
    width: 42px;
    text-align: center;
    padding: 8px 6px;
}
.sel-all-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.dest-cb,
.sel-all-cb {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary);
}
tr.dest-deselected td {
    opacity: 0.38;
}
tr.dest-deselected td a {
    pointer-events: none;
}

/* ── Section collapse ───────────────────────────────────────────────────── */
.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    margin-bottom: 0;
}
.collapse-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0 4px;
    font-size: 1.15em;
    line-height: 1;
    color: var(--primary);
    cursor: pointer;
    transition: transform 0.2s ease;
    transform-origin: center;
}
.collapse-btn[aria-expanded="false"] {
    transform: rotate(-90deg);
}
.section-body {
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.22s ease;
    max-height: 4000px;   /* large enough for any table */
    opacity: 1;
}
.section-body.collapsed {
    max-height: 0;
    opacity: 0;
}
.section-card.is-collapsed {
    padding-bottom: 16px;
}

/* ── Timetable ──────────────────────────────────────────────────────────── */
.timetable-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--primary-light);
    border-radius: 6px;
}
.timetable-controls label {
    font-weight: 600;
    color: var(--primary);
    font-size: 1em;
}
.timetable-controls input[type="month"] {
    padding: 8px 12px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 1em;
    color: var(--dark);
    background: white;
    cursor: pointer;
}
.timetable-controls input[type="month"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
}
.timetable-controls .tt-hint {
    font-size: 0.88em;
    color: #666;
}
#timetable-table-wrap {
    overflow-x: auto;
}
#timetable-table {
    margin-top: 0;
}
#timetable-table thead th {
    white-space: nowrap;
}
.tt-row-skip td {
    color: #999;
    font-style: italic;
    background: #fafafa;
}
.tt-row-skip .tt-month-cell {
    color: #bbb;
}
.tt-month-cell {
    white-space: nowrap;
    font-weight: 600;
    color: var(--primary);
}
.tt-dest-cell a {
    font-weight: 600;
}
.tt-dest-cell .tt-no-dest {
    color: #bbb;
}
.tt-focus-cell {
    font-size: 0.9em;
    color: #555;
}
.tt-unscheduled {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.tt-unscheduled h4 {
    margin: 0 0 8px 0;
    color: #777;
    font-size: 0.95em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tt-unscheduled ul {
    margin: 0;
    padding-left: 20px;
    color: #888;
    font-size: 0.9em;
}
.tt-unscheduled ul li {
    margin-bottom: 4px;
}
.tt-notes {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.88em;
    color: #666;
}
.tt-notes ul {
    margin: 6px 0 0 0;
    padding-left: 20px;
}
.tt-notes ul li {
    margin-bottom: 5px;
}
.tt-count-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.82em;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}
