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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #6da340;
    background-image: url('https://x.boardgamearena.net/data/themereleases/current/games/agricola/260123-1203/img/background.jpg');
    background-repeat: repeat;
    background-size: auto;
    min-height: 100vh;
    padding: 20px;
}

/* Nav bar */
.nav-bar {
    max-width: 1200px;
    margin: 0 auto 16px;
    display: flex;
    gap: 12px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 0.95em;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.4);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* Main container */
.draft-container {
    max-width: 1600px;
    margin: 0 auto;
}

/* Wide two-column layout: main content left, strategy sidebar right */
.draft-wide-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.draft-main-col {
    flex: 1;
    min-width: 0;
}

.draft-side-col {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

/* Header section */
.draft-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.draft-title {
    font-size: 2em;
    color: #333;
}

.title-icon {
    height: 1em;
    width: auto;
    vertical-align: middle;
    margin-right: 4px;
}

.draft-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.round-indicator {
    font-size: 1.2em;
    font-weight: 600;
    color: #555;
    background: #f0f0f0;
    padding: 8px 18px;
    border-radius: 8px;
}

.round-indicator .round-num {
    color: #8B6914;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: #8B6914;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #6d5210;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b02a37;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #565e64;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 60px;
    color: white;
    font-size: 1.3em;
}

/* Search section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    position: relative;
}

.search-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1.05em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #8B6914;
}

.suggestions {
    position: absolute;
    left: 30px;
    right: 30px;
    top: calc(100% - 8px);
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-rank {
    font-size: 0.85em;
    color: #999;
    min-width: 35px;
}

.suggestion-name {
    flex: 1;
    color: #333;
}

.suggestion-type {
    font-size: 0.8em;
    color: #888;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 10px;
}

/* Hand display */
.hand-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.hand-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.hand-column {
    min-width: 0;
}

.column-header {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-count {
    font-size: 0.85em;
    font-weight: 400;
    color: #888;
}

.card-count.complete {
    color: #28a745;
    font-weight: 600;
}

/* Sort controls */
.sort-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 4px 10px;
    font-size: 0.8em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}

.sort-btn:hover {
    border-color: #999;
}

.sort-btn.active {
    background: #8B6914;
    color: white;
    border-color: #8B6914;
}

/* Card rows in hand */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fafafa;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    gap: 8px;
}

.card-row:hover {
    background: #f0f0f0;
}

.card-row.selected {
    border-color: #8B6914;
    background: #fdf6e3;
}

.card-row.faded {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.card-row.marked-remaining {
    border-left: 3px solid #28a745;
    background: rgba(40, 167, 69, 0.08);
}

.card-row .card-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.9em;
    color: #333;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-row .card-stat {
    font-size: 0.8em;
    color: #777;
    min-width: 45px;
    text-align: right;
}

.card-row .card-stat-label {
    font-size: 0.65em;
    color: #aaa;
    text-transform: uppercase;
}

.card-row .remove-btn {
    padding: 2px 6px;
    font-size: 0.75em;
    border: none;
    background: none;
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.card-row .remove-btn:hover {
    color: #dc3545;
    background: #fee;
}

/* Draft actions */
.draft-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
}

/* Your Hand section */
.your-hand-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.your-hand-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Prior hands compact view */
.prior-hands-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.prior-hands-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}

.prior-hands-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.prior-hand-card {
    min-width: 0;
    flex: 1;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
    overflow: hidden;
}

.prior-hand-header {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
}

.prior-hand-card .mini-card {
    font-size: 0.8em;
    color: #555;
    padding: 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prior-hand-card .mini-card.drafted {
    color: #8B6914;
    font-weight: 600;
}

.prior-hand-card .mini-card.passed {
    color: #aaa;
}

.prior-hand-card .mini-card.others-took {
    color: #dc3545;
    text-decoration: line-through;
    opacity: 0.6;
}

.others-took-count {
    font-size: 0.7em;
    color: #999;
    text-align: center;
    padding: 4px 0;
    margin-top: 4px;
    border-top: 1px dashed #ddd;
    font-style: italic;
}

/* ─── Wheel Watch ────────────────────────────────────────────────── */
.prior-hand-card .mini-card {
    position: relative;
    padding-right: 20px;
}

.mini-card.wheel-watched {
    border-left: 2px solid rgba(139, 105, 20, 0.4);
    padding-left: 4px;
}

.wheel-watch-indicator {
    display: inline;
    font-size: 0.85em;
    margin-left: 3px;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
}

.wheel-watch-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    cursor: pointer;
    border: none;
    background: none;
    opacity: 0.4;
    transition: opacity 0.15s;
    z-index: 1;
    line-height: 1;
    padding: 0;
}

.wheel-watch-btn:hover {
    opacity: 0.8;
}

.wheel-watch-btn.active {
    opacity: 1;
}

.mini-card.clickable:hover .wheel-watch-btn {
    display: inline-flex;
}

@media (max-width: 768px) {
    .wheel-watch-btn {
        display: inline-flex;
    }
}

/* Wheel Watch Note in Popover */
.popover-wheel-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.popover-wheel-note-label {
    display: block;
    font-size: 0.75em;
    opacity: 0.8;
    margin-bottom: 4px;
    font-weight: 600;
}

.popover-wheel-note-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.85em;
    outline: none;
    box-sizing: border-box;
}

.popover-wheel-note-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.popover-wheel-note-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

/* Summary view */
.summary-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    color: #333;
}

.summary-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.summary-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.summary-column-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
    color: #555;
}

.summary-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
}

.summary-card .card-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.summary-card .card-stats {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    color: #777;
}

.summary-card.clickable {
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.summary-card.clickable:hover {
    background: #eaeaea;
    transform: translateY(-1px);
}

/* Clickable card rows in YourHand */
.card-row.clickable {
    cursor: pointer;
}

/* Marking mode banner */
.marking-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.marking-banner-text {
    color: #856404;
    font-size: 0.95em;
}

/* Empty state */
.empty-hand {
    text-align: center;
    padding: 24px;
    color: #aaa;
    font-size: 0.95em;
}

/* ─── Pick badge (pass 1/2 numbering) ─────────────────────────────── */
.pick-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8B6914;
    color: white;
    font-size: 0.65em;
    font-weight: 700;
    margin-right: 4px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* ─── Strategy tag pills ─────────────────────────────────────────── */
.tag-pills {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
    margin-left: 6px;
}

.tag-pill {
    display: inline-block;
    color: white;
    font-size: 0.75em;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    line-height: 1.4;
}

/* ─── Tag dots for prior hands mini-cards ─────────────────────────── */
.mini-tag-dots {
    display: inline-flex;
    gap: 2px;
    margin-right: 3px;
    vertical-align: middle;
    flex-shrink: 0;
}

.mini-tag-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── Tag legend ─────────────────────────────────────────────────── */
.tag-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 10px;
    font-size: 0.7em;
    color: #888;
}

.tag-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.tag-legend-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.tag-legend-item-active {
    border-color: currentColor;
    font-weight: 600;
}

.tag-filter-clear {
    display: inline-flex;
    align-items: center;
    font-size: inherit;
    color: #999;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #ccc;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.tag-filter-clear:hover {
    background: #eee;
    color: #666;
}

.tag-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tag-legend-label {
    font-weight: 500;
}

/* ─── Tag filter highlight/dim ───────────────────────────────────── */
.mini-card.tag-highlighted {
    border-radius: 3px;
    color: #333 !important;
    font-weight: 600;
}

.mini-card.tag-dimmed {
    opacity: 0.25;
}

/* ─── Clickable mini-cards in prior hands ─────────────────────────── */
.mini-card.clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.mini-card.clickable:hover {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
}

/* ─── Card Detail Popover ─────────────────────────────────────────── */
.card-detail-popover {
    position: fixed;
    z-index: 2000;
    background: linear-gradient(135deg, #b8956a 0%, #8B6914 100%);
    color: white;
    border-radius: 12px;
    padding: 16px;
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: popoverSlideIn 0.15s ease-out;
}

@keyframes popoverSlideIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.popover-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popover-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-right: 28px;
}

.popover-name {
    font-weight: 700;
    font-size: 1.05em;
}

.popover-rank {
    font-size: 0.9em;
    opacity: 0.8;
}

.popover-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.popover-tag {
    font-size: 0.75em;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.popover-image {
    margin-bottom: 10px;
    text-align: center;
}

.popover-image img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.popover-prereqs {
    font-size: 0.8em;
    background: rgba(255, 220, 150, 0.2);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.popover-description {
    font-size: 0.8em;
    line-height: 1.4;
    margin-bottom: 10px;
    opacity: 0.9;
}

.popover-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    font-size: 0.75em;
}

.popover-stats > div {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 6px;
    border-radius: 4px;
    text-align: center;
}

.popover-stat-label {
    display: block;
    font-size: 0.8em;
    opacity: 0.7;
    text-transform: uppercase;
}

/* ─── Summary toggle ──────────────────────────────────────────────── */
.summary-toggle {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
}

.toggle-btn {
    padding: 8px 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: transparent;
    color: #888;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: #f0f0f0;
}

.toggle-btn.active {
    background: #555;
    color: white;
    border-color: #555;
}

/* Others' pick accent */
.summary-card.others-pick,
.summary-card-compact.others-pick {
    border-left: 3px solid #e88;
}

.other-badge {
    display: inline-block;
    font-size: 0.7em;
    background: #f8d7da;
    color: #a44;
    padding: 1px 6px;
    border-radius: 8px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Compact card row for opponents column */
.summary-card-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.summary-card-compact.clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.summary-card-compact.clickable:hover {
    background: #eaeaea;
}

.summary-card-compact .card-name-inline {
    font-weight: 600;
    white-space: nowrap;
}

.summary-card-compact .card-stats-inline {
    margin-left: auto;
    color: #999;
    font-size: 0.85em;
    white-space: nowrap;
}

/* Played card toggle */
.played-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #888;
    flex-shrink: 0;
    margin: 0;
}

.summary-card-compact.played {
    opacity: 0.4;
}

.summary-card-compact.played .card-name-inline {
    text-decoration: line-through;
}

.summary-card-compact.played .tag-pill {
    opacity: 0.5;
}

.remaining-count {
    font-size: 0.8em;
    font-weight: 400;
    color: #999;
}

/* Subgroups within a summary column (e.g., Occupations / Minors under Your Hand) */
.summary-subgroup {
    margin-bottom: 16px;
}

.summary-subgroup-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #777;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
}

/* Opponents' hand groups in combined view */
.opponents-hand-group {
    margin-bottom: 20px;
}

.opponents-hand-header {
    font-size: 1em;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #e88;
}

.opponents-hand-header .hand-note {
    font-weight: 400;
    font-size: 0.85em;
    color: #999;
}

/* ─── Screenshot paste hint (inline below search) ────────────────── */
.screenshot-paste-hint {
    margin-top: 8px;
    padding: 6px 12px;
    text-align: center;
    border-radius: 6px;
    transition: background 0.2s;
    background: rgba(255, 255, 255, 0.85);
}

.screenshot-paste-hint.dragover {
    background: #fdf6e3;
    box-shadow: inset 0 0 0 2px #8B6914;
}

.screenshot-hint-text {
    font-size: 0.82em;
    color: #999;
}

.screenshot-hint-text.processing {
    color: #8B6914;
    font-weight: 500;
}

.screenshot-upload-link {
    background: none;
    border: none;
    padding: 0;
    color: #8B6914;
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.screenshot-upload-link:hover {
    color: #6d5210;
}

/* ─── Screenshot result banners ──────────────────────────────────── */
.screenshot-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9em;
    margin-top: 12px;
}

.screenshot-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.screenshot-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.screenshot-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.screenshot-unmatched {
    font-size: 0.85em;
    margin-top: 4px;
    opacity: 0.85;
}

.screenshot-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    color: inherit;
    opacity: 0.6;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.screenshot-dismiss:hover {
    opacity: 1;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .draft-header {
        padding: 20px;
    }

    .draft-title {
        font-size: 1.5em;
    }

    .hand-columns {
        grid-template-columns: 1fr;
    }

    .summary-columns {
        grid-template-columns: 1fr;
    }

    .search-section {
        padding: 16px 20px;
    }

    .suggestions {
        left: 20px;
        right: 20px;
    }

    .card-detail-popover {
        width: calc(100vw - 32px);
        left: 16px !important;
    }

    .summary-toggle {
        flex-direction: column;
        align-items: center;
    }

    .toggle-btn {
        width: 100%;
        max-width: 200px;
    }

}

/* Stack sidebar below main content when not wide enough */
@media (max-width: 1100px) {
    .draft-wide-layout {
        flex-direction: column;
    }

    .draft-side-col {
        width: auto;
        position: static;
    }
}

/* ─── Strategy Dashboard ─────────────────────────────────────────── */
.strategy-dashboard {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.strategy-dashboard-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
}

/* Dimensions */
.dimension-section {
    margin-bottom: 16px;
}

.dimension-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.85em;
}

.dimension-label {
    color: #555;
    font-weight: 600;
}

.dimension-value {
    font-weight: 600;
    text-transform: capitalize;
}

.dimension-value.weak, .dimension-value.low, .dimension-value.not_covered {
    color: #c0392b;
}

.dimension-value.adequate, .dimension-value.medium {
    color: #d4a017;
}

.dimension-value.strong, .dimension-value.high, .dimension-value.covered {
    color: #27ae60;
}

.dimension-value.placeholder {
    color: #bbb;
    font-weight: 400;
}

/* Dimension value with justification */
.dimension-value-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.dimension-reason {
    font-size: 0.78em;
    color: #888;
    font-weight: 400;
    max-width: 180px;
    text-align: right;
    line-height: 1.3;
}

/* Strategy Archetype Badges */
.archetype-section {
    margin-bottom: 10px;
}

.archetype-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.archetype-badge {
    display: inline-block;
    font-size: 0.78em;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: #8B6914;
    color: white;
}

/* AI Reasoning Collapsible */
.reasoning-section {
    margin-bottom: 12px;
}

.reasoning-toggle {
    background: none;
    border: none;
    color: #888;
    font-size: 0.78em;
    cursor: pointer;
    padding: 2px 0;
    font-weight: 600;
}

.reasoning-toggle:hover {
    color: #555;
}

.reasoning-content {
    font-size: 0.8em;
    color: #555;
    line-height: 1.5;
    padding: 8px 10px;
    background: #f5f5f5;
    border-radius: 6px;
    border-left: 3px solid #ccc;
    margin-top: 6px;
    animation: rationaleSlideIn 0.15s ease-out;
}

/* Overall Analysis and Risks */
.strategy-analysis, .strategy-risks {
    font-size: 0.83em;
    color: #444;
    line-height: 1.5;
    margin-bottom: 14px;
    padding: 8px 10px;
    background: #f8f8f8;
    border-radius: 8px;
    border-left: 3px solid #ddd;
}

.strategy-analysis.has-content { border-left-color: #8B6914; }
.strategy-risks.has-content { border-left-color: #c0392b; }

.strategy-section-label {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* Farm Grid */
.farm-grid-section {
    margin-bottom: 14px;
}

.farm-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    max-width: 220px;
}

.farm-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0ebe0;
    border: 1px solid #d4c9a8;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    color: #888;
    user-select: none;
    transition: background 0.1s;
}

.farm-cell:hover { background: #e8e0cf; }
.farm-cell.locked { cursor: default; background: #e8dcc4; }
.farm-cell.locked:hover { background: #e8dcc4; }

.farm-cell[data-state="H"] { color: #e67e22; }
.farm-cell[data-state="F"] { color: #27ae60; }
.farm-cell[data-state="P"] { color: #8B6914; }

/* Notes */
.strategy-notes {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.82em;
    font-family: inherit;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
    line-height: 1.4;
    color: #333;
    background: #fafafa;
    margin-bottom: 14px;
}

.strategy-notes:focus {
    outline: none;
    border-color: #8B6914;
}

.strategy-notes::placeholder {
    color: #bbb;
}

/* Get AI Advice button */
.strategy-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #8B6914;
    color: white;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.strategy-btn:hover { background: #73570f; }
.strategy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.strategy-btn.loading {
    background: #a07d1c;
    cursor: wait;
}

.strategy-divider {
    border: none;
    border-top: 1px solid #e8e0cf;
    margin: 12px 0;
}

/* ─── AI Suggestion Pills ────────────────────────────────────────── */
.ai-suggestion-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2980b9;
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.ai-suggestion-pill:hover {
    background: #1a6da0;
    transform: scale(1.15);
}

.card-row.has-suggestion {
    border-left: 3px solid #2980b9;
}

.ai-rationale {
    font-size: 0.82em;
    color: #444;
    line-height: 1.45;
    padding: 8px 12px 8px 36px;
    background: #eaf2f8;
    border-left: 3px solid #2980b9;
    border-radius: 0 0 6px 6px;
    margin-top: -2px;
    margin-bottom: 4px;
    animation: rationaleSlideIn 0.15s ease-out;
}

@keyframes rationaleSlideIn {
    from { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
    to { opacity: 1; max-height: 100px; }
}

/* ─── Temporary Card UI ─────────────────────────────────────────────── */

/* "No matching cards" prompt below search */
.temp-card-prompt {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fdf6e3;
    border: 1px dashed #d4a017;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.temp-card-prompt-text {
    font-size: 0.88em;
    color: #856404;
}

.temp-card-prompt-btn {
    background: none;
    border: 1px solid #8B6914;
    color: #8B6914;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.temp-card-prompt-btn:hover {
    background: #8B6914;
    color: white;
}

/* Inline temp card form (inside search section) */
.temp-card-form {
    margin-top: 10px;
    padding: 14px;
    background: #fdf6e3;
    border: 1px solid #e8d9a0;
    border-radius: 8px;
}

.temp-card-form-row {
    margin-bottom: 10px;
}

.temp-card-form-row label {
    display: block;
    font-size: 0.8em;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}

.temp-card-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.95em;
    border: 1px solid #d4c9a8;
    border-radius: 6px;
    outline: none;
    background: white;
}

.temp-card-input:focus {
    border-color: #8B6914;
}

.temp-card-textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9em;
    font-family: inherit;
    border: 1px solid #d4c9a8;
    border-radius: 6px;
    outline: none;
    resize: vertical;
    background: white;
}

.temp-card-textarea:focus {
    border-color: #8B6914;
}

/* Type toggle (Occupation / Minor Improvement) */
.temp-card-type-toggle {
    display: flex;
    gap: 4px;
}

.temp-card-type-toggle .type-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid #d4c9a8;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.temp-card-type-toggle .type-btn:hover {
    border-color: #8B6914;
}

.temp-card-type-toggle .type-btn.active {
    background: #8B6914;
    color: white;
    border-color: #8B6914;
}

/* "Add description" link */
.temp-card-add-desc {
    background: none;
    border: none;
    color: #8B6914;
    font-size: 0.82em;
    cursor: pointer;
    padding: 2px 0;
    margin-bottom: 8px;
}

.temp-card-add-desc:hover {
    text-decoration: underline;
}

/* Form action buttons */
.temp-card-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85em;
}

/* Card row with temp styling */
.card-row.temp {
    border-left: 2px dashed #d4a017;
    background: #fefcf4;
}

.card-row.temp:hover {
    background: #fdf6e3;
}

/* "NEW" badge replacing rank for temp cards */
.temp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    font-weight: 700;
    color: #8B6914;
    background: #fdf6e3;
    border: 1px solid #d4a017;
    border-radius: 4px;
    padding: 1px 5px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Edit pencil button for temp cards */
.edit-temp-btn {
    padding: 2px 6px;
    font-size: 0.85em;
    border: none;
    background: none;
    color: #bbb;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.edit-temp-btn:hover {
    color: #8B6914;
    background: #fdf6e3;
}

/* Unmatched row in screenshot results */
.unmatched-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.unmatched-name {
    flex: 1;
    font-weight: 500;
}

.unmatched-add-btn {
    background: none;
    border: 1.5px solid #8B6914;
    color: #8B6914;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.unmatched-add-btn:hover {
    background: #8B6914;
    color: white;
}

/* Edit temp card modal overlay */
.temp-edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.temp-edit-modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.temp-edit-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}
