/* ========================================
   FlightAutoBriefing — Web UI
   Theme: Dark Navy + White + Air Premia Blue
   ======================================== */

:root {
    --navy-dark: #0a1628;
    --navy: #132038;
    --navy-light: #1c2d4a;
    --navy-lighter: #243656;
    --blue: #0066CC;
    --blue-light: #338ADB;
    --blue-glow: rgba(0, 102, 204, 0.15);
    --white: #ffffff;
    --gray-100: #f0f2f5;
    --gray-200: #d8dce3;
    --gray-300: #b0b8c6;
    --gray-400: #8892a4;
    --gray-500: #636d80;
    --red: #e53935;
    --red-bg: rgba(229, 57, 53, 0.12);
    --red-border: rgba(229, 57, 53, 0.3);
    --yellow: #ffc107;
    --yellow-bg: rgba(255, 193, 7, 0.10);
    --yellow-border: rgba(255, 193, 7, 0.25);
    --green: #43a047;
    --green-bg: rgba(67, 160, 71, 0.10);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

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

html {
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
    background: var(--navy-dark);
    color: var(--white);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* ===== Screens ===== */
.screen {
    display: none;
}
.screen.active {
    display: block;
}

/* ===== FOCC Button ===== */
.focc-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.6);
    border-radius: 10px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.focc-btn:hover {
    background: rgba(55, 65, 81, 0.95);
    color: #fff;
    border-color: rgba(96, 165, 250, 0.4);
}
.focc-btn svg { flex-shrink: 0; }

/* ===== Upload Screen ===== */
.upload-container {
    max-width: 540px;
    margin: 0 auto;
    padding: 60px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
}

.logo-area {
    text-align: center;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(0, 102, 204, 0.4));
}

.logo-area h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--white);
}

.subtitle {
    color: var(--gray-400);
    font-size: 18px;
    margin-top: 8px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--navy-lighter);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    background: var(--navy);
    transition: all var(--transition);
    cursor: pointer;
}

.drop-zone.drag-over {
    border-color: var(--blue);
    background: var(--blue-glow);
    transform: scale(1.02);
}

.drop-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.drop-text {
    color: var(--gray-300);
    font-size: 18px;
    margin-bottom: 16px;
}

.btn-primary {
    display: inline-block;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-appearance: none;
}

.btn-primary:hover {
    background: var(--blue-light);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97);
}

.drop-hint {
    color: var(--gray-500);
    font-size: 18px;
    margin-top: 12px;
}

/* Progress */
.progress-area {
    background: var(--navy);
    border-radius: var(--radius);
    padding: 20px;
}

.progress-area.hidden {
    display: none;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--gray-200);
}

.progress-bar {
    height: 6px;
    background: var(--navy-lighter);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-status {
    color: var(--gray-400);
    font-size: 18px;
    margin-top: 8px;
    text-align: center;
}

/* ===== Result Screen ===== */

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navy);
    border-bottom: 1px solid var(--navy-lighter);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-back {
    background: none;
    border: 1px solid var(--navy-lighter);
    color: var(--gray-300);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 17px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-back:hover {
    background: var(--navy-lighter);
    color: var(--white);
}

.flight-badge {
    font-size: 17px;
    font-weight: 700;
    color: var(--blue-light);
    letter-spacing: 0.5px;
}

/* Flag Banner */
.flag-banner {
    background: var(--navy);
    padding: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--navy-lighter);
}

.flag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 600;
}

.flag-chip.critical {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
}

.flag-chip.warning {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
}

.flag-chip.info {
    background: var(--green-bg);
    border: 1px solid rgba(67, 160, 71, 0.3);
    color: var(--green);
}

/* Parsing Warnings Banner — 파서 실패/핵심 필드 누락 가시화 */
.parse-warnings {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-left: 4px solid var(--red);
    margin: 0 16px 12px;
    padding: 12px 16px;
    border-radius: 6px;
    color: var(--red);
}

.parse-warnings-header {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.parse-warnings-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.parse-warnings-list li {
    margin: 2px 0;
}

/* Main Content */
.result-content {
    padding: 16px;
    padding-bottom: 80px;
    max-width: 960px;
    margin: 0 auto;
}

/* Section (collapsible) */
.section {
    background: var(--navy);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--navy-lighter);
    transition: border-color var(--transition);
}

.section.critical {
    border-color: var(--red-border);
}

.section.warning {
    border-color: var(--yellow-border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background var(--transition);
}

.section-header:hover {
    background: var(--navy-light);
}

.section-header:active {
    background: var(--navy-lighter);
}

.section-chevron {
    font-size: 18px;
    color: var(--gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.section.open .section-chevron {
    transform: rotate(90deg);
}

.section-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.section-badge {
    font-size: 18px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.section-badge.critical {
    background: var(--red-bg);
    color: var(--red);
}

.section-badge.warning {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.section-body {
    display: none;
    padding: 0 16px 16px;
}

.section.open .section-body {
    display: block;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.info-item {
    background: var(--navy-light);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.info-label {
    font-size: 17px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
    font-variant-numeric: tabular-nums;
}

.info-value.highlight {
    color: var(--blue-light);
}

.info-value.critical {
    color: var(--red);
}

.info-value.warning {
    color: var(--yellow);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}

.data-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--gray-400);
    font-weight: 600;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--navy-lighter);
    white-space: nowrap;
}

.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--gray-200);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .mono {
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
    font-size: 18px;
}

/* Cards (Weather, Company NOTAM) */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.card {
    background: var(--navy-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--navy-lighter);
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--blue-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-role {
    font-size: 17px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--blue-glow);
    color: var(--blue-light);
    font-weight: 600;
    text-transform: uppercase;
}

.wx-raw {
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
    font-size: 18px;
    line-height: 1.6;
    color: var(--gray-200);
    background: var(--navy);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 8px;
}

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

/* NOTAM */
.notam-group {
    margin-bottom: 16px;
}

.notam-group:last-child {
    margin-bottom: 0;
}

.notam-group-header {
    font-size: 17px;
    font-weight: 700;
    color: var(--blue-light);
    padding: 8px 0;
    border-bottom: 1px solid var(--navy-lighter);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notam-count {
    font-size: 18px;
    color: var(--gray-400);
    font-weight: 400;
}

.notam-item {
    background: var(--navy-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 6px;
    border-left: 3px solid var(--navy-lighter);
    font-size: 18px;
    line-height: 1.5;
    color: var(--gray-200);
}

.notam-item.critical {
    border-left-color: var(--red);
    background: var(--red-bg);
}

.notam-item.warning {
    border-left-color: var(--yellow);
    background: var(--yellow-bg);
}

.notam-meta {
    font-size: 17px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.notam-text {
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
    font-size: 18px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Company NOTAM contact card */
.contact-card {
    background: var(--navy-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--blue);
    border-left: 4px solid var(--blue);
}

.contact-card .contact-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--blue-light);
    margin-bottom: 8px;
}

.contact-card .contact-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
    font-size: 17px;
}

.contact-card .contact-label {
    color: var(--gray-400);
    min-width: 80px;
    font-size: 18px;
}

.contact-card a {
    color: var(--blue-light);
    text-decoration: none;
}

/* Flag detail in section */
.flag-detail {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flag-detail.warning {
    background: var(--yellow-bg);
    border-color: var(--yellow-border);
}

.flag-detail.info {
    background: var(--green-bg);
    border-color: rgba(67, 160, 71, 0.3);
}

/* Scrollable table wrapper */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--navy-lighter);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error */
.error-box {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--red);
}

.error-box p {
    margin-top: 8px;
    color: var(--gray-300);
    font-size: 17px;
}

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }

/* Sub-section within a section-body */
.sub-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-300);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--navy-lighter);
}

.sub-heading:first-child {
    margin-top: 0;
}

/* Fuel bar visualization */
.fuel-bar-container {
    margin: 12px 0;
}

.fuel-bar {
    height: 28px;
    background: var(--navy-light);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    position: relative;
}

.fuel-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.5s ease;
}

.fuel-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* OFP-style Fuel Table */
.fuel-ofp-table {
    margin-top: 12px;
}
.fuel-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 17px;
}
.fuel-table thead th {
    text-align: right;
    padding: 4px 10px;
    color: var(--gray-400);
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid var(--navy-lighter);
}
.fuel-table thead th:first-child {
    text-align: left;
}
.fuel-table td {
    padding: 5px 10px;
}
.fuel-table td.fuel-label {
    text-align: left;
    color: var(--gray-300);
    font-weight: 500;
}
.fuel-table td.fuel-num {
    text-align: right;
    color: var(--gray-200);
}
.fuel-table tr.indent td.fuel-label {
    padding-left: 28px;
    color: var(--gray-400);
    font-weight: 400;
}
.fuel-table tr.highlight td {
    color: var(--white);
    font-weight: 600;
}
.fuel-table tr.highlight td.fuel-label {
    color: var(--white);
    font-weight: 600;
}
.fuel-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}
.fuel-sensitivity {
    margin-top: 8px;
    font-size: 16px;
    color: var(--gray-400);
    text-align: right;
}

/* Notam toggle buttons */
.notam-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.notam-filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    border: 1px solid var(--navy-lighter);
    background: var(--navy-light);
    color: var(--gray-300);
    cursor: pointer;
    transition: all var(--transition);
}

.notam-filter-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

.notam-filter-btn:hover {
    border-color: var(--blue);
}

/* Unfiltered 버튼 — 다른 버튼과 동일 스타일, active만 보라색 계열 */
.notam-filter-btn.unfiltered.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: var(--white);
}

/* ETP / Route detail compact */
.route-summary {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.route-tag {
    background: var(--navy-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    color: var(--gray-200);
}

.route-tag strong {
    color: var(--white);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .upload-container {
        padding: 40px 16px;
    }

    .drop-zone {
        padding: 36px 16px;
    }

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

    .result-content {
        padding: 12px;
        padding-bottom: 60px;
    }

    .section-header {
        padding: 12px 14px;
    }

    .data-table {
        font-size: 18px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* iPad landscape */
@media (min-width: 1024px) {
    .info-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    animation: fadeIn 0.3s ease;
}

/* ===== FPL Detail Modal ===== */
.fpl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.fpl-modal {
    background: var(--navy-dark);
    border-radius: var(--radius);
    border: 1px solid var(--navy-lighter);
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: fplModalIn 0.25s ease;
}

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

.fpl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--navy-lighter);
    flex-shrink: 0;
}

.fpl-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--white);
}

.fpl-modal-close {
    background: var(--red);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.fpl-modal-close:hover {
    background: #c00;
    transform: scale(1.05);
}

.fpl-modal-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 24px;
    flex: 1;
}

.fpl-detail-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--navy-lighter);
}

.fpl-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fpl-detail-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fpl-item-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--blue);
    color: var(--white);
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.fpl-detail-sublabel {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-300);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    margin-top: 10px;
}

.fpl-raw-value {
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
    font-size: 17px;
    color: var(--gray-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.fpl-eq-raw {
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
    font-size: 18px;
    color: var(--gray-200);
    background: var(--navy);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    word-break: break-all;
}

.fpl-code-group {
    margin-bottom: 10px;
}

.fpl-code-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fpl-code-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--navy-light);
    border: 1px solid var(--navy-lighter);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 18px;
    line-height: 1.4;
}

.fpl-code-key {
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
    font-weight: 700;
    color: var(--blue-light);
    font-size: 18px;
}

.fpl-code-desc {
    color: var(--gray-200);
    font-size: 18px;
}

.btn-fpl-detail {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--navy-light);
    border: 1px solid var(--blue);
    border-radius: var(--radius-sm);
    color: var(--blue-light);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.btn-fpl-detail:hover {
    background: var(--blue-glow);
    border-color: var(--blue-light);
    transform: translateY(-1px);
}

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

@media (max-width: 768px) {
    .fpl-modal-overlay {
        padding: 12px 8px;
    }
    .fpl-modal-content {
        padding: 12px 14px 20px;
    }
    .fpl-code-chip {
        font-size: 17px;
        padding: 3px 8px;
    }
}

/* Print styles */
@media print {
    .top-bar, .btn-back { display: none; }
    .section { break-inside: avoid; }
    .section.open .section-body { display: block; }
    body { background: white; color: black; }
}

/* Login */
.login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}
.pin-input {
    width: 200px;
    padding: 16px 20px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.pin-input:focus {
    border-color: #0066CC;
}
.pin-input::placeholder {
    letter-spacing: 2px;
    font-size: 18px;
    color: rgba(255,255,255,0.3);
}
.login-error {
    color: #ff4444;
    font-size: 17px;
    margin: 0;
}
.login-error.hidden {
    display: none;
}

/* Weather Chart Analysis */
.wx-chart-item {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.wx-chart-item:last-child {
    border-bottom: none;
}
.wx-analysis-md {
    font-size: 18px;
    line-height: 1.6;
    color: var(--gray-200, #ccc);
}
.wx-analysis-md h3, .wx-analysis-md h4 {
    color: var(--gray-100, #eee);
}
.wx-analysis-md li {
    margin-bottom: 2px;
}
.wx-analysis-md strong {
    color: var(--gray-100, #eee);
}
