/* ==========================================================================
   Tools HQ Design System & Stylesheet
   Theme: Professional, Compact, High Density, Zero CLS Ad Reserved Units
   Location: web/assets/css/style.css
   ========================================================================== */

:root {
    /* Color Palette - Light Mode */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    /* Hour Block Visual Status Colors */
    --work-bg: #dcfce7;
    --work-border: #bbf7d0;
    --work-text: #166534;
    
    --off-bg: #fef3c7;
    --off-border: #fde68a;
    --off-text: #92400e;
    
    --sleep-bg: #f1f5f9;
    --sleep-border: #e2e8f0;
    --sleep-text: #94a3b8;
    
    --selection-bg: rgba(37, 99, 235, 0.25);
    --selection-border: #2563eb;
    
    --ad-bg: #f8fafc;
    --ad-border: #cbd5e1;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    /* Glass / Timeline Polish */
    --glass-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 248, 255, 0.82) 60%, rgba(238, 242, 255, 0.78) 100%);
    --glass-panel-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-highlight: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(30, 41, 59, 0.10), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    --tooltip-bg: rgba(15, 23, 42, 0.92);
    --tooltip-text: #f8fafc;
}

.dark-theme {
    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --bg-subtle: #334155;
    --border-color: #334155;
    --border-strong: #475569;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);
    
    --work-bg: #064e3b;
    --work-border: #047857;
    --work-text: #a7f3d0;
    
    --off-bg: #78350f;
    --off-border: #b45309;
    --off-text: #fde68a;
    
    --sleep-bg: #1e293b;
    --sleep-border: #334155;
    --sleep-text: #64748b;
    
    --selection-bg: rgba(59, 130, 246, 0.35);
    --selection-border: #60a5fa;
    
    --ad-bg: #1e293b;
    --ad-border: #334155;

    --glass-bg: linear-gradient(155deg, rgba(30, 41, 59, 0.90) 0%, rgba(15, 23, 42, 0.86) 60%, rgba(30, 27, 60, 0.82) 100%);
    --glass-panel-bg: rgba(30, 41, 59, 0.82);
    --glass-border: rgba(148, 163, 184, 0.18);
    --glass-highlight: rgba(148, 163, 184, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    --tooltip-bg: rgba(248, 250, 252, 0.95);
    --tooltip-text: #0f172a;
}

/* Reset & Base Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    color: var(--text-main);
    background-color: var(--bg-app);
    line-height: 1.4;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.hidden {
    display: none !important;
}

/* Header Navbar */
.app-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 16px;
}

.logo-sub {
    color: var(--primary);
    font-weight: 400;
}

.main-nav {
    display: flex;
    gap: 4px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: var(--bg-subtle);
}

.nav-item.active {
    color: var(--primary);
    background-color: var(--primary-light);
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Buttons & Controls */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    user-select: none;
}

.btn:hover {
    background-color: var(--bg-subtle);
    border-color: var(--border-strong);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-success {
    background-color: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-secondary {
    background-color: var(--bg-subtle);
    border-color: var(--border-color);
}

.btn-icon {
    padding: 6px 8px;
    font-size: 14px;
}

.btn-toggle {
    padding: 4px 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.btn-toggle.active {
    background-color: var(--bg-card);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.toggle-group {
    display: inline-flex;
    background-color: var(--bg-subtle);
    padding: 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.link-btn:hover {
    color: var(--primary-hover);
}

/* Ad Placement Containers (Zero CLS Reserved Heights) */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px auto;
    width: 100%;
}

.ad-slot {
    background-color: var(--ad-bg);
    border: 1px dashed var(--ad-border);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-label {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.ad-placeholder-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
}

.ad-demo-badge {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    opacity: 0.6;
}

.ad-leaderboard-wrap {
    max-width: 1400px;
    padding: 0 16px;
}

.ad-leaderboard {
    width: 728px;
    height: 90px;
    max-width: 100%;
}

.ad-infeed {
    width: 100%;
    height: 90px;
}

.ad-sidebar {
    width: 300px;
    height: 250px;
}

/* Main Layout Grid */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 32px 16px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.content-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* AI Smart Assistant Input Bar */
.ai-assistant-card {
    background-color: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px 8px;
}

.ai-input-wrap:focus-within {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

.ai-icon {
    font-size: 16px;
}

#aiPromptInput {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    height: 34px;
    font-size: 13px;
    color: var(--text-main);
}

.ai-suggestions-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chip-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.chip-btn {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.search-box-wrap {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.search-input-group {
    display: flex;
    align-items: center;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 10px;
}

.search-input-group:focus-within {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

.search-icon {
    font-size: 13px;
    margin-right: 8px;
    color: var(--text-muted);
}

#citySearchInput {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    height: 32px;
    font-size: 13px;
    color: var(--text-main);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
}

#modalCitySearchResults {
    z-index: 2000;
}

.search-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

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

.search-item:hover {
    background-color: var(--primary-light);
}

.search-item-tz {
    font-size: 11px;
    color: var(--text-muted);
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-picker-input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 12px;
    background-color: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
}

.view-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info Cards & Recommender */
.info-card {
    background-color: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

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

.card-title {
    font-weight: 600;
    color: var(--primary);
}

.close-card-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
}

/* Timeline Card & 24h Visual Converter Grid — Glass / iOS-style Shell */
.timeline-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    overflow-x: auto;
}

.timeline-header {
    display: flex;
    background: var(--glass-panel-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.location-col-header {
    width: 240px;
    min-width: 240px;
    padding: 8px 14px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.col-header-title {
    line-height: 1.2;
}

.col-header-toggles {
    display: flex;
    gap: 8px;
    text-transform: none;
    letter-spacing: normal;
}

.meta-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.meta-toggle input[type="checkbox"] {
    width: 11px;
    height: 11px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

.meta-toggle:hover {
    color: var(--text-main);
}

.timeline-header-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 720px;
}

.am-pm-scale-band {
    display: flex;
    align-items: center;
    min-height: 22px;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--text-muted);
    text-transform: none;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.10), rgba(167, 139, 250, 0.10));
}

.am-pm-scale-band strong {
    color: var(--text-main);
    font-weight: 700;
}

.local-date-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2px;
}

.day-diff-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.badge-plus {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-minus {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Location Rows */
.location-rows-container {
    display: flex;
    flex-direction: column;
    position: relative;
}

.timeline-selection-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: var(--selection-bg);
    border: 2px solid var(--selection-border);
    border-radius: var(--radius-sm);
    pointer-events: none;
    z-index: 8;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.25);
    transition: left 0.05s ease, width 0.05s ease;
}

.location-row {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.location-row:last-child {
    border-bottom: none;
}

.location-row:hover {
    background-color: var(--glass-highlight);
}

.location-row.dragging {
    opacity: 0.4;
}

.location-row.drag-over {
    box-shadow: inset 0 2px 0 var(--primary), inset 0 -2px 0 var(--primary);
}

.location-row-info {
    width: 240px;
    min-width: 240px;
    padding: 9px 12px;
    border-right: 1px solid var(--glass-border);
    background: var(--glass-panel-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    position: sticky;
    left: 0;
    z-index: 5;
}

.location-top-bar {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1;
    padding: 0 1px;
    margin-top: 2px;
    user-select: none;
    opacity: 0.55;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.drag-handle:hover {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.city-name {
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.3;
    color: var(--text-main);
    flex: 1;
    min-width: 0;
    word-break: break-word;
    padding-top: 1px;
}

.member-tag-text {
    color: var(--primary);
}

.city-sub {
    font-weight: 500;
    font-size: 11.5px;
    color: var(--text-muted);
}

.row-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    margin-top: 1px;
}

.btn-row-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    position: relative;
}

.btn-row-action:hover {
    color: var(--primary);
    background-color: var(--bg-subtle);
}

.btn-row-remove:hover {
    color: #ef4444;
}

/* Lightweight glass tooltip for row action buttons + drag handle */
[data-tooltip] {
    position: relative;
}

/* Tooltip renders below its trigger — the timeline card's horizontal scroll
   (overflow-x: auto) also clips vertical overflow per spec, so an above-anchored
   tooltip on the top row gets cut off at the card's top edge. */
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.location-datetime-row {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}

.dt-date {
    font-weight: 500;
    color: var(--text-muted);
}

.dt-sep {
    opacity: 0.4;
}

.dt-time {
    font-weight: 600;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.2px;
}

.location-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-top: 1px;
}

.tz-badge-zone {
    color: #0369a1;
    background-color: rgba(14, 165, 233, 0.10);
}

.tz-badge-hours {
    color: #7c3aed;
    background-color: rgba(124, 58, 237, 0.10);
}

.tz-badge {
    background-color: var(--bg-subtle);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.tag-edit-input {
    border: 1px solid var(--primary);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    flex: 1;
    min-width: 0;
    outline: none;
}

.timeline-hours-track {
    display: flex;
    flex: 1;
    min-width: 720px;
    position: relative;
    user-select: none;
}

.hour-cell {
    flex: 1;
    min-width: 30px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--glass-border);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.1s ease;
    position: relative;
}

.hour-cell:hover {
    filter: brightness(0.97);
}

.hour-cell:last-child {
    border-right: none;
}

.cell-hour-num {
    line-height: 1.1;
}

.cell-ampm {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-top: 1px;
    opacity: 0.5;
}

.half-hour-mode .hour-cell {
    min-width: 32px;
    font-size: 9px;
    letter-spacing: -0.2px;
}

.half-hour-mode .cell-ampm {
    font-size: 6px;
}

.half-hour-mode .hour-cell.slot-on-hour {
    font-weight: 700;
}

.half-hour-mode .hour-cell.slot-half-mark {
    font-weight: 500;
    border-right-style: dashed;
    opacity: 0.8;
}

.hour-cell.status-work {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, var(--work-bg), var(--work-bg));
    color: var(--work-text);
}

.hour-cell.status-off {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, var(--off-bg), var(--off-bg));
    color: var(--off-text);
}

.hour-cell.status-sleep {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, var(--sleep-bg), var(--sleep-bg));
    color: var(--sleep-text);
}

.hour-cell.cell-selected {
    outline: 2px solid var(--selection-border);
    outline-offset: -2px;
    z-index: 4;
}

.day-badge {
    position: absolute;
    top: 2px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 0 3px;
    border-radius: 2px;
}

/* Slot Selection Bar */
.slot-summary-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

.selected-time-highlight {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    margin-left: 6px;
}

.export-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* SEO Content & Article */
.seo-article {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 8px;
}

.seo-article h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.seo-article h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 8px 0;
}

.seo-article p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.legend-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 2px;
}

.legend-box.work-hours { background-color: var(--work-bg); border: 1px solid var(--work-border); }
.legend-box.off-hours { background-color: var(--off-bg); border: 1px solid var(--off-border); }
.legend-box.sleep-hours { background-color: var(--sleep-bg); border: 1px solid var(--sleep-border); }

.seo-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    list-style: none;
}

/* Sidebar Widgets */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.widget-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.widget-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.widget-list li {
    display: flex;
    gap: 10px;
    align-items: center;
}

.widget-icon {
    font-size: 16px;
}

.text-primary { color: var(--primary); font-weight: 600; }

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    padding: 20px 16px;
    margin-top: 32px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-right {
        order: 2;
    }

    .ad-sidebar {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .header-container {
        padding: 0 8px;
    }
    
    .main-nav {
        display: none;
    }

    .tool-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .location-col-header, .location-row-info {
        width: 140px;
        min-width: 140px;
    }

    .col-header-toggles {
        gap: 5px;
        flex-wrap: wrap;
    }

    .city-name {
        font-size: 12px;
    }

    .ad-leaderboard {
        height: 50px;
    }
}
