/* ========================================
   Galaxy Sandbox - Styles
   ======================================== */

:root {
    --bg-dark: #0a0a12;
    --bg-panel: #12121c;
    --bg-panel-hover: #1a1a28;
    --border-color: #2a2a3c;
    --text-primary: #e0e0e0;
    --text-secondary: #8888aa;
    --accent-blue: #4a9eff;
    --accent-gold: #ffd700;
    --accent-green: #4caf50;
    --accent-red: #f44336;
    --accent-purple: #9c27b0;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;

    /* Poiesis Interactive brand palette (BRAND.md) — used by the
       landing screen, walkthrough tooltips, and the feedback FAB. */
    --poiesis-primary: #1A2CA3;
    --poiesis-secondary: #5015A2;
    --poiesis-accent: #EFB832;
    --poiesis-offwhite: #F6F6F3;
    --poiesis-ink: #2A2A28;
    --poiesis-gray: #7E7E76;
    --font-display: 'Funnel Display', 'Segoe UI', Tahoma, sans-serif;
    --font-brand: 'Funnel Sans', 'Segoe UI', Tahoma, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ========================================
   Top Bar
   ======================================== */

#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    height: 40px;
}

.bar-section {
    display: flex;
    gap: 16px;
    align-items: center;
}

.bar-section.center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.bar-section.right {
    margin-left: auto;
}

#game-time {
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

#time-speed {
    background: var(--accent-blue);
    color: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    min-width: 40px;
    text-align: center;
    transition: background 0.2s;
}

#time-speed:hover {
    background: #6ab0ff;
}

#time-speed.paused {
    background: var(--accent-red);
    animation: pulse-pause 1.5s infinite;
}

@keyframes pulse-pause {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#current-location {
    font-weight: 600;
    color: var(--accent-gold);
}

#player-credits {
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-weight: 600;
}

.lang-toggle {
    margin-left: 12px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-mono);
}

.lang-toggle:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* ========================================
   Main Content
   ======================================== */

#main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panels */
aside {
    width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#right-panel {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.panel {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.panel h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

/* Game Container */
#game-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-dark);
}

#game-canvas {
    width: 100%;
    height: 100%;
}

/* View Controls */
#view-controls {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: var(--bg-panel);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#view-controls button {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

#view-controls button:hover {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
}

#view-controls button.active {
    background: var(--accent-blue);
    color: var(--bg-dark);
}

#btn-toggle-travelers {
    margin-left: 8px;
    padding: 6px 10px !important;
}

#btn-toggle-travelers.active {
    background: var(--accent-gold);
}

/* Zoom Controls */
#zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#zoom-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
    transition: all 0.2s;
}

#zoom-controls button:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
}

/* ========================================
   Bottom Bar
   ======================================== */

#bottom-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
}

#bottom-bar button {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

#bottom-bar button:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
    border-color: var(--accent-blue);
}

/* ========================================
   Modal
   ======================================== */

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#modal-overlay.hidden {
    display: none;
}

#modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

#modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
}

#modal-close:hover {
    background: var(--accent-red);
    color: white;
}

/* ========================================
   Character Creation
   ======================================== */

.modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.modal-fullscreen.hidden {
    display: none;
}

.creation-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* 3-act card-based creation (GDD § 63.5) — wider canvas for card grids */
.creation-content--cards {
    width: min(960px, 95vw);
    max-width: 960px;
}

.creation-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13px;
    margin: -12px 0 24px;
}

.act-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-gold);
    font-size: 18px;
    margin-bottom: 4px !important;
    letter-spacing: 0.3px;
}

.act-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--accent-gold);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.05);
}

.act-prompt {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin: -2px 0 10px;
}

.identity-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 4px;
}

.identity-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.cards-grid--single {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.creation-card {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-dark);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.creation-card:hover {
    border-color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    background: var(--bg-panel-hover, rgba(40, 40, 60, 0.4));
}

.creation-card.selected {
    border-color: var(--accent-gold);
    border-left-color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.08);
    transform: translateY(-1px);
}

.creation-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.creation-card-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.creation-portrait {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
}

.portrait-text {
    padding: 14px 18px;
    background: rgba(255, 215, 0, 0.04);
    border-left: 2px solid var(--accent-gold);
    border-radius: 0 4px 4px 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    min-height: 80px;
    font-style: italic;
}

.portrait-text .portrait-line {
    margin: 0 0 8px;
}

.portrait-text .portrait-line:last-child {
    margin-bottom: 0;
}

.portrait-placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.creation-content h1 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--accent-gold);
}

.creation-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-section label {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-section h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 8px;
}

.form-section input[type="text"],
.form-section select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 14px;
}

.form-section input[type="text"]:focus,
.form-section select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Gender radio (character creation) */
.gender-choice {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.gender-option input[type="radio"] {
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* Personality Sliders */
.personality-sliders {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    color: var(--text-primary);
}

.slider-group label span {
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-dark);
    border-radius: 3px;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
}

.trait-desc {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Goals Selection */
.goals-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.goal-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.goal-item:hover {
    border-color: var(--accent-blue);
    background: var(--bg-panel-hover);
}

.goal-item.selected {
    border-color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.1);
}

.goal-item .goal-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.goal-item .goal-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Start Button */
.btn-primary {
    padding: 14px 24px;
    border: none;
    background: var(--accent-gold);
    color: var(--bg-dark);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn-primary:hover {
    background: #ffed4a;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Panel Content Styles
   ======================================== */

/* Player Info */
#player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-stat {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.player-stat .label {
    color: var(--text-secondary);
}

.player-stat .value {
    color: var(--text-primary);
}

/* Location Info */
#location-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.location-type {
    color: var(--accent-purple);
    font-size: 11px;
    text-transform: uppercase;
}

.location-desc {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

/* NPCs List */
#npcs-here-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.npc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.npc-item:hover {
    background: var(--bg-panel-hover);
}

.npc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.npc-info {
    flex: 1;
    min-width: 0;
}

.npc-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.npc-occupation {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Actions List */
#actions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-btn {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
    font-size: 13px;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-panel-hover);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn .action-time {
    float: right;
    color: var(--text-secondary);
    font-size: 11px;
    background: var(--bg-panel);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Journal Modal */
.journal-entries {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.journal-day {
    margin-bottom: 16px;
}

.journal-day-header {
    font-weight: bold;
    color: var(--accent-blue);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: var(--bg-panel);
}

.journal-day-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.journal-entry {
    display: grid;
    grid-template-columns: 50px 120px 1fr;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-size: 12px;
}

.journal-time {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.journal-location {
    color: var(--accent-gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.journal-text {
    color: var(--text-primary);
}

.journal-entry.event-travel .journal-text { color: var(--accent-blue); }
.journal-entry.event-trade .journal-text { color: var(--accent-green); }
.journal-entry.event-social .journal-text { color: var(--accent-purple); }
.journal-entry.event-danger .journal-text { color: var(--accent-red); }

/* ========================================
   Activity Panel
   ======================================== */

#activity-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.panel-header h3 {
    margin: 0;
}

.btn-icon {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-panel-hover);
    color: var(--accent-blue);
}

.btn-icon.active {
    color: var(--accent-blue);
}

/* Activity Filters */
.filters-container {
    background: var(--bg-dark);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.filter-group {
    margin-bottom: 10px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.filter-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 12px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.filter-chip {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--bg-dark);
}

/* Activity Stats */
#activity-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--bg-dark);
    border-radius: 6px;
}

.stat-mini {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-mini .stat-icon {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.stat-mini span:not(.stat-icon) {
    color: var(--accent-blue);
    font-weight: 600;
}

/* Activity Feed */
#activity-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
}

.activity-item {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-size: 11px;
    animation: fadeIn 0.3s ease;
    border-left: 3px solid transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.activity-item.type-travel { border-left-color: var(--accent-blue); }
.activity-item.type-work { border-left-color: var(--accent-green); }
.activity-item.type-social { border-left-color: var(--accent-purple); }
.activity-item.type-trade { border-left-color: var(--accent-gold); }
.activity-item.type-rest { border-left-color: var(--text-secondary); }

.activity-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    color: var(--text-primary);
    line-height: 1.3;
}

.activity-text .npc-name {
    color: var(--accent-blue);
    font-weight: 500;
}

.activity-text .location-name {
    color: var(--accent-gold);
}

.activity-text .amount {
    color: var(--accent-green);
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-secondary);
}

.activity-location {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    flex-shrink: 0;
}

/* Pause indicator */
.activity-paused {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ========================================
   Scrollbar
   ======================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   Utility
   ======================================== */

.hidden {
    display: none !important;
}

.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-purple { color: var(--accent-purple); }

/* ========================================
   Character Modal Status
   ======================================== */

.character-status {
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}

.character-status.status-here {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.character-status.status-away {
    background: rgba(136, 136, 170, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(136, 136, 170, 0.3);
}

/* Location display */
.location-name-large {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-gold);
    margin: 4px 0;
}

.location-type {
    font-size: 12px;
    color: var(--text-secondary);
}

.travel-progress {
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent-blue);
}

/* Activity item importance */
.activity-item.important {
    background: rgba(255, 215, 0, 0.1);
    border-left: 2px solid var(--accent-gold);
}

.activity-item.known-person {
    background: rgba(74, 158, 255, 0.08);
}

.activity-item .activity-location-badge {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 3px;
    font-size: 10px;
    margin-left: 4px;
}

/* ========================================
   Population Table Modal
   ======================================== */

.population-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.population-filters input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 13px;
}

.population-filters input[type="text"]:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.population-filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 12px;
    min-width: 120px;
}

.population-stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.population-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.population-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.population-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-panel);
    z-index: 1;
}

.population-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.population-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.population-table th.sortable:hover {
    color: var(--accent-blue);
}

.population-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.population-table tr.npc-row {
    cursor: pointer;
    transition: background 0.2s;
}

.population-table tr.npc-row:hover {
    background: var(--bg-panel-hover);
}

.npc-name-cell {
    font-weight: 500;
    color: var(--accent-blue);
}

/* Wealth classes */
.wealth-high {
    color: var(--accent-gold);
    font-weight: 600;
}

.wealth-medium {
    color: var(--accent-green);
}

.wealth-low {
    color: var(--text-secondary);
}

/* State classes */
.state-idle {
    color: var(--text-secondary);
}

.state-traveling {
    color: var(--accent-blue);
}

.state-working {
    color: var(--accent-green);
}

.state-socializing {
    color: var(--accent-purple);
}

.state-resting {
    color: var(--text-secondary);
    font-style: italic;
}

.state-trading {
    color: var(--accent-gold);
}

/* ========================================
   Personality Bars
   ======================================== */

.personality-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.personality-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.personality-bar-item .bar-label {
    width: 100px;
    font-size: 11px;
    color: var(--text-secondary);
}

.personality-bar-item .bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.personality-bar-item .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.personality-bar-item .bar-value {
    width: 30px;
    text-align: right;
    font-size: 11px;
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

.attitude-display {
    font-size: 16px;
    font-weight: 600;
    padding: 8px 0;
}

/* ========================================
   Talk NPC List
   ======================================== */

.talk-npc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 12px;
}

.talk-npc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.talk-npc-item:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent-blue);
}

.talk-npc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.talk-npc-info {
    flex: 1;
    min-width: 0;
}

.talk-npc-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.talk-npc-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.talk-npc-relation {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

/* ========================================
   Enhanced Contacts List
   ======================================== */

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
}

.contact-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.contact-item:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent-blue);
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.contact-main {
    flex: 1;
    min-width: 0;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.contact-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.contact-occupation {
    font-size: 11px;
    color: var(--text-secondary);
}

.contact-opinion-bar {
    height: 6px;
    background: var(--bg-panel);
    border-radius: 3px;
    position: relative;
    margin-bottom: 6px;
}

.contact-opinion-bar .opinion-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.contact-opinion-bar .opinion-fill.opinion-positive {
    background: linear-gradient(90deg, var(--accent-green), #81c784);
}

.contact-opinion-bar .opinion-fill.opinion-neutral {
    background: linear-gradient(90deg, var(--text-secondary), #aaa);
}

.contact-opinion-bar .opinion-fill.opinion-negative {
    background: linear-gradient(90deg, #e57373, var(--accent-red));
}

.contact-opinion-bar .opinion-marker {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 10px;
    background: var(--text-secondary);
    transform: translateX(-50%);
}

.contact-details {
    display: flex;
    gap: 6px;
    font-size: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.contact-location {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   Energy & Survival System
   ======================================== */

.player-energy {
    padding: 8px;
    background: var(--bg-dark);
    border-radius: 6px;
    margin: 4px 0;
}

.energy-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.energy-header .label {
    color: var(--text-secondary);
}

.energy-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.energy-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.exhaustion-warning {
    margin-top: 8px;
    padding: 6px 10px;
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.3), rgba(244, 67, 54, 0.1));
    border: 1px solid var(--accent-red);
    border-radius: 4px;
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.energy-warning-box {
    padding: 10px 12px;
    background: linear-gradient(90deg, rgba(255, 152, 0, 0.2), rgba(255, 152, 0, 0.05));
    border: 1px solid #ff9800;
    border-radius: 6px;
    color: #ff9800;
    font-size: 12px;
    margin-bottom: 10px;
    text-align: center;
}

/* Death Notice */
.death-notice {
    text-align: center;
    padding: 20px;
}

.death-notice p {
    font-size: 18px;
    color: var(--accent-red);
    margin-bottom: 16px;
}

.death-notice .action-btn {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    font-weight: 600;
}

.death-notice .action-btn:hover {
    background: #e53935;
}

/* Death Modal */
.death-modal-content {
    text-align: center;
    padding: 20px;
}

.death-modal-content .death-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.death-modal-content h2 {
    color: var(--accent-red);
    margin-bottom: 12px;
}

.death-modal-content .death-cause {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.death-modal-content .death-stats {
    background: var(--bg-dark);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.death-modal-content .death-stats h4 {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 12px;
    text-transform: uppercase;
}

.death-modal-content .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.death-modal-content .stat-row .label {
    color: var(--text-secondary);
}

.death-modal-content .btn-restart {
    padding: 12px 32px;
    background: var(--accent-blue);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.death-modal-content .btn-restart:hover {
    background: #6ab0ff;
    transform: translateY(-2px);
}

/* ========================================
   Trade / Market System
   ======================================== */

.trade-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 16px;
}

.trade-header .label {
    color: var(--text-secondary);
    font-size: 12px;
}

.trade-header .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-gold);
}

.trade-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.trade-tab {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.trade-tab:hover {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
}

.trade-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.trade-content {
    max-height: 400px;
    overflow-y: auto;
}

.trade-category {
    margin-bottom: 16px;
}

.trade-category h4 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.trade-goods {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-good-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    transition: background 0.2s;
}

.trade-good-item:hover {
    background: var(--bg-panel-hover);
}

.trade-good-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.trade-good-name {
    font-size: 13px;
    font-weight: 500;
}

.trade-good-qty {
    color: var(--text-secondary);
    font-size: 12px;
}

.trade-good-supply {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.trade-good-supply.supply-high {
    background: rgba(76, 175, 80, 0.2);
    color: var(--accent-green);
}

.trade-good-supply.supply-mid {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.trade-good-supply.supply-low {
    background: rgba(244, 67, 54, 0.2);
    color: var(--accent-red);
}

.trade-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
}

.trade-tag.produced {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent-green);
}

.trade-tag.consumed {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
}

.trade-good-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 80px;
}

.buy-price {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 14px;
}

.sell-price {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 14px;
}

.trade-profit {
    font-size: 11px;
}

.trade-profit.profit-positive {
    color: var(--accent-green);
}

.trade-profit.profit-negative {
    color: var(--accent-red);
}

.btn-trade {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-trade.btn-buy {
    background: var(--accent-blue);
    color: white;
}

.btn-trade.btn-buy:hover:not(.disabled) {
    background: #6ab0ff;
}

.btn-trade.btn-sell {
    background: var(--accent-green);
    color: white;
}

.btn-trade.btn-sell:hover {
    background: #66bb6a;
}

.btn-trade.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.text-center {
    text-align: center;
    padding: 20px;
}

/* ========================================
   Inventory Modal
   ======================================== */

.inventory-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.inventory-stat {
    background: var(--bg-dark);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.inventory-stat .label {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.inventory-stat .value {
    font-size: 16px;
    font-weight: 600;
}

.inventory-stat .value.credits {
    color: var(--accent-gold);
}

.inventory-stat .value.fortune {
    color: var(--accent-blue);
}

.cargo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cargo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 6px;
}

.cargo-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cargo-name {
    font-weight: 500;
}

.cargo-qty {
    color: var(--text-secondary);
    font-size: 12px;
}

.cargo-value {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   Galactic Markets modal (GDD § 65, v0.30)
   ========================================
   Three internal views — Par lieu · Par bien · Routes. Each opens via
   tabs under the hub bar. Shared atoms : .market-tag, .market-num, and
   the price-good/bad chips reused across views. */

.market-view-tabs {
    display: flex;
    gap: 4px;
    margin: 8px 0 14px 0;
    border-bottom: 1px solid #2a3548;
}

.market-view-tab {
    background: transparent;
    border: none;
    color: #8a96aa;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.market-view-tab:hover { color: #b0bcd0; }

.market-view-tab.active {
    color: #dfe6f0;
    border-bottom-color: #4a9eff;
    font-weight: 600;
}

.market-tier-chip {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
}

.market-tier-chip.market-tier-public {
    background: rgba(138, 150, 170, 0.18);
    color: #8a96aa;
}

.market-tier-chip.market-tier-premium {
    background: rgba(74, 158, 255, 0.2);
    color: #6db1ff;
}

.market-tier-chip.market-tier-direct,
.market-tier-chip.market-tier-orionum_direct {
    background: rgba(255, 200, 80, 0.18);
    color: #ffc850;
}

/* ─── Shared atoms ─────────────────────────────────────────────── */

.market-tag {
    display: inline-block;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.market-num { text-align: right; font-variant-numeric: tabular-nums; }

.tag-produced { background: rgba(76, 175, 80, 0.2);  color: var(--accent-green); }
.tag-consumed { background: rgba(74, 158, 255, 0.2); color: var(--accent-blue);  }

.price-good { color: var(--accent-green); }
.price-bad  { color: var(--accent-red);   }

/* ─── View : Par lieu ──────────────────────────────────────────── */

.market-location-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.market-location-select {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}

.market-nav-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.market-nav-btn:hover {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.4);
}

.market-location-card {
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 14px;
}

.market-location-card.player-here {
    border-color: rgba(74, 158, 255, 0.4);
    background: linear-gradient(180deg, rgba(74, 158, 255, 0.08), rgba(14, 20, 32, 0.4));
}

.market-location-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.market-location-head h3 { margin: 0; color: var(--accent-gold); }

.market-location-system {
    font-size: 12px;
    color: var(--text-secondary);
}

.market-location-specs {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 12px;
    margin: 0;
    font-size: 12px;
}

.market-location-specs dt {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.market-location-specs dd { margin: 0; color: var(--text-primary); }

.market-goods-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.market-goods-table th,
.market-goods-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-color);
}

.market-goods-table th {
    background: var(--bg-panel);
    text-align: left;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.market-goods-table th.market-num,
.market-goods-table td.market-num { text-align: right; }

.market-good-name { font-weight: 500; }

/* ─── View : Par bien ──────────────────────────────────────────── */

.market-good-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.market-good-filters select {
    padding: 8px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    min-width: 180px;
    font-family: inherit;
}

.market-good-baseline {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
}

.market-good-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.market-good-column h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.market-good-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.market-good-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.market-good-row.player-here {
    border-color: rgba(74, 158, 255, 0.4);
    background: rgba(74, 158, 255, 0.08);
}

.market-good-row-loc { display: flex; flex-direction: column; }

.market-good-row-name {
    font-weight: 500;
    font-size: 13px;
}

.market-good-row-sys {
    font-size: 10.5px;
    color: var(--text-secondary);
}

.market-good-row-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-good-row-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.market-good-row-diff {
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
}

.market-good-row-diff.price-good { background: rgba(76, 175, 80, 0.18); }
.market-good-row-diff.price-bad  { background: rgba(244, 67, 54, 0.18); }

.market-opportunity {
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
}

.market-opportunity h4 { margin: 0 0 6px 0; color: var(--accent-gold); }
.market-opportunity .profit { color: var(--accent-green); font-weight: 600; }

/* ─── View : Routes ────────────────────────────────────────────── */

.market-routes-locked {
    text-align: center;
    padding: 32px 24px;
    background: var(--bg-dark);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
}

.market-routes-locked-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.market-routes-locked h3 {
    margin: 0 0 12px 0;
    color: var(--accent-gold);
}

.market-routes-locked-tiers {
    list-style: none;
    padding: 0;
    margin: 16px auto;
    max-width: 480px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.market-routes-locked-tiers li {
    padding: 8px 12px;
    background: var(--bg-panel);
    border-left: 3px solid rgba(255, 200, 80, 0.5);
    border-radius: 4px;
    font-size: 13px;
}

.market-routes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.market-routes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.market-route-card {
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.market-route-card.market-route-top {
    border-color: rgba(255, 200, 80, 0.5);
    background: linear-gradient(180deg, rgba(255, 200, 80, 0.06), rgba(14, 20, 32, 0.4));
}

.market-route-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.market-route-rank {
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 28px;
}

.market-route-good {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.market-route-profit {
    color: var(--accent-green);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.market-route-path {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    margin-bottom: 8px;
}

.market-route-from,
.market-route-to {
    padding: 3px 8px;
    background: var(--bg-panel);
    border-radius: 4px;
}

.market-route-arrow {
    color: var(--accent-blue);
    font-weight: 700;
}

.market-route-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0;
    font-size: 12px;
}

.market-route-stats > div {
    background: var(--bg-panel);
    padding: 6px 8px;
    border-radius: 4px;
}

.market-route-stats dt {
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.market-route-stats dd {
    margin: 2px 0 0 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.market-route-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.market-routes-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary);
}

/* ========================================
   Subscriptions hub (Comms → 💳 Abonnements)
   ======================================== */

.subscriptions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 12px 0;
}

@media (min-width: 720px) {
    .subscriptions-grid { grid-template-columns: 1fr 1fr; }
}

.subscription-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
}

.subscription-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.subscription-card-icon {
    font-size: 24px;
    line-height: 1;
}

.subscription-card-head h3 { margin: 0; color: var(--accent-gold); font-size: 16px; }

.subscription-card-pitch {
    margin: 4px 0 0 0;
    font-size: 12px;
    line-height: 1.4;
}

.subscription-tiers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-tier {
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.subscription-tier-current {
    border-color: rgba(255, 200, 80, 0.5);
    background: linear-gradient(180deg, rgba(255, 200, 80, 0.06), var(--bg-panel));
}

.subscription-tier-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.subscription-tier-name { font-weight: 600; font-size: 13px; }

.subscription-tier-price {
    font-size: 12px;
    color: var(--accent-gold);
    font-variant-numeric: tabular-nums;
}

.subscription-tier-pitch {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.subscription-tier-current-label {
    margin: 0;
    font-size: 11px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.subscription-tier-switch {
    width: 100%;
    padding: 6px;
    font-size: 12px;
}

.subscriptions-soon {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

.subscriptions-soon h4 {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.subscriptions-soon ul {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.subscriptions-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--bg-panel);
    border-radius: 6px;
    border-left: 3px solid var(--accent-gold);
}

.subscriptions-monthly-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.subscriptions-monthly-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-gold);
    font-variant-numeric: tabular-nums;
}

/* ─── Comms → Actualités tab (§ 64.3.c, v0.35) ───────────────────── */

.news-empty {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-secondary);
    font-style: italic;
}

.news-locked {
    background: var(--bg-dark);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    font-style: normal;
}

.news-locked h3 {
    margin: 0 0 12px 0;
    color: var(--accent-gold);
    font-style: normal;
}

.news-actions {
    display: flex;
    justify-content: flex-end;
    margin: 8px 0;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 540px;
    overflow-y: auto;
    padding-right: 4px;
}

.news-card {
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-left: 3px solid #4a9eff;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.news-card:hover { background: rgba(74, 158, 255, 0.06); }
.news-card.news-unread { background: rgba(74, 158, 255, 0.06); }

.news-card-factual { border-left-color: #4a9eff; }
.news-card-upbeat  { border-left-color: #4caf50; }
.news-card-scandal { border-left-color: #ffd166; }
.news-card-leak    { border-left-color: #b07eec; }

.news-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.news-card-icon { font-size: 16px; line-height: 1; }

.news-card-kind {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 600;
}

.news-card-dot {
    color: #4a9eff;
    font-size: 11px;
    margin-left: auto;
}

.news-card-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #f0f4fa;
    font-weight: 600;
}

.news-card-body {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.subscriptions-next-billing {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.next-billing-due {
    color: var(--accent-red);
    font-weight: 700;
}

/* ========================================
   Travel Modal
   ======================================== */

.travel-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 16px;
}

.travel-header .label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-right: 8px;
}

.travel-header .value {
    font-weight: 600;
}

.travel-header .value.credits {
    color: var(--accent-gold);
}

/* Travel modal CSS — see the single-column refactor block lower in this
 * file (search `Travel modal — refactored Phase 2.1`). The legacy 3-column
 * grid block that sat here was removed in the layout-bug fix : it shared
 * the same selectors as the refactored block (style.css ≈4400) and was
 * the indirect cause of clipping on long location names. */

/* ========================================
   Pause Active — bandeau & action en cours
   (GDD § 36, § 62.4.4, § 62.4.5)
   ======================================== */

#pause-banner {
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.12), rgba(255, 215, 0, 0.12));
    border-bottom: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    animation: pause-banner-glow 2s ease-in-out infinite;
}

#pause-banner.hidden {
    display: none;
}

.pause-banner-icon {
    font-size: 16px;
}

.pause-banner-label {
    color: var(--text-secondary);
}

.pause-banner-reason {
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
}

.pause-banner-btn {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pause-banner-btn:hover {
    background: #ffea7a;
}

@keyframes pause-banner-glow {
    0%, 100% { box-shadow: inset 0 0 0 rgba(255, 215, 0, 0); }
    50% { box-shadow: inset 0 -2px 8px rgba(255, 215, 0, 0.25); }
}

/* Current action block inside the actions panel */
.current-action {
    background: var(--bg-panel-hover);
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.current-action-label {
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.current-action-progress {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.current-action-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    transition: width 0.3s ease-out;
}

.current-action-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-align: right;
}

/* ========================================
   Sauvegardes (GDD § 62.4.7)
   ======================================== */

.saves-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.save-slot {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--bg-panel);
    transition: border-color 0.15s;
}

.save-slot:hover {
    border-color: var(--accent-blue);
}

.save-slot.empty {
    opacity: 0.7;
}

.save-slot.corrupt {
    border-color: var(--accent-red);
    background: rgba(244, 67, 54, 0.06);
}

.save-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.save-slot-name {
    font-weight: 600;
    color: var(--accent-blue);
}

.save-slot-meta {
    color: var(--text-secondary);
    font-size: 12px;
}

.save-slot-state {
    color: var(--text-secondary);
    font-size: 11px;
    font-style: italic;
}

.save-slot-times {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    font-size: 12px;
    font-family: var(--font-mono);
}

.save-slot-gametime {
    color: var(--accent-gold);
}

.save-slot-realtime {
    color: var(--text-secondary);
}

.save-slot-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-save-act {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-save-act:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
    border-color: var(--accent-blue);
}

.btn-save-act.danger:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.saves-io {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* ========================================
   Epitaph modal — GDD § 63.4.4 proof point
   ======================================== */

.epitaph-modal-content {
    text-align: center;
    padding: 16px 8px;
}

.epitaph-icon {
    font-size: 64px;
    margin-bottom: 8px;
    filter: grayscale(20%);
}

.epitaph-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 12px 0 24px 0;
}

.epitaph-name {
    font-size: 22px;
    color: var(--accent-gold);
    font-weight: 600;
}

.epitaph-age {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.epitaph-paragraphs {
    text-align: left;
    max-width: 540px;
    margin: 0 auto 24px auto;
    line-height: 1.6;
    color: var(--text-primary);
}

.epitaph-paragraphs p {
    margin-bottom: 10px;
    font-size: 14px;
}

.epitaph-paragraphs p:first-child {
    font-size: 15px;
    color: var(--accent-gold);
}

.epitaph-stats {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 16px;
    max-width: 400px;
    margin: 0 auto 24px auto;
}

.epitaph-stats h4 {
    text-align: center;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.epitaph-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.epitaph-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-restart {
    background: var(--accent-blue);
    color: var(--bg-dark);
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-restart:hover {
    background: #6ab0ff;
}

/* ─── Dialogue scene (GDD § 63.4.5 — DialogueEngine v0) ───────────── */

.dialogue-scene {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 360px;
}

.dialogue-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a3548;
}

.dialogue-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.dialogue-header-info h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.dialogue-header-info p {
    margin: 0;
    font-size: 13px;
}

.dialogue-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    min-height: 80px;
    max-height: 280px;
    overflow-y: auto;
}

.dialogue-empty-hint {
    font-style: italic;
    padding: 24px 8px;
    text-align: center;
}

/* ── Beat history cards (one per topic pick) ─────────────────────── */

.dialogue-beat {
    background: #1a2233;
    border-left: 3px solid #6cb6ff;
    padding: 12px 14px;
    border-radius: 4px;
}

.dialogue-beat.dialogue-tone-pos    { border-left-color: #4caf50; }
.dialogue-beat.dialogue-tone-dark   { border-left-color: #b07eec; }
.dialogue-beat.dialogue-tone-tendre { border-left-color: #ec7eb5; }
.dialogue-beat.dialogue-tone-dur    { border-left-color: #e05050; }
.dialogue-beat.dialogue-tone-neu    { border-left-color: #6cb6ff; }

.dialogue-beat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #8a96aa;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dialogue-beat-topic {
    font-weight: 600;
    color: #b0bcd0;
}

.dialogue-beat-tone {
    font-style: italic;
}

.dialogue-beat-text {
    margin: 0;
    line-height: 1.5;
    color: #dfe6f0;
    font-size: 13px;
}

/* ── Modal scaffolding (header, history, controls) ───────────────── */

.dialogue-controls {
    margin-top: auto;
    border-top: 1px solid #2a3548;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dialogue-actes-remaining {
    margin: 0;
    font-size: 12px;
    color: #8a96aa;
    text-align: center;
}

.dialogue-picker-title {
    margin: 4px 0 6px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a0acc0;
}

.dialogue-finish-btn {
    margin-top: 4px;
}

.dialogue-finished-hint,
.dialogue-empty-hint {
    font-style: italic;
    text-align: center;
    padding: 12px 4px;
    color: #8a96aa;
}

/* ── Topic chip grid (Sims-style picker) ─────────────────────────── */

.dialogue-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.dialogue-topic-chip {
    background: #1f2a3d;
    border: 1px solid #2e3a52;
    border-left-width: 3px;
    color: #dfe6f0;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
    font-family: inherit;
}

.dialogue-topic-chip:hover {
    background: #283449;
    border-color: #4a9eff;
}

.dialogue-topic-chip:active {
    transform: translateY(1px);
}

.dialogue-topic-icon {
    font-size: 16px;
    line-height: 1;
}

.dialogue-topic-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
}

.dialogue-topic-cat {
    font-size: 10px;
    color: #8a96aa;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Category accent on the left border of each chip — keeps the grid readable
   at a glance and signals what kind of move the player is about to make. */
.dialogue-topic-chip.dialogue-cat-connaitre   { border-left-color: #6cb6ff; }
.dialogue-topic-chip.dialogue-cat-bavarder    { border-left-color: #8a96aa; }
.dialogue-topic-chip.dialogue-cat-approfondir { border-left-color: #ec7eb5; }
.dialogue-topic-chip.dialogue-cat-sonder      { border-left-color: #b07eec; }
.dialogue-topic-chip.dialogue-cat-confronter  { border-left-color: #e05050; }
.dialogue-topic-chip.dialogue-cat-affecter    { border-left-color: #ffd166; }

/* ─── Hub bar (Social · Activités — chantier 2.5) ───────────────────
   Replaces 6 standalone bottom-bar buttons with 2 thematic hubs.
   Each hub's modal prepends this bar so users can pivot between
   sister surfaces (Contacts ↔ Corporations ↔ Factions, etc.)
   without closing the modal. Visually : a slim pill row above the
   modal's own internal tabs so the two layers don't compete. */

.hub-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: -8px -8px 14px -8px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(20, 28, 44, 0.65), rgba(14, 20, 32, 0.4));
    border: 1px solid #1f2a3e;
    border-radius: 8px;
}

.hub-bar-title {
    color: #6b7892;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    flex-shrink: 0;
}

.hub-bar-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.hub-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #8a96aa;
    padding: 5px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    border-radius: 5px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.hub-tab:hover {
    color: #dfe6f0;
    background: rgba(74, 158, 255, 0.08);
}

.hub-tab.active {
    color: #f0f4fa;
    background: rgba(74, 158, 255, 0.18);
    border-color: rgba(74, 158, 255, 0.45);
    font-weight: 600;
    cursor: default;
}

/* ─── Contracts modal (GDD § 39, § 63.4.7) ──────────────────────── */

.contracts-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #2a3548;
    margin: 10px 0 14px 0;
}

.contracts-tab {
    background: transparent;
    border: none;
    color: #8a96aa;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.contracts-tab:hover {
    color: #b0bcd0;
}

.contracts-tab.active {
    color: #dfe6f0;
    border-bottom-color: #4a9eff;
    font-weight: 600;
}

.contracts-content {
    min-height: 200px;
}

.contracts-empty {
    text-align: center;
    padding: 32px 16px;
    font-style: italic;
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contract-card {
    background: #1a2233;
    border: 1px solid #2a3548;
    border-left: 3px solid #4a9eff;
    border-radius: 4px;
    padding: 12px 14px;
}

.contract-card.contract-type-livraison_locale { border-left-color: #4caf50; }
.contract-card.contract-type-filature         { border-left-color: #b07eec; }

.contract-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.contract-type-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #b0bcd0;
}

.contract-issuer {
    font-size: 13px;
    color: #dfe6f0;
    font-weight: 600;
}

.contract-description {
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-size: 13px;
    color: #dfe6f0;
}

.contract-progress {
    background: #232c3d;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 12px;
    color: #b0bcd0;
    margin-bottom: 8px;
}

.contract-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #8a96aa;
    margin-bottom: 8px;
}

.contract-meta strong {
    color: #ffd166;
}

.btn-contract-accept {
    width: 100%;
}

.contract-status {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
}

.contract-status-completed { color: #4caf50; }
.contract-status-failed    { color: #e05050; }
.contract-status-expired   { color: #8a96aa; }

/* Card is clickable — subtle affordance on hover. */
.contract-card {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.contract-card:hover {
    background: #20283a;
    border-color: #4a9eff;
}

/* Detail view */
.contract-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contract-detail-back {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #8a96aa;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    font-size: 13px;
    transition: color 0.15s;
}
.contract-detail-back:hover {
    color: #4a9eff;
}

.contract-detail-header {
    border-left: 3px solid #4a9eff;
    padding-left: 12px;
}
.contract-detail-header.contract-type-livraison_locale { border-left-color: #4caf50; }
.contract-detail-header.contract-type-filature         { border-left-color: #b07eec; }

.contract-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.contract-detail-table tr {
    border-bottom: 1px solid #232a36;
}
.contract-detail-table tr:last-child {
    border-bottom: none;
}
.contract-detail-label {
    padding: 8px 12px 8px 0;
    color: #8a96aa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: 40%;
    vertical-align: top;
}
.contract-detail-value {
    padding: 8px 0;
    color: #dfe6f0;
    font-size: 13px;
    line-height: 1.4;
}
.contract-detail-value strong {
    color: #ffd166;
}

/* Chance bars inside the contract detail (filature risk readout) */
.contract-chances {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}
.chance {
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
}
.chance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chance strong {
    font-weight: 700;
    letter-spacing: 0.2px;
}
.chance-good { background: #1e2e1e; color: #6ec97a; }
.chance-mid  { background: #2e2820; color: #ffd166; }
.chance-bad  { background: #2e1e1e; color: #e05050; }

.contract-chances-precision {
    margin-top: 6px;
    font-size: 11px;
    font-style: italic;
    color: #8a96aa;
    line-height: 1.4;
}

/* Character modal — refused-to-speak banner */
.character-refused-banner {
    background: #2e1e1e;
    border-left: 3px solid #e05050;
    color: #f0c0c0;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Refused-conversation explanation modal */
.refused-modal {
    text-align: center;
    padding: 14px 20px 24px 20px;
}
.refused-modal .refused-icon {
    font-size: 40px;
    margin-bottom: 8px;
}
.refused-modal h2 {
    margin: 0 0 14px 0;
    color: #e05050;
}
.refused-body {
    color: #dfe6f0;
    line-height: 1.55;
    margin: 0 0 20px 0;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Combat scene (GDD § 40, § 63.4.8) ──────────────────────────── */

.combat-scene {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
}

.combat-scene h2 {
    margin: 0;
    color: #e05050;
    letter-spacing: 0.3px;
}

.combat-tense {
    /* subtle red urgency */
    background: linear-gradient(180deg, #281616 0%, #1a2233 60%);
    border-radius: 6px;
    padding: 16px;
}

.combat-intro {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    color: #f0c0c0;
}

.combat-hint {
    margin: 0;
    text-align: center;
    font-size: 11px;
    font-style: italic;
    color: #8a96aa;
}

.combat-choices {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.combat-choice {
    background: #1f2a3d;
    border: 1px solid #2e3a52;
    color: #dfe6f0;
    padding: 14px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
    font-family: inherit;
}

.combat-choice:hover {
    background: #283449;
    border-color: #4a9eff;
}
.combat-choice:active {
    transform: translateY(1px);
}

.combat-choice-confront  { border-left: 3px solid #e05050; }
.combat-choice-flee      { border-left: 3px solid #6cb6ff; }
.combat-choice-negotiate { border-left: 3px solid #ffd166; }

.combat-choice-label {
    font-weight: 700;
    font-size: 15px;
}

.combat-choice-power {
    font-size: 11px;
    align-self: center;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Resolved view */
.combat-resolved {
    background: #1a2233;
    border-radius: 6px;
    padding: 16px;
}

.combat-outcome {
    background: #232c3d;
    border-left: 3px solid #6cb6ff;
    padding: 12px 14px;
    border-radius: 4px;
    line-height: 1.6;
    color: #dfe6f0;
    font-size: 14px;
}

.combat-outcome.combat-outcome-net_victory     { border-left-color: #6ec97a; }
.combat-outcome.combat-outcome-costly_victory  { border-left-color: #ffd166; }
.combat-outcome.combat-outcome-forced_retreat  { border-left-color: #b07eec; }
.combat-outcome.combat-outcome-wound           { border-left-color: #e05050; }
.combat-outcome.combat-outcome-successful_flight    { border-left-color: #6cb6ff; }
.combat-outcome.combat-outcome-failed_flight        { border-left-color: #e05050; }
.combat-outcome.combat-outcome-negotiation_paid     { border-left-color: #ffd166; }
.combat-outcome.combat-outcome-negotiation_failed   { border-left-color: #e05050; }

.combat-effects-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.combat-effect {
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.combat-effect.good { background: #1e2e1e; color: #6ec97a; }
.combat-effect.bad  { background: #2e1e1e; color: #e05050; }

/* ─── Dev toggle in top bar ──────────────────────────────────────── */

.dev-toggle {
    background: transparent;
    border: 1px solid #2a3548;
    color: #b0bcd0;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.dev-toggle:hover {
    background: #283449;
    border-color: #ffd166;
    color: #ffd166;
}

/* ─── Notifications bell (top-bar) ──────────────────────────────── */

.bell-toggle {
    position: relative;
    background: transparent;
    border: 1px solid #2a3548;
    color: #b0bcd0;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bell-toggle:hover {
    background: #283449;
    border-color: #4a9eff;
    color: #4a9eff;
}

.bell-toggle:focus-visible {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

.notif-badge {
    display: inline-block;
    background: #e05050;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    min-width: 16px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.notif-badge.hidden { display: none; }

/* ─── Notifications toasts (top-right, fixed) ───────────────────── */

.notification-toast-container {
    position: fixed;
    /* The right-side activity-feed panel is 280px wide ; we shift the
       toast stack inboard (280 + 12 gutter) so toasts paint over the
       canvas, not over the feed. */
    top: 56px;
    right: 292px;
    /* z-index lives BELOW #modal-overlay (1000) so a forced modal
       (epitaph, contract result, scene) always wins ; the bell modal
       opens through the regular path, so it stays above toasts too. */
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 360px;
    max-width: calc(100vw - 304px);
    /* Cap the stack height so an event burst can't push toasts off
       the viewport silently. Overflow scrolls within the container. */
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    pointer-events: none;
}

.notification-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #1a2231;
    border: 1px solid #2a3548;
    border-left: 4px solid #4a9eff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    color: #dfe6f0;
    /* No row-wide cursor:pointer — the toast body itself only marks
       read on click. Navigation is the explicit "Open" button. */
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.notification-toast-open {
    background: transparent;
    border: 1px solid #4a9eff;
    color: #4a9eff;
    padding: 3px 10px;
    margin-top: 4px;
    font-size: 11.5px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.notification-toast-open:hover {
    background: rgba(74, 158, 255, 0.15);
}

.notification-toast.notification-toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast-success { border-left-color: #4caf50; }
.notification-toast-warning { border-left-color: #ffd166; }
.notification-toast-danger  { border-left-color: #e05050; }

.notification-toast-icon {
    font-size: 18px;
    line-height: 1.1;
    flex-shrink: 0;
}

.notification-toast-content {
    flex: 1;
    min-width: 0;
}

.notification-toast-title {
    font-weight: 600;
    font-size: 13px;
    color: #f0f4fa;
    margin-bottom: 2px;
    line-height: 1.3;
}

.notification-toast-body {
    font-size: 12px;
    color: #b0bcd0;
    line-height: 1.4;
    word-wrap: break-word;
}

.notification-toast-close {
    background: transparent;
    border: none;
    color: #6b7892;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.notification-toast-close:hover { color: #dfe6f0; }

/* ─── Notifications center modal ────────────────────────────────── */

.notifications-actions {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.notifications-actions button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 540px;
    overflow-y: auto;
    padding-right: 4px;
}

.notifications-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-style: italic;
}

.notification-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-left: 3px solid #4a9eff;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}

.notification-row:hover { background: rgba(74, 158, 255, 0.06); }

.notification-row.notification-unread {
    background: rgba(74, 158, 255, 0.06);
}

.notification-row-success { border-left-color: #4caf50; }
.notification-row-warning { border-left-color: #ffd166; }
.notification-row-danger  { border-left-color: #e05050; }

.notification-row-icon {
    font-size: 18px;
    line-height: 1.1;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.notification-row-content { flex: 1; min-width: 0; }

.notification-row-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 2px;
}

.notification-row-title {
    font-weight: 600;
    font-size: 13.5px;
}

.notification-row-when {
    font-size: 10.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.notification-row-body {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-row-link {
    margin-top: 6px;
    background: transparent;
    border: 1px solid #4a9eff;
    color: #4a9eff;
    padding: 3px 10px;
    font-size: 11.5px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.notification-row-link:hover {
    background: rgba(74, 158, 255, 0.15);
}

.notification-row-dot {
    color: #4a9eff;
    font-size: 12px;
    flex-shrink: 0;
    align-self: center;
}

/* ─── Dev modal layout ──────────────────────────────────────────── */

.dev-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dev-modal h2 {
    margin: 0;
    color: #ffd166;
    letter-spacing: 0.3px;
}

.dev-section {
    background: #1a2233;
    border: 1px solid #232a36;
    border-radius: 6px;
    padding: 12px 14px;
}

.dev-section h3 {
    margin: 0 0 10px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #8a96aa;
}

.dev-state-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #dfe6f0;
}

.dev-label {
    color: #8a96aa;
    margin-right: 6px;
}

.dev-cmd {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #232a36;
}
.dev-cmd:first-of-type {
    border-top: none;
    padding-top: 0;
}

.dev-cmd-head {
    flex: 1;
    min-width: 0;
}

.dev-cmd-name {
    display: inline-block;
    background: #232c3d;
    color: #ffd166;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
    margin-bottom: 4px;
}

.dev-cmd-desc {
    margin: 0;
    font-size: 12px;
    color: #b0bcd0;
    line-height: 1.4;
}

.dev-cmd-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.dev-input {
    background: #0e1420;
    border: 1px solid #2a3548;
    color: #dfe6f0;
    padding: 6px 8px;
    border-radius: 3px;
    font-size: 12px;
    width: 110px;
    font-family: inherit;
}

.dev-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
}

.dev-btn-danger {
    background: #4a1a1a;
    color: #f0c0c0;
    border-color: #6e2828;
}
.dev-btn-danger:hover {
    background: #6e2828;
    border-color: #e05050;
}

.dev-npc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dev-npc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #1f2a3d;
    border-radius: 4px;
    font-size: 12px;
}

.dev-npc-name {
    flex: 0 0 auto;
    color: #dfe6f0;
    font-weight: 600;
}

.dev-npc-meta {
    flex: 1;
    font-size: 11px;
}

.dev-npc-actions {
    display: flex;
    gap: 4px;
}

.dev-btn-mini {
    background: #2a3548;
    border: 1px solid #3a455a;
    color: #b0bcd0;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.dev-btn-mini:hover {
    background: #3a455a;
    color: #ffd166;
}

/* ─── Performance section (dev modal) ───────────────────────────── */

.dev-perf-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #dfe6f0;
}
.dev-perf-table th {
    text-align: right;
    color: #8a96aa;
    font-weight: 600;
    padding: 3px 10px;
    border-bottom: 1px solid #232a36;
}
.dev-perf-table th:first-child { text-align: left; }
.dev-perf-table td {
    text-align: right;
    padding: 3px 10px;
}
.dev-perf-table td:first-child { text-align: left; }
.dev-perf-table tbody tr:nth-child(odd) { background: #161d2b; }

.dev-perf-bench-result:not(:empty) {
    margin-top: 10px;
    padding: 10px 12px;
    background: #0e1420;
    border: 1px solid #2a3548;
    border-radius: 5px;
}
.dev-perf-bench-grid { font-family: 'Consolas', 'Monaco', monospace; }

/* ─── Live perf overlay (HUD — F3) ──────────────────────────────── */

.perf-overlay {
    position: fixed;
    top: 44px;
    left: 8px;
    z-index: 900;                 /* below the modal overlay (1000) */
    pointer-events: none;         /* never intercept clicks — pure HUD */
    min-width: 188px;
    padding: 8px 10px;
    background: rgba(10, 14, 22, 0.82);
    border: 1px solid #2a3548;
    border-radius: 6px;
    color: #dfe6f0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    line-height: 1.5;
    backdrop-filter: blur(3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    user-select: none;
}
.perf-overlay.hidden { display: none; }

.perf-overlay-title {
    color: #ffd166;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.perf-overlay-hint {
    color: #5a6678;
    border: 1px solid #2a3548;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 9px;
}
.perf-overlay-row { white-space: nowrap; }
.perf-overlay-row b { color: #fff; }

/* Frame-budget colour cues mirror the FPS thresholds in the snapshot. */
.perf-overlay-row.perf-ok b   { color: #6ee7a8; }   /* < 16.7 ms (60 fps) */
.perf-overlay-row.perf-warn b { color: #ffd166; }   /* < 33 ms (30 fps)   */
.perf-overlay-row.perf-bad b  { color: #ff6b6b; }   /* janky              */

/* ─── Resolution modal (contracts, mirrors combat-resolved) ──────── */

.result-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    padding: 16px 8px 8px 8px;
    text-align: center;
}

.result-modal .result-icon {
    font-size: 40px;
    line-height: 1;
}

.result-modal h2 {
    margin: 0;
    color: #dfe6f0;
}

.result-modal.result-accent-good h2     { color: #6ec97a; }
.result-modal.result-accent-bad h2      { color: #ffd166; }
.result-modal.result-accent-critical h2 { color: #e05050; }

.result-body {
    margin: 0;
    line-height: 1.55;
    font-size: 14px;
    color: #dfe6f0;
    max-width: 520px;
}

.result-effects {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 4px 0 6px 0;
}

.result-chip {
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.result-chip.good     { background: #1e2e1e; color: #6ec97a; }
.result-chip.bad      { background: #2e2820; color: #ffd166; }
.result-chip.critical { background: #2e1e1e; color: #e05050; }

/* ─── Contract cargo warning (Trade sell list) ───────────────────── */

.trade-good-contract {
    border-left: 3px solid #ffd166;
    padding-left: 8px;
}

.cargo-contract-warn {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    background: #2e2820;
    color: #ffd166;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
}

/* ─── Divert confirmation modal ──────────────────────────────────── */

.divert-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    padding: 8px 6px;
    text-align: center;
}

.divert-modal .divert-icon {
    font-size: 36px;
    line-height: 1;
    color: #ffd166;
}

.divert-modal h2 {
    margin: 0;
    color: #ffd166;
}

.divert-body {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #dfe6f0;
    max-width: 520px;
}

.divert-breakdown {
    width: 100%;
    max-width: 460px;
    border-collapse: collapse;
    margin: 6px 0;
}
.divert-breakdown tr {
    border-bottom: 1px solid #232a36;
}
.divert-breakdown tr:last-child { border-bottom: none; }
.divert-breakdown tr.divert-row-delivered {
    background: rgba(108, 182, 255, 0.05);
}
.divert-breakdown tr.divert-row-net {
    background: rgba(255, 209, 102, 0.06);
    font-weight: 600;
}
.divert-label {
    text-align: left;
    padding: 8px 10px 8px 0;
    color: #b0bcd0;
    font-size: 12px;
}
.divert-value {
    text-align: right;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
}
.divert-value.good { color: #6ec97a; }
.divert-value.bad  { color: #e05050; }

.divert-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

/* ─── Feed importance tiers (GDD § 63.4.10) ──────────────────────── */

.activity-item.importance-critical {
    border-left: 3px solid #e05050;
    background: linear-gradient(90deg, rgba(224, 80, 80, 0.08), transparent 60%);
}
.activity-item.importance-high {
    border-left: 3px solid #ffd166;
}
.activity-item.importance-medium {
    border-left: 3px solid #6cb6ff;
}
.activity-item.importance-low {
    border-left: 3px solid transparent;
}
.activity-item.importance-background {
    border-left: 3px solid transparent;
    opacity: 0.7;
}

/* ─── Corporations modal (GDD § 16) ──────────────────────────────── */

.modal-subtitle {
    margin-top: -6px;
    font-size: 12px;
    color: #8a96aa;
}

.corps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.corp-card {
    background: #1a2233;
    border: 1px solid #232a36;
    border-left: 3px solid #4a9eff;
    border-radius: 4px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.corp-card:hover {
    background: #20283a;
    border-color: #4a9eff;
}

.corp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.corp-name {
    font-weight: 700;
    color: #dfe6f0;
    font-size: 14px;
}

.corp-rep-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.corp-rep-bare      { background: #232a36; color: #8a96aa; }
.corp-rep-wary      { background: #2e1e1e; color: #e05050; }
.corp-rep-known     { background: #1e2e1e; color: #6ec97a; }
.corp-rep-insider   { background: #1e2c3e; color: #6cb6ff; }
.corp-rep-confidant { background: #2c1e3e; color: #b07eec; }

.corp-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #8a96aa;
}
.corp-sector {
    color: #b0bcd0;
    font-weight: 600;
}

/* Detail view */
.corp-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.corp-detail-header {
    border-left: 3px solid #4a9eff;
    padding-left: 12px;
}
.corp-detail-header h2 {
    margin: 0 0 6px 0;
}
.corp-detail-meta {
    margin: 0;
    font-size: 12px;
    color: #8a96aa;
}
.corp-detail-rep {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #b0bcd0;
}

.corp-tier-block {
    background: #1a2233;
    border: 1px solid #232a36;
    border-radius: 6px;
    padding: 12px 14px;
}
.corp-tier-block h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #b0bcd0;
}

.corp-tier-block.locked {
    background: #141923;
    border: 1px dashed #2a3548;
    color: #5d6677;
}
.corp-tier-block.locked h3 {
    color: #5d6677;
}
.corp-tier-block.locked .corp-lock-hint {
    margin: 0;
    font-size: 12px;
    font-style: italic;
}

.corp-tier-block.unlocked.corp-tier-known    { border-left: 3px solid #6ec97a; }
.corp-tier-block.unlocked.corp-tier-insider  { border-left: 3px solid #6cb6ff; }
.corp-tier-block.unlocked.corp-tier-confidant { border-left: 3px solid #b07eec; }

.corp-pitch, .corp-signature, .corp-fronts, .corp-secret {
    margin: 0;
    line-height: 1.55;
    font-size: 13px;
    color: #dfe6f0;
}
.corp-secret {
    color: #f0c0c0;
    font-style: italic;
}

.corp-label {
    color: #8a96aa;
    font-size: 12px;
    margin-right: 6px;
}

.corp-exec-list {
    margin: 6px 0 0 0;
    padding-left: 20px;
    font-size: 12px;
    color: #dfe6f0;
}

/* On contract cards : "Au nom de Helix Logistics" */
.contract-corp-line {
    font-size: 11px;
    color: #b0bcd0;
    font-style: italic;
    margin: -4px 0 4px 0;
}

/* ─── Scene activity cards (GDD § 63.4.6 — SceneEngine v0) ───────── */

.activity-item.type-scene {
    background: #1a1f2c;
    border-left-width: 3px;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: 4px;
}

.activity-item.type-scene .scene-icon {
    font-size: 18px;
    line-height: 1;
    padding-top: 2px;
}

.scene-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scene-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #2a3548;
    color: #b0bcd0;
}

.scene-player-tag {
    font-size: 11px;
    color: #ffd166;
    font-weight: 600;
}

.scene-text {
    color: #dfe6f0;
    line-height: 1.5;
    font-size: 13px;
}

/* Per-category accents on the left border + badge tint. */
.activity-item.scene-category-intime {
    border-left-color: #ec7eb5;
}
.activity-item.scene-category-intime .scene-category-badge {
    background: #3a2330;
    color: #ec7eb5;
}

.activity-item.scene-category-sombre {
    border-left-color: #e05050;
}
.activity-item.scene-category-sombre .scene-category-badge {
    background: #3a1f1f;
    color: #e05050;
}

.activity-item.scene-category-macro {
    border-left-color: #ffd166;
}
.activity-item.scene-category-macro .scene-category-badge {
    background: #3a3220;
    color: #ffd166;
}

.activity-item.scene-category-info {
    border-left-color: #6cb6ff;
}
.activity-item.scene-category-info .scene-category-badge {
    background: #1f2c3a;
    color: #6cb6ff;
}

.activity-item.scene-category-orionum {
    border-left-color: #b07eec;
}
.activity-item.scene-category-orionum .scene-category-badge {
    background: #2c1f3a;
    color: #b07eec;
}

.activity-item.scene-category-quotidien {
    border-left-color: #8a96aa;
}
.activity-item.scene-category-quotidien .scene-category-badge {
    background: #232a36;
    color: #b0bcd0;
}

.activity-item.scene-involves-player {
    box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.35);
    background: #20242f;
}

/* ─────────────────────────────────────────────────────────────
 * Factions modal (GDD § 63.6 — Faction v0 alive)
 *
 * Mirror of the corp styling, but the left accent reads --faction-color
 * (set inline from Faction.color) so each card visually carries its
 * faction's identity colour without needing a per-faction class.
 * ───────────────────────────────────────────────────────────── */

.factions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.faction-card {
    background: #1a2233;
    border: 1px solid #232a36;
    border-left: 4px solid var(--faction-color, #4a9eff);
    border-radius: 4px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.faction-card:hover {
    background: #20283a;
    border-color: var(--faction-color, #4a9eff);
}

.faction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.faction-name {
    font-weight: 700;
    color: #dfe6f0;
    font-size: 14px;
}

.faction-rep-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.faction-rep-inconnu      { background: #232a36; color: #8a96aa; }
.faction-rep-sympathisant { background: #1e2e1e; color: #6ec97a; }
.faction-rep-membre       { background: #1e2c3e; color: #6cb6ff; }
.faction-rep-officier     { background: #2c1e3e; color: #b07eec; }

.faction-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #8a96aa;
    align-items: center;
}
.faction-systems {
    color: #b0bcd0;
    font-weight: 600;
}

.faction-hostility {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 600;
}
.faction-hostility-wary    { background: #2e2418; color: #d6a567; }
.faction-hostility-hostile { background: #2e1818; color: #e05050; }

.faction-motto {
    margin: 6px 0 0 0;
    font-size: 12px;
    font-style: italic;
    color: #8a96aa;
}

/* Detail view */
.faction-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faction-detail-header {
    border-left: 3px solid var(--faction-color, #4a9eff);
    padding-left: 12px;
}
.faction-detail-header h2 {
    margin: 0 0 6px 0;
}
.faction-detail-motto {
    margin: 0;
    font-size: 13px;
    color: #b0bcd0;
    font-style: italic;
}
.faction-detail-rep {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #b0bcd0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.faction-tier-block {
    background: #1a2233;
    border: 1px solid #232a36;
    border-radius: 6px;
    padding: 12px 14px;
}
.faction-tier-block h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #b0bcd0;
}
.faction-tier-block.unlocked {
    border-left: 3px solid var(--faction-color, #4a9eff);
}

.faction-tier-block.locked {
    background: #141923;
    border: 1px dashed #2a3548;
    color: #5d6677;
}
.faction-tier-block.locked h3 {
    color: #5d6677;
}
.faction-lock-hint {
    margin: 0;
    font-size: 12px;
    font-style: italic;
}

.faction-desc, .faction-lore, .faction-secret, .faction-territory-list {
    margin: 0;
    line-height: 1.55;
    font-size: 13px;
    color: #dfe6f0;
}
.faction-secret {
    color: #f0c0c0;
    font-style: italic;
}

.faction-tensions {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.faction-tension {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 3px;
    background: #141923;
}
.faction-tension-good    { color: #6ec97a; }
.faction-tension-neutral { color: #b0bcd0; }
.faction-tension-bad     { color: #e08070; }

/* ─────────────────────────────────────────────────────────────
 * Contract route profitability chip (Phase 2.1)
 *
 * Shown on each available-contract card with anticipated travel
 * time / cost / net profit. Colored by margin so the player can
 * scan the missions board for the best deals at a glance.
 * ───────────────────────────────────────────────────────────── */

.contract-route-row {
    margin: 6px 0 4px;
}

.contract-route {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 3px;
    background: #141923;
    color: #b0bcd0;
    border-left: 3px solid #4a9eff;
}
.contract-route-good { border-left-color: #6ec97a; color: #cfe5d0; }
.contract-route-lean { border-left-color: #d6a567; color: #e0cba0; }
.contract-route-loss { border-left-color: #e05050; color: #e8b0b0; }
.contract-route-unknown { border-left-color: #5d6677; color: #8a96aa; font-style: italic; }

/* Detail view route block */
.contract-route-summary {
    padding: 10px 12px;
    border-radius: 4px;
    background: #141923;
    border-left: 3px solid #4a9eff;
    margin-bottom: 8px;
    line-height: 1.5;
}
.contract-route-summary.contract-route-good { border-left-color: #6ec97a; }
.contract-route-summary.contract-route-lean { border-left-color: #d6a567; }
.contract-route-summary.contract-route-loss { border-left-color: #e05050; }

.contract-route-margin {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.contract-route-good-chip { background: #1e2e1e; color: #6ec97a; }
.contract-route-lean-chip { background: #2e2418; color: #d6a567; }
.contract-route-loss-chip { background: #2e1818; color: #e05050; }

.contract-route-legs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.contract-route-legs li {
    font-size: 12px;
    color: #b0bcd0;
    padding: 4px 8px;
    background: #141923;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.route-leg-icon { opacity: 0.85; }
.route-leg-meta {
    margin-left: auto;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #8a96aa;
}

/* ─────────────────────────────────────────────────────────────
 * Activity feed clickable rows + detail modal
 * (Phase 2.1 — feed grew with the 12-system cluster)
 * ───────────────────────────────────────────────────────────── */

.activity-item {
    cursor: pointer;
    transition: background 0.12s ease;
}
.activity-item:hover {
    background: rgba(74, 158, 255, 0.06);
}

.activity-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: #1a2233;
    border-radius: 6px;
    border-left: 3px solid #4a9eff;
}
.activity-detail-header h2 {
    margin: 4px 0 0;
    font-size: 18px;
    color: #dfe6f0;
}
.activity-detail-icon {
    font-size: 28px;
    line-height: 1;
}
.activity-detail-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: #232a36;
    color: #b0bcd0;
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 8px;
}

.activity-detail-scene {
    border-left-width: 4px;
}
.activity-detail-scene.scene-category-intime   { border-left-color: #e09cb8; }
.activity-detail-scene.scene-category-sombre   { border-left-color: #c14a4a; }
.activity-detail-scene.scene-category-macro    { border-left-color: #d6a567; }
.activity-detail-scene.scene-category-info     { border-left-color: #6cb6ff; }
.activity-detail-scene.scene-category-orionum  { border-left-color: #9c70d6; }
.activity-detail-scene.scene-category-quotidien{ border-left-color: #b0bcd0; }

.activity-detail-body {
    font-size: 14px;
    line-height: 1.6;
    color: #dfe6f0;
    padding: 0 4px;
    margin: 0;
}
.activity-detail-scene-text {
    font-style: italic;
    color: #e6e2d4;
}

.activity-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.activity-detail-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #232a36;
    color: #dfe6f0;
}
.activity-detail-table td:first-child {
    color: #8a96aa;
    width: 35%;
    font-size: 12px;
}

.activity-detail-section h3 {
    margin: 4px 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #b0bcd0;
}
.activity-detail-participants {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.activity-detail-npc-link {
    background: #141923;
    border: 1px solid #232a36;
    color: #dfe6f0;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.12s, background 0.12s;
}
.activity-detail-npc-link:hover {
    border-color: #4a9eff;
    background: #1a2233;
}

.activity-detail-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────────
 * Travel modal — single-column card pattern (Phase 2.1 layout fix)
 *
 * The earlier 3-column grid (1fr auto auto) overcommitted the 552 px
 * usable width of #modal-content : `min-width: 110px` on actions +
 * `min-width: 90px` on meta + an icon-name-chip row on a 1fr track
 * with `flex-wrap: wrap` produced unbreakable content that pushed the
 * right side off-canvas. Combined with `overflow: hidden` on
 * .travel-group, the overflow was silently chopped — rows with long
 * location names appeared empty, short ones showed only their name.
 *
 * Fix : single-column card with three stacked rows (header /
 * meta-line / footer with stats + actions), borrowing the corp-card
 * shape that already fits the default modal width comfortably.
 * Headers stick during scroll so the system context never disappears.
 * ───────────────────────────────────────────────────────────── */

.travel-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: #141923;
    border-radius: 6px;
}

.travel-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.travel-control-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a96aa;
    min-width: 70px;
}

.travel-chip-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    /* Let the chip row consume the remaining track inside its control-group
     * so chips flow horizontally and only wrap when truly necessary. */
    flex: 1 1 auto;
    min-width: 0;
}

.travel-chip {
    background: #1a2233;
    border: 1px solid #232a36;
    color: #b0bcd0;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.travel-chip:hover {
    border-color: #4a9eff;
    color: #dfe6f0;
}
.travel-chip.active {
    background: #1e2c3e;
    border-color: #6cb6ff;
    color: #6cb6ff;
    font-weight: 600;
}

.travel-search {
    width: 100%;
    background: #1a2233;
    border: 1px solid #232a36;
    color: #dfe6f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.travel-search:focus {
    outline: none;
    border-color: #6cb6ff;
}

.travel-stats {
    font-size: 11px;
    color: #8a96aa;
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Destination list owns no inner scrollbar — #modal-content already
 * scrolls vertically. Two nested scrollbars hide rows and steal width. */
.travel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: none;
    overflow: visible;
}

.travel-group {
    border: 1px solid #232a36;
    border-radius: 6px;
    overflow: visible;
}

.travel-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1a2233;
    border-bottom: 1px solid #232a36;
    border-radius: 6px 6px 0 0;
    position: sticky;
    top: 0;
    /* z-index 10 keeps the sticky header above any scroll-track artifacts
     * Firefox/macOS render on top of the modal's scrollable content. */
    z-index: 10;
}

.travel-group-system {
    font-weight: 600;
    color: #f4d8a8;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.travel-group-jumps {
    font-size: 11px;
    color: #8a96aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Destination card — 3 stacked rows, single column ───────────── */
.travel-dest {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: #141923;
    border-bottom: 1px solid #1a2233;
    border-left: 3px solid transparent;
    min-width: 0; /* allow ellipsis on overflowing names */
}
.travel-dest:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}
.travel-margin-good    { border-left-color: #6ec97a; }
.travel-margin-loss    { border-left-color: #e05050; }
.travel-margin-unknown { border-left-color: #5d6677; }

/* Row 1 — title (icon + name, ellipsised) ←→ faction chip (anchored right) */
.travel-dest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.travel-dest-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}
.travel-dest-icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}
.travel-dest-name {
    font-weight: 600;
    color: #dfe6f0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.travel-faction-chip {
    flex-shrink: 0;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 3px;
    background: #1a2233;
    color: #b0bcd0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid #232a36;
    white-space: nowrap;
}
.travel-faction-coalition  { color: #6cb6ff; border-color: #2b4566; }
.travel-faction-consortium { color: #d6a567; border-color: #4a3d20; }
.travel-faction-cercle     { color: #b07eec; border-color: #3a2750; }
.travel-faction-clans      { color: #e05050; border-color: #503030; }
.travel-faction-neutral    { color: #8a96aa; border-color: #2a3548; }

/* Row 2 — type · system · via (one muted line, ellipsised if too long) */
.travel-dest-meta-line {
    font-size: 12px;
    color: #8a96aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.travel-dest-meta-sep {
    margin: 0 6px;
    opacity: 0.5;
}
.travel-dest-via {
    color: #d6a567;
    font-style: italic;
}

/* Row 3 — stats (time / cost / jumps) left ←→ action buttons right */
.travel-dest-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.travel-dest-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #b0bcd0;
    /* Allow the stats line to shrink so the action buttons stay on the same
     * row at narrow widths. Without `flex-shrink: 1` + `min-width: 0`, the
     * actions (flex-shrink: 0) would force the stats to overflow and the
     * footer's `flex-wrap: wrap` would push the buttons to a new line. */
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}
.travel-stat-time  { color: #b0bcd0; }
.travel-stat-cost  { color: #f4d8a8; font-weight: 600; }
.travel-stat-cost.insufficient { color: #e05050; }
.travel-stat-jumps {
    font-size: 11px;
    color: #8a96aa;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.travel-dest-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.travel-dest-actions .action-btn {
    padding: 5px 12px;
    font-size: 12px;
    line-height: 1.2;
}
.btn-travel-auto {
    background: #4a9eff;
    color: #ffffff;
    font-weight: 600;
}
.btn-travel-auto:hover:not(:disabled) {
    background: #6cb6ff;
}
.btn-travel-hop {
    background: #1e2c3e;
    color: #6cb6ff;
    border: 1px solid #4a9eff;
    font-weight: 500;
}
.btn-travel-hop:hover:not(:disabled) {
    background: #243749;
}
.btn-travel-auto.disabled,
.btn-travel-hop.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.travel-unreachable {
    font-size: 11px;
    color: #5d6677;
    font-style: italic;
    padding: 4px 0;
}

.travel-empty {
    text-align: center;
    padding: 24px;
    font-style: italic;
}

/* ─────────────────────────────────────────────────────────────
 * NPC profile : Plan section + Recent actions timeline +
 * Follow/Unfollow button (chantier 2.4 — Follow / Comprendre).
 *
 * Plan + timeline are gated by the player following the NPC ; the
 * button toggles it. Marker style ★ added inline on the title +
 * contact rows.
 * ───────────────────────────────────────────────────────────── */

.plan-goal {
    margin: 4px 0 8px;
    font-size: 12px;
}
.plan-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 2px solid #232a36;
    padding-left: 12px;
}
.plan-steps li {
    font-size: 13px;
    line-height: 1.5;
    color: #b0bcd0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.plan-step-marker {
    display: inline-block;
    width: 16px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}
.plan-step-done {
    color: #6ec97a;
    opacity: 0.7;
    text-decoration: line-through;
}
.plan-step-current {
    color: #f4d8a8;
    font-weight: 600;
}
.plan-step-pending {
    color: #8a96aa;
}

.recent-actions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}
.recent-action-row {
    display: grid;
    grid-template-columns: 24px 80px 1fr auto;
    gap: 8px;
    padding: 4px 8px;
    background: #141923;
    border-radius: 3px;
    font-size: 12px;
    color: #b0bcd0;
    align-items: center;
}
.recent-action-row.recent-action-fail {
    color: #c9a0a0;
    background: #1f1414;
}
.recent-action-icon { font-size: 14px; text-align: center; }
.recent-action-kind { color: #dfe6f0; font-weight: 600; }
.recent-action-where {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.recent-action-when {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #8a96aa;
    text-align: right;
}

.btn-follow {
    background: #1e2c3e;
    color: #6cb6ff;
    border: 1px solid #4a9eff;
    font-weight: 500;
}
.btn-follow:hover {
    background: #243749;
}
.btn-following {
    background: #2c1e3e;
    color: #b07eec;
    border: 1px solid #b07eec;
    font-weight: 600;
}
.btn-following:hover {
    background: #3a2750;
}

/* Contacts modal — followed filter visual cue */
.contact-followed {
    border-left: 3px solid #b07eec;
}
.contact-followed .contact-name {
    color: #b07eec;
}

/* ─────────────────────────────────────────────────────────────
 * Contact request status + narrative (GDD § 64.1 — chantier 64.1)
 *
 * Six outcome chips + a one-paragraph narrative line under each.
 * Coloured by the same palette as the rest of the social UI :
 *   warm  → green, cold → blue, ghost → gray, refus_poli → amber,
 *   refus_aggressif / refus_factionnel → red.
 * ───────────────────────────────────────────────────────────── */

.contact-status {
    margin: 12px 0;
    padding: 10px 12px;
    background: #141923;
    border-radius: 4px;
    border-left: 3px solid #232a36;
}
.contact-status .contact-chip {
    display: inline-block;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.contact-chip-accept_warm        { background: #1e2e1e; color: #6ec97a; }
.contact-chip-accept_cold        { background: #1e2c3e; color: #6cb6ff; }
.contact-chip-ghost              { background: #232a36; color: #8a96aa; font-style: italic; }
.contact-chip-refus_poli         { background: #2e2418; color: #d6a567; }
.contact-chip-refus_aggressif    { background: #2e1818; color: #e05050; }
.contact-chip-refus_factionnel   { background: #2e1818; color: #e05050; }

.contact-status .contact-narrative {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #d8d2bf;
    font-style: italic;
}

.btn-contact-request {
    background: #1e2c3e;
    color: #6cb6ff;
    border: 1px solid #4a9eff;
    font-weight: 500;
}
.btn-contact-request:hover:not(:disabled) {
    background: #243749;
}
.btn-in-contact {
    background: #1e2e1e;
    color: #6ec97a;
    border: 1px solid #4d8055;
    font-weight: 600;
    cursor: default;
    opacity: 0.85;
}
.btn-contact-blocked {
    background: #2e1818;
    color: #e05050;
    border: 1px solid #6e2e2e;
    font-weight: 500;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ─────────────────────────────────────────────────────────────
 * NPC interpellation modal (GDD § 28.7) — a curious NPC walks up.
 * Small modal : avatar + name + occupation + one-paragraph opening
 * + three choice buttons. Sober, no chrome ; mirrors the dialogue
 * scene's quiet typography rather than the loud combat tense modal.
 * ───────────────────────────────────────────────────────────── */

.interpellation-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
}
.interpellation-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.interpellation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.interpellation-id h2 {
    margin: 0 0 2px 0;
    font-size: 18px;
    color: #dfe6f0;
}
.interpellation-opening {
    margin: 0;
    line-height: 1.65;
    font-size: 15px;
    color: #d8d2bf;
    font-style: italic;
    padding: 14px 16px;
    background: #141923;
    border-left: 3px solid #6cb6ff;
    border-radius: 0 4px 4px 0;
}
.interpellation-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.interpellation-choice-accept {
    background: #1e2e1e;
    color: #6ec97a;
    border: 1px solid #4d8055;
    font-weight: 600;
    text-align: left;
}
.interpellation-choice-accept:hover {
    background: #243a25;
}
.interpellation-choice-decline {
    background: #232a36;
    color: #b0bcd0;
    border: 1px solid #2f3a4b;
    text-align: left;
}
.interpellation-choice-decline:hover {
    background: #2a3344;
}
.interpellation-choice-ignore {
    background: #2e1818;
    color: #e05050;
    border: 1px solid #5e2828;
    text-align: left;
}
.interpellation-choice-ignore:hover {
    background: #3a1d1d;
}

/* ─────────────────────────────────────────────────────────────
 * Communications hub (GDD § 64.2 — chantier 64.2)
 *
 * Bottom-bar badge for unread + 3-tab modal (Inbox / Outbox / Plan)
 * + thread view + composer.
 * ───────────────────────────────────────────────────────────── */

.comm-badge {
    display: inline-block;
    background: #e05050;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    min-width: 18px;
    text-align: center;
}
.comm-badge.hidden { display: none; }

.comms-tabs {
    display: flex;
    gap: 4px;
    margin: 12px 0;
    border-bottom: 1px solid #232a36;
}
.comms-tab {
    background: transparent;
    border: none;
    color: #8a96aa;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s;
}
.comms-tab:hover { color: #dfe6f0; }
.comms-tab.active {
    color: #6cb6ff;
    border-bottom-color: #6cb6ff;
    font-weight: 600;
}

.comms-content { min-height: 200px; }
.comms-empty {
    text-align: center;
    padding: 32px 16px;
    font-style: italic;
}

.comms-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comms-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: #141923;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s;
    border-left: 3px solid transparent;
}
.comms-row:hover { background: #1a2233; }
.comms-row.comms-unread {
    border-left-color: #6cb6ff;
    background: #16203a;
}
.comms-row.comms-unread .comms-name { color: #6cb6ff; font-weight: 600; }

.comms-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.comms-avatar-lg { width: 52px; height: 52px; font-size: 16px; }

.comms-row-main { flex: 1; min-width: 0; }
.comms-row-line1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.comms-name {
    font-weight: 500;
    color: #dfe6f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comms-time {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #8a96aa;
    flex-shrink: 0;
}
.comms-preview {
    font-size: 12px;
    color: #b0bcd0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comms-row-line2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #8a96aa;
}
.comms-topic { color: #b0bcd0; }

.comms-status {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.comms-status-in_transit     { background: #2e2418; color: #d6a567; }
.comms-status-pending_thought{ background: #1e2c3e; color: #6cb6ff; }
.comms-status-delivered      { background: #1e2e1e; color: #6ec97a; }

/* Thread view */
.comms-thread-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0 18px;
}
.comms-thread-header h2 { margin: 0; }
.comms-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
}
.comms-msg {
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 3px solid #232a36;
    background: #141923;
}
.comms-msg-in { border-left-color: #6cb6ff; }
.comms-msg-out {
    border-left-color: #d6a567;
    background: #1a1a14;
}
.comms-msg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 11px;
}
.comms-msg-sender { font-weight: 600; color: #dfe6f0; font-size: 12px; }
.comms-msg-time { color: #8a96aa; font-family: 'Courier New', monospace; }
.comms-msg-topic {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #b0bcd0;
    margin-bottom: 6px;
}
.comms-msg-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #dfe6f0;
}

.comms-compose-btn {
    background: #1e2c3e;
    color: #6cb6ff;
    border: 1px solid #4a9eff;
    font-weight: 500;
    margin-top: 8px;
}
.comms-compose-btn:hover { background: #243749; }

.comms-composer-info {
    display: flex;
    justify-content: space-between;
    background: #141923;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0 14px;
    font-size: 12px;
    color: #b0bcd0;
}
.comms-composer-latency { font-weight: 600; color: #d6a567; }

/* Plan section */
.comms-plan-intro {
    font-size: 13px;
    color: #b0bcd0;
    margin: 8px 0 16px;
}
.comms-plan-note {
    font-size: 11px;
    font-style: italic;
    margin: 12px 0 0;
}
/* .comms-tier* removed v0.30 — replaced by .subscription-* cards in
   the unified Abonnements tab. Pricing + tiers now live in one model
   (js/social/Subscriptions.js). */

/* ─────────────────────────────────────────────────────────────
 * Intro cinematic (GDD § 63.7 — First Light)
 *
 * Five-beat opening sequence after character creation. Full-screen
 * overlay, deep noir-sci-fi background gradient, sober text reveals.
 * Skippable with Space / Click / Escape (handled in IntroCinematic.js).
 * ───────────────────────────────────────────────────────────── */

#intro-cinematic {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #14122a 0%, #0a0814 60%, #050307 100%);
    color: #e6e2d4;
    font-family: 'Georgia', 'Times New Roman', serif;
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.7s ease-out;
}
#intro-cinematic.intro-fade-in   { opacity: 1; }
#intro-cinematic.intro-fade-out  { opacity: 0; transition: opacity 0.7s ease-in; }

/* Subtle starfield — three layered radial gradients. Pure CSS, no JS, no
 * image asset ; readable on every monitor without burning a lot of paint
 * budget. The animation is a very slow drift to feel "alive without moving". */
.intro-stars {
    position: absolute;
    inset: -50px;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4), transparent 50%),
        radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.3), transparent 50%),
        radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,0.35), transparent 50%),
        radial-gradient(1px 1px at 80% 20%, rgba(255,200,180,0.3), transparent 50%),
        radial-gradient(1.5px 1.5px at 15% 70%, rgba(180,200,255,0.3), transparent 50%),
        radial-gradient(1px 1px at 90% 90%, rgba(255,255,255,0.4), transparent 50%);
    background-size: 600px 600px;
    background-repeat: repeat;
    opacity: 0.45;
    animation: intro-stars-drift 90s linear infinite;
}
@keyframes intro-stars-drift {
    from { transform: translate(0, 0); }
    to   { transform: translate(-300px, -200px); }
}

.intro-stage {
    position: relative;
    z-index: 1;
    width: min(720px, 86vw);
    text-align: center;
    pointer-events: none;
}

.intro-beat {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease-out, transform 1.1s ease-out;
    line-height: 1.7;
    letter-spacing: 0.2px;
    text-wrap: balance;
}
.intro-beat--in {
    opacity: 1;
    transform: translateY(0);
}

/* Per-beat typography — calibrated to feel like opening titles, not paragraphs */
.intro-beat--setting {
    font-size: 22px;
    font-style: italic;
    color: #d8d2bf;
    text-shadow: 0 0 12px rgba(180, 160, 200, 0.2);
}
.intro-beat--origin {
    font-size: 17px;
    color: #d8d2bf;
    max-width: 600px;
    margin: 0 auto;
}
.intro-beat--event {
    font-size: 17px;
    color: #c8b8b0;
    max-width: 600px;
    margin: 0 auto;
    border-left: 2px solid rgba(180, 100, 100, 0.4);
    padding-left: 18px;
    text-align: left;
    animation: intro-event-pulse 4s ease-in-out infinite;
}
@keyframes intro-event-pulse {
    0%, 100% { border-left-color: rgba(180, 100, 100, 0.4); }
    50%      { border-left-color: rgba(220, 120, 120, 0.7); }
}
.intro-beat--motivations {
    font-size: 17px;
    color: #d8d2bf;
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
}
.intro-beat--arrival {
    font-size: 22px;
    color: #e6e2d4;
    font-style: italic;
    text-shadow: 0 0 18px rgba(255, 220, 180, 0.25);
}
.intro-beat--arrival strong {
    display: block;
    margin-top: 14px;
    font-size: 18px;
    color: #f4d8a8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-style: normal;
}

/* Skip hint bottom-right corner — discreet, doesn't fight the text */
.intro-skip-hint {
    position: absolute;
    bottom: 24px;
    right: 32px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(230, 226, 212, 0.4);
    letter-spacing: 0.5px;
    pointer-events: none;
    user-select: none;
}

/* ========================================
   Landing screen (v0.36) — Poiesis brand
   ========================================
   First surface the playtester sees. Sobre / literary tone, brand
   palette, single CTA into character creation. Sits above #app
   until "Commencer" is clicked. */

.landing-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: radial-gradient(ellipse at center,
        #1A2CA3 0%,
        #0F1A6B 40%,
        #060A2E 90%);
    color: var(--poiesis-offwhite);
    font-family: var(--font-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: landing-fade-in 0.4s ease-out;
}

.landing-screen.hidden { display: none; }

@keyframes landing-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.landing-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 23% 17%, rgba(239, 184, 50, 0.4) 50%, transparent 100%),
        radial-gradient(1px 1px at 67% 31%, rgba(246, 246, 243, 0.5) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 12% 78%, rgba(239, 184, 50, 0.3) 50%, transparent 100%),
        radial-gradient(1px 1px at 85% 62%, rgba(246, 246, 243, 0.4) 50%, transparent 100%),
        radial-gradient(2px 2px at 45% 88%, rgba(246, 246, 243, 0.3) 50%, transparent 100%),
        radial-gradient(1px 1px at 91% 12%, rgba(239, 184, 50, 0.5) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 34% 52%, rgba(246, 246, 243, 0.35) 50%, transparent 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
}

.landing-shell {
    position: relative;
    max-width: 720px;
    width: calc(100% - 64px);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.landing-studio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--poiesis-accent);
}

.landing-studio-name { font-weight: 600; }

.landing-lang {
    background: transparent;
    border: 1px solid rgba(246, 246, 243, 0.3);
    color: var(--poiesis-offwhite);
    padding: 4px 12px;
    border-radius: 4px;
    font-family: var(--font-brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.landing-lang:hover {
    border-color: var(--poiesis-accent);
    color: var(--poiesis-accent);
}

.landing-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
}

.landing-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.05;
    margin: 0;
    letter-spacing: -0.01em;
    color: var(--poiesis-offwhite);
}

.landing-tagline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    color: var(--poiesis-accent);
    letter-spacing: 0.04em;
    margin: 0;
}

.landing-pitch {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(246, 246, 243, 0.85);
    margin-top: 8px;
}

.landing-pitch p { margin: 0; }

.landing-pitch em {
    color: var(--poiesis-accent);
    font-style: italic;
    font-weight: 400;
}

.landing-cta {
    align-self: flex-start;
    background: var(--poiesis-accent);
    color: var(--poiesis-ink);
    border: none;
    padding: 14px 38px;
    border-radius: 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 12px;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
    box-shadow: 0 4px 20px rgba(239, 184, 50, 0.25);
}

.landing-cta:hover {
    background: #FFC957;
    transform: translateY(-1px);
    box-shadow: 0 6px 26px rgba(239, 184, 50, 0.4);
}

.landing-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(239, 184, 50, 0.3);
}

.landing-mini-help {
    font-size: 12px;
    color: rgba(246, 246, 243, 0.5);
    margin: 0;
    font-style: italic;
}

.landing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(246, 246, 243, 0.12);
    font-size: 11px;
    color: rgba(246, 246, 243, 0.55);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-display);
}

.landing-alpha-chip {
    color: var(--poiesis-accent);
    font-weight: 600;
}

.landing-signature {
    color: rgba(246, 246, 243, 0.4);
}

@media (max-width: 600px) {
    .landing-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .landing-pitch { font-size: 14px; }
}

/* ========================================
   Feedback FAB (v0.36)
   ======================================== */

.feedback-fab {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 9500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--poiesis-secondary);
    color: var(--poiesis-offwhite);
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--font-brand);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 16px rgba(80, 21, 162, 0.4);
    transition: background 0.15s, transform 0.12s, box-shadow 0.12s;
}

.feedback-fab:hover {
    background: #6B25C9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(80, 21, 162, 0.55);
}

.feedback-fab-icon { font-size: 14px; }

.feedback-fab.hidden { display: none; }

@media (max-width: 480px) {
    .feedback-fab-label { display: none; }
    .feedback-fab { padding: 10px; }
}

/* ========================================
   Help toggle (top-bar) — v0.36
   ======================================== */

.help-toggle {
    background: transparent;
    border: 1px solid #2a3548;
    color: #b0bcd0;
    border-radius: 4px;
    padding: 2px 10px;
    margin: 0 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-brand);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.help-toggle:hover {
    background: rgba(239, 184, 50, 0.12);
    border-color: var(--poiesis-accent);
    color: var(--poiesis-accent);
}

.help-toggle:focus-visible {
    outline: 2px solid var(--poiesis-accent);
    outline-offset: 2px;
}

/* ========================================
   Walkthrough overlay (v0.36)
   ========================================
   Dimmed background + spotlight cutout around the highlighted DOM
   element + floating tip card. Skippable, replayable from the help
   toggle in the top-bar. */

.walkthrough-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    pointer-events: none;
}

.walkthrough-overlay.hidden { display: none; }

.walkthrough-overlay.walkthrough-visible {
    pointer-events: auto;
    animation: walkthrough-fade-in 0.2s ease-out;
}

@keyframes walkthrough-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.walkthrough-dim {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 46, 0.62);
    backdrop-filter: blur(1px);
}

.walkthrough-spotlight {
    position: absolute;
    border: 2px solid var(--poiesis-accent);
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(6, 10, 46, 0.6),
        0 0 24px rgba(239, 184, 50, 0.4);
    pointer-events: none;
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}

.walkthrough-spotlight.no-target { display: none; }

.walkthrough-tip {
    position: absolute;
    max-width: 360px;
    background: var(--poiesis-offwhite);
    color: var(--poiesis-ink);
    border-radius: 10px;
    padding: 18px 20px;
    font-family: var(--font-brand);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    border-left: 4px solid var(--poiesis-accent);
}

.walkthrough-tip-step {
    font-family: var(--font-display);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--poiesis-secondary);
    font-weight: 600;
    margin-bottom: 6px;
}

.walkthrough-tip-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    margin: 0 0 8px 0;
    color: var(--poiesis-primary);
    line-height: 1.25;
}

.walkthrough-tip-body {
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0 0 14px 0;
    color: var(--poiesis-ink);
}

.walkthrough-tip-body strong {
    color: var(--poiesis-primary);
    font-weight: 700;
}

.walkthrough-tip-body em {
    color: var(--poiesis-secondary);
    font-style: italic;
}

.walkthrough-tip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.walkthrough-skip {
    background: transparent;
    border: none;
    color: var(--poiesis-gray);
    font-size: 12px;
    font-family: var(--font-brand);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}

.walkthrough-skip:hover { color: var(--poiesis-ink); }

.walkthrough-next {
    background: var(--poiesis-primary);
    color: var(--poiesis-offwhite);
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s;
}

.walkthrough-next:hover { background: #2841C7; }

