/* Homeo Rep - Main Stylesheet */
/* Mobile-first, synchronized with HomeoShip (homeoship.com) aesthetic */

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

:root {
    --color-primary: #2c3e50;
    --color-secondary: #7f8c8d;
    --color-accent: #3b82f6;
    --color-accent-hover: #2563eb;
    --color-success: #22c55e;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-text-muted: #9ca3af;
    --color-bg: #ffffff;
    --color-bg-light: #f9fafb;
    --color-bg-warm: #fafaf9;
    --color-bg-card: #ffffff;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-shadow: rgba(0, 0, 0, 0.06);
    --color-shadow-lg: rgba(0, 0, 0, 0.1);
    --color-footer-bg: #282828;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px var(--color-shadow);
    --shadow-md: 0 4px 12px var(--color-shadow);
    --shadow-lg: 0 8px 24px var(--color-shadow-lg);
    --shadow-xl: 0 12px 40px var(--color-shadow-lg);

    --header-height: 56px;
    --mobile-tab-height: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ====================== */
/* HEADER - HomeoShip-style */
/* ====================== */
.header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-inner {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1;
}

.logo-sub {
    font-size: var(--font-size-sm);
    color: var(--color-accent);
    font-weight: 500;
    white-space: nowrap;
}

.nav {
    display: none;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

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

/* ====================== */
/* BREADCRUMB */
/* ====================== */
.breadcrumb {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    padding: var(--spacing-sm) 0;
    display: none;
    position: relative;
    z-index: 50;
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    margin-right: var(--spacing-sm);
    color: var(--color-text-muted);
}

.breadcrumb-item a {
    color: var(--color-accent);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--color-text-light);
}

/* ====================== */
/* HERO */
/* ====================== */
.hero {
    background: linear-gradient(135deg, var(--color-bg) 0%, #f0f4f8 50%, var(--color-bg-light) 100%);
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--color-border-light);
    position: relative;
    z-index: 40;
}

/* Mobile: keep hero compact and focused on app identity */
@media (max-width: 767px) {
    .hero {
        padding: 10px 0;
    }
    .hero-ad {
        max-width: 100%;
        min-height: 50px;
        margin: var(--spacing-sm) auto 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    .hero-ad .adsbygoogle {
        min-height: 50px;
    }
    .hero-content {
        text-align: center;
    }
}

.hero .container,
.hero-container {
    max-width: 1080px;
}

/* Desktop: minimal hero, then workspace immediately below */
@media (min-width: 768px) {
    .hero-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .hero-content {
        width: 100%;
    }
    .hero-ad {
        width: 100%;
        max-width: 720px;
        margin: var(--spacing-md) 0 0;
        min-height: 90px;
    }
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
}

.hero-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 4px 0 0;
    line-height: 1.4;
    text-align: center;
}

.hero-ad {
    text-align: center;
}

/* ====================== */
/* MOBILE TAB NAVIGATION */
/* ====================== */
.mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    padding-bottom: var(--safe-bottom);
    height: calc(var(--mobile-tab-height) + var(--safe-bottom));
}

.mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mobile-tab.active {
    color: var(--color-accent);
}

.mobile-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 0 0 2px 2px;
}

.mobile-tab svg {
    width: 22px;
    height: 22px;
}

.tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    background: var(--color-accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

/* ====================== */
/* STATUS BAR */
/* ====================== */
.status-bar {
    background: var(--color-warning);
    color: #92400e;
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.status-bar .container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-bar.error {
    background: #fef2f2;
    color: #991b1b;
}

.status-bar.loading {
    background: #eff6ff;
    color: #1e40af;
}

.status-bar.success {
    background: #f0fdf4;
    color: #166534;
}

.status-retry {
    margin-left: auto;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: inherit;
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}

/* ====================== */
/* MAIN CONTENT */
/* ====================== */
.main-content {
    flex: 1;
    padding: var(--spacing-md) 0;
    padding-bottom: calc(var(--mobile-tab-height) + var(--safe-bottom) + var(--spacing-md));
}

/* On mobile, reduce top padding since hero is hidden */
@media (max-width: 767px) {
    .main-content {
        padding-top: var(--spacing-sm);
    }
}

/* ====================== */
/* PANELS */
/* ====================== */
.panel {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    display: none;
    scroll-margin-top: calc(var(--header-height) + 16px);
}

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

/* Mobile-specific: search panel should have extra top padding when focused */
@media (max-width: 767px) {
    .search-panel {
        padding-top: var(--spacing-lg);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.panel-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 var(--spacing-md) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.panel-icon {
    flex-shrink: 0;
    color: var(--color-accent);
}

/* ====================== */
/* SEARCH BOX */
/* ====================== */
.search-box {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

/* On mobile, search panel becomes the hero area */
@media (max-width: 767px) {
    .search-panel {
        background: linear-gradient(135deg, var(--color-bg) 0%, #f0f4f8 50%, var(--color-bg-light) 100%);
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--color-border-light);
        margin-bottom: 0;
        padding: var(--spacing-lg) var(--spacing-md);
        box-shadow: none;
    }
    
    .search-panel .panel-title {
        margin-top: 0;
        margin-bottom: var(--spacing-sm);
    }
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    min-height: 48px;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    scroll-margin-top: calc(var(--header-height) + var(--spacing-md));
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    cursor: pointer;
    min-height: 48px;
    min-width: 48px;
    transition: background-color 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.search-btn:hover {
    background-color: var(--color-accent-hover);
}

.search-btn:active {
    transform: scale(0.96);
}

.search-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.search-hint em {
    color: var(--color-text-light);
    font-style: normal;
    background: var(--color-bg-light);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* ====================== */
/* SEARCH RESULTS */
/* ====================== */
.search-results {
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.rubric-item {
    padding: 12px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    background-color: var(--color-bg);
    -webkit-tap-highlight-color: transparent;
}

.rubric-item:hover {
    background-color: var(--color-bg-light);
    border-color: var(--color-accent);
}

.rubric-item:active {
    transform: scale(0.99);
    background-color: rgba(59, 130, 246, 0.06);
}

.rubric-item.selected {
    background-color: rgba(59, 130, 246, 0.08);
    border-color: var(--color-accent);
}

.rubric-path {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: 2px;
    line-height: 1.4;
    word-break: break-word;
}

.rubric-text {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: 2px;
    line-height: 1.4;
    color: var(--color-text);
}

.rubric-text .highlight {
    background-color: #fef3c7;
    padding: 1px 3px;
    border-radius: 2px;
}

.rubric-remedies {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.rubric-remedies .remedy {
    display: inline-block;
    margin-right: var(--spacing-sm);
}

/* ====================== */
/* CASE RUBRICS */
/* ====================== */
.case-rubrics {
    min-height: 120px;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.case-rubric-card {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.case-rubric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.case-rubric-info {
    flex: 1;
    min-width: 0;
}

.case-rubric-info .rubric-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-rubric-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.weight-select {
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-family: var(--font-family);
    background-color: white;
    cursor: pointer;
    min-height: 36px;
    color: var(--color-text);
}

.remove-rubric-btn {
    background-color: var(--color-error);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 700;
    min-height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.remove-rubric-btn:hover {
    background-color: #dc2626;
}

/* ====================== */
/* BUTTONS */
/* ====================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text-light);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background-color: var(--color-bg-light);
    border-color: var(--color-text-muted);
}

.btn-sm {
    padding: 8px 12px;
    font-size: var(--font-size-xs);
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

/* ====================== */
/* CASE ACTIONS */
/* ====================== */
.case-actions {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border-light);
}

/* ====================== */
/* ANALYSIS RESULTS */
/* ====================== */
.analysis-results {
    min-height: 120px;
}

.remedy-result {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.remedy-result:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--color-border);
}

.remedy-result:first-child {
    border-left: 3px solid var(--color-accent);
}

.remedy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

.remedy-name {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--color-primary);
    line-height: 1.3;
}

.remedy-score {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-accent);
    flex-shrink: 0;
}

.remedy-details {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border-light);
    display: none;
}

.remedy-details.expanded {
    display: block;
}

.rubric-contribution {
    padding: 6px 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border-light);
}

.rubric-contribution:last-child {
    border-bottom: none;
}

/* ====================== */
/* EMPTY STATE */
/* ====================== */
.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--spacing-xl);
    font-size: var(--font-size-sm);
}

/* ====================== */
/* CONTENT SECTIONS - Shared Styles */
/* ====================== */
.content-section {
    padding: 48px 0;
    position: relative;
}

.section-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 0 0 12px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    text-align: justify;
    text-align-last: center;
}

/* ====================== */
/* HOW IT WORKS SECTION */
/* ====================== */
.how-it-works {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-light) 100%);
    padding: 56px 0;
    border-top: 1px solid var(--color-border-light);
}


.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.step-number {
    width: 52px;
    height: 52px;
    line-height: 52px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.25rem;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 12px 0;
}

.step-text {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.75;
    margin: 0;
    text-align: justify;
    text-align-last: center;
}

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

/* ====================== */
/* FEATURES SECTION */
/* ====================== */
.features-section {
    background: var(--color-bg-light);
    padding: 56px 0;
    border-top: 1px solid var(--color-border-light);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.feature-icon svg {
    color: var(--color-accent);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
    line-height: 1.3;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.7;
    margin: 0;
    text-align: justify;
    text-align-last: center;
}

/* ====================== */
/* FAQ SECTION */
/* ====================== */
.faq-section {
    background: var(--color-bg);
    padding: 56px 0;
    border-top: 1px solid var(--color-border-light);
}

.faq-list {
    max-width: 800px;
    margin: 32px auto 0;
}

.faq-item {
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--color-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
    border-color: var(--color-border);
}

.faq-item[open] {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

.faq-question {
    padding: 18px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: background-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.5;
}

.faq-question:hover {
    background: var(--color-bg-light);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-accent);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    transition: transform 0.2s, background-color 0.2s;
}

.faq-item[open] .faq-question::after {
    content: '−';
    background: var(--color-accent);
    color: white;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-answer {
    padding: 0 20px 20px;
    border-top: 1px solid var(--color-border-light);
    margin-top: -1px;
    background: var(--color-bg-light);
}

.faq-answer p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.8;
    margin: 16px 0 0 0;
    text-align: justify;
}

.faq-answer a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* ====================== */
/* SEO CONTENT SECTION */
/* ====================== */
.seo-content {
    background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-bg) 100%);
    padding: 56px 0;
    border-top: 1px solid var(--color-border-light);
}

.seo-text {
    max-width: 800px;
    margin: 32px auto 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 16px;
    padding: 32px;
}

.seo-text p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.85;
    margin: 0 0 20px 0;
    text-align: justify;
}

.seo-text p:last-child {
    margin-bottom: 0;
}

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

.seo-text a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.seo-text a:hover {
    text-decoration: underline;
}

/* ====================== */
/* FOOTER - HomeoShip exact match */
/* ====================== */
.footer {
    background-color: var(--color-footer-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--spacing-lg) 0;
    margin-top: 0;
    /* On mobile, add padding for bottom tab bar */
    padding-bottom: calc(var(--mobile-tab-height) + var(--safe-bottom) + var(--spacing-lg));
}

.footer .container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-align: center;
}

.footer-social {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.footer-social-link {
    color: #ffffff;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
}

.footer-social-link:hover {
    opacity: 0.7;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-sm);
    margin: 0;
    line-height: 1.6;
}

.footer-brand {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
}

.footer-brand:hover {
    opacity: 0.8;
}

/* ====================== */
/* LOADING STATES */
/* ====================== */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-text-muted);
}

.spinner {
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====================== */
/* NOTIFICATION */
/* ====================== */
.notification {
    position: fixed;
    bottom: calc(var(--mobile-tab-height) + var(--safe-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    max-width: calc(100vw - 32px);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-align: center;
    animation: slideUp 0.3s ease-out;
    color: white;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, 100%); opacity: 0; }
}

/* ====================== */
/* TABLET (768px+) */
/* ====================== */
@media (min-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .nav {
        display: flex;
    }

    .breadcrumb {
        display: block;
    }

    .hero {
        padding: 16px 0 12px;
    }

    .hero-title {
        font-size: 1.85rem;
        text-align: center;
    }

    .hero-text {
        font-size: 1rem;
        text-align: center;
    }

    .hero .container {
        text-align: center;
    }
    
    /* Reset panel title alignment for larger screens */
    .panel-title {
        justify-content: flex-start;
        text-align: left;
    }
    
    .search-hint {
        text-align: left;
    }
    
    .search-results {
        max-height: 55vh;
    }
    
    /* Reset text alignment for larger screens */
    .step-text {
        text-align: center;
        text-align-last: center;
    }
    
    .feature-card p {
        text-align: left;
        text-align-last: left;
    }
    
    .section-subtitle {
        text-align: center;
        text-align-last: center;
    }

    .mobile-tabs {
        display: none;
    }

    .main-content {
        padding: var(--spacing-lg) 0;
        padding-bottom: var(--spacing-lg);
    }

    .main-content .container {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--spacing-lg);
    }

    .panel {
        display: block;
        padding: var(--spacing-lg);
    }

    .search-panel {
        grid-column: 1;
    }

    .case-panel {
        grid-column: 2;
    }

    .analysis-panel {
        grid-column: 3;
    }

    .panel-title {
        font-size: var(--font-size-xl);
    }

    /* Content sections - Tablet */
    .how-it-works,
    .features-section,
    .faq-section,
    .seo-content {
        padding: 64px 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle,
    .how-it-works .section-desc {
        font-size: 1.05rem;
    }

    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .step-card {
        padding: 32px 28px;
    }

    .step-number {
        width: 56px;
        height: 56px;
        line-height: 56px;
        font-size: 1.35rem;
    }

    .step-title {
        font-size: 1.15rem;
    }

    .step-text {
        font-size: 0.95rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .feature-card {
        padding: 28px;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }

    .faq-list {
        margin-top: 40px;
    }

    .faq-question {
        font-size: 1rem;
        padding: 20px 24px;
    }

    .faq-answer {
        padding: 0 24px 24px;
    }

    .faq-answer p {
        font-size: 0.95rem;
    }

    .seo-text {
        padding: 40px;
        margin-top: 40px;
    }

    .seo-text p {
        font-size: 1rem;
    }

    .footer {
        padding: 32px 0;
        padding-bottom: 32px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .notification {
        bottom: 24px;
    }
}

/* ====================== */
/* DESKTOP (1024px+) */
/* ====================== */
@media (min-width: 1024px) {
    .container {
        padding: 0 var(--spacing-lg);
    }

    .hero-title {
        font-size: 2rem;
    }

    /* Content sections - Desktop */
    .how-it-works,
    .features-section,
    .faq-section,
    .seo-content {
        padding: 80px 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 16px;
    }

    .section-subtitle,
    .how-it-works .section-desc {
        font-size: 1.1rem;
        margin-bottom: 48px;
    }

    .steps-grid {
        gap: 32px;
    }

    .step-card {
        padding: 40px 32px;
    }

    .step-number {
        width: 64px;
        height: 64px;
        line-height: 64px;
        font-size: 1.5rem;
        margin-bottom: 24px;
    }

    .step-title {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }

    .step-text {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .feature-card {
        padding: 32px;
    }

    .feature-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

    .feature-card h3 {
        font-size: 1.15rem;
        margin-bottom: 8px;
    }

    .feature-card p {
        font-size: 0.95rem;
        line-height: 1.75;
    }

    .faq-list {
        margin-top: 48px;
    }

    .faq-item {
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .faq-question {
        font-size: 1.05rem;
        padding: 22px 28px;
    }

    .faq-answer {
        padding: 0 28px 28px;
    }

    .faq-answer p {
        font-size: 1rem;
        margin-top: 20px;
    }

    .seo-text {
        padding: 48px;
        margin-top: 48px;
        border-radius: 20px;
    }

    .seo-text p {
        font-size: 1.05rem;
        margin-bottom: 24px;
    }

    .footer {
        padding: 40px 0;
        padding-bottom: 40px;
    }

    .case-actions {
        position: sticky;
        bottom: 0;
        background-color: var(--color-bg-card);
        padding-bottom: var(--spacing-md);
    }
}

/* ====================== */
/* LARGE DESKTOP (1280px+) */
/* ====================== */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .section-title {
        font-size: 2.25rem;
    }

    .steps-grid,
    .features-grid {
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }

    .faq-list {
        max-width: 900px;
    }

    .seo-text {
        max-width: 900px;
    }
}

/* ====================== */
/* MOBILE SEARCH FOCUS IMPROVEMENTS */
/* ====================== */
@media (max-width: 767px) {
    /* When search input is focused on mobile, ensure visibility above keyboard */
    .search-input:focus {
        position: relative;
        z-index: 10;
    }
    
    /* Add padding-top to search results container for better visibility */
    .search-results {
        padding-top: var(--spacing-sm);
        max-height: 45vh;
    }
    
    /* Ensure panel title is centered on mobile */
    .panel-title {
        justify-content: center;
        text-align: center;
    }
    
    /* Center align search hint on mobile */
    .search-hint {
        text-align: center;
    }
    
    /* Ensure hero text is properly centered */
    .hero .container {
        text-align: center;
    }
    
    .hero-text {
        margin-left: auto;
        margin-right: auto;
    }
}

/* ====================== */
/* ACCESSIBILITY */
/* ====================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-text);
}

/* Scrollbar styling */
.search-results::-webkit-scrollbar,
.case-rubrics::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-track,
.case-rubrics::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb,
.case-rubrics::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.search-results::-webkit-scrollbar-thumb:hover,
.case-rubrics::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Print */
@media print {
    .header, .mobile-tabs, .hero-badges,
    .search-box, .case-actions, .analysis-controls, .status-bar {
        display: none !important;
    }

    .panel {
        display: block !important;
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    body {
        background: white;
    }
}
