* {
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --violet: #7c3aed;
    --danger: #dc2626;
    --bg: #f5f7fb;
    --card: rgba(255, 255, 255, 0.92);
    --text: #111827;
    --muted: #64748b;
    --border: #e5edf7;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 32rem),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 28rem),
        var(--bg);
    color: #1f2937;
}

a {
    color: inherit;
    text-decoration: none;
}

.page {
    min-height: 100vh;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    color: #fff;
    padding: 14px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(124, 58, 237, 0.96));
    box-shadow: 0 12px 34px rgba(37, 99, 235, 0.24);
    backdrop-filter: blur(18px);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-mark {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    font-weight: 900;
}

.nav-links {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.nav-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 30px auto 48px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: stretch;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 244, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 30px;
    padding: 42px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.12);
}

.hero-content,
.hero-panel {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hero h1,
.page-title h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.15;
    color: var(--text);
}

.hero p,
.page-title p {
    margin: 0;
    color: var(--muted);
    line-height: 1.85;
    font-size: 16px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.hero-panel {
    align-self: center;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.12);
}

.hero-panel-title {
    margin-bottom: 14px;
    color: #334155;
    font-weight: 800;
}

.hero-panel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 13px 0;
    border-top: 1px solid #e2e8f0;
}

.hero-panel-item span {
    color: var(--muted);
}

.hero-panel-item strong {
    color: var(--primary);
    font-size: 26px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--violet));
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
}

.stat-card .num {
    font-size: 34px;
    font-weight: 900;
    color: var(--primary);
}

.stat-card .label {
    margin-top: 6px;
    color: #6b7280;
}

.card {
    background: var(--card);
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.compact-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-section {
    margin-top: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 26px;
}

.section-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.feature-card {
    display: flex;
    min-height: 178px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: #bfdbfe;
    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.12);
}

.primary-feature {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(245, 243, 255, 0.94));
}

.feature-card.is-disabled {
    border-style: dashed;
    background: rgba(248, 250, 252, 0.92);
}

.role-chip {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 13px;
    font-weight: 900;
}

.feature-tag {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.feature-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.card h3 {
    margin: 0 0 12px;
    font-size: 22px;
    color: #111827;
}

.card p {
    margin: 8px 0;
    color: #4b5563;
    line-height: 1.7;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.page-title {
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 14px;
    padding: 11px 17px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
    transition: all 0.2s ease;
}

.btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.24);
}

.btn-secondary {
    background: #eef2ff;
    color: #3730a3;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #e0e7ff;
    color: #312e81;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.12);
}

.btn-success {
    background: #16a34a;
}

.btn-danger {
    background: #dc2626;
}

.btn-small {
    padding: 7px 12px;
    border-radius: 10px;
}

.form-card {
    max-width: 760px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.muted {
    color: #6b7280;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    background: #fbfdff;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 14px;
    align-items: end;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.flash-list {
    padding: 0;
    list-style: none;
    margin: 0 0 18px;
}

.flash-list li {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-card {
    position: relative;
    width: min(460px, 100%);
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #eef2ff;
    color: #3730a3;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.compact-title {
    margin: 0 0 20px;
}

.compact-title h1 {
    font-size: 28px;
}

.form-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-weight: 700;
}

.empty {
    text-align: center;
    padding: 46px;
    color: #6b7280;
    background: #fff;
    border-radius: 18px;
    border: 1px dashed #cbd5e1;
}

.table-card {
    overflow-x: auto;
    border-radius: 22px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 720px;
}

th,
td {
    padding: 15px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
}

th {
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
    white-space: nowrap;
}

tr:hover td {
    background: #f8fbff;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.poster-preview {
    max-width: 360px;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 8px;
}

.published-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.published-event-card {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid #eef2f7;
}

.published-event-poster {
    width: 100%;
    height: 360px;
    object-fit: cover;
    background: #f8fafc;
}

.published-event-body {
    padding: 20px;
}

.published-event-body h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 22px;
}

.promo-text {
    color: #374151;
    line-height: 1.8;
    font-size: 16px;
    white-space: pre-wrap;
}

.moment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.moment-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}

.moment-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.moment-body {
    padding: 16px;
}

.moment-body p {
    color: #374151;
    line-height: 1.7;
    margin: 0 0 10px;
}

.moment-body small {
    display: block;
    color: #6b7280;
    margin-bottom: 12px;
}

.moment-preview-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.moment-preview-strip img {
    width: 100%;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.geofence-map {
    width: 100%;
    height: 360px;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    overflow: hidden;
    margin-bottom: 10px;
}

.geofence-summary {
    text-align: left;
    padding: 16px;
    line-height: 1.8;
}

.geofence-summary strong {
    color: #111827;
}

.year-switch-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.year-switch-form input {
    width: 110px;
}

.footprint-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(48px, 1fr));
    gap: 12px;
    align-items: end;
    min-height: 140px;
}

.footprint-month {
    display: grid;
    gap: 8px;
    justify-items: center;
    color: var(--muted);
    font-size: 13px;
}

.footprint-month-bar {
    width: 24px;
    min-height: 12px;
    border-radius: 999px 999px 6px 6px;
    background: linear-gradient(180deg, var(--primary), var(--violet));
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.footprint-timeline {
    position: relative;
}

.footprint-node {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.footprint-node:last-child {
    border-bottom: none;
}

.footprint-dot {
    width: 14px;
    height: 14px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.footprint-node h4 {
    margin: 0 0 8px;
    color: var(--text);
}

.certificate-card {
    max-width: 920px;
    min-height: 640px;
    margin: 28px auto;
    padding: 58px;
    text-align: center;
    background: radial-gradient(circle at top, #fff8df, #ffffff 58%);
    border: 8px double #b8860b;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(120, 78, 0, 0.16);
    color: #3f2f0b;
}

.certificate-ribbon {
    display: inline-flex;
    padding: 8px 18px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 800;
}

.certificate-card h1 {
    margin: 28px 0 6px;
    color: #8b5a00;
    font-size: clamp(42px, 7vw, 64px);
    letter-spacing: 14px;
}

.certificate-subtitle {
    margin: 0;
    color: #a16207;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.certificate-name {
    margin: 44px 0 8px;
    color: #111827;
    font-size: 36px;
    font-weight: 900;
}

.certificate-meta,
.certificate-text {
    color: #4b5563;
    font-size: 17px;
    line-height: 2;
}

.certificate-title {
    display: inline-block;
    margin: 30px 0;
    padding: 14px 30px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
    font-size: 34px;
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.24);
}

.certificate-summary {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.certificate-summary span {
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
}

.certificate-footer {
    margin-top: 56px;
    text-align: right;
    color: #3f2f0b;
    font-weight: 700;
}

.discussion-panel {
    display: grid;
    gap: 14px;
}

.discussion-message {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.discussion-message-own {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.discussion-message-system {
    background: #fef3c7;
    border-color: #fde68a;
}

.discussion-message-deleted {
    opacity: 0.72;
    background: #f8fafc;
}

.discussion-meta {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.discussion-content {
    color: var(--text);
    line-height: 1.75;
    white-space: pre-wrap;
}

.emergency-banner {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
    padding: 20px 22px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fee2e2, #fff7ed);
    border: 1px solid #fecaca;
    box-shadow: 0 16px 34px rgba(220, 38, 38, 0.12);
}

.emergency-banner strong {
    color: #991b1b;
    font-size: 18px;
}

.emergency-banner p {
    margin: 8px 0 0;
    color: #7f1d1d;
}

.emergency-card {
    border-color: #fecaca;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 242, 0.82));
}

.emergency-phone-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.timeline-item {
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.timeline-item:first-child {
    border-top: 0;
}

.timeline-item small {
    color: var(--muted);
    margin-left: 8px;
}

.emergency-status-open,
.emergency-status-responding {
    color: #991b1b;
    font-weight: 800;
}

.dashboard-screen {
    display: grid;
    gap: 20px;
}

.screen-hero {
    align-items: stretch;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.18), transparent 22rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.88));
}

.screen-hero .page-title {
    margin-bottom: 0;
}

.screen-kpis {
    margin-top: 0;
}

.screen-kpis .stat-card strong {
    display: block;
    color: var(--primary);
    font-size: 34px;
    line-height: 1.1;
}

.screen-kpis .stat-card span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 700;
}

.screen-section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 20px;
    align-items: start;
}

.heat-score {
    color: var(--primary);
    font-size: 18px;
    font-weight: 900;
}

.heat-bar {
    width: 100%;
    height: 9px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5edf7;
}

.heat-bar-fill {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.occupancy-fill {
    background: linear-gradient(90deg, #0f766e, #22c55e);
}

.ranking-list {
    display: grid;
    gap: 12px;
}

.ranking-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.ranking-main {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ranking-main strong {
    color: var(--text);
}

.ranking-main span,
.empty-text {
    color: var(--muted);
    line-height: 1.6;
}

.risk-panel {
    display: grid;
    gap: 12px;
}

.risk-item {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.risk-item strong {
    color: var(--text);
}

.risk-item span {
    color: #475569;
    line-height: 1.6;
}

.risk-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.risk-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

@media print {
    .navbar,
    .no-print,
    .toolbar,
    .flash-list {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    .container {
        width: 100%;
        margin: 0;
    }

    .card,
    .table-card,
    .stat-card,
    .certificate-card {
        box-shadow: none !important;
    }

    .certificate-card {
        min-height: 92vh;
        border-radius: 0;
        page-break-inside: avoid;
    }
}

@media (max-width: 900px) {
    .navbar {
        display: flex;
        flex-wrap: wrap;
        padding: 16px 18px;
        gap: 12px;
    }

    .nav-toggle {
        display: inline-grid;
        place-items: center;
        margin-left: auto;
    }

    .nav-links {
        display: none;
        flex: 0 0 100%;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .navbar.nav-open .nav-links {
        display: flex;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 32px;
    }

    .hero-panel {
        max-width: none;
    }

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

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .footprint-months {
        grid-template-columns: repeat(6, minmax(48px, 1fr));
    }

    .inline-form,
    .grid-2,
    .grid-two,
    .screen-section-grid,
    .compact-stats,
    .emergency-banner,
    .emergency-phone-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        display: block;
    }

    .emergency-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .geofence-map {
        height: 300px;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1180px);
        margin-top: 18px;
    }

    .nav-links a,
    .nav-links .badge {
        font-size: 12px;
        padding: 7px 9px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 26px;
        border-radius: 24px;
    }

    .card,
    .stat-card {
        border-radius: 18px;
        padding: 20px;
    }

    .footprint-months {
        grid-template-columns: repeat(3, minmax(48px, 1fr));
    }

    .certificate-card {
        padding: 32px 20px;
    }

    .certificate-card h1 {
        letter-spacing: 8px;
    }
}
