/* style.css */
:root {
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    
    --success-color: #10b981;
    --danger-color: #ef4444;
    
    --font-main: 'Inter', sans-serif;
    
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    background-attachment: fixed;
}

/* Common Components */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-main);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    white-space: nowrap;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

/* Favorites Cards */
.favorites-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.favorite-card {
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    border: 1px solid var(--border-color);
    min-width: 0;
    min-height: 155px;
}

.favorite-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px dashed rgba(255,255,255,0.1) !important;
    background: rgba(255,255,255,0.02) !important;
    min-height: 155px;
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.favorite-card-empty:hover {
    border-color: rgba(255,255,255,0.25) !important;
    background: rgba(255,255,255,0.05) !important;
}

.favorite-card:hover {
    border-color: rgba(255,255,255, 0.3);
    transform: translateY(-4px);
}

.favorite-card.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color), 0 8px 24px rgba(59, 130, 246, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.card-symbol {
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
}

.card-symbol > div {
    min-width: 0;
    overflow: hidden;
}

.card-symbol > div > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card name marquee */
.card-name-wrap {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    max-width: 100%;
    min-width: 0;
    /* override inherited text-overflow from .card-symbol > div > div */
    text-overflow: clip;
}
.card-name-text {
    display: inline-block;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}
@keyframes card-name-scroll {
    0%, 10% { transform: translateX(0); }
    80%, 100% { transform: translateX(var(--scroll-end, 0px)); }
}
.card-name-wrap:hover .card-name-text.overflows,
.card-name-text.overflows.tapped {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    animation: card-name-scroll 2.5s ease-in-out forwards;
}

/* Favorites onboarding (empty state) */
.fav-onboarding {
    text-align: center;
    padding: 3rem 1.5rem;
    margin-bottom: 2rem;
}
.fav-onboarding-msg {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Custom Checkbox */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.custom-checkbox:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 3px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.card-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-change {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-neutral { color: var(--text-secondary); }

/* Main Content Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Chart Section */
.chart-section {
    padding: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.timeframe-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.25rem;
    flex-shrink: 0;
}

.timeframe-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.timeframe-btn.active {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Indicator button tooltip */
.indicator-btn-wrap {
    position: relative;
}
.indicator-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
    white-space: nowrap;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}
.indicator-btn-wrap:hover .indicator-tooltip,
.indicator-tooltip.visible {
    opacity: 1;
}

.chart-container {
    height: 400px;
    width: 100%;
    position: relative;
}

.chart-placeholder {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* News Section */
.news-section {
    padding: 1.5rem;
}

.news-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.news-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.news-source {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.news-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color var(--transition-fast);
}

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

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: min(90vw, 500px);
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input-wrapper .material-symbols-outlined {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

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

.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.search-result-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.search-result-item.disabled:hover {
    background: rgba(255, 255, 255, 0.03);
}

.search-result-info {
    margin-left: 1rem;
    flex-grow: 1;
}

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

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.empty-state .material-symbols-outlined {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* News List (네이버 뉴스 스타일) */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-list-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

.news-list-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(4px);
}

.news-list-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 2rem;
    flex-shrink: 0;
    line-height: 1.5;
}

.news-list-content {
    flex-grow: 1;
    min-width: 0;
}

.news-list-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.news-list-summary {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Market Overview Ticker */
.market-overview {
    padding: 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.market-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.market-overview-title {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.market-overview-title .material-symbols-outlined {
    font-size: 0.95rem;
}

.market-updated {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.market-ticker {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.market-ticker::-webkit-scrollbar {
    display: none;
}

.market-ticker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.5rem;
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
    flex: 1;
    min-width: 115px;
    gap: 0.2rem;
    transition: background var(--transition-fast);
    cursor: default;
}

.market-ticker-item:last-child {
    border-right: none;
}

.market-ticker-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.market-ticker-name {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.market-ticker-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.market-ticker-change {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.05rem;
}

/* Landing Page */
.landing-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.landing-hero {
    padding: 4rem 2rem 3.5rem;
    text-align: center;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
}

.landing-badge .material-symbols-outlined {
    font-size: 1rem;
}

.landing-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 40%, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.9;
    max-width: 460px;
    margin: 0 auto 2rem;
}

.landing-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-cta-btn {
    padding: 0.85rem 2rem !important;
    font-size: 0.95rem !important;
    background: var(--accent-color) !important;
}

.landing-login-btn {
    padding: 0.85rem 2rem !important;
    font-size: 0.95rem !important;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.landing-feature-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.landing-feature-icon {
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-feature-icon .material-symbols-outlined {
    font-size: 1.4rem;
    color: var(--accent-color);
}

.landing-feature-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.landing-feature-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.7;
}

@media (max-width: 600px) {
    .landing-title {
        font-size: 2.1rem;
    }
    .landing-features {
        grid-template-columns: 1fr;
    }
    .landing-hero {
        padding: 2.5rem 1.25rem 2rem;
    }
}

/* Desktop 2-column layout */
@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 1.4fr 1fr;
        align-items: start;
    }
}

/* Mobile visibility helpers */
.mobile-only { display: none; }
.mobile-btn-label { display: none; }

/* Mobile stock selector wrapper */
.mobile-stock-selector {
    margin-bottom: 0.75rem;
}

/* Custom Select Component */
.custom-select {
    position: relative;
    margin-bottom: 0.75rem;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-select-trigger:active {
    background: var(--bg-surface-hover);
    border-color: var(--accent-color);
}

.custom-select-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.custom-select-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease-out;
}

.custom-select-dropdown {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    z-index: 200;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 1rem);
    animation: slideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.custom-select-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

.custom-select-dropdown-header {
    padding: 0.75rem 1.5rem 0.9rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.custom-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-tap-highlight-color: transparent;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:active {
    background: var(--bg-surface-hover);
}

.custom-select-option.selected {
    color: var(--accent-color);
}

.custom-select-option-label {
    font-size: 1rem;
    font-weight: 500;
}

.custom-select-option-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Mobile price card */
.mobile-price-card {
    padding: 1.25rem 1.5rem;
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
}

.mobile-price-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Responsive Layout */
@media (max-width: 768px) {
    .mobile-only { display: block; }
    .mobile-btn-label { display: inline; }

    body {
        background-image: none;
    }

    .container {
        width: 100%;
        padding: 1rem;
    }

    .header {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }

    .header h1 {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .header h1 .material-symbols-outlined {
        font-size: 1.6rem !important;
    }

    .header > div {
        display: flex !important;
        flex-direction: row !important;
        width: auto !important;
        gap: 0.35rem !important;
        align-items: center !important;
        flex-shrink: 0;
    }

    .header > div > span {
        display: none;
    }

    .header .btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 0 !important;
        flex-shrink: 0;
    }

    .header .btn .material-symbols-outlined {
        font-size: 1.2rem !important;
    }

    .favorites-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }
    .favorites-container > *:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 0.25rem);
    }

    .favorite-card {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .card-symbol {
        font-size: 0.95rem;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .card-price {
        font-size: 1.2rem !important;
        overflow-wrap: anywhere;
    }

    .market-overview {
        margin-bottom: 1.25rem;
    }

    .market-overview-header {
        padding: 0.7rem 1rem 0.6rem;
    }

    .market-ticker-item {
        min-width: 95px;
        padding: 0.7rem 0.9rem;
    }

    .market-ticker-price {
        font-size: 0.85rem;
    }

    .chart-section,
    .news-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .chart-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .chart-title,
    .news-header {
        font-size: 1rem;
    }

    .timeframe-selector {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .timeframe-btn {
        flex: 1 0 auto;
        padding: 0.5rem 0.75rem;
    }

    .chart-container {
        height: 300px;
    }

    .chart-placeholder {
        height: 300px;
    }

    .btn-admin {
        grid-column: unset;
    }

    .news-list-item {
        gap: 0.75rem;
        padding: 0.85rem;
        border-radius: 8px;
    }

    .news-list-num {
        min-width: 1.5rem;
        font-size: 0.95rem;
    }

    .news-list-title {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
    }

    .news-list-summary {
        display: none;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        width: 100vw !important;
        max-width: none !important;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.05rem;
    }

    .search-input-wrapper {
        margin-bottom: 1rem;
    }

    .search-input {
        min-height: 44px;
        padding: 0.85rem 0.85rem 0.85rem 2.75rem;
        font-size: 16px;
    }

    .search-result-item {
        padding: 0.85rem;
    }

    .search-result-info {
        min-width: 0;
        margin-left: 0.75rem;
    }

    .search-result-symbol,
    .search-result-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .modal-body > div[style*="overflowX"] {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    table {
        min-width: 620px;
    }
}

@media (max-width: 420px) {
    .container {
        padding: 0.75rem;
    }

    .header > div {
        grid-template-columns: 1fr;
    }

    .favorite-card {
        padding: 0.6rem;
    }

    .chart-container {
        height: 260px;
    }

    .chart-placeholder {
        height: 260px;
    }
}
