/* Pusula ortak stiller: sahada eldivenle, güneşte okunabilir; APK ve web aynı. */

html, body {
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

h1:focus, h2:focus, h3:focus {
    outline: none;
}

.app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Roboto, "Segoe UI", sans-serif;
    color: #1F4E9A;
    background: #F6F6F8;
}

body:has(.mud-layout) .app-loading,
body:has(.boot) .app-loading {
    display: none;
}

.page-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom));
}

/* ---------- Alt gezinme ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    justify-content: space-around;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    min-height: 56px;
}

    .bn-item.active {
        color: var(--mud-palette-primary);
        font-weight: 600;
    }

/* ---------- Sonuç butonları (✓ / ⚠ / ✗) ---------- */
.result-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.3fr;
    gap: 8px;
}

.result-btn {
    min-height: 64px !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    text-transform: none !important;
}

.result-btn .mud-icon-root {
    font-size: 1.9rem !important;
}

/* ---------- Kartlar ve bölümler ---------- */
.section-title {
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    margin: 18px 4px 8px !important;
}

.station-card {
    border-left: 6px solid var(--mud-palette-primary);
}

.station-card.has-red {
    border-left-color: var(--mud-palette-error);
}

.station-card.all-clean {
    border-left-color: var(--mud-palette-success);
}

.counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 1rem;
    margin-right: 10px;
}

.counter.temiz { color: var(--mud-palette-success); }
.counter.sari { color: var(--mud-palette-warning); }
.counter.kirmizi { color: var(--mud-palette-error); }

.cue {
    border-radius: 10px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    font-weight: 600;
}

.cue-big {
    font-size: 1.25rem;
    font-weight: 800;
    border-radius: 12px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--mud-palette-primary) 16%, transparent);
    border-left: 5px solid var(--mud-palette-primary);
}

.coach-section h6 {
    margin-bottom: 4px;
}

.coach-section ol, .coach-section ul {
    margin: 0;
    padding-left: 1.3rem;
}

.coach-section li {
    margin-bottom: 4px;
}

.muted {
    color: var(--mud-palette-text-secondary);
}

.big-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

/* ---------- Grafikler ---------- */
.rate-row {
    display: grid;
    grid-template-columns: minmax(96px, 34%) 1fr auto;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.rate-track {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: var(--mud-palette-action-disabled-background);
    overflow: hidden;
}

.rate-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 7px;
}

.rate-value {
    min-width: 48px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.chip-wrap .mud-chip {
    margin: 4px 6px 4px 0 !important;
}

.chip-big .mud-chip {
    min-height: 40px;
    font-size: 0.95rem;
}

.chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    margin: 6px 0;
    white-space: pre-line;
}

.chat-bubble.me {
    margin-left: auto;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    border-bottom-right-radius: 4px;
}

.chat-bubble.coach {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom-left-radius: 4px;
}

.pre-line {
    white-space: pre-line;
}

.reminder-card {
    border-radius: 16px !important;
}

.reminder-card .routine li {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.done-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.sticky-actions {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 5;
    padding: 8px 0;
    background: var(--mud-palette-background);
}

/* ---------- Ana sayı + ölçer ---------- */
.hero-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-value {
    font-size: 3.2rem;
    font-weight: 600;
    line-height: 1;
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 6px;
}

.hero-status-text {
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

.meter-track {
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 0 4px 4px 0;
}

/* ---------- Çubuk listesi ---------- */
.bar-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr 56px;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.bar-label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    line-height: 1.2;
}

.bar-flag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
}

.bar-track {
    height: 14px;
}

.bar-fill {
    height: 14px;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
}

.bar-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ---------- Trend ---------- */
.trend-svg {
    width: 100%;
    height: auto;
    max-height: 200px;
}

.trend-axis {
    font-size: 9px;
    fill: var(--mud-palette-text-secondary);
}

.trend-end {
    font-size: 11px;
    font-weight: 700;
    fill: var(--mud-palette-text-primary);
}

/* ---------- Gösterge kutuları ---------- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.kpi {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Butonlar normal yazımla: uzun Türkçe seçenekler büyük harfle zor okunur. */
.mud-button-root {
    text-transform: none;
    letter-spacing: 0.01em;
}

/* Bildirimler alt gezinmenin üstünde. */
.mud-snackbar-location-bottom-center {
    bottom: calc(72px + env(safe-area-inset-bottom)) !important;
}

/* ---------- Piyasa kartları ve grafik ---------- */
.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.snap-card { cursor: pointer; }
.snap-code .muted { font-weight: 400; font-size: 0.8rem; }
.spark { display: block; margin-left: auto; }
.chart-wrap { width: 100%; }
.price-chart { width: 100%; display: block; touch-action: none; border-radius: 8px; }
.text-right { text-align: right; }
.muted { color: var(--mud-palette-text-secondary); }

/* ---------- Analiz ---------- */
.verdict-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; margin-bottom: 12px; }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 12px; }
.risk-table td:nth-child(odd) { color: var(--mud-palette-text-secondary); width: 18%; }
.news-item { background: transparent; }
.action-table-wrap { overflow-x: auto; }
.action-table { min-width: 760px; font-size: 0.85rem; }
.donut { flex-shrink: 0; }

.qr-box { width: 160px; height: 160px; background: #fff; padding: 6px; border-radius: 8px; flex-shrink: 0; }
.qr-box svg { width: 100%; height: 100%; display: block; }
