@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --bg-primary: #08101b;
    --bg-secondary: #0d1828;
    --bg-tertiary: #122239;
    --bg-surface: #0f1c2d;
    --bg-elevated: #162944;
    --bg-hover: #1c3352;

    --accent: #3dd8c1;
    --accent-soft: rgba(61, 216, 193, 0.16);
    --accent-glow: rgba(61, 216, 193, 0.28);
    --sun: #ffb84d;
    --sun-soft: rgba(255, 184, 77, 0.16);

    --success: #35d07f;
    --warning: #f2b955;
    --danger: #f06b6b;
    --info: #55a3ff;

    --text-primary: #e6eef8;
    --text-secondary: #9eb0c8;
    --text-muted: #6e829f;

    --border: #213650;
    --border-soft: #1a2b43;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.36);

    --nav-height: 58px;
    --mob-nav-height: 60px;
    --sidebar-width: 246px;
    --sidebar-collapsed: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 16% 0%, rgba(61, 216, 193, 0.18), transparent 30%),
        radial-gradient(circle at 86% 8%, rgba(255, 184, 77, 0.16), transparent 35%),
        linear-gradient(160deg, #07101a 0%, #091425 35%, #0a1528 100%);
    background-attachment: fixed;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: rgba(9, 18, 30, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Centre-pinned communication buttons ──────────────────────────────── */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.nav-comm-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 15px;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.nav-comm-btn:hover,
.nav-comm-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.nav-comm-btn.ringing {
    border-color: var(--success);
    color: var(--success);
    animation: nav-ring-pulse 0.9s ease-in-out infinite;
}

@keyframes nav-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(53, 208, 127, 0.45); }
    50%       { box-shadow: 0 0 0 6px rgba(53, 208, 127, 0); }
}

.nav-comm-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #08101b;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

.nav-comm-badge.visible {
    display: inline-flex;
}

.nav-comm-badge.call {
    background: var(--success);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.brand i {
    color: var(--sun);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.16s ease, color 0.16s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}

.nav-chip {
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    font-family: 'IBM Plex Mono', monospace;
}

.sidebar-toggle {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.app-shell {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    border-right: 1px solid var(--border);
    background: rgba(12, 24, 40, 0.88);
    padding: 14px;
    transition: width 0.2s ease, min-width 0.2s ease;
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    align-self: flex-start;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
    overflow: hidden;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .side-note {
    display: none;
}

.sidebar-section {
    margin-bottom: 18px;
}

.sidebar-title {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1.1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.side-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: rgba(15, 28, 45, 0.7);
}

.main-content {
    flex: 1;
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 34px;
    line-height: 1.04;
    letter-spacing: -0.6px;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.6;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    background: linear-gradient(160deg, rgba(19, 36, 58, 0.94), rgba(12, 23, 38, 0.94));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.card h2,
.card h3 {
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.card p,
.card li {
    color: var(--text-secondary);
    line-height: 1.55;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.kpi {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 12px;
}

.kpi-label {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 23px;
    font-weight: 700;
    color: var(--text-primary);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(17, 31, 50, 0.62);
    margin-right: 6px;
    margin-bottom: 6px;
}

.list-clean {
    list-style: none;
    display: grid;
    gap: 10px;
}

.list-clean li {
    border: 1px solid var(--border-soft);
    background: rgba(13, 25, 41, 0.7);
    border-radius: var(--radius-md);
    padding: 12px;
}

.list-clean strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
}

th {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    background: rgba(14, 24, 38, 0.9);
}

.btn,
button.btn {
    display: inline-block;
    vertical-align: middle;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.btn:hover,
button.btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-glow);
}

.btn-primary {
    background: linear-gradient(130deg, rgba(61, 216, 193, 0.25), rgba(61, 216, 193, 0.1));
    border-color: rgba(61, 216, 193, 0.45);
    color: #cffff8;
}

.btn-primary:hover {
    transform: translateY(-1px);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0a1627;
    color: var(--text-primary);
    padding: 10px 12px;
    font-family: inherit;
}

label {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: var(--sun-soft);
    color: #ffdca7;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid rgba(255, 184, 77, 0.36);
}

.empty-state {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 24px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}

.weather-timestamp {
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
}

.status-good {
    color: var(--success);
}

.status-warn {
    color: var(--warning);
}

.status-bad {
    color: var(--danger);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-cell {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    min-height: 175px;
    background: rgba(10, 22, 36, 0.78);
    color: var(--text-secondary);
    padding: 7px;
}

.calendar-head {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.calendar-empty {
    opacity: 0.45;
}

.calendar-day {
    cursor: default;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.calendar-day:hover {
    border-color: rgba(61, 216, 193, 0.28);
    background: rgba(18, 35, 56, 0.95);
}

.day-num {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.day-num-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

/* Outlook-style named event pills */
.cal-event-pill {
    display: flex;
    align-items: baseline;
    gap: 4px;
    width: 100%;
    text-align: left;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 2px;
    border: none;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: filter 0.12s, outline 0.1s;
    max-width: 100%;
    box-sizing: border-box;
}

.cal-event-pill:hover {
    filter: brightness(1.25);
}

.cal-event-pill.selected {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 1px;
}

.cal-pill-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    opacity: 0.8;
    flex-shrink: 0;
}

.cal-pill-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Category colours */
.cat-activity   { background: rgba(61, 216, 193, 0.2);  color: #cffff8; border-left: 3px solid var(--accent); }
.cat-food       { background: rgba(240, 185, 54, 0.2);  color: #ffe8a0; border-left: 3px solid var(--sun); }
.cat-travel     { background: rgba(94, 169, 255, 0.2);  color: #b8d9ff; border-left: 3px solid #5ea9ff; }
.cat-lodging    { background: rgba(195, 139, 255, 0.2); color: #e5ccff; border-left: 3px solid #c38bff; }
.cat-weather-watch { background: rgba(231, 102, 102, 0.2); color: #ffd0d0; border-left: 3px solid #e76666; }

/* Small category badge (used in detail panel & event list) */
.cal-cat-badge {
    display: inline-block;
    font-size: 10px;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 999px;
}

/* Event detail panel (appears below grid on event click) */
.event-detail-panel {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(14, 27, 44, 0.96);
    padding: 16px;
    animation: fadeSlideIn 0.15s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.event-detail-inner {}

.event-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.event-detail-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.event-detail-close:hover {
    color: var(--text-primary);
}

/* Modal dialog */
dialog#eventModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    padding: 0;
    width: min(560px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.modal-photo-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--bg-tertiary);
}

.modal-photo-img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    object-position: center;
}

.modal-photo-caption {
    padding: 5px 12px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    background: rgba(0,0,0,0.4);
}

.modal-photo-caption a {
    color: var(--text-muted);
}

dialog#eventModal h2,
dialog#eventModal form {
    padding: 20px 24px;
}

dialog#eventModal h2 {
    padding-bottom: 0;
    margin-bottom: 0;
}

dialog#eventModal::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
}

/* ── Dinner Planner ─────────────────────────────────────────────────── */
.dp-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.dp-row:last-child { border-bottom: none; }
.dp-row.dp-today {
    background: rgba(250, 196, 62, 0.06);
    border-radius: var(--radius-sm);
    padding: 11px 8px;
    margin: 0 -8px;
}
.dp-date {
    flex-shrink: 0;
    width: 76px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding-top: 2px;
    line-height: 1.4;
}
.dp-tonight {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 2px;
}
.dp-info { flex: 1; min-width: 0; }
.dp-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.dp-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.dp-rating {
    color: #f0c040;
    font-size: 11px;
    font-weight: 600;
}
.dp-price {
    color: var(--text-muted);
    font-size: 11px;
    font-family: 'IBM Plex Mono', monospace;
}
.dp-tip {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.5;
}
.dp-actions { flex-shrink: 0; padding-top: 2px; }
.btn-sm {
    font-size: 11px;
    padding: 4px 10px;
    white-space: nowrap;
}

.map-canvas {
    width: 100%;
    min-height: 460px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.map-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px;
    margin-bottom: 6px;
}

.map-toolbar-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-bottom: 4px;
}

.map-toolbar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.map-presets,
.map-basemap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.map-preset-btn,
.map-basemap-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.map-preset-btn.active,
.map-basemap-btn.active {
    background: var(--accent-soft);
    border-color: rgba(61, 216, 193, 0.55);
    color: #cffff8;
}

.map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 6px 12px;
}

.map-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: rgba(10, 22, 36, 0.9);
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
}

.map-filter-chip input {
    width: auto;
    accent-color: var(--accent);
}

.map-filter-chip.off {
    opacity: 0.5;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #0d1b2e;
    color: var(--text-primary);
}

.leaflet-container a {
    color: var(--accent);
}

.leaflet-control-zoom a {
    background: rgba(10, 21, 35, 0.92);
    color: var(--text-primary);
    border-color: var(--border);
}

.leaflet-control-zoom a:hover {
    background: rgba(20, 36, 56, 0.92);
}

.surf-highlight-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.surf-highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.surf-highlight-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: rgba(10, 22, 36, 0.68);
    padding: 12px;
}

.surf-highlight-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.surf-highlight-title-row h4 {
    font-size: 18px;
}

.surf-highlight-time {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.surf-highlight-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.surf-metric-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(17, 31, 50, 0.68);
    color: var(--text-primary);
    padding: 5px 10px;
    font-size: 12px;
}

.surf-highlight-spots {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.surf-tag-good {
    color: var(--success);
}

.surf-tag-mid {
    color: var(--warning);
}

.surf-tag-poor {
    color: var(--danger);
}

@media (max-width: 1080px) {
    .nav-links {
        display: none;
    }

    .hero-grid,
    .grid-2,
    .grid-3,
    .kpi-row,
    .surf-highlight-grid,
    .dual-clock-row {
        grid-template-columns: 1fr;
    }
}

/* --- Dual Clock --- */
.dual-clock-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.clock-card {
    background: linear-gradient(160deg, rgba(19, 36, 58, 0.96), rgba(12, 23, 38, 0.96));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    text-align: center;
}

.clock-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.9px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.clock-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 58px;
    font-weight: 500;
    color: var(--accent);
    line-height: 1;
    letter-spacing: 2px;
}

.clock-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* --- History Articles --- */
.history-article {
    margin-bottom: 16px;
    scroll-margin-top: calc(var(--nav-height) + 16px);
}

.history-era-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.history-era-header h2 {
    margin: 0;
}

.history-era-badge {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(61, 216, 193, 0.28);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-article p {
    color: var(--text-secondary);
    line-height: 1.72;
    margin-bottom: 12px;
}

.history-article p:last-of-type {
    margin-bottom: 14px;
}

.history-article em {
    color: var(--sun);
    font-style: italic;
}

.history-article strong {
    color: var(--text-primary);
}

.history-places {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--border-soft);
}

/* --- Calendar today highlight --- */
.calendar-today {
    border-color: rgba(61, 216, 193, 0.55);
    background: rgba(61, 216, 193, 0.06);
}

/* ── Calendar trip range ─────────────────────────────────────────────── */
.cal-trip-start,
.cal-trip-end,
.cal-trip-mid {
    position: relative;
}

.cal-trip-start::before,
.cal-trip-end::before,
.cal-trip-mid::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: var(--radius-sm);
    pointer-events: none;
    z-index: 0;
}

.cal-trip-start::before {
    background: rgba(255, 184, 77, 0.12);
    border: 1px solid rgba(255, 184, 77, 0.5);
}

.cal-trip-end::before {
    background: rgba(255, 184, 77, 0.12);
    border: 1px solid rgba(255, 184, 77, 0.5);
}

.cal-trip-mid::before {
    background: rgba(255, 184, 77, 0.07);
    border: 1px solid rgba(255, 184, 77, 0.2);
}

.cal-trip-start .day-num-row,
.cal-trip-end .day-num-row,
.cal-trip-mid .day-num-row {
    position: relative;
    z-index: 1;
}

.cal-trip-start .day-num,
.cal-trip-end .day-num {
    color: var(--sun);
    font-weight: 700;
}

/* ── Open Now / Closed badges ────────────────────────────────────────── */
.open-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

.open-badge-open {
    background: rgba(53, 208, 127, 0.18);
    color: #35d07f;
    border: 1px solid rgba(53, 208, 127, 0.35);
}

.open-badge-closed {
    background: rgba(240, 107, 107, 0.12);
    color: #f06b6b;
    border: 1px solid rgba(240, 107, 107, 0.3);
}

.open-hours-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    font-style: normal;
}

.open-now-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    display: inline-block;
    margin-left: 8px;
}

/* ── See on Map link ─────────────────────────────────────────────────── */
.btn-map-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(61, 216, 193, 0.3);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 6px;
}

.btn-map-link:hover {
    background: rgba(61, 216, 193, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* table-cell map link: no margin, centered */
td .btn-map-link {
    margin-top: 0;
    justify-content: center;
}

/* ── Trip Pill in top nav ────────────────────────────────────────────── */
.trip-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.3;
}

.trip-pill:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--text-primary);
}

.trip-pill-empty {
    color: var(--text-muted);
    border-style: dashed;
}

.trip-pill-upcoming {
    border-color: rgba(255, 184, 77, 0.4);
    color: var(--sun);
}

.trip-pill-active {
    border-color: rgba(61, 216, 193, 0.5);
    color: var(--accent);
    background: rgba(61, 216, 193, 0.06);
}

.trip-pill-past {
    color: var(--text-muted);
    opacity: 0.7;
}

.trip-pill-dates {
    font-weight: 600;
}

.trip-pill-status {
    font-size: 11px;
    opacity: 0.85;
}

.trip-pill-edit-icon {
    font-size: 10px;
    opacity: 0.5;
    margin-left: 2px;
}

/* ── Trip Countdown KPI tile ─────────────────────────────────────────── */
.kpi-trip {
    border-color: rgba(255, 184, 77, 0.25);
    background: linear-gradient(135deg, var(--bg-surface), rgba(255,184,77,0.05));
    transition: border-color 0.2s;
}

.kpi-trip:hover {
    border-color: rgba(255, 184, 77, 0.5);
}

.kpi-trip .kpi-value {
    font-size: 16px;
    color: var(--sun);
}

/* ── Trip Date Dialog ────────────────────────────────────────────────── */
.trip-date-dialog {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    padding: 28px;
    max-width: 380px;
    width: 92vw;
    box-shadow: var(--shadow-md);
}

.trip-date-dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
}

.trip-date-dialog h2 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.trip-dialog-sub {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.trip-dialog-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 22px;
}

.trip-dialog-fields label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.trip-dialog-fields input[type="date"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 14px;
    font-family: 'Space Grotesk', sans-serif;
    width: 100%;
    color-scheme: dark;
}

.trip-dialog-fields input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
}

.trip-dialog-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.trip-dialog-clear {
    margin-left: auto;
    color: var(--danger);
    border-color: rgba(240, 107, 107, 0.4);
    font-size: 12px;
}

.today-marker {
    display: block;
    font-size: 9px;
    letter-spacing: 0.8px;
    color: var(--accent);
    text-transform: uppercase;
    margin-top: 3px;
    font-family: 'IBM Plex Mono', monospace;
}

/* Month abbreviation shown in day cells on 2-week view */
.day-month-abbr {
    font-size: 9px;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-right: 2px;
}

/* ── Calendar Navigation Bar ─────────────────────────────────────────── */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.cal-month-label {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.cal-nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cal-nav-btn {
    padding: 7px 12px;
    font-size: 13px;
}

/* ── Calendar date-jump input ────────────────────────────────────────── */
.cal-jump-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 9px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.cal-jump-wrap:hover,
.cal-jump-wrap:focus-within {
    border-color: var(--accent);
}

.cal-jump-icon {
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.cal-jump-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Space Grotesk', sans-serif;
    color-scheme: dark;
    width: 120px;
    cursor: pointer;
}

.cal-jump-input::-webkit-calendar-picker-indicator {
    display: none;
}

/* ── Calendar Day State Classes ──────────────────────────────────────── */
.cal-day-selected {
    border-color: var(--accent) !important;
    background: rgba(61, 216, 193, 0.1) !important;
}

.cal-day-has-events .day-num {
    color: var(--accent);
}

.cal-more-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    padding: 1px 2px;
    margin-top: 2px;
    font-family: 'IBM Plex Mono', monospace;
}

.cal-more-btn:hover {
    color: var(--accent);
}

/* Mobile dot indicator (hidden on desktop) */
.cal-day-dot {
    display: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin: 4px auto 0;
}

/* ── Day View Panel ──────────────────────────────────────────────────── */
.day-view-panel {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(14, 27, 44, 0.96);
    padding: 16px 20px;
    animation: fadeSlideIn 0.15s ease;
}

.day-view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.day-view-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
}

.day-view-count {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
}

.day-view-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
}

.day-view-close:hover {
    color: var(--text-primary);
}

.day-event-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.day-event-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
}

.day-event-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 16px;
    padding-top: 4px;
}

.day-event-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid currentColor;
}

.day-event-line {
    width: 2px;
    flex: 1;
    background: var(--border-soft);
    margin-top: 4px;
    min-height: 20px;
}

.day-event-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 4px;
}

.day-event-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.day-event-title {
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.day-event-location {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.day-event-location i {
    color: var(--text-muted);
    font-size: 11px;
}

.day-event-notes {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
    line-height: 1.5;
}

/* ── Mobile Bottom Navigation ────────────────────────────────────────── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mob-nav-height);
    background: rgba(9, 18, 30, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
    z-index: 900;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    transition: color 0.15s ease;
}

.mob-nav-item i {
    font-size: 18px;
}

.mob-nav-item:hover,
.mob-nav-item.active {
    color: var(--accent);
    text-decoration: none;
}

/* Sidebar overlay backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
}

.sidebar-backdrop.visible {
    display: block;
}

/* ── Responsive: 860px breakpoint ────────────────────────────────────── */
@media (max-width: 860px) {
    /* ── Base font size: 16px prevents iOS auto-zoom on input focus ───────── */
    body {
        font-size: 16px;
    }

    /* Inputs MUST be 16px to stop iOS Safari zooming on focus */
    input, select, textarea, .input-field {
        font-size: 16px;
    }

    /* Mobile bottom nav visible */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Main content gets bottom padding to clear the nav bar */
    .main-content {
        padding: 16px 14px calc(var(--mob-nav-height) + 20px);
    }

    /* Sidebar becomes a slide-in overlay */
    .sidebar {
        position: fixed;
        top: var(--nav-height);
        bottom: 0;
        left: 0;
        z-index: 1100;
        width: var(--sidebar-width) !important;
        min-width: var(--sidebar-width) !important;
        transform: translateX(0);
        transition: transform 0.22s ease;
        overflow-y: auto;
    }

    .sidebar.mobile-hidden {
        transform: translateX(-100%);
    }

    /* Hide desktop text chip in top nav on mobile */
    .nav-chip {
        display: none;
    }

    /* ── Touch-friendly top nav hit areas (44px Apple HIG minimum) ─────────── */
    .nav-comm-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .faves-nav-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .sidebar-toggle {
        padding: 10px 12px;
        font-size: 20px;
    }

    .faves-dialog-close {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* ── Bottom nav: larger icons and labels ─────────────────────────────── */
    .mob-nav-item {
        font-size: 11px;
        padding: 4px 6px;
    }

    .mob-nav-item i {
        font-size: 20px;
    }

    /* ── Page header ─────────────────────────────────────────────────────── */
    .page-header {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .page-header p {
        font-size: 15px;
    }

    /* ── Cards ───────────────────────────────────────────────────────────── */
    .card {
        padding: 14px;
        border-radius: var(--radius-md);
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .card h3 {
        font-size: 1.05rem;
    }

    /* ── Buttons: 44px touch target ──────────────────────────────────────── */
    .btn {
        min-height: 44px;
        font-size: 15px;
        padding: 11px 16px;
    }

    /* ── Forms: single column on mobile ─────────────────────────────────── */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* ── Tables: remove forced min-width; let the .table-wrap scroll ─────── */
    table {
        min-width: 0;
        font-size: 14px;
    }

    th, td {
        padding: 10px 10px;
        font-size: 14px;
        white-space: normal;
    }

    /* ── Calendar: compact cells — hide event chips, show dot ────────────── */
    .calendar-grid {
        gap: 3px;
    }

    .calendar-cell {
        min-height: 52px !important;
        padding: 4px 3px;
    }

    .cal-event-pill {
        display: none;
    }

    .cal-more-btn {
        display: none;
    }

    .cal-day-dot {
        display: block;
    }

    .day-num {
        font-size: 13px;
    }

    .today-marker {
        display: none;
    }

    .cal-nav-controls {
        gap: 4px;
    }

    .cal-nav-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 44px;
    }

    /* ── Day view panel ──────────────────────────────────────────────────── */
    .day-view-panel {
        padding: 14px;
    }

    /* ── Map ─────────────────────────────────────────────────────────────── */
    .map-toolbar {
        flex-direction: column;
    }

    .map-toolbar-actions,
    .map-presets,
    .map-basemap {
        width: 100%;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .map-canvas {
        min-height: max(55vh, 380px);
    }

    /* ── Grids collapse to single column ─────────────────────────────────── */
    .hero-grid,
    .grid-2,
    .grid-3,
    .kpi-row,
    .surf-highlight-grid,
    .dual-clock-row {
        grid-template-columns: 1fr;
    }

    /* ── Board / messages ────────────────────────────────────────────────── */
    .board-body {
        font-size: 15px;
    }

    .board-alias {
        font-size: 14px;
    }

    .board-time {
        font-size: 12px;
    }

    .board-tab {
        font-size: 15px;
        padding: 12px 16px;
        min-height: 44px;
    }

    /* ── VoIP callee picker ──────────────────────────────────────────────── */
    .callee-btn {
        min-height: 52px;
        font-size: 15px;
        padding: 12px 14px;
    }

    /* ── Dinner planner compact ──────────────────────────────────────────── */
    .dp-row {
        flex-wrap: wrap;
    }

    .dp-actions {
        width: 100%;
        padding-top: 6px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Phase 5 — Favorites / Saved Places
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Heart button on content cards and table rows ─────────────────────── */
.fave-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    padding: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

.fave-btn:hover {
    border-color: #f06b6b;
    color: #f06b6b;
}

.fave-btn-active {
    background: rgba(240, 107, 107, 0.12);
    border-color: #f06b6b;
    color: #f06b6b;
}

/* ── Faves nav button (top-right nav bar) ─────────────────────────────── */
.faves-nav-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.faves-nav-btn:hover {
    border-color: #f06b6b;
    color: #f06b6b;
}

/* ── Count badge on nav button ────────────────────────────────────────── */
.faves-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f06b6b;
    color: #fff;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

/* ── Saved places dialog ──────────────────────────────────────────────── */
.faves-dialog {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    padding: 0;
    max-width: 420px;
    width: 92vw;
    max-height: 80vh;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.faves-dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
}

.faves-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.faves-dialog-header h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.faves-dialog-header h2 i {
    color: #f06b6b;
}

.faves-dialog-close {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
}

.faves-dialog-close:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.faves-dialog-list {
    overflow-y: auto;
    padding: 14px 22px;
    flex: 1;
    min-height: 80px;
}

.faves-empty {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    padding: 18px 0;
    margin: 0;
}

.faves-group {
    margin-bottom: 16px;
}

.faves-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.faves-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    margin-bottom: 5px;
}

.faves-name {
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.faves-name:hover {
    color: var(--accent);
    text-decoration: underline;
}

.faves-remove {
    background: none;
    border: 1px solid transparent;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}

.faves-remove:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.faves-dialog-footer {
    padding: 12px 22px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.faves-dialog-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

/* ── GPS "You Are Here" marker ───────────────────────────────────────────── */
.gps-icon { background: transparent; border: none; }
.gps-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: #4a90e2; border: 2.5px solid #fff;
    box-shadow: 0 0 6px rgba(74,144,226,0.7);
    position: absolute; top: 4px; left: 4px;
}
.gps-pulse-ring {
    position: absolute; top: 0; left: 0;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(74,144,226,0.25);
    animation: gps-pulse 1.5s ease-out infinite;
}
@keyframes gps-pulse {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.0); opacity: 0; }
}
#gpsBtn.gps-active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }

/* ── Message board ───────────────────────────────────────────────────────── */
.board-feed {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 14px; background: var(--bg-primary);
    max-height: 340px; overflow-y: auto;
}
.board-msg { border-bottom: 1px solid var(--border); padding: 10px 0; }
.board-msg:last-child { border-bottom: none; }
.board-msg-header {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; margin-bottom: 4px;
}
.board-alias { font-weight: 600; color: var(--accent); font-size: 13px; }
.board-time  { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.board-body  { font-size: 14px; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }

/* ── Photos page ─────────────────────────────────────────────────────────── */
.photo-upload-area {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 32px 20px; text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: default;
}
.photo-upload-area.drag-over { border-color: var(--accent); background: rgba(61,216,193,0.06); }
.photo-preview-img {
    max-width: 100%; max-height: 320px; border-radius: var(--radius-sm);
    object-fit: contain; margin-bottom: 10px;
}
.upload-progress-bar {
    height: 6px; border-radius: 3px; background: var(--border);
    overflow: hidden; flex: 1;
}
.upload-progress-fill {
    height: 100%; width: 0%; background: var(--accent);
    border-radius: 3px; transition: width 0.2s;
}

/* Photo gallery grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.photo-card {
    border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border); cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    background: var(--bg-card);
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.photo-thumb {
    width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
}
.photo-card-footer {
    padding: 8px 10px;
    display: flex; flex-direction: column; gap: 2px;
}
.photo-alias { font-size: 12px; font-weight: 600; color: var(--accent); }
.photo-cap   { font-size: 12px; color: var(--text-primary); }
.photo-date  { font-size: 11px; color: var(--text-muted); }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.88);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px;
    gap: 14px;
}
.lightbox-img {
    max-width: 100%; max-height: 80vh;
    border-radius: var(--radius-sm); object-fit: contain;
}
.lightbox-caption {
    color: var(--text-secondary); font-size: 14px; text-align: center;
    max-width: 640px;
}
.lightbox-close {
    position: absolute; top: 16px; right: 20px;
    background: transparent; border: none; color: #fff;
    font-size: 1.6rem; cursor: pointer; line-height: 1;
    padding: 4px 8px;
}
.lightbox-close:hover { color: var(--accent); }

/* ── Board page ───────────────────────────────────────────────────────── */
.input-field {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.15s;
    width: 100%;
}
.input-field:focus {
    outline: none;
    border-color: var(--accent);
}
.form-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
/* ── Board tabs ───────────────────────────────────────────────────────── */
.board-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.board-tab {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.board-tab.active {
    background: var(--accent);
    color: #08101b;
    border-color: var(--accent);
}
.board-tab:not(.active):hover {
    border-color: var(--accent);
    color: var(--accent);
}
.board-panel { display: none; }
.board-panel.active { display: block; }

/* ── Callee picker (VoIP) ─────────────────────────────────────────────── */
.callee-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.callee-btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.callee-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.callee-btn.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* ── Peer GPS markers on map ──────────────────────────────────────────── */
.peer-gps-icon { background: transparent; border: none; }
.peer-gps-dot {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #08101b;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

/* ── Login page (nav-username hide on small screens) ─────────────────── */
@media (max-width: 520px) {
    .nav-username { display: none !important; }

    /* Smaller page headings on very small phones */
    .page-header h1 { font-size: 22px; }

    /* VoIP: stack callee buttons vertically on small screens */
    .callee-picker { flex-direction: column; }
    .callee-btn { min-width: 100%; }

    /* Photo grid: 2 per row on small phones */
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Map toolbar buttons wrap tighter */
    .map-preset-btn, .map-basemap-btn {
        font-size: 13px;
        padding: 8px 10px;
    }
}

