:root {
    --bg: #0c1e33;
    --bg-alt: #111f35;
    --surface: #16263d;
    --surface-hover: #1c2e4a;
    --surface-raised: #1e3350;
    --border: rgba(55, 90, 130, 0.35);
    --border-subtle: rgba(55, 90, 130, 0.18);

    --text: #e8edf3;
    --text-secondary: #9db0c8;
    --text-muted: #6b839e;

    --accent: #e87b35;
    --accent-dim: rgba(232, 123, 53, 0.12);
    --accent-border: rgba(232, 123, 53, 0.35);

    --green: #34c770;
    --green-dim: rgba(52, 199, 112, 0.12);
    --blue: #3b8cf6;
    --yellow: #e5a820;
    --red: #e05050;

    --excellent: #34c770;
    --good: #3b8cf6;
    --fair: #e5a820;
    --poor: #e05050;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    --shadow: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---- Background fish canvas ---- */
#fish-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* ---- App shell ---- */
.app {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==================================
   HEADER
   ================================== */
header {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.logo-icon {
    font-size: 24px;
    line-height: 1;
}

h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: var(--text);
}

.tagline {
    font-size: 12px;
    color: var(--text-muted);
    display: none;
}

.header-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: color 0.15s, border-color 0.15s;
    background: none;
    box-shadow: none;
    min-height: 36px;
}

.header-guide-link:hover {
    color: var(--accent);
    border-color: var(--accent-border);
    background: none;
    transform: none;
    box-shadow: none;
}

/* ==================================
   MAIN LAYOUT — two-column desktop
   ================================== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

/* ==================================
   MAP COLUMN (left)
   ================================== */
.map-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 12px;
    align-self: start;
    height: calc(100vh - 70px);
}

.map-controls-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.spot-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    pointer-events: none;
    color: var(--text-muted);
}

.spot-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px 8px 32px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    transition: border-color 0.15s;
}

.spot-search:focus {
    outline: none;
    border-color: var(--accent);
}

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

.spot-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 260px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.spot-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s;
}

.spot-dropdown-item:last-child { border-bottom: none; }
.spot-dropdown-item:hover { background: var(--surface-hover); color: var(--accent); }

.map-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.preset-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.loc-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font);
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.loc-btn:hover {
    border-color: var(--accent-border);
    color: var(--text);
}

.loc-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.geo-btn {
    background: var(--accent-dim) !important;
    border-color: var(--accent-border) !important;
    color: var(--accent) !important;
    font-weight: 600 !important;
}

.geo-btn:hover {
    background: var(--accent) !important;
    color: var(--bg) !important;
}

.coord-details summary {
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 0;
    opacity: 0.7;
}

.coord-details summary:hover {
    opacity: 1;
}

.custom-location {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.custom-location input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
}

.custom-location input:focus { outline: none; border-color: var(--accent); }

.coord-error { font-size: 12px; color: var(--red); margin-top: 4px; }

.coast-notice {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 500;
    background: rgba(11, 34, 60, 0.88);
    border: 1px solid rgba(229, 168, 32, 0.3);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 11px;
    color: var(--yellow);
    line-height: 1.4;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

/* ==================================
   DECISION PANEL (right column)
   ================================== */
.decision-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-section {
    background: var(--bg-alt);
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* -- Location header -- */
.dp-location {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dp-location-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.dp-location-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dp-chip {
    font-size: 11px;
    color: var(--text-muted);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-weight: 500;
    white-space: nowrap;
}

/* -- Score block -- */
.dp-score-block {
    text-align: center;
    padding: 24px 18px 18px;
}

.dp-score-question {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 14px;
}

.dp-score-number {
    font-size: 56px;
    font-weight: 800;
    font-family: var(--mono);
    line-height: 1;
    letter-spacing: -0.04em;
}

.dp-score-label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dp-score-bar {
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}

.dp-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.dp-score-why {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 14px;
    line-height: 1.6;
    text-align: center;
}

/* -- Best hours -- */
.dp-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.dp-best-hours {
    display: flex;
    gap: 6px;
}

.dp-hour-card {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.dp-hour-card:first-child {
    border-color: var(--accent-border);
    background: var(--accent-dim);
}

.dp-hour-time {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--mono);
}

.dp-hour-score {
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.dp-hour-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* -- Target fish -- */
.dp-fish-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dp-fish-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s;
    flex: 1;
    min-width: 120px;
}

.dp-fish-item:hover {
    border-color: var(--accent-border);
}

.dp-fish-illust {
    width: 36px;
    height: 24px;
    flex-shrink: 0;
}

.dp-fish-name {
    font-size: 13px;
    font-weight: 600;
}

.dp-fish-eff {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--mono);
    margin-left: auto;
}

.dp-fish-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* -- Bait/tackle -- */
.dp-bait-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dp-bait-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: border-color 0.15s;
}

.dp-bait-card:hover {
    border-color: var(--accent-border);
}

.dp-bait-fish {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.dp-bait-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.dp-bait-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.dp-bait-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    font-weight: 500;
}

.dp-bait-tag.lure {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--blue);
}

/* -- Conditions grid -- */
.dp-conditions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.dp-cond-item {
    background: var(--surface);
    padding: 10px 8px;
    text-align: center;
    border-radius: var(--radius-xs);
}

.dp-cond-value {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: -0.02em;
}

.dp-cond-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

.dp-cond-note {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* -- Score factors -- */
.dp-factors {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dp-factor {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.dp-factor-bar {
    width: 32px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dp-factor-val {
    font-weight: 700;
    font-family: var(--mono);
    font-size: 11px;
    min-width: 28px;
    text-align: right;
}

/* ==================================
   FULL-WIDTH SECTIONS (below grid)
   ================================== */
.section-full {
    margin-bottom: 16px;
}

/* -- Hourly forecast (Apple Weather style) -- */
.hourly-section {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.hourly-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px 0;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.hourly-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.hourly-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 8px 6px;
    scroll-snap-type: x proximity;
}

.hourly-scroll::-webkit-scrollbar { display: none; }

/* Score gradient band — fixed overview below scroll */
.hw-gradient-band {
    display: flex;
    gap: 0;
    padding: 0 14px 14px;
}

.hw-gradient-segment {
    flex: 1;
    height: 5px;
    min-width: 0;
}

.hw-gradient-segment:first-child {
    border-radius: 3px 0 0 3px;
}

.hw-gradient-segment:last-child {
    border-radius: 0 3px 3px 0;
}

.hw-card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    min-width: 60px;
    scroll-snap-align: start;
    position: relative;
}

.hw-card.hw-now .hw-time {
    color: var(--accent);
    font-weight: 700;
}

.hw-time {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.hw-icon {
    font-size: 22px;
    line-height: 1;
    height: 28px;
    display: flex;
    align-items: center;
}

.hw-temp {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.hw-score {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: -0.03em;
}

/* -- Telegram CTA -- */
.tg-cta {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.tg-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tg-cta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tg-cta-text strong {
    font-size: 14px;
    color: var(--text);
}

.tg-cta-text span {
    font-size: 12px;
    color: var(--text-muted);
}

.tg-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #2AABEE;
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.tg-cta-btn:hover { opacity: 0.88; }

.tg-cta-features {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.tg-cta-features span {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.15s;
    align-self: flex-start;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-weight: 500;
    font-size: 13px;
}


/* ==================================
   LOADING / ERROR / HIDDEN
   ================================== */
.hidden { display: none !important; }

.loading {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-muted);
    font-size: 13px;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    box-shadow: var(--shadow-md);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

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

.error-banner {
    background: rgba(224, 80, 80, 0.08);
    border: 1px solid rgba(224, 80, 80, 0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--red);
    font-size: 13px;
}

/* ==================================
   LEAFLET OVERRIDES
   ================================== */
.leaflet-container { background: #0a1929 !important; }

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow) !important;
}

.leaflet-control-zoom a {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 14px !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 2px !important;
}

.leaflet-control-layers {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 10px !important;
    box-shadow: var(--shadow) !important;
    font-family: var(--font) !important;
    font-size: 11px !important;
}

.leaflet-control-layers-toggle {
    background-color: var(--surface) !important;
    border-radius: var(--radius-sm) !important;
    width: 32px !important;
    height: 32px !important;
}

.leaflet-control-attribution {
    background: rgba(12, 30, 51, 0.85) !important;
    color: var(--text-muted) !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a { color: var(--accent) !important; }

.leaflet-popup-content-wrapper {
    background: var(--surface-raised) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md) !important;
}

.leaflet-popup-tip { background: var(--surface-raised) !important; }

.leaflet-popup-content {
    font-family: var(--font);
    font-size: 12px;
    margin: 10px 12px;
}

/* Map markers */
.score-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 11px;
    color: white;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: transform 0.15s;
    font-family: var(--mono);
    box-shadow: var(--shadow);
}

.score-marker:hover { transform: scale(1.15); }

.score-marker-active {
    transform: scale(1.2);
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(232, 123, 53, 0.3);
}

.selected-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid white;
    animation: pulse-ring 2s ease infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(232, 123, 53, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(232, 123, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(232, 123, 53, 0); }
}

.popup-score {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--mono);
}

.popup-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.popup-fish {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ==================================
   FOOTER
   ================================== */
footer {
    text-align: center;
    padding: 20px 0 12px;
    color: var(--text-muted);
    font-size: 11px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
}

/* ==================================
   FISH GUIDE (fihrist)
   ================================== */
.guide-app { max-width: 1120px; }

.guide-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.15s;
}

.guide-back:hover { opacity: 0.7; }

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

.guide-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    min-width: 60px;
}

.filter-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 4px;
}

.guide-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 500;
    transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--accent-border); color: var(--text); }

.filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.guide-count {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    font-family: var(--mono);
}

.guide-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 32px;
}

.guide-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    transition: border-color 0.15s;
    cursor: pointer;
}

.guide-card:hover {
    border-color: var(--accent-border);
}

.guide-illust {
    width: 80px;
    height: 52px;
    margin: 0 auto 8px;
    padding: 6px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.guide-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.guide-cat {
    font-size: 11px;
    color: var(--text-muted);
}

.fish-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--mono);
}

.guide-season-block { margin-bottom: 8px; }

.guide-month-labels {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 2px;
}

.month-label {
    width: 12px;
    text-align: center;
    font-size: 8px;
    font-weight: 600;
    color: var(--text-muted);
}

.guide-seasons {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.season-dot {
    width: 12px;
    height: 5px;
    border-radius: 2px;
    background: var(--border);
}

.season-dot.on { opacity: 1; }

.guide-regions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.region-tag {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    border: 1px solid;
    white-space: nowrap;
}

/* ==================================
   FISH DETAIL PAGE
   ================================== */
.panel {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

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

.modal-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-fish-illust {
    width: 88px;
    height: 56px;
    flex-shrink: 0;
}

.modal-fish-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.modal-fish-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-meta-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.modal-section { margin-bottom: 16px; }
.modal-section:last-child { margin-bottom: 0; }

.modal-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.nutrition-item {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    text-align: center;
}

.nutrition-value {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--mono);
    line-height: 1.2;
}

.nutrition-unit { font-size: 10px; color: var(--text-muted); }
.nutrition-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    margin-top: 3px;
}

.nutrition-minerals {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.cooking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cooking-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.cooking-method {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    min-width: 64px;
    text-align: center;
}

.cooking-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tackle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.tackle-item {
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.tackle-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    margin-bottom: 3px;
}

.tackle-value {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

.tackle-technique {
    grid-column: 1 / -1;
    padding: 10px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
}

.tackle-technique .tackle-label { color: var(--accent); }
.tackle-technique .tackle-value { color: var(--text-secondary); line-height: 1.5; }

.tackle-baits { grid-column: 1 / -1; }

.bait-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.bait-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    background: var(--surface-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-weight: 500;
}

.bait-tag.lure {
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.2);
    color: var(--blue);
}

.modal-tip-box {
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.chip {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-weight: 500;
}

.detail-hero h1 {
    font-size: 24px;
    background: none;
    -webkit-text-fill-color: var(--text);
}

.detail-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.detail-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}

.detail-nav-card:hover { border-color: var(--accent-border); }

.detail-nav-arrow { font-size: 18px; color: var(--text-muted); }
.detail-nav-fish-illust { width: 56px; height: 36px; }
.detail-nav-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.detail-nav-name { font-size: 14px; font-weight: 600; }

.detail-all-fish { margin-bottom: 20px; }

.detail-fish-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 6px 2px;
}

.detail-fish-strip::-webkit-scrollbar { display: none; }

.detail-strip-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg-alt);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    transition: border-color 0.15s;
    min-width: 72px;
}

.detail-strip-item:hover { border-color: var(--accent-border); }
.detail-strip-item.active { background: var(--surface-hover); color: var(--text); }

.detail-strip-illust { width: 40px; height: 28px; }
.detail-strip-name { font-size: 9px; font-weight: 600; text-align: center; }

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

/* ==================================
   RESPONSIVE — Tablet
   ================================== */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }

    .map-column {
        position: static;
        height: auto;
    }

    .map-wrap { min-height: 45vh; }
}

/* ==================================
   RESPONSIVE — Mobile
   ================================== */
@media (max-width: 640px) {
    /* Prevent iOS zoom on focus */
    input[type="text"],
    input[type="number"],
    select {
        font-size: 16px !important;
    }

    /* App shell */
    .app { padding: 0 8px; }
    header { padding: 8px 0; margin-bottom: 4px; }
    h1 { font-size: 15px; }
    .header-guide-link { padding: 4px 10px; min-height: 32px; font-size: 12px; }
    .header-guide-link .link-text { display: none; }
    .header-guide-link::after { content: 'Rehber'; }

    /* Layout */
    .main-layout { gap: 6px; margin-bottom: 6px; }

    /* Map controls */
    .map-controls-bar { gap: 6px; }
    .spot-search-wrap { flex: 1; min-width: 0; }
    .spot-search { padding: 6px 10px 6px 30px; font-size: 13px; }
    .geo-btn { font-size: 11px !important; white-space: nowrap; padding: 6px 8px; }

    /* Map — edge-to-edge, controlled height */
    .map-wrap {
        min-height: 38vh;
        max-height: 50vh;
        margin: 0 -8px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Preset pills — horizontal scroll */
    .preset-pills { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; gap: 3px; }
    .preset-pills::-webkit-scrollbar { display: none; }
    .loc-btn { flex-shrink: 0; padding: 4px 8px; font-size: 10px; }

    /* Hide coord details on mobile */
    .coord-details { display: none; }

    /* Decision panel cards */
    .decision-panel { gap: 6px; }
    .dp-section { padding: 10px 12px; border-radius: var(--radius-sm); }

    /* Location header */
    .dp-location { flex-direction: column; align-items: flex-start; gap: 4px; }
    .dp-location-name { font-size: 14px; }
    .dp-location-meta { flex-wrap: wrap; }
    .dp-chip { font-size: 10px; padding: 2px 6px; }

    /* Score block */
    .dp-score-block { padding: 16px 12px 14px; }
    .dp-score-question { font-size: 12px; margin-bottom: 10px; }
    .dp-score-number { font-size: 40px; }
    .dp-score-label { font-size: 12px; }
    .dp-score-bar { margin-top: 12px; }
    .dp-score-why { font-size: 12px; margin-top: 10px; }

    /* Best hours — horizontal scroll */
    .dp-best-hours { overflow-x: auto; scrollbar-width: none; }
    .dp-best-hours::-webkit-scrollbar { display: none; }
    .dp-hour-card { flex-shrink: 0; min-width: 80px; padding: 8px 4px; }
    .dp-hour-time { font-size: 13px; }
    .dp-hour-score { font-size: 11px; }
    .dp-hour-meta { font-size: 9px; }

    /* Target fish — horizontal scroll */
    .dp-fish-list { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .dp-fish-list::-webkit-scrollbar { display: none; }
    .dp-fish-item { flex-shrink: 0; min-width: 120px; flex: none; padding: 6px 10px; }
    .dp-fish-name { font-size: 12px; }
    .dp-fish-illust { width: 28px; height: 18px; }

    /* Bait cards */
    .dp-bait-card { padding: 8px 10px; gap: 8px; }
    .dp-bait-fish { font-size: 12px; }
    .dp-bait-detail { font-size: 11px; }

    /* Conditions grid — 3 columns, compact */
    .dp-conditions { grid-template-columns: repeat(3, 1fr); gap: 4px; }
    .dp-cond-item { padding: 8px 4px; }
    .dp-cond-value { font-size: 14px; }
    .dp-cond-label { font-size: 9px; }

    /* Score factors */
    .dp-factor { font-size: 11px; padding: 4px 0; gap: 6px; }
    .dp-factor-val { font-size: 10px; min-width: 24px; }
    .dp-factor-bar { width: 24px; }
    .dp-section-title { font-size: 12px; margin-bottom: 8px; }

    /* Hourly section — edge-to-edge */
    .section-full { margin-bottom: 8px; }
    .hourly-section { border-radius: 0; margin: 0 -8px; border-left: none; border-right: none; }
    .hourly-header { padding: 10px 12px 8px; }
    .hourly-title { font-size: 12px; }
    .hw-card { min-width: 48px; padding: 8px 4px 10px; gap: 4px; }
    .hw-time { font-size: 10px; }
    .hw-icon { font-size: 16px; height: 22px; }
    .hw-temp { font-size: 13px; }
    .hw-score { font-size: 11px; }
    .hw-gradient-band { padding: 0 8px 10px; }

    /* Telegram CTA — edge-to-edge */
    .tg-cta { border-radius: 0; margin: 0 -8px; border-left: none; border-right: none; padding: 14px 12px; }
    .tg-cta-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .tg-cta-text strong { font-size: 13px; }
    .tg-cta-text span { font-size: 11px; }
    .tg-cta-btn { width: 100%; justify-content: center; font-size: 13px; padding: 8px 16px; }
    .tg-cta-features { flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; }
    .tg-cta-features span { font-size: 10px; }

    /* Footer */
    footer { padding: 14px 0 10px; font-size: 10px; }

    /* ---- Fish Guide (fihrist) mobile ---- */
    .guide-filter-group { flex-direction: column; align-items: flex-start; gap: 4px; }
    .guide-filters { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .guide-filters::-webkit-scrollbar { display: none; }
    .filter-label { min-width: auto; font-size: 10px; }
    .filter-btn { flex-shrink: 0; padding: 4px 10px; font-size: 11px; }
    .guide-legend { padding: 8px 10px; gap: 8px; margin-bottom: 10px; }
    .legend-item { font-size: 10px; }
    .guide-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .guide-card { padding: 8px; }
    .guide-illust { width: 56px; height: 36px; }
    .guide-name { font-size: 12px; }
    .guide-count { font-size: 12px; }

    /* ---- Fish Detail (balik) mobile ---- */
    .panel { padding: 12px 14px; }
    .modal-hero { flex-direction: column; text-align: center; gap: 8px; }
    .modal-fish-illust { width: 72px; height: 46px; }
    .modal-fish-title { font-size: 18px; }
    .modal-fish-subtitle { font-size: 12px; }
    .modal-meta-row { justify-content: center; }
    .detail-hero h1 { font-size: 18px; }
    .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
    .nutrition-value { font-size: 16px; }
    .tackle-grid { grid-template-columns: 1fr; }
    .detail-nav { gap: 6px; }
    .detail-nav-card { padding: 10px 8px; }
    .detail-nav-name { font-size: 12px; }
    .detail-strip-item { min-width: 60px; padding: 6px 8px; }
    .detail-strip-name { font-size: 8px; }
}
