:root {
    /* Color Palette - Engineering Dark Theme */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --card-hover: #2a2a2a;
    --accent-primary: #1DB954;
    /* Engineering Green */
    --accent-secondary: #ffb300;
    /* Amber Warning */
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-white: #ffffff;

    /* Fonts */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', 'Courier New', monospace;

    /* Spacing & Borders */
    --radius-lg: 12px;
    --radius-md: 8px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 32px;

    /* Safe Areas for Mobile */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* UI Consts */
    --nav-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    padding-top: calc(var(--safe-top) + var(--spacing-lg));
    padding-bottom: calc(var(--safe-bottom) + 100px);
    padding-left: calc(var(--safe-left) + var(--spacing-md));
    padding-right: calc(var(--safe-right) + var(--spacing-md));
    max-width: 600px;
    /* Mobile focused container */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--text-white) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

/* Global Search */
.search-container {
    margin-top: 16px;
    position: relative;
}

#global-search {
    width: 100%;
    padding: 13px 20px 13px 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: var(--text-white);
    font-size: 0.95rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
}

#global-search:focus {
    border-color: var(--accent-primary);
    background-color: rgba(29, 185, 84, 0.05);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.15);
}

/* ── Search Overlay ────────────────────────────────────────── */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px);
    z-index: 3000;
    display: none;
    flex-direction: column;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.search-overlay.active {
    display: flex;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-overlay-header {
    padding: var(--spacing-lg) var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.close-overlay {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
}

#overlay-search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 1.1rem;
}

#overlay-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

.overlay-search-results {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

/* Search results dropdown */
.search-results,
.overlay-search-results {
    display: none;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-y: auto;
    z-index: 999;
    box-shadow: none;
    max-height: none;
    padding-bottom: 100px;
    /* Space for bottom nav */
}

/* Specific styling for the overlay list */
.overlay-search-results {
    padding-top: var(--spacing-md);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.search-result-name {
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 2px;
}

.search-result-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-results.open {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

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

.search-result-item:hover,
.search-result-item.focused {
    background: rgba(29, 185, 84, 0.08);
}

.search-result-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.search-result-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.search-result-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-name mark {
    background: transparent;
    color: var(--accent-primary);
    font-weight: 700;
}

.search-result-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-category {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    margin-left: auto;
    flex-shrink: 0;
    padding: 2px 8px;
    background: rgba(255, 179, 0, 0.1);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    flex-grow: 1;
    margin-bottom: 20px;
}

.grid-card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    outline: none;
}

.grid-card:hover,
.grid-card:active {
    background-color: var(--card-hover);
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-sm);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.3));
}

#icon-antenna {
    background-image: url('assets/antenna.png');
}

#icon-calculators {
    background-image: url('assets/calculators.png');
}

#icon-link {
    background-image: url('assets/link.png');
}

#icon-operator {
    background-image: url('assets/operating.png');
}

#icon-resources {
    background-image: url('assets/resources.png');
}

#icon-activity {
    background-image: url('assets/activity.png');
}

#icon-lookup {
    background-image: url('assets/lookup.png');
}

.card-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    text-align: center;
}

/* Specific Card Themes */
#antenna-designer {
    --accent: #58a6ff;
}

#calculators {
    --accent: #79c0ff;
}

#link-planning {
    --accent: #d2a8ff;
}

#operator-hub {
    --accent: #56d364;
}

#ham-activity {
    --accent: #ffb300;
}

#ham-lookup {
    --accent: #79c0ff;
}

.grid-card:hover .card-label {
    color: var(--accent-primary);
}

/* Calculator Controls */
.calculator-container {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group input {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    color: var(--text-white);
    font-family: var(--font-mono);
    font-size: 1.5rem;
    /* Large, easy to read */
    width: 100%;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--accent-primary);
    background-color: #222;
}

.calc-btn {
    background-color: var(--accent-primary);
    color: var(--bg-color);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    margin-top: var(--spacing-sm);
    transition: all 0.2s ease;
    position: relative;
    /* Support for .locked overlays */
    overflow: hidden;
    /* Ensure overlay doesn't spill */
}

.calc-btn:active {
    transform: scale(0.98);
}

/* Toggle Switch */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.toggle-label.active {
    color: var(--accent-primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Results Overlay */
.results-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: flex-end;
}

.results-overlay.active {
    display: flex;
}

.results-content {
    background-color: #1a1a1a;
    width: 100%;
    max-width: 600px;
    border-top: 3px solid var(--accent-primary);
    border-radius: 24px 24px 0 0;
    padding: var(--spacing-lg);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-row.primary {
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.result-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.result-value {
    color: var(--text-white);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.6rem;
}

.result-row.primary .result-value {
    color: var(--accent-primary);
    font-size: 2.5rem;
}

.close-results {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-lg);
    cursor: pointer;
    font-weight: 600;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Physics Tools Specifics */
.sync-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xs) 0;
}

.sync-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    background: rgba(29, 185, 84, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1px solid rgba(29, 185, 84, 0.3);
}

/* dB Reference Table */
.ref-toggle-container {
    margin-top: var(--spacing-md);
    text-align: center;
}

.text-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.8;
}

.text-link:hover {
    opacity: 1;
}

.ref-table {
    margin-top: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ref-table.hidden {
    display: none;
}

.ref-row {
    display: flex;
    justify-content: space-between;
    padding: 8px var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ref-row.head {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Ohm's Law Grid */
.grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.grid-4 .input-group:nth-child(n+5) {
    grid-column: span 2;
}

.field-info {
    grid-column: span 2;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin-top: var(--spacing-xs);
}

/* Overwrite Highlight Animation */
.ohm-input.overwritten {
    animation: highlightGreen 0.6s ease;
}

@keyframes highlightGreen {
    0% {
        background-color: rgba(29, 185, 84, 0.2);
        border-color: var(--accent-primary);
    }

    100% {
        background-color: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Select Inputs */
select {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    color: var(--text-white);
    font-family: var(--font-main);
    font-size: 1rem;
    width: 100%;
    outline: none;
    appearance: none;
    cursor: pointer;
}

select:focus {
    border-color: var(--accent-primary);
}

/* Responsiveness for larger screens */
@media (min-width: 768px) {
    .app-container {
        max-width: 800px;
    }

    .home-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-card {
        aspect-ratio: 1 / 1.1;
    }
}

/* Page Control */
.page {
    display: none;
    animation: fadeIn 0.3s ease forwards;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.back-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-color);
}

/* Tool Lists */
.tool-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: 20px;
}

.tool-item {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.tool-item:hover {
    background-color: var(--card-hover);
    border-color: var(--accent-primary);
}

.tool-name {
    color: var(--accent-primary);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
}

.tool-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Category Dividers */
.category-divider {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid rgba(29, 185, 84, 0.2);
    opacity: 0.8;
}

/* Resistor Visualizer */
.resistor-visual-container {
    padding: var(--spacing-lg) 0;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.resistor-body {
    position: relative;
    width: 200px;
    height: 60px;
    background-color: #d2b48c;
    /* Tan body */
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.resistor-body::before,
.resistor-body::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 4px;
    background: #888;
    z-index: -1;
}

.resistor-body::before {
    right: 100%;
}

.resistor-body::after {
    left: 100%;
}

.resistor-band {
    width: 12px;
    height: 100%;
    background: #ccc;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.resistor-band:hover {
    outline: 2px solid var(--accent-primary);
}

.live-value-display {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--card-hover);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#resistor-value {
    color: var(--accent-primary);
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
}

#resistor-tolerance {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toggle Groups & Pickers */
.toggle-group {
    display: flex;
    background: #1a1a1a;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.toggle-group.full-width {
    width: 100%;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: var(--accent-primary);
    color: var(--bg-color);
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: var(--spacing-md);
}

.color-swatch {
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s ease;
}

.color-swatch:hover {
    transform: scale(1.05);
}

.color-swatch.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

/* Network Solver Specs */
.component-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.network-item {
    display: flex;
    gap: var(--spacing-sm);
    animation: fadeIn 0.2s ease;
}

.network-input {
    flex: 1;
    background: #1a1a1a !important;
    color: var(--text-white) !important;
    padding: 12px !important;
    font-size: 1.1rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.network-unit {
    display: flex;
    align-items: center;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 30px;
}

/* --- DX Dashboard Styles --- */
.live-indicator-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.live-indicator-wrap.active {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.live-indicator-wrap.paused {
    background: rgba(160, 160, 160, 0.1);
    border: 1px solid rgba(160, 160, 160, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.live-indicator-wrap.active .pulse-dot,
.live-indicator-wrap.live .pulse-dot {
    background-color: #2ecc71 !important;
    animation: pulse-green 1.5s infinite;
}

.live-indicator-wrap.offline .pulse-dot {
    background-color: #e74c3c;
}

.live-indicator-wrap.active .live-text,
.live-indicator-wrap.live .live-text {
    color: #2ecc71 !important;
}

.live-indicator-wrap.offline .live-text {
    color: #e74c3c;
}

.live-indicator-wrap.reconnecting .pulse-dot {
    background-color: #f1c40f;
    animation: blink 1s infinite;
}

.live-indicator-wrap.reconnecting .live-text {
    color: #f1c40f;
}

.live-indicator-wrap.paused .pulse-dot {
    background-color: #a0a0a0;
}

.live-text {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.live-indicator-wrap.paused .live-text {
    color: #a0a0a0;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

/* DX Spot Aging Styles */
.spot-card {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.spot-card.fresh {
    border-left-color: var(--accent-primary);
    box-shadow: inset 5px 0 10px -5px var(--accent-primary);
}

.spot-card.stale {
    border-left-color: #a0a0a0;
    opacity: 0.8;
}

.spot-card.old {
    border-left-color: transparent;
    opacity: 0.6;
}

@keyframes blink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.dashboard-controls {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-row {
    display: flex;
    gap: 8px;
}

.filter-select.mini {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
}

.dx-ticker-container {
    background: #0d0d0d;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 500px;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pull-indicator {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: -50px;
    transition: margin-top 0.2s;
}

.dx-ticker-list {
    display: flex;
    flex-direction: column;
}

.spot-card {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 1fr;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.spot-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 3px;
    border-radius: 0 2px 2px 0;
}

.spot-card.fresh::before {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.spot-card.stale::before {
    background: var(--accent-secondary);
}

.spot-card.old::before {
    background: transparent;
}

.spot-card:active {
    background: rgba(255, 255, 255, 0.05);
}

.spot-main {
    display: flex;
    flex-direction: column;
}

.spot-call-mini {
    font-weight: 800;
    color: var(--text-white);
    font-size: 1.05rem;
}

.spot-de {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.spot-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spot-freq-mini {
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.95rem;
}

.spot-band-mini {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.spot-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.spot-mode-mini {
    font-weight: 600;
    font-size: 0.85rem;
    color: #58a6ff;
}

.spot-time-mini {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.dx-footer-mini {
    display: flex;
    justify-content: space-between;
    padding: 10px 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.spinner.mini {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* --- Existing Styles (Fallback) --- */
/* --- Call-Lookup / Station Card Styles --- */
.credentials-settings {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.credentials-settings summary {
    padding: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.credentials-form {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.credential-hint {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    opacity: 0.8;
}

.station-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

.station-identity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.country-flag-large {
    width: 80px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#lookup-callsign {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-white);
    margin: 0;
    letter-spacing: 0.05em;
}

.badge-row {
    display: flex;
    gap: 8px;
}

.station-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.station-badge.lotw {
    background: #58a6ff;
    color: #0d1117;
}

.station-badge.eqsl {
    background: #ffb300;
    color: #0d1117;
}

.station-info {
    margin-bottom: 20px;
}

.station-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-white);
    margin: 0;
}

.station-qth {
    color: var(--text-muted);
    font-size: 1rem;
}

.station-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: var(--radius-md);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.meta-value {
    color: var(--text-white);
    font-weight: bold;
    font-family: var(--font-mono);
}

.remove-item {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.2);
    color: #ff4444;
    width: 45px;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    cursor: pointer;
}

.add-item-btn {
    width: 100%;
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-item-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.result-summary {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(29, 185, 84, 0.1);
    border: 1px solid rgba(29, 185, 84, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#network-total {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* SVG Circuit Container */
.svg-diagram {
    width: 100%;
    height: 120px;
    background: #1a1a1a;
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Filter Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.full-span {
    grid-column: span 2;
}

.filter-input.overwritten {
    animation: highlightGreen 0.6s ease;
}

/* Tool Lists */
.grid-card.filtered {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}

.grid-card.highlight {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.4);
}

/* --- Geospatial & Location Modifiers --- */
.page.geo-mode {
    background: radial-gradient(circle at 50% 50%, #2c3e50 0%, #121212 100%);
    position: relative;
    min-height: 100vh;
}

.page.geo-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

.geo-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(52, 152, 219, 0.3) !important;
}

.geo-input:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

/* HF Frequency Prediction Grid */
.frequency-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.bom-freq-input.mini {
    padding: 8px 4px;
    font-size: 0.85rem;
    text-align: center;
}

.geo-results {
    background: rgba(44, 62, 80, 0.6) !important;
    border-left: 4px solid #3498db !important;
    margin-top: 25px;
}

.dashboard .dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.dash-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.dash-item.active-accent {
    border-color: var(--accent-primary);
    background: rgba(29, 185, 84, 0.1);
}

.dash-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-white);
    font-family: 'Roboto Mono', monospace;
    margin: 10px 0;
}

.dash-item.mini {
    padding: 10px;
}

.dash-item.mini label {
    font-size: 0.7rem;
}

.gps-status {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
}

.gps-status.searching {
    color: #f1c40f;
}

.gps-status.data-synced {
    color: var(--accent-primary);
}

.uppercase {
    text-transform: uppercase;
}

/* --- Antenna Designer Specifics --- */
.svg-ant-element {
    stroke: var(--accent-primary);
    stroke-width: 3;
    stroke-linecap: round;
}

.svg-ant-boom {
    stroke: #808080;
    stroke-width: 4;
    stroke-linecap: square;
}

.svg-ant-text {
    fill: var(--text-white);
    font-size: 12px;
    font-family: var(--font-main);
}

.svg-ant-dim {
    fill: #1DB954;
    /* Active green for changeable dimensions */
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: bold;
}

.svg-ant-label {
    fill: var(--text-muted);
    font-size: 10px;
}

/* --- Link Planning Specifics --- */
.gauge-red {
    color: #e74c3c !important;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}

.gauge-yellow {
    color: #f1c40f !important;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
}

.gauge-green {
    color: #1DB954 !important;
    text-shadow: 0 0 10px rgba(29, 185, 84, 0.4);
}

.band-rec-excellent {
    border-left: 4px solid #1DB954 !important;
}

.band-rec-fair {
    border-left: 4px solid #f1c40f !important;
}

.band-rec-poor {
    border-left: 4px solid #e74c3c !important;
}

#greyline-container {
    width: 100%;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.dx-storm-alert {
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% {
        background: #e74c3c;
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        background: #c0392b;
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }

    100% {
        background: #e74c3c;
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Embedded Map Styles */
.map-wrapper {
    overflow: hidden;
    transition: all 0.3s ease;
}

.map-wrapper.fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background: var(--bg-card);
    margin: 0 !important;
}

.map-wrapper.fullscreen .embedded-map {
    height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
}

.map-fallback {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
}

/* Pulsing Red Marker */
.pulse-marker {
    width: 14px;
    height: 14px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.pulse-marker::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 14px;
    height: 14px;
    background: inherit;
    border-radius: inherit;
    animation: markerPulse 2s infinite ease-out;
    z-index: -1;
}

@keyframes markerPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Leaflet Dark Customizations */
.leaflet-container {
    background: #1a1a1a !important;
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.5) !important;
    color: var(--text-muted) !important;
    font-size: 0.6rem !important;
}

/* Advanced RBN Dashboard Styles */
.rbn-control-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rbn-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

.filter-section label {
    display: block;
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.checkbox-grid.mini {
    grid-template-columns: repeat(2, 1fr);
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.checkbox-grid label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.checkbox-grid input[type="checkbox"]:checked+span,
.checkbox-grid label:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(29, 185, 84, 0.1);
}

.rbn-search-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.rbn-search-row .input-group {
    flex: 1;
    min-width: 150px;
}

.rbn-search-row .input-group.mini {
    flex: 0;
}

.rbn-settings-row {
    display: flex;
    align-items: center;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    flex-wrap: wrap;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* RBN Table Styles */
.rbn-grid-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
}

.rbn-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.rbn-table th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
}

.rbn-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rbn-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.rbn-table tr.highlighted {
    background: rgba(29, 185, 84, 0.15) !important;
}

.rbn-table td:nth-child(3) {
    color: var(--accent-secondary);
}

/* Freq */
.rbn-table td:nth-child(6) {
    font-weight: 600;
}

/* SNR */

.flag-mini {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 6px;
}

/* RBN Map Extensions */
.prop-path-arc {
    stroke-dasharray: 10, 5;
    animation: flowLine 30s linear infinite;
}

@keyframes flowLine {
    to {
        stroke-dashoffset: -100;
    }
}

.skimmer-dot {
    fill: #e74c3c;
    stroke: white;
    stroke-width: 1;
}

.station-dot {
    fill: #3498db;
    stroke: white;
    stroke-width: 1;
}

@media (max-width: 768px) {
    .rbn-filter-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Resources Reference Library --- */
.resource-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-main);
    background: #1a1a1a;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.resource-table th {
    background: #252525;
    padding: 10px;
    text-align: left;
    color: var(--accent-secondary);
    font-weight: 600;
}

.resource-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.resource-table tr:hover {
    background: rgba(255, 179, 0, 0.05);
}

.mode-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
}

.ctcss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.ctcss-item {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent-secondary);
}

.morse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.morse-card {
    background: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.morse-char {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-white);
}

.morse-code {
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    letter-spacing: 2px;
}

.audio-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

.glossary-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glossary-term {
    font-weight: bold;
    color: var(--accent-primary);
    font-size: 1rem;
    display: block;
    margin-bottom: 4px;
}

.glossary-def {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.term-link {
    color: var(--accent-primary);
    text-decoration: underline dotted;
    cursor: help;
}

/* Interactive Band Plan Styles */
.band-selector {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.band-selector::-webkit-scrollbar {
    height: 4px;
}

.band-selector::-webkit-scrollbar-thumb {
    background: rgba(29, 185, 84, 0.3);
    border-radius: 2px;
}

.band-btn {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.band-btn.active {
    background: var(--accent-primary);
    color: var(--bg-color);
    border-color: var(--accent-primary);
}

.ribbon-outer-container {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.ribbon-zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    justify-content: center;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#bp-zoom-slider {
    flex: 1;
    max-width: 200px;
    accent-color: var(--accent-primary);
}

.ribbon-viewport {
    width: 100%;
    height: 140px;
    background: #111;
    border-radius: var(--radius-md);
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: crosshair;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ribbon-viewport::-webkit-scrollbar {
    height: 6px;
}

.ribbon-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ribbon-canvas {
    height: 80px;
    position: relative;
    min-width: 100%;
}

.ribbon-scale {
    height: 40px;
    position: relative;
    min-width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ribbon-segment {
    position: absolute;
    height: 60px;
    top: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--bg-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ribbon-segment:hover {
    filter: brightness(1.2);
    z-index: 10;
    transform: scaleY(1.05);
}

.freq-marker {
    position: absolute;
    top: 0;
    width: 1px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
}

.freq-label {
    position: absolute;
    top: 15px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    transform: translateX(-50%);
}

.vfo-needle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ff3e3e;
    box-shadow: 0 0 10px #ff3e3e;
    z-index: 20;
    pointer-events: none;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vfo-needle::after {
    content: '▼';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff3e3e;
    font-size: 10px;
}

.band-info-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.info-band-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.info-freq-range {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.info-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vfo-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vfo-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    transition: border-color 0.2s ease;
}

.vfo-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(29, 185, 84, 0.2);
}

.vfo-input {
    background: none;
    border: none;
    color: var(--text-white);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    width: 90px;
    outline: none;
    padding: 0;
    margin: 0;
}

.vfo-input::-webkit-outer-spin-button,
.vfo-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.vfo-unit {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.vfo-mode {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.vfo-mode.active {
    background: var(--accent-primary);
    color: var(--bg-color);
}

.segment-tooltip {
    position: absolute;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid var(--accent-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    max-width: 200px;
}

/* CTCSS Tone Reference Page */
.ctcss-search-container {
    margin-bottom: 25px;
}

#ctcss-search-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 1rem;
}

.ctcss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
    margin-top: 10px;
    padding-bottom: 20px;
}

/* Mobile-specific Carousel / Horizontal Snap */
@media (max-width: 600px) {
    .ctcss-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-left: 5px;
        padding-right: 20px;
        scroll-padding-left: 5px;
    }

    .ctcss-grid::-webkit-scrollbar {
        height: 4px;
    }

    .ctcss-grid::-webkit-scrollbar-thumb {
        background: rgba(29, 185, 84, 0.3);
        border-radius: 2px;
    }

    .ctcss-card {
        flex: 0 0 140px;
        /* Force card width on mobile for swiping visibility */
        scroll-snap-align: start;
        min-height: 120px;
    }
}

.ctcss-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    cursor: pointer;
    min-width: 44px;
    /* Minimum touch target width */
    min-height: 44px;
    /* Minimum touch target height */
}

.ctcss-card:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.ctcss-card.highlight {
    border-color: var(--accent-secondary);
    background: rgba(241, 196, 15, 0.05);
    border-width: 1.5px;
}

.ctcss-card.active {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary);
    transform: scale(0.95);
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.4);
}

.ctcss-card.active * {
    color: var(--bg-color) !important;
}

.ctcss-freq {
    font-size: 1.3rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-white);
    letter-spacing: -0.5px;
}

.ctcss-num-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ctcss-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.ctcss-code-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
    background: rgba(29, 185, 84, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.ctcss-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}


.offset-badge-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.offset-badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-muted);
}

.offset-badge.active {
    background: var(--accent-primary);
    color: var(--bg-color);
    border-color: var(--accent-primary);
}

.readout-box {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-align: center;
    min-height: 48px;
}

.technical-note {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent-primary);
    padding: 15px;
    border-radius: 0 8px 8px 0;
}

/* Radio Glossary Interactive Page */
.glossary-search-container {
    margin-bottom: 20px;
}

#glossary-search-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 1rem;
}

.glossary-layout {
    display: flex;
    gap: 15px;
    position: relative;
    padding-right: 30px;
    /* Space for fixed sidebar */
}

.glossary-main {
    flex: 1;
}

.glossary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.glossary-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    transition: all 0.2s ease;
}

.glossary-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.glossary-term {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFB300;
    /* Bold Amber */
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.glossary-definition {
    font-size: 0.95rem;
    color: #CCCCCC;
    /* Light Grey */
    line-height: 1.5;
}

.glossary-link {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.glossary-link:hover {
    color: var(--text-white);
    background: rgba(0, 188, 212, 0.1);
}

.alphabet-nav {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 100;
}

.alphabet-nav span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    cursor: pointer;
    padding: 2px 4px;
    transition: all 0.1s ease;
    text-align: center;
}

.alphabet-nav span:hover {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.alphabet-nav span.active {
    color: var(--accent-primary);
    font-weight: 700;
}

@media (max-width: 600px) {
    .glossary-layout {
        padding-right: 20px;
    }

    .alphabet-nav span {
        font-size: 0.6rem;
    }
}



/* Q-Codes Interactive Page */
.q-search-container {
    margin-bottom: 20px;
}

#q-search-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 1rem;
    transition: all 0.2s ease;
}

#q-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.1);
}

.q-list-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.q-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.q-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.q-card.expanded {
    border-color: var(--accent-primary);
    background: rgba(0, 188, 212, 0.02);
}

.q-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.q-code {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-primary);
    min-width: 60px;
}

.q-meaning-short {
    font-size: 0.95rem;
    color: var(--text-white);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.q-card-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
    animation: slideDown 0.2s ease-out;
}

.q-card.expanded .q-card-details {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.q-detail-row {
    margin-bottom: 10px;
}

.q-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.q-detail-text {
    font-size: 0.9rem;
    color: var(--text-white);
    line-height: 1.4;
}

.q-detail-text em {
    color: var(--accent-primary);
    font-style: normal;
}

/* ══════════════════════════════════════════════════════════ */
/* Help & About                                              */
/* ══════════════════════════════════════════════════════════ */

/* Home card icon */
#icon-help {
    background-image: url('assets/help.png');
}

/* Search */
.help-search-container {
    margin-bottom: 16px;
}

#help-search {
    width: 100%;
    padding: 12px 18px 12px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: var(--text-white);
    font-size: 0.9rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
}

#help-search:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.15);
}

#help-search::placeholder {
    color: var(--text-muted);
}

/* Tabs */
.help-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 4px;
}

.help-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.help-tab.active {
    background: var(--accent-primary);
    color: #000;
}

.help-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-white);
}

/* Panels */
.help-panel {
    display: none;
}

.help-panel.active {
    display: block;
}

/* ── Manual Markdown Styles ─────────────────────────────── */
.manual-section {
    margin-bottom: 28px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.manual-section-header {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.manual-section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-secondary);
    /* Amber */
    margin: 0;
    letter-spacing: 0.02em;
}

.manual-section-body {
    padding: 16px 18px;
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.7;
}

.manual-section-body h4 {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 700;
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.manual-section-body ul {
    padding-left: 18px;
    margin: 4px 0 10px;
}

.manual-section-body li {
    margin-bottom: 4px;
    color: #ccc;
}

.manual-section-body strong {
    color: var(--text-white);
    font-weight: 600;
}

.manual-section-body code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.07);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--accent-primary);
}

.manual-section-body p {
    margin: 6px 0;
}

.help-highlight {
    background: rgba(255, 179, 0, 0.25);
    color: var(--text-white);
    border-radius: 2px;
    padding: 0 2px;
}

/* ── FAQ Accordion ──────────────────────────────────────── */
.faq-item {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item.open {
    border-color: rgba(29, 185, 84, 0.3);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.faq-question-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
    flex: 1;
}

.faq-chevron {
    font-size: 0.75rem;
    color: var(--accent-primary);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.2s;
    padding: 0 18px;
}

.faq-item.open .faq-answer {
    max-height: 400px;
    padding: 0 18px 16px;
}

.faq-answer-text {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

.faq-answer-text strong {
    color: var(--text-white);
}

.faq-answer-text code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.07);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--accent-primary);
}

/* Contact Button */
.help-contact {
    margin-top: 28px;
    margin-bottom: 12px;
    text-align: center;
}

.contact-btn {
    display: inline-block;
    padding: 13px 28px;
    background: linear-gradient(135deg, var(--accent-primary), #00a846);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 30px;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    letter-spacing: 0.02em;
}

.contact-btn:hover {
    opacity: 0.88;
    transform: translateY(-2px);
}

/* FAQ Category Headers */
.faq-category-header {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 18px 4px 8px;
    border-bottom: 1px solid rgba(255, 179, 0, 0.2);
    margin-bottom: 10px;
}

/* ── Global Bottom Navigation ────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    border-top: 2px solid var(--accent-primary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-bottom);
    z-index: 2000;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 0;
    border-radius: 12px;
}

.nav-icon {
    font-size: 24px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: var(--accent-primary);
    text-shadow: 0 0 15px rgba(29, 185, 84, 0.3);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(29, 185, 84, 0.4));
}

.nav-item:active .nav-icon {
    transform: scale(0.9);
}

/* ── Action Buttons & Reset ──────────────────────────────── */
.action-btn {
    background-color: var(--accent-primary);
    color: var(--bg-color);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.secondary {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
}

.action-btn.secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(29, 185, 84, 0.05);
}

.reset-btn {
    margin-top: 10px;
}

/* ── Monetization & Paywall ───────────────────────────── */

.paywall-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.paywall-overlay.active {
    display: flex;
}

.paywall-content {
    width: 100%;
    max-width: 1000px;
    background: linear-gradient(145deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.paywall-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.premium-badge {
    background: var(--accent-secondary);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: inline-block;
}

.paywall-header h2 {
    font-size: 2.2rem;
    color: var(--text-white);
    margin-bottom: 8px;
}

.paywall-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.tier-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tier-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.tier-card.hobbyist {
    border-color: rgba(29, 185, 84, 0.3);
}

.tier-card.hobbyist:hover {
    border-color: var(--accent-primary);
}

.tier-card.engineer {
    background: rgba(29, 185, 84, 0.02);
    border-color: rgba(29, 185, 84, 0.5);
    box-shadow: 0 0 30px rgba(29, 185, 84, 0.1);
}

.tier-card.lifetime {
    background: linear-gradient(180deg, rgba(255, 179, 0, 0.05) 0%, rgba(255, 179, 0, 0) 100%);
    border-color: rgba(255, 179, 0, 0.3);
}

.best-value-badge,
.serious-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 16px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.serious-badge {
    background: var(--accent-secondary);
    color: #000;
}

.tier-identity {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.tier-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
}

.tier-price {
    margin-top: 12px;
}

.price-val {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-white);
}

.price-period {
    color: var(--text-muted);
}

.annual-offer {
    font-size: 0.8rem;
    color: var(--accent-primary);
    margin-top: 4px;
    font-weight: 600;
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: var(--spacing-md) 0;
    flex-grow: 1;
}

.tier-features li {
    padding: 8px 0;
    color: var(--text-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-features li::before {
    content: "✓";
    color: var(--accent-primary);
    font-weight: bold;
}

.purchase-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hobbyist-btn {
    background: var(--accent-primary);
    color: #fff;
}

.engineer-btn {
    background: var(--text-white);
    color: #000;
}

.lifetime-btn {
    background: var(--accent-secondary);
    color: #000;
}

.purchase-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.paywall-footer {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-lg);
}

.restore-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 12px;
}

.terms-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* 🔒 Lock Indicators */
.premium-locked {
    position: relative;
    overflow: hidden;
}

.premium-locked::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: grayscale(1) blur(1px);
    z-index: 5;
    pointer-events: none;
    border-radius: inherit;
}

.premium-locked::after {
    content: "🔒 PREMIUM";
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-secondary);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 10;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.premium-locked .card-icon,
.premium-locked .tool-icon,
.premium-locked .search-result-icon,
.premium-locked img {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .paywall-header h2 {
        font-size: 1.8rem;
    }

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

    .paywall-content {
        padding: var(--spacing-md);
    }

    /* HF Prediction Mobile Fix */
    .frequency-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .bom-freq-input.mini {
        padding: 10px 4px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .frequency-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}