@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');

:root {
    --brand: #0f766e;
    --brand-dark: #0a4f4a;
    --brand-soft: #e8f7f4;
    --navy: #102a43;
    --blue: #2563eb;
    --cyan: #0891b2;
    --green: #16845b;
    --line-green: #06c755;
    --yellow: #eab308;
    --orange: #ea6a25;
    --red: #dc3f4f;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --background: #f1f6f7;
    --text: #18252f;
    --muted: #637381;
    --border: #dbe5e9;
    --border-strong: #c5d3da;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 3px 12px rgba(16, 42, 67, .055);
    --shadow: 0 14px 38px rgba(16, 42, 67, .085);
    --shadow-lg: 0 28px 70px rgba(8, 55, 62, .16);
    --focus: 0 0 0 4px rgba(15, 118, 110, .16);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 90% 0, rgba(14, 159, 154, .055), transparent 27rem),
        var(--background);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { color: var(--brand-dark); background: #bdece5; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; color: var(--navy); font-size: clamp(1.65rem, 4vw, 2.45rem); font-weight: 800; line-height: 1.22; letter-spacing: -.025em; }
h2 { color: var(--navy); font-size: 1.18rem; font-weight: 750; }
h3 { color: var(--navy); }
.muted { color: var(--muted); }

/* App shell */
.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 76px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(197, 211, 218, .72);
    box-shadow: 0 1px 0 rgba(255,255,255,.7);
    backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); font-size: 1.05rem; font-weight: 800; }
.brand-mini {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--cyan));
    border-radius: 13px;
    box-shadow: 0 7px 18px rgba(15, 118, 110, .2);
    font-size: .86rem;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.12; }
.brand-copy small { margin-top: 3px; color: var(--brand); font-size: .68rem; font-weight: 650; letter-spacing: .015em; }
.topbar-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 11px; }
.system-status { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.live-clock {
    min-height: 48px;
    padding: 6px 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--navy);
    background: linear-gradient(135deg, #f8fafc, #edf8f6);
    border: 1px solid #d7e8e5;
    border-radius: 14px;
    box-shadow: inset 0 1px rgba(255,255,255,.8);
}
.live-indicator { width: 8px; height: 8px; flex: 0 0 auto; background: #10b981; border: 2px solid #d1fae5; border-radius: 50%; box-shadow: 0 0 0 3px rgba(16,185,129,.12); animation: livePulse 2s ease-in-out infinite; }
.clock-copy { display: flex; flex-direction: column; line-height: 1.14; white-space: nowrap; }
.clock-copy strong { color: var(--navy); font-size: .86rem; font-variant-numeric: tabular-nums; letter-spacing: .025em; }
.clock-copy small { margin-top: 3px; color: var(--muted); font-size: .6rem; font-weight: 550; }
.version-chip { padding: 6px 9px; color: var(--brand); background: var(--brand-soft); border: 1px solid #d1ebe6; border-radius: 999px; font-size: .64rem; font-weight: 750; white-space: nowrap; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.78); } }
.user-chip {
    min-width: 0;
    padding: 7px 11px 7px 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--navy);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 15px;
    font-size: .83rem;
    font-weight: 650;
}
.user-chip > span:last-child { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-chip small { color: var(--muted); font-size: .68rem; font-weight: 500; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, var(--brand), var(--cyan)); border-radius: 10px; font-weight: 800; }

.app-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    padding: 25px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 10% 0, rgba(45, 212, 191, .18), transparent 14rem),
        linear-gradient(180deg, #123647, #102a43 55%, #0b2235);
    box-shadow: inset -1px 0 rgba(255,255,255,.06);
}
.nav-section { margin: 2px 12px 10px; color: #83a5b7; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar a { min-height: 46px; padding: .7rem .85rem; display: flex; align-items: center; gap: 11px; color: #d7e6ed; border: 1px solid transparent; border-radius: 13px; font-size: .88rem; font-weight: 580; transition: background .2s ease, transform .2s ease, color .2s ease; }
.sidebar a:hover { color: #fff; background: rgba(255,255,255,.09); transform: translateX(2px); }
.sidebar a.active { color: #fff; background: linear-gradient(135deg, rgba(20,184,166,.34), rgba(8,145,178,.25)); border-color: rgba(153,246,228,.16); box-shadow: inset 3px 0 #5eead4; }
.nav-icon { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(255,255,255,.08); border-radius: 8px; font-size: 1rem; }
.sidebar .logout-link { margin-top: auto; color: #f6c7cd; }

.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 34px clamp(20px, 3vw, 44px); overflow: hidden; }
.hero, .page-heading, .person-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.hero {
    position: relative;
    min-height: 185px;
    padding: clamp(25px, 4vw, 40px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 82% 15%, rgba(255,255,255,.18), transparent 14rem),
        linear-gradient(128deg, #0b5e58 0%, #0f766e 48%, #0c8fa2 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 22px 44px rgba(15,118,110,.18);
}
.hero::after { content: ""; position: absolute; width: 170px; height: 170px; right: -30px; bottom: -75px; border: 26px solid rgba(255,255,255,.08); border-radius: 50%; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(1.75rem, 3.5vw, 2.65rem); }
.hero .eyebrow { color: #adf5e9; }
.hero-copy { margin: .45rem 0 0; color: rgba(255,255,255,.8); }
.hero .button.primary { color: var(--brand-dark); background: #fff; box-shadow: 0 10px 24px rgba(3, 52, 55, .2); }
.page-heading { padding-top: 4px; }
.page-heading p, .person-hero p { margin: 0; color: var(--muted); }
.person-hero { padding: 25px; background: linear-gradient(135deg, #fff, #edf9f7); border: 1px solid #d4ebe7; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.eyebrow, .record-id { display: inline-block; margin-bottom: 6px; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .085em; text-transform: uppercase; }

/* Components */
.button {
    min-height: 44px;
    padding: .72rem 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--navy);
    background: var(--surface-soft);
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: none;
    font: inherit;
    font-size: .9rem;
    font-weight: 720;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible { outline: none; box-shadow: var(--focus); }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--blue), #1576bb); box-shadow: 0 8px 18px rgba(37,99,235,.18); }
.button.secondary { width: 100%; margin-top: 10px; color: var(--navy); background: #eef4f7; border-color: #e1eaee; }
.button.secondary-action { color: var(--brand); background: var(--brand-soft); border-color: #cfe9e4; }
.button.line { width: 100%; color: #fff; background: linear-gradient(135deg, #06c755, #05b74d); box-shadow: 0 8px 18px rgba(6,199,85,.19); }
.button.danger-button { color: #9b2936; background: #fff0f1; border-color: #f8d6da; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.button-lg { min-height: 54px; border-radius: 15px; font-size: .98rem; }
.line-wordmark { padding: 2px 6px; color: var(--line-green); background: #fff; border-radius: 7px; font-size: .72rem; font-weight: 900; letter-spacing: -.02em; }
.vhv-dot { padding: 2px 6px; color: var(--brand); background: #d9f3ee; border-radius: 7px; font-size: .72rem; font-weight: 800; }

.metric-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric, .card { background: rgba(255,255,255,.96); border: 1px solid rgba(219,229,233,.92); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.metric { position: relative; min-height: 144px; padding: 22px; display: flex; flex-direction: column; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.metric:hover, .card:hover { box-shadow: var(--shadow); }
.metric:hover { transform: translateY(-2px); }
.metric::before { content: ""; position: absolute; width: 74px; height: 74px; right: -22px; top: -20px; background: var(--brand-soft); border-radius: 50%; }
.metric > span { color: var(--muted); font-size: .84rem; font-weight: 600; }
.metric strong { margin-top: 4px; color: var(--navy); font-size: clamp(1.65rem, 3vw, 2.15rem); font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.metric small { margin-top: auto; color: var(--muted); font-size: .75rem; }
.metric.red, .metric.danger { border-top: 4px solid var(--red); }
.metric.orange { border-top: 4px solid var(--orange); }
.metric.yellow { border-top: 4px solid var(--yellow); }
.metric.green { border-top: 4px solid var(--green); }
.metric.red::before, .metric.danger::before { background: #fff0f1; }
.metric.orange::before { background: #fff2e9; }
.metric.yellow::before { background: #fff9db; }
.metric.green::before { background: #e9f8f1; }
.card { padding: clamp(19px, 2.6vw, 27px); margin-bottom: 20px; transition: box-shadow .2s ease; }
.card > h2:first-child { margin-bottom: 7px; }

.risk-legend { margin: 16px 0; display: flex; flex-wrap: wrap; gap: 9px; }
.pill { padding: .34rem .72rem; display: inline-block; border: 1px solid transparent; border-radius: 999px; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.pill.red { color: #9f2533; background: #fff0f1; border-color: #f7d4d9; }
.pill.orange { color: #9a4315; background: #fff2e9; border-color: #f7ddcc; }
.pill.yellow { color: #755900; background: #fff8d7; border-color: #f4e7a6; }
.pill.green { color: #08704a; background: #e8f8ef; border-color: #ccebd9; }

/* Forms */
.searchbar { margin-bottom: 18px; padding: 12px; display: flex; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
input, select {
    width: 100%;
    min-height: 48px;
    padding: .72rem .86rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    font: inherit;
    font-size: .93rem;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder { color: #9aabb5; }
input:hover, select:hover { border-color: #9db7c2; }
input:focus, select:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: var(--focus); }
label { display: flex; flex-direction: column; gap: 7px; color: #344955; font-size: .88rem; font-weight: 680; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.check-row { display: grid; grid-template-columns: 24px 1fr; align-items: start; color: var(--muted); font-size: .82rem; font-weight: 500; line-height: 1.55; }
.check-row input { min-height: 0; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }

/* NCD target import */
.import-content { max-width: 1320px; }
.admin-quick-action { display: flex; align-items: center; justify-content: space-between; gap: 22px; background: linear-gradient(135deg, #fff, #edf9f7); border-color: #d4ebe7; }
.admin-quick-action h2 { margin-bottom: 5px; }
.admin-quick-action p { margin-bottom: 0; }
.import-layout { margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 20px; }
.upload-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 18px; }
.upload-heading { display: flex; align-items: center; gap: 14px; }
.upload-heading h2 { margin-bottom: 3px; }
.upload-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, var(--brand), var(--cyan)); border-radius: 14px; box-shadow: 0 9px 20px rgba(15,118,110,.2); font-size: 1.25rem; }
.file-drop { padding: 18px; color: var(--navy); background: #f5fbfa; border: 1px dashed #91c9c0; border-radius: 16px; }
.file-drop input[type="file"] { min-height: 50px; padding: 9px; background: #fff; border-style: solid; }
.file-drop input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 12px; color: #fff; background: var(--brand); border: 0; border-radius: 9px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.file-drop > span { color: var(--muted); font-size: .72rem; font-weight: 500; }
.upload-privacy { margin: 0; color: var(--muted); font-size: .72rem; text-align: center; }
.upload-privacy span { color: var(--brand); }
.import-rules { margin-bottom: 0; background: linear-gradient(160deg, #102a43, #0b3f49); border-color: rgba(255,255,255,.08); }
.import-rules h2 { color: #fff; }
.import-rules .eyebrow { color: #6ee7d3; }
.import-rules ol { margin: 18px 0; padding: 0; display: grid; gap: 13px; list-style: none; counter-reset: import-rule; }
.import-rules li { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; color: #fff; counter-increment: import-rule; }
.import-rules li::before { content: counter(import-rule); width: 26px; height: 26px; grid-row: span 2; display: grid; place-items: center; color: #99f6e4; background: rgba(153,246,228,.1); border: 1px solid rgba(153,246,228,.16); border-radius: 8px; font-size: .7rem; font-weight: 800; }
.import-rules li strong { font-size: .82rem; }
.import-rules li span { color: #b9ccd5; font-size: .72rem; line-height: 1.5; }
.privacy-shield { padding: 13px 14px; display: flex; flex-direction: column; color: #b9ccd5; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 13px; font-size: .7rem; }
.privacy-shield b { margin-bottom: 3px; color: #6ee7d3; font-size: .76rem; }
.import-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-heading { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.inline-search { width: min(470px, 100%); display: flex; gap: 8px; }
.inline-search input { min-width: 0; }
.compact-table { min-width: 520px; }
.warning-card { border-left: 4px solid var(--yellow); }

/* Tables and charts */
.table-card { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-spacing: 0; border-collapse: separate; }
th, td { padding: .9rem .85rem; text-align: left; vertical-align: middle; border-bottom: 1px solid #e8eef1; }
th { color: #71818c; background: #f8fafb; font-size: .73rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
thead th:first-child { border-radius: 11px 0 0 11px; }
thead th:last-child { border-radius: 0 11px 11px 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f7fbfb; }
tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 38px; color: var(--muted); text-align: center; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-row form { margin: 0; }
.chart-wrap { position: relative; min-height: 340px; }

.village-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.village { min-height: 145px; padding: 20px; display: flex; flex-direction: column; border: 1px solid rgba(16,42,67,.09); border-radius: 18px; box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.village:hover { transform: translateY(-2px); }
.village h3 { margin: .25rem 0; font-size: .96rem; }
.village strong { color: var(--navy); font-size: 2.15rem; }
.village small { margin-top: auto; }
.heat-0 { background: linear-gradient(145deg, #fff, #e7f8ee); }
.heat-1 { background: linear-gradient(145deg, #fff, #fff7ce); }
.heat-2 { background: linear-gradient(145deg, #fff, #ffe6b8); }
.heat-3 { background: linear-gradient(145deg, #fff, #ffc4a7); }
.heat-4 { color: #681a23; background: linear-gradient(145deg, #fff, #ffaaa5); }

.alert { position: relative; margin-bottom: 17px; padding: .9rem 1rem .9rem 2.65rem; border: 1px solid transparent; border-radius: 14px; font-size: .88rem; }
.alert::before { position: absolute; left: 1rem; top: .9rem; font-weight: 900; }
.alert.error { color: #9b2936; background: #fff0f1; border-color: #f7d5d9; }
.alert.error::before { content: "!"; }
.alert.success { color: #08704a; background: #e9f8ef; border-color: #ccebd9; }
.alert.success::before { content: "✓"; }

/* System footer */
.site-footer {
    margin-top: 34px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: #506571;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(219,229,233,.9);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}
.footer-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, var(--brand), var(--cyan)); border-radius: 11px; font-size: .72rem; font-weight: 900; }
.footer-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; line-height: 1.35; }
.footer-copy strong { color: var(--navy); font-size: .78rem; }
.footer-copy small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.footer-copy a { color: var(--brand); font-weight: 700; }
.footer-version { padding: 5px 9px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; font-size: .62rem; font-weight: 700; white-space: nowrap; }

/* Login and registration */
.login-page {
    padding: clamp(12px, 3vw, 34px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 12% 9%, rgba(45,212,191,.17), transparent 24rem),
        radial-gradient(circle at 88% 92%, rgba(14,165,233,.11), transparent 27rem),
        #edf4f5;
}
.login-shell { width: min(1080px, 100%); min-height: min(690px, calc(100vh - 120px)); display: grid; grid-template-columns: minmax(340px, .9fr) minmax(430px, 1.1fr); overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,.8); border-radius: 32px; box-shadow: var(--shadow-lg); }
.login-story { position: relative; padding: clamp(38px, 5vw, 66px); display: flex; align-items: flex-end; overflow: hidden; color: #fff; background: linear-gradient(145deg, #0a4f4a, #0f766e 52%, #087f90); }
.login-story::before { content: ""; position: absolute; width: 360px; height: 360px; left: -190px; top: -170px; border: 55px solid rgba(255,255,255,.07); border-radius: 50%; }
.login-story::after { content: "+"; position: absolute; right: 25px; top: 18px; color: rgba(255,255,255,.08); font-size: 17rem; font-weight: 300; line-height: 1; }
.story-content { position: relative; z-index: 2; }
.story-kicker { display: inline-block; margin-bottom: 19px; color: #99f6e4; font-size: .68rem; font-weight: 800; letter-spacing: .15em; }
.login-story h2 { margin-bottom: 16px; color: #fff; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.2; letter-spacing: -.04em; }
.login-story p { max-width: 430px; color: rgba(255,255,255,.76); font-size: .95rem; }
.story-points { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.story-points span { padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; color: rgba(255,255,255,.76); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; font-size: .72rem; }
.story-points b { color: #99f6e4; font-size: .84rem; }
.story-points.vertical { grid-template-columns: 1fr; }
.story-points.vertical span { flex-direction: row; gap: 10px; }
.pulse-art { position: absolute; z-index: 1; inset: auto 0 44% 0; height: 90px; opacity: .14; transform: rotate(-5deg); }
.pulse-art::before { content: ""; position: absolute; inset: 44px 0 auto; height: 2px; background: #fff; }
.pulse-art span { position: absolute; left: 34%; width: 2px; background: #fff; transform-origin: bottom; }
.pulse-art span:nth-child(1) { top: 31px; height: 34px; transform: rotate(30deg); }
.pulse-art span:nth-child(2) { top: 12px; left: 42%; height: 71px; transform: rotate(-25deg); }
.pulse-art span:nth-child(3) { top: 30px; left: 50%; height: 35px; transform: rotate(28deg); }

.login-card { width: 100%; padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; background: #fff; }
.login-system-status { margin-bottom: 20px; align-self: flex-end; }
.login-page > .site-footer { width: min(1080px, 100%); margin-top: 14px; background: rgba(255,255,255,.56); box-shadow: none; }
.login-brand-row { margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand-mark { position: relative; width: 62px; height: 62px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--brand), var(--cyan)); border-radius: 18px; box-shadow: 0 11px 25px rgba(15,118,110,.22); font-size: 1rem; font-weight: 900; }
.brand-pulse { position: absolute; width: 10px; height: 10px; right: -2px; bottom: 5px; background: #34d399; border: 3px solid #fff; border-radius: 50%; }
.vhv-mark { font-size: .86rem; }
.secure-badge { padding: 7px 10px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.login-kicker { margin-bottom: 7px; color: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .06em; }
.login-card h1 { font-size: clamp(2rem, 4.7vw, 3rem); line-height: 1.18; }
.login-lead { margin-bottom: 25px; color: var(--muted); font-size: .92rem; }
.stack { display: flex; flex-direction: column; gap: 15px; }
.login-form input { min-height: 52px; background: #f8fafc; }
.divider { margin: 20px 0; display: flex; align-items: center; gap: 13px; color: #92a2ac; font-size: .76rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: #e0e8ec; }
.privacy-note { margin: 20px 0 0; padding-top: 15px; color: #82929c; border-top: 1px solid #edf1f3; font-size: .72rem; text-align: center; }
.privacy-note span { color: var(--brand); }
.register-shell { grid-template-columns: minmax(330px, .82fr) minmax(470px, 1.18fr); }
.register-story { background: linear-gradient(145deg, #0c4a6e, #0f766e 58%, #138a7a); }
.register-card { width: 100%; }
.notice-box { margin: 19px 0; padding: 15px 17px; color: #6a5010; background: #fff9dd; border: 1px solid #f1e5aa; border-radius: 14px; font-size: .82rem; }
.notice-box p { margin: 5px 0 0; }
.back-link { margin-top: 17px; display: block; color: var(--muted); font-size: .84rem; text-align: center; }
.mobile-nav { display: none; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 220px minmax(0,1fr); }
    .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .village-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: minmax(300px, .78fr) minmax(420px, 1.22fr); }
    .story-points { grid-template-columns: 1fr; }
    .story-points span { flex-direction: row; gap: 9px; }
    .import-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { display: none; }
    .content { padding: 22px 16px 100px; }
    .topbar { height: 68px; padding: 0 14px; }
    .brand-mini { width: 38px; height: 38px; }
    .brand-copy { font-size: .9rem; }
    .user-chip { max-width: 52%; }
    .user-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .hero { min-height: 165px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .village-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mobile-nav { position: fixed; z-index: 35; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 70px; padding: 7px 8px; display: flex; align-items: center; justify-content: space-around; background: rgba(255,255,255,.94); border: 1px solid rgba(197,211,218,.82); border-radius: 21px; box-shadow: 0 15px 38px rgba(16,42,67,.19); backdrop-filter: blur(18px); }
    .mobile-nav a { min-width: 0; padding: 4px 3px; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .64rem; font-weight: 650; white-space: nowrap; }
    .mobile-nav a > span { font-size: 1.18rem; line-height: 1.2; }
    .mobile-nav a.active { color: var(--brand); font-weight: 800; }
    .mobile-nav .mobile-primary { margin-top: -25px; color: var(--brand-dark); }
    .mobile-nav .mobile-primary > span { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--brand), var(--cyan)); border: 4px solid #fff; border-radius: 16px; box-shadow: 0 9px 20px rgba(15,118,110,.28); }
    .login-page { padding: 12px; justify-content: flex-start; }
    .login-shell, .register-shell { min-height: 0; grid-template-columns: 1fr; border-radius: 25px; }
    .login-story { display: none; }
    .login-card { padding: clamp(27px, 7vw, 46px); }
}

@media (max-width: 560px) {
    h1 { font-size: 1.7rem; }
    .brand-copy small { display: none; }
    .topbar .user-chip { display: none; }
    .topbar-actions { gap: 6px; }
    .topbar .live-clock { min-height: 44px; padding: 5px 8px; gap: 6px; }
    .topbar .clock-copy strong { font-size: .75rem; }
    .topbar .clock-copy small { font-size: .53rem; }
    .topbar .version-chip { max-width: 92px; padding: 5px 7px; overflow: hidden; font-size: .55rem; text-overflow: ellipsis; }
    .hero, .page-heading, .person-hero { align-items: flex-start; flex-direction: column; }
    .hero { padding: 24px; border-radius: 22px; }
    .hero .button { width: 100%; }
    .metric-grid, .metric-grid.four { gap: 11px; }
    .metric { min-height: 125px; padding: 17px; }
    .metric strong { font-size: 1.65rem; }
    .form-grid, .village-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .searchbar { flex-direction: column; }
    .searchbar .button { width: 100%; }
    .admin-quick-action, .section-heading { align-items: stretch; flex-direction: column; }
    .admin-quick-action .button, .page-heading .secondary-action { width: 100%; }
    .inline-search { flex-direction: column; }
    .inline-search .button { width: 100%; }
    .import-result-grid, .import-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { padding: 18px; border-radius: 16px; }
    .login-page { padding: 0; background: #fff; }
    .login-shell, .register-shell { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
    .login-card { min-height: 100vh; padding: 28px 22px 38px; justify-content: flex-start; }
    .login-system-status { width: 100%; margin-bottom: 20px; justify-content: space-between; }
    .login-brand-row { margin-bottom: 24px; }
    .brand-mark { width: 56px; height: 56px; border-radius: 16px; }
    .secure-badge { font-size: .62rem; }
    .login-card h1 { font-size: 2.15rem; }
    .login-lead { margin-bottom: 22px; }
    .site-footer, .login-page > .site-footer { margin: 14px 0 0; padding: 16px; align-items: flex-start; flex-wrap: wrap; border-radius: 15px; }
    .login-page > .site-footer { width: 100%; background: #f8fafc; }
    .footer-copy { flex-basis: calc(100% - 55px); }
    .footer-version { margin-left: 51px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
    .live-indicator { animation: none !important; }
}

/* Public self-assessment entry */
.public-assessment-entry {
    position: relative;
    min-height: 88px;
    margin: 0 0 3px;
    padding: 16px 17px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 13px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 92% 10%, rgba(255,255,255,.2), transparent 6rem),
        linear-gradient(135deg, #0f766e, #0a9aa5);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(15,118,110,.2);
    transition: transform .18s ease, box-shadow .18s ease;
}
.public-assessment-entry:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 34px rgba(15,118,110,.25); }
.assessment-entry-icon { width: 48px; height: 48px; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.18); border-radius: 15px; font-size: 1.35rem; }
.assessment-entry-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.assessment-entry-copy strong { font-size: .98rem; }
.assessment-entry-copy small { margin-top: 3px; color: rgba(255,255,255,.78); font-size: .72rem; }
.assessment-entry-arrow { width: 30px; height: 30px; display: grid; place-items: center; background: rgba(255,255,255,.14); border-radius: 50%; font-weight: 800; }
.login-member-divider { margin: 17px 0; text-align: center; }
.login-member-divider span { max-width: 72%; line-height: 1.35; }

/* Public self-assessment */
.public-assessment-page { background: radial-gradient(circle at 0 0, rgba(45,212,191,.12), transparent 26rem), #eff7f6; }
.public-topbar { position: sticky; }
.public-login-link { min-height: 42px; white-space: nowrap; }
.public-assessment-content { width: min(1480px, 100%); margin: 0 auto; padding: 42px clamp(18px, 4vw, 58px); }
.assessment-intro { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.assessment-intro h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.assessment-intro p { max-width: 790px; margin: 0; color: var(--muted); }
.intro-trust { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.intro-trust span { padding: 7px 11px; color: #08704a; background: rgba(255,255,255,.8); border: 1px solid #ccebd9; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.assessment-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 390px); align-items: start; gap: 24px; }
.assessment-card, .lookup-card, .public-safety-card { background: rgba(255,255,255,.96); border: 1px solid rgba(207,224,226,.92); border-radius: 26px; box-shadow: var(--shadow); }
.assessment-card { padding: clamp(22px, 3.2vw, 38px); overflow: hidden; }
.lookup-column { position: sticky; top: 98px; display: flex; flex-direction: column; gap: 16px; }
.lookup-card { padding: 26px; }
.lookup-heading { margin-bottom: 22px; display: flex; align-items: flex-start; gap: 12px; }
.lookup-heading > span { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; background: var(--brand-soft); border-radius: 13px; }
.lookup-heading h2 { margin-bottom: 3px; }
.lookup-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.public-lookup-button { width: 100%; color: #fff; background: linear-gradient(135deg, #0d8394, #0f766e); box-shadow: 0 8px 18px rgba(15,118,110,.18); }
.lookup-privacy { margin: 16px 0 0; padding-top: 14px; color: var(--muted); border-top: 1px solid var(--border); font-size: .72rem; line-height: 1.6; }
.public-safety-card { padding: 18px 20px; color: #6a5010; background: #fffbed; border-color: #eee1a8; box-shadow: none; }
.public-safety-card span { font-weight: 800; }
.public-safety-card p { margin: 5px 0 0; font-size: .76rem; }
.public-error { scroll-margin-top: 90px; }
.form-honeypot { position: absolute !important; width: 1px; height: 1px; left: -10000px; overflow: hidden; }
.wizard-title-row { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wizard-title-row > div { display: flex; align-items: center; gap: 10px; }
.wizard-title-row h2 { margin: 0; font-size: 1.35rem; }
.wizard-title-row > span { color: var(--muted); font-size: .74rem; }
.wizard-icon { font-size: 1.2rem; }
.wizard-progress { height: 8px; margin-bottom: 13px; overflow: hidden; background: #e4ecef; border-radius: 999px; }
.wizard-progress span { width: 33.333%; height: 100%; display: block; background: linear-gradient(90deg, #0ea5b7, #16a35f); border-radius: inherit; transition: width .28s ease; }
.wizard-steps { margin-bottom: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wizard-steps button { min-height: 45px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #64748b; background: #eef2f4; border: 0; border-radius: 14px; font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.wizard-steps button b { display: none; }
.wizard-steps button.is-complete { color: #08704a; background: #dff5ea; }
.wizard-steps button.is-active { color: #fff; background: linear-gradient(135deg, #0d91a0, #16a35f); box-shadow: 0 7px 15px rgba(15,118,110,.17); }
.wizard-enhanced .wizard-panel { display: none; }
.wizard-enhanced .wizard-panel.is-active { display: block; animation: panelIn .22s ease-out; }
@keyframes panelIn { from { opacity: .2; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.panel-heading { margin-bottom: 24px; }
.panel-heading > span { color: var(--brand); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.panel-heading h2 { margin: 3px 0 4px; font-size: 1.55rem; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .83rem; }
.assessment-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.assessment-form-grid input, .assessment-form-grid select, .lookup-card input { min-height: 56px; border-radius: 15px; }
.assessment-form-grid label > small, .dob-field > small { color: var(--muted); font-size: .68rem; font-weight: 500; }
.dob-field { display: flex; flex-direction: column; gap: 7px; color: #344955; font-size: .88rem; font-weight: 680; }
.dob-grid { display: grid; grid-template-columns: .7fr 1.25fr .9fr; gap: 10px; }
.wizard-actions { margin-top: 28px; display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 12px; }
.wizard-actions.one { grid-template-columns: 1fr; }
.wizard-actions .button.primary { background: linear-gradient(135deg, #0d8394, #0f766e); }
.button.quiet { color: var(--muted); background: #f1f5f7; border-color: #e3eaed; }
.measurement-note { margin-top: 21px; padding: 14px 16px; display: flex; align-items: flex-start; gap: 10px; color: #425a67; background: #eef9f8; border: 1px solid #d4ebe7; border-radius: 14px; font-size: .78rem; }
.measurement-note strong { color: var(--brand-dark); white-space: nowrap; }
.q2-heading { margin: 26px 0 12px; }
.q2-heading h3 { margin-bottom: 1px; font-size: 1.08rem; }
.q2-heading p { margin: 0; color: var(--muted); font-size: .76rem; }
.q2-card { margin: 0 0 13px; padding: 18px; background: #effbfc; border: 1px solid #bfe9ed; border-radius: 18px; }
.q2-card legend { width: 100%; padding: 0 0 12px; color: var(--navy); font-size: .88rem; font-weight: 750; }
.choice-chip { min-width: 94px; margin-right: 8px; padding: 10px 13px; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; color: var(--navy); background: #fff; border: 1px solid #d8e4e8; border-radius: 13px; cursor: pointer; }
.choice-chip input { width: 17px; min-height: 0; height: 17px; margin: 0; accent-color: var(--brand); }
.q2-note { color: var(--muted); font-size: .72rem; }
.consent-box { margin-top: 24px; padding: 20px; color: #76501f; background: #fff9e9; border: 1px solid #efd995; border-radius: 19px; }
.consent-title { display: flex; align-items: center; gap: 10px; }
.consent-title > span { width: 39px; height: 39px; display: grid; place-items: center; background: #fff1bf; border-radius: 12px; }
.consent-title h3 { margin: 0; color: #7a3f17; font-size: 1rem; }
.consent-title div > span { color: #9a6b34; font-size: .64rem; font-weight: 700; letter-spacing: .08em; }
.consent-box > p { margin: 12px 0 0; font-size: .73rem; line-height: 1.72; }
.consent-check { margin-top: 15px; padding-top: 14px; display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 10px; border-top: 1px solid #ecdca9; color: #704116; font-size: .78rem; }
.consent-check input { width: 19px; min-height: 0; height: 19px; margin-top: 2px; accent-color: var(--brand); }

/* Public result */
.public-result-hero { position: relative; min-height: 220px; margin-bottom: 20px; padding: clamp(25px, 4vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; color: #fff; border-radius: 28px; box-shadow: var(--shadow); }
.public-result-hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; bottom: -115px; border: 36px solid rgba(255,255,255,.1); border-radius: 50%; }
.public-result-hero > * { position: relative; z-index: 1; }
.public-result-hero.risk-green { background: linear-gradient(135deg, #08704a, #0f9b78); }
.public-result-hero.risk-yellow { background: linear-gradient(135deg, #947100, #d3a20a); }
.public-result-hero.risk-orange { background: linear-gradient(135deg, #a14917, #ea6a25); }
.public-result-hero.risk-red { background: linear-gradient(135deg, #972c3a, #dc3f4f); }
.public-result-hero .eyebrow { color: rgba(255,255,255,.76); }
.public-result-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.15rem); }
.public-result-hero p { margin: 0; color: rgba(255,255,255,.8); }
.result-code-card { min-width: 290px; padding: 20px; display: flex; flex-direction: column; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.23); border-radius: 19px; backdrop-filter: blur(10px); }
.result-code-card span { color: rgba(255,255,255,.78); font-size: .74rem; }
.result-code-card strong { margin: 3px 0; color: #fff; font-size: clamp(1.05rem, 4vw, 1.65rem); letter-spacing: .06em; overflow-wrap: anywhere; }
.result-code-card small { color: rgba(255,255,255,.72); font-size: .68rem; }
.urgent-banner { margin-bottom: 20px; padding: 16px 18px; display: flex; flex-direction: column; color: #9b2936; background: #fff0f1; border: 1px solid #f5cbd1; border-radius: 16px; }
.urgent-banner span { margin-top: 3px; font-size: .8rem; }
.result-person-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.result-person-row div { display: flex; flex-direction: column; }
.result-person-row span { color: var(--muted); font-size: .7rem; }
.result-person-row strong { color: var(--navy); font-size: .88rem; }
.public-result-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.result-metric { min-height: 145px; padding: 20px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.result-metric span { color: var(--muted); font-size: .77rem; font-weight: 650; }
.result-metric strong { margin: 8px 0 2px; color: var(--navy); font-size: 1.55rem; line-height: 1.2; }
.result-metric small { margin-top: auto; color: var(--brand); font-size: .7rem; }
.recommendation-heading { margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.recommendation-heading > span { width: 45px; height: 45px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 14px; font-size: 1.2rem; }
.recommendation-heading .eyebrow { margin: 0; font-size: .64rem; }
.recommendation-heading h2 { margin: 2px 0 0; }
.recommendation-card ul { margin: 0; padding-left: 1.35rem; }
.recommendation-card li { margin: 7px 0; color: #425a67; }
.mental-health-help { margin-top: 18px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #5b3d78; background: #f6effc; border: 1px solid #e5d4f3; border-radius: 14px; }
.mental-health-help span { font-size: .8rem; }
.mental-health-help a { color: #7c3ca4; font-size: 1.05rem; font-weight: 900; }
.result-actions { display: flex; gap: 12px; }
.result-actions .button { min-width: 170px; }
.clinical-disclaimer { margin: 18px auto 0; max-width: 850px; color: var(--muted); font-size: .72rem; text-align: center; }

@media (max-width: 1040px) {
    .assessment-layout { grid-template-columns: 1fr; }
    .lookup-column { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .7fr); }
    .result-person-row, .public-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .public-assessment-content { padding: 26px 14px 34px; }
    .assessment-intro { align-items: flex-start; flex-direction: column; }
    .intro-trust { justify-content: flex-start; }
    .assessment-form-grid { grid-template-columns: 1fr; }
    .assessment-form-grid .span-2 { grid-column: span 1; }
    .lookup-column { display: flex; }
    .public-result-hero { align-items: stretch; flex-direction: column; }
    .result-code-card { min-width: 0; }
}

@media (max-width: 560px) {
    .public-topbar .system-status, .public-login-link { display: none; }
    .public-topbar { height: 64px; }
    .public-assessment-content { padding-top: 22px; }
    .assessment-intro h1 { font-size: 2rem; }
    .assessment-card { padding: 18px 15px; border-radius: 21px; }
    .wizard-title-row { align-items: flex-start; }
    .wizard-title-row > span { max-width: 90px; text-align: right; }
    .wizard-steps button { min-height: 54px; padding: 7px 4px; flex-direction: column; gap: 1px; font-size: .66rem; }
    .wizard-steps button b { display: block; font-size: .72rem; }
    .dob-grid { grid-template-columns: .65fr 1.2fr .85fr; gap: 6px; }
    .dob-grid input, .dob-grid select { padding: .62rem .55rem; font-size: .82rem; }
    .wizard-actions { grid-template-columns: 1fr; }
    .wizard-actions .button { width: 100%; }
    .measurement-note { flex-direction: column; }
    .choice-chip { min-width: calc(50% - 8px); margin-right: 4px; }
    .consent-box { padding: 17px 15px; }
    .public-result-hero { padding: 24px 20px; border-radius: 22px; }
    .result-person-row, .public-result-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .result-person-row { padding: 16px; }
    .result-person-row div { padding-bottom: 7px; border-bottom: 1px solid var(--border); }
    .result-metric { min-height: 125px; padding: 15px; }
    .result-metric strong { font-size: 1.2rem; }
    .mental-health-help { align-items: flex-start; flex-direction: column; }
    .result-actions { flex-direction: column; }
    .result-actions .button { width: 100%; }
    .public-assessment-entry { grid-template-columns: 42px minmax(0, 1fr) 26px; padding: 14px; }
    .assessment-entry-icon { width: 42px; height: 42px; }
    .assessment-entry-copy strong { font-size: .88rem; }
    .assessment-entry-copy small { font-size: .66rem; }
}

@media (prefers-reduced-motion: reduce) {
    .wizard-enhanced .wizard-panel.is-active { animation: none !important; }
}

/* Continuous-care upgrade */
.form-help-link { margin-top: -2px; color: var(--brand); font-size: .76rem; font-weight: 650; text-align: right; }
.health-book-entry { margin-top: 10px; background: radial-gradient(circle at 92% 10%, rgba(255,255,255,.18), transparent 6rem), linear-gradient(135deg, #123647, #0c7190); box-shadow: 0 12px 25px rgba(16,42,67,.17); }
.narrow-content { max-width: 850px; }
.standalone-card { width: min(560px, calc(100% - 28px)); margin: 32px auto; padding: clamp(24px,5vw,40px); background: #fff; border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow-lg); }
.standalone-card .stack { display: grid; gap: 15px; }
.form-section-heading { margin: 8px 0 1px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--brand-dark); background: linear-gradient(135deg,#eef9f7,#f6fbfc); border: 1px solid #d4ebe7; border-radius: 14px; }
.form-section-heading strong { font-size: .91rem; }
.form-section-heading span { color: var(--muted); font-size: .7rem; font-weight: 500; text-align: right; }
.clinical-note { margin: 0; padding-top: 4px; font-size: .73rem; }
.button.compact { min-height: 34px; padding: .42rem .65rem; border-radius: 9px; font-size: .72rem; }
.row-muted { opacity: .58; background: #f5f7f8; }

.risk-score-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.risk-score-card { padding: 18px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--green); border-radius: 17px; box-shadow: var(--shadow-sm); }
.risk-score-card.yellow { border-top-color: var(--yellow); }
.risk-score-card.orange { border-top-color: var(--orange); }
.risk-score-card.red { border-top-color: var(--red); }
.risk-score-card > span { min-height: 38px; color: var(--muted); font-size: .76rem; font-weight: 650; }
.risk-score-card strong { color: var(--navy); font-size: 1.7rem; line-height: 1.2; }
.risk-score-card strong small { margin-left: 2px; color: var(--muted); font-size: .68rem; }
.risk-score-card em { margin-top: 8px; color: var(--muted); font-size: .64rem; font-style: normal; }
.score-track { height: 7px; margin-top: 11px; overflow: hidden; background: #edf1f3; border-radius: 999px; }
.score-track i { height: 100%; display: block; background: var(--green); border-radius: inherit; }
.risk-score-card.yellow .score-track i { background: var(--yellow); }
.risk-score-card.orange .score-track i { background: var(--orange); }
.risk-score-card.red .score-track i { background: var(--red); }

/* Clinical governance and Rule Card */
.rule-card-page { max-width: 1280px; }
.rule-card-hero { margin-bottom: 18px; padding: clamp(24px,4vw,44px); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; color: #fff; background: radial-gradient(circle at 92% 12%, rgba(255,255,255,.14), transparent 13rem), linear-gradient(135deg,#102a43,#087f76); border-radius: 26px; box-shadow: var(--shadow-lg); }
.rule-card-hero h1 { margin: 7px 0; max-width: 780px; color: #fff; }
.rule-card-hero p { margin: 0; color: #d9f7f2; }
.rule-card-hero .eyebrow { color: #83f0df; }
.rule-version-panel { min-width: 250px; padding: 17px 19px; display: flex; flex-direction: column; color: #d9f7f2; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 18px; backdrop-filter: blur(9px); }
.rule-version-panel span,.rule-version-panel small { font-size: .7rem; }
.rule-version-panel strong { margin: 3px 0; color: #fff; font-size: 1rem; }
.clinical-warning { margin-bottom: 18px; padding: 17px 19px; display: flex; align-items: flex-start; gap: 14px; color: #8a2b32; background: #fff3f3; border: 1px solid #ffcfd2; border-radius: 18px; }
.clinical-warning > span { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: #c93643; border-radius: 50%; font-weight: 850; }
.clinical-warning p { margin: 4px 0 0; color: #9b4a50; font-size: .78rem; }
.rule-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.rule-card-section { position: relative; overflow: hidden; }
.rule-card-section.span-2 { grid-column: 1 / -1; }
.rule-card-section h2 { margin: 0 0 16px 46px; color: var(--navy); }
.rule-card-section h3 { margin: 12px 0 8px; font-size: .83rem; }
.section-number { position: absolute; top: 20px; left: 20px; width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,var(--brand),var(--cyan)); border-radius: 10px; font-size: .68rem; font-weight: 850; }
.rule-definition-list { margin: 0; display: grid; gap: 10px; }
.rule-definition-list > div { padding: 12px 14px; display: grid; grid-template-columns: minmax(130px,.35fr) 1fr; gap: 16px; background: #f6fafb; border-radius: 12px; }
.rule-definition-list dt { color: var(--muted); font-size: .72rem; font-weight: 700; }
.rule-definition-list dd { margin: 0; color: var(--navy); font-size: .8rem; font-weight: 650; }
.rule-chip-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.rule-chip-list span { padding: 8px 11px; color: #8a3d18; background: #fff5e9; border: 1px solid #f3ddc3; border-radius: 999px; font-size: .68rem; font-weight: 700; }
.compact-list { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; list-style: none; }
.compact-list li { padding: 7px 9px; color: #365864; background: #eef7f7; border-radius: 8px; font-size: .67rem; }
.rule-card-section details { margin-top: 14px; }
.rule-card-section summary { color: var(--brand); font-size: .74rem; font-weight: 750; cursor: pointer; }
.rule-card-section details .compact-list { margin-top: 10px; }
.rule-threshold-table { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.rule-threshold-table > div { padding: 17px; display: flex; flex-direction: column; gap: 6px; background: #f5fafb; border: 1px solid #dce9ec; border-radius: 14px; }
.rule-threshold-table strong { color: var(--brand-dark); }
.rule-threshold-table span { color: #506874; font-size: .72rem; }
.rule-footnote { margin: 15px 0 0; padding: 12px 14px; color: #5f717a; background: #f8fafb; border-left: 4px solid #9db9c0; border-radius: 9px; font-size: .72rem; }
.review-condition-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; list-style: none; counter-reset: review-condition; }
.review-condition-list li { padding: 13px 14px 13px 45px; position: relative; color: #425c67; background: #f4f9fa; border-radius: 12px; font-size: .75rem; counter-increment: review-condition; }
.review-condition-list li::before { content: counter(review-condition); position: absolute; top: 11px; left: 12px; width: 24px; height: 24px; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 50%; font-size: .62rem; font-weight: 800; }
.validation-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; }
.validation-metrics > div { padding: 16px; display: flex; flex-direction: column; background: #f6fafb; border: 1px solid #dce9ec; border-radius: 14px; }
.validation-metrics span { color: var(--muted); font-size: .68rem; font-weight: 700; }
.validation-metrics strong { margin: 7px 0; color: var(--navy); font-size: 1rem; }
.validation-metrics small { color: var(--brand); font-size: .62rem; }
.validation-context { margin-top: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.validation-context > div { grid-template-columns: minmax(115px,.35fr) 1fr; }
.evidence-list { margin: 0; padding: 0; display: grid; gap: 10px; list-style: none; }
.evidence-list li { padding: 11px 12px; background: #f6fafb; border-radius: 11px; }
.evidence-list a { color: var(--brand-dark); font-size: .75rem; font-weight: 750; }
.evidence-list small { margin-top: 3px; display: block; color: var(--muted); font-size: .63rem; }
.change-log-card { margin-top: 18px; }
.change-log-card table { margin-top: 4px; }

.care-content { max-width: 1520px; }
.dashboard-action-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.dashboard-action-grid > a { min-height: 92px; padding: 15px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; color: var(--navy); background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.dashboard-action-grid > a:hover { border-color: #a9d6cf; box-shadow: var(--shadow); transform: translateY(-1px); }
.dashboard-action-grid > a > span { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,var(--brand),var(--cyan)); border-radius: 12px; font-size: 1.15rem; }
.dashboard-action-grid div { display: flex; flex-direction: column; }
.dashboard-action-grid strong { font-size: .84rem; }
.dashboard-action-grid small { margin-top: 2px; color: var(--muted); font-size: .66rem; }
.dashboard-action-grid b { color: var(--brand); }
.care-tabs { margin: 0 0 22px; padding: 7px; display: flex; gap: 6px; overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.care-tabs a { min-height: 43px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; flex: 1 0 auto; color: var(--muted); border-radius: 11px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.care-tabs a.active { color: #fff; background: linear-gradient(135deg,var(--brand),var(--cyan)); box-shadow: 0 7px 16px rgba(15,118,110,.17); }
.filter-bar { margin-bottom: 18px; padding: 13px; display: grid; grid-template-columns: minmax(220px,1.5fr) minmax(140px,.6fr) minmax(190px,.8fr) auto; gap: 9px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.section-tools { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.followup-list { display: grid; gap: 14px; }
.followup-card { padding: 20px; background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--yellow); border-radius: 17px; box-shadow: var(--shadow-sm); }
.followup-card.priority-high { border-left-color: var(--orange); }
.followup-card.priority-urgent { border-left-color: var(--red); }
.followup-card.priority-routine { border-left-color: var(--green); }
.followup-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.followup-summary h3 { margin: 8px 0 1px; }
.followup-summary small { color: var(--muted); }
.followup-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: .76rem; }
.followup-meta span { color: var(--brand); font-weight: 750; }
.followup-meta strong { color: var(--navy); }
.text-danger { color: var(--red) !important; }
.followup-card > p { margin: 15px 0; padding: 12px 14px; color: #425a67; background: #f7fafb; border-radius: 12px; font-size: .8rem; }
.followup-card details { border-top: 1px solid var(--border); }
.followup-card summary { padding-top: 13px; color: var(--brand); font-size: .78rem; font-weight: 750; cursor: pointer; }
.followup-form { margin-top: 16px; }
.coverage-cell { min-width: 150px; display: flex; align-items: center; gap: 9px; }
.coverage-cell > span { width: 95px; height: 7px; overflow: hidden; background: #e8eef1; border-radius: 999px; }
.coverage-cell i { height: 100%; display: block; background: linear-gradient(90deg,var(--cyan),var(--green)); border-radius: inherit; }
.coverage-cell b { font-size: .72rem; }
.innovation-hero { color: #d8f3ee; background: radial-gradient(circle at 90% 10%,rgba(255,255,255,.12),transparent 13rem),linear-gradient(130deg,#123647,#0f766e); border-color: transparent; }
.innovation-hero h2 { max-width: 940px; color: #fff; font-size: clamp(1.3rem,3vw,2rem); }
.innovation-hero p { margin-bottom: 0; color: #bcd3d8; }
.outcome-flow { margin: 18px 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.outcome-flow span { min-height: 70px; padding: 13px; display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #d4ebe7; border-radius: 13px; font-size: .76rem; font-weight: 750; text-align: center; }

.health-book-content { max-width: 1380px; }
.health-book-lookup-layout { min-height: 480px; display: grid; place-items: start center; }
.health-book-lookup { margin-top: 12px; }
.secure-health-book-card { width: min(100%, 920px); }
.health-book-secure-intro .intro-trust { flex-wrap: wrap; }
.health-book-auth-choice { margin-top: 24px; display: grid; grid-template-columns: minmax(0,1fr) 56px minmax(0,1fr); align-items: stretch; gap: 18px; }
.health-book-auth-primary,.health-book-auth-otp { position: relative; padding: 26px; border: 1px solid #d8e6ea; border-radius: 24px; background: linear-gradient(155deg,#fff,#f7fbfc); }
.health-book-auth-primary { border-color: #bdebd0; background: radial-gradient(circle at 100% 0,rgba(6,199,85,.12),transparent 10rem),#f8fffb; }
.health-book-auth-primary h3,.health-book-auth-otp h3 { margin: 0 0 7px; color: #102f45; font-size: 1.25rem; }
.health-book-auth-primary p,.health-book-auth-otp p { min-height: 48px; margin: 0 0 18px; color: #607586; }
.health-book-auth-primary .button,.health-book-auth-otp .button { width: 100%; justify-content: center; }
.secure-channel-badge { position: absolute; top: 16px; right: 16px; padding: 5px 10px; border-radius: 999px; background: #dff8e8; color: #087739; font-size: .75rem; font-weight: 800; }
.health-book-auth-divider { display: grid; place-items: center; position: relative; color: #78909c; font-weight: 800; }
.health-book-auth-divider::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 50%; width: 1px; background: #d8e3e8; }
.health-book-auth-divider span { position: relative; z-index: 1; padding: 10px 0; background: #fff; }
.health-book-security-note { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 18px; border-radius: 18px; background: #edf8f7; color: #476474; }
.health-book-security-note b { color: #0f766e; margin-right: 4px; }
.health-book-security-note span { padding: 7px 10px; border-radius: 999px; background: #fff; font-size: .86rem; }
.health-book-cancel-form { margin-top: 8px; }
.health-book-cancel-form .button { width: 100%; }
.otp-verify-form input[name="otp"] { text-align: center; letter-spacing: .45em; font-size: 1.35rem; font-weight: 800; }
.public-book-auth-state { display: block; margin-top: 10px; color: rgba(255,255,255,.82); }

@media (max-width: 760px) {
  .health-book-auth-choice { grid-template-columns: 1fr; gap: 12px; }
  .health-book-auth-divider { min-height: 28px; }
  .health-book-auth-divider::before { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 1px; }
  .health-book-auth-divider span { padding: 0 12px; }
  .health-book-auth-primary,.health-book-auth-otp { padding: 22px 18px; border-radius: 20px; }
  .health-book-auth-primary p,.health-book-auth-otp p { min-height: 0; }
  .health-book-security-note { align-items: flex-start; flex-direction: column; }
  .health-book-security-note span { border-radius: 12px; }
}
.public-book-person { margin-top: 0; }

.system-health-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 13px; }
.system-health-card { min-height: 120px; padding: 18px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--yellow); border-radius: 16px; box-shadow: var(--shadow-sm); }
.system-health-card.ok { border-top-color: var(--green); }
.system-health-card.bad { border-top-color: var(--red); }
.system-health-card > span { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; }
.system-health-card strong { margin: 8px 0 2px; color: var(--navy); }
.system-health-card small { margin-top: auto; color: var(--muted); overflow-wrap: anywhere; font-size: .65rem; }
.admin-operations-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.reset-action, .reset-action form { display: flex; align-items: center; gap: 7px; }
.reset-action input { min-width: 220px; min-height: 38px; }
.mini-log { margin-top: 18px; display: grid; gap: 8px; }
.mini-log > div { padding: 10px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 2px 8px; align-items: center; background: #f7fafb; border-radius: 11px; }
.mini-log b { overflow-wrap: anywhere; color: var(--navy); font-size: .72rem; }
.mini-log small { grid-column: 2; color: var(--muted); font-size: .63rem; }
.mini-log form { grid-column: 2; }

.admin-import-actions { margin-bottom: 20px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.admin-import-actions .admin-quick-action { margin: 0; }
.account-admin-actions { display: flex; align-items: flex-start; gap: 8px; }
.account-admin-actions details { min-width: 150px; }
.account-admin-actions summary { color: var(--brand); font-size: .7rem; font-weight: 750; cursor: pointer; }
.account-admin-actions details form { margin-top: 7px; display: grid; gap: 6px; }
.account-admin-actions input { min-height: 36px; min-width: 180px; }

.google-import-content { max-width: 1500px; margin: auto; }
.google-import-heading { align-items: flex-end; }
.google-setup { border-left: 5px solid var(--yellow); }
.google-setup ol { margin: 16px 0; padding-left: 24px; display: grid; gap: 9px; }
.google-setup code { padding: 3px 7px; color: #075985; background: #ecfeff; border-radius: 6px; overflow-wrap: anywhere; }
.connection-banner { margin-bottom: 18px; padding: 14px 18px; display: flex; align-items: center; gap: 11px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 14px; }
.connection-banner .connection-dot { width: 11px; height: 11px; flex: 0 0 auto; background: #10b981; border-radius: 50%; box-shadow: 0 0 0 5px rgba(16,185,129,.13); }
.connection-banner div { display: flex; flex-direction: column; }
.connection-banner strong { color: #065f46; }
.connection-banner small { color: #047857; }
.sheet-step-guide { margin: 0 0 18px; padding: 8px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; background: #e7eef1; border-radius: 15px; }
.sheet-step-guide span { min-height: 44px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #47606c; background: rgba(255,255,255,.67); border-radius: 10px; font-size: .72rem; font-weight: 750; }
.sheet-step-guide b { width: 23px; height: 23px; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 50%; }
.sheet-import-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.sheet-import-card { min-height: 160px; padding: 18px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 11px; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: var(--shadow-sm); transition: .18s ease; }
.sheet-import-card.selected { border-color: #67c6bb; box-shadow: 0 12px 28px rgba(15,118,110,.13); transform: translateY(-2px); }
.sheet-import-card.missing { opacity: .48; }
.sheet-order { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,var(--brand),var(--cyan)); border-radius: 11px; font-weight: 800; }
.sheet-api-name { color: var(--brand); font-size: .62rem; font-weight: 800; letter-spacing: .06em; overflow-wrap: anywhere; }
.sheet-import-card h2 { margin: 3px 0 7px; font-size: 1.02rem; }
.sheet-import-card p { margin: 0; color: var(--muted); font-size: .7rem; }
.sheet-import-card .button { grid-column: 2; justify-self: start; align-self: end; }
.sheet-import-workbench { overflow: hidden; }
.import-summary-grid { margin: 18px 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.import-summary-grid article { padding: 15px; display: flex; flex-direction: column; background: #f7fafb; border: 1px solid #e2e9ec; border-top: 4px solid #94a3b8; border-radius: 13px; }
.import-summary-grid article.green { border-top-color: #10b981; }
.import-summary-grid article.blue { border-top-color: #0ea5e9; }
.import-summary-grid article.red { border-top-color: #ef4444; }
.import-summary-grid span { color: var(--muted); font-size: .68rem; }
.import-summary-grid strong { color: var(--navy); font-size: 1.45rem; }
.import-issues { margin: 16px 0; border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.import-issues summary { padding: 13px 16px; color: #991b1b; background: #fff1f2; font-weight: 750; cursor: pointer; }
.confirm-import-box { margin-top: 18px; padding: 18px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px 16px; background: linear-gradient(135deg,#effcf9,#f0f9ff); border: 1px solid #99e0d6; border-radius: 15px; }
.confirm-import-box label { display: flex; align-items: flex-start; gap: 9px; color: var(--navy); font-weight: 700; }
.confirm-import-box input { width: 18px; height: 18px; flex: 0 0 auto; }
.confirm-import-box small { grid-column: 1 / -1; color: var(--muted); }
.import-empty { min-height: 210px; display: grid; place-items: center; align-content: center; text-align: center; }
.import-empty span { font-size: 2rem; color: var(--cyan); }
.import-empty p { max-width: 650px; margin-bottom: 0; }
.migration-safety > div { margin: 15px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.migration-safety > div span { padding: 9px 12px; color: #7f1d1d; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 999px; font-size: .7rem; font-weight: 750; }

.gps-import-content { max-width: 1420px; }
.gps-import-content .google-setup pre { padding: 13px 15px; overflow-x: auto; color: #075985; background: #ecfeff; border: 1px solid #bae6e8; border-radius: 11px; font-size: .72rem; }
.gps-import-selector { align-items: end; }
.gps-sheet-form { min-width: min(100%,430px); display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: end; gap: 9px; }
.gps-sheet-form label { min-width: 0; }
.gps-sheet-form .button { min-height: 48px; }
.gps-summary-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.gps-import-rules { border-top: 5px solid var(--cyan); }
.gps-rule-grid { margin-top: 15px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.gps-rule-grid span { padding: 12px; display: flex; align-items: center; gap: 10px; color: #47606c; background: #f3f8f9; border-radius: 12px; font-size: .72rem; }
.gps-rule-grid b { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--brand); border-radius: 50%; }

@media (max-width: 980px) {
    .rule-card-hero { align-items: stretch; flex-direction: column; }
    .rule-version-panel { min-width: 0; }
    .validation-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-action-grid { grid-template-columns: 1fr; }
    .risk-score-grid, .system-health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .outcome-flow { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .sheet-import-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 680px) {
    .rule-card-grid,.rule-threshold-table,.review-condition-list,.validation-metrics,.validation-context { grid-template-columns: 1fr; }
    .rule-card-section.span-2 { grid-column: auto; }
    .rule-definition-list > div { grid-template-columns: 1fr; gap: 3px; }
    .form-section-heading, .section-tools, .followup-summary { align-items: stretch; flex-direction: column; }
    .form-section-heading span { text-align: left; }
    .filter-bar, .admin-operations-grid { grid-template-columns: 1fr; }
    .filter-bar .button { width: 100%; }
    .followup-meta { align-items: flex-start; }
    .risk-score-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
    .risk-score-card { padding: 14px; }
    .outcome-flow { grid-template-columns: 1fr 1fr; }
    .system-health-grid { grid-template-columns: 1fr 1fr; }
    .reset-action { align-items: stretch; flex-direction: column; }
    .reset-action form { align-items: stretch; flex-direction: column; }
    .reset-action input { min-width: 0; }
    .admin-import-actions, .sheet-import-grid, .sheet-step-guide, .import-summary-grid, .gps-rule-grid { grid-template-columns: 1fr; }
    .google-import-heading { align-items: stretch; }
    .google-import-heading form, .google-import-heading .button { width: 100%; }
    .gps-import-selector { align-items: stretch; flex-direction: column; }
    .gps-sheet-form { width: 100%; min-width: 0; grid-template-columns: 1fr; }
    .gps-sheet-form .button { width: 100%; }
    .confirm-import-box { grid-template-columns: 1fr; }
    .confirm-import-box .button { width: 100%; }
    .account-admin-actions { flex-direction: column; }
    .account-admin-actions input { min-width: 0; }
}

/* Community health map */
.map-content { max-width: 1600px; margin: 0 auto; }
.map-heading { align-items: flex-end; }
.map-heading p { max-width: 880px; }
.map-privacy-badge { max-width: 360px; padding: 12px 15px; display: flex; align-items: center; gap: 11px; color: #075985; background: linear-gradient(135deg,#ecfeff,#eef9f7); border: 1px solid #bae6e8; border-radius: 15px; box-shadow: var(--shadow-sm); }
.map-privacy-badge > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg,var(--brand),var(--cyan)); border-radius: 10px; }
.map-privacy-badge div { display: flex; flex-direction: column; line-height: 1.3; }
.map-privacy-badge strong { color: var(--navy); font-size: .78rem; }
.map-privacy-badge small { margin-top: 2px; color: var(--muted); font-size: .66rem; }
.map-privacy-badge.exact { color: #9a3412; background: linear-gradient(135deg,#fff7ed,#fff1f2); border-color: #fed7aa; }
.map-privacy-badge.aggregate { color: #047857; background: linear-gradient(135deg,#ecfdf5,#ecfeff); border-color: #a7f3d0; }

.map-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 11px; }
.map-summary-card { min-height: 112px; padding: 17px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-top: 4px solid #758792; border-radius: 16px; box-shadow: var(--shadow-sm); }
.map-summary-card > span { color: var(--muted); font-size: .7rem; font-weight: 700; }
.map-summary-card strong { margin-top: 3px; color: var(--navy); font-size: 1.65rem; line-height: 1.25; }
.map-summary-card small { margin-top: auto; color: var(--muted); font-size: .64rem; }
.map-summary-red { border-top-color: var(--red); }
.map-summary-orange { border-top-color: var(--orange); }
.map-summary-yellow { border-top-color: var(--yellow); }
.map-summary-green { border-top-color: var(--green); }
.map-summary-missing { border-top-color: #a8b4bb; background: #f8fafb; }

.map-filter-card { margin-bottom: 17px; padding: 18px; background: rgba(255,255,255,.96); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.map-filter-heading { margin-bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.map-filter-heading h2 { margin: 1px 0 0; }
.map-filter-grid { display: grid; grid-template-columns: minmax(170px,1fr) minmax(200px,1.15fr) minmax(190px,1fr) auto; align-items: end; gap: 10px; }
.map-filter-grid .button { min-height: 48px; }
.map-legend { margin-top: 14px; padding-top: 13px; display: flex; flex-wrap: wrap; gap: 8px 15px; border-top: 1px solid #e7eef1; }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; color: #506571; font-size: .69rem; font-weight: 650; }
.map-legend i { width: 11px; height: 11px; background: var(--legend-color); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px color-mix(in srgb,var(--legend-color),#000 12%); }

.map-workspace { min-height: 630px; margin-bottom: 18px; display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 16px; }
.map-canvas-card, .map-list-card { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.health-map { z-index: 1; width: 100%; height: 630px; background: #dbe9e8; }
.map-offline-notice { position: absolute; z-index: 500; top: 14px; left: 50%; width: min(540px,calc(100% - 28px)); padding: 10px 14px; color: #8a4b0f; background: rgba(255,251,235,.96); border: 1px solid #f3d48d; border-radius: 12px; box-shadow: var(--shadow-sm); transform: translateX(-50%); font-size: .72rem; text-align: center; }
.map-empty-overlay { position: absolute; z-index: 450; left: 50%; top: 50%; width: min(480px,calc(100% - 40px)); padding: 20px; display: flex; flex-direction: column; color: var(--navy); background: rgba(255,255,255,.93); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); transform: translate(-50%,-50%); pointer-events: none; text-align: center; }
.map-empty-overlay span { margin-top: 5px; color: var(--muted); font-size: .75rem; }
.map-list-card { height: 630px; display: flex; flex-direction: column; }
.map-list-heading { padding: 18px 18px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.map-list-heading h2 { margin-bottom: 1px; font-size: 1rem; }
.map-list-heading p { margin: 0; color: var(--muted); font-size: .7rem; }
.map-list-heading > span { padding: 4px 7px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; font-size: .6rem; font-weight: 700; white-space: nowrap; }
.map-household-list { padding: 9px; display: grid; gap: 6px; overflow-y: auto; }
.map-list-item { width: 100%; padding: 10px; display: grid; grid-template-columns: 12px minmax(0,1fr) auto; align-items: center; gap: 9px; color: var(--navy); background: #f8fafb; border: 1px solid transparent; border-radius: 12px; font: inherit; cursor: pointer; text-align: left; transition: .16s ease; }
.map-list-item:hover { background: #fff; border-color: var(--border); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.map-list-item > i { width: 10px; height: 10px; background: #758792; border-radius: 50%; box-shadow: 0 0 0 3px rgba(117,135,146,.12); }
.map-list-item.status-red > i { background: var(--red); box-shadow: 0 0 0 3px rgba(220,63,79,.12); }
.map-list-item.status-orange > i { background: var(--orange); box-shadow: 0 0 0 3px rgba(234,106,37,.12); }
.map-list-item.status-yellow > i { background: var(--yellow); box-shadow: 0 0 0 3px rgba(234,179,8,.12); }
.map-list-item.status-green > i { background: var(--green); box-shadow: 0 0 0 3px rgba(22,132,91,.12); }
.map-list-item > span { min-width: 0; display: flex; flex-direction: column; }
.map-list-item strong { overflow: hidden; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.map-list-item small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.map-list-item > b { color: #9aabb5; font-size: 1.05rem; }
.map-list-empty { padding: 40px 20px; color: var(--muted); font-size: .75rem; text-align: center; }

.map-popup { font-family: "Noto Sans Thai","Leelawadee UI",Tahoma,sans-serif; }
.map-popup-status { padding: 3px 7px; display: inline-block; color: #52636d; background: #edf2f4; border-radius: 999px; font-size: .66rem; font-weight: 750; }
.map-popup-red { color: #9f2533; background: #fff0f1; }
.map-popup-orange { color: #9a4315; background: #fff2e9; }
.map-popup-yellow { color: #755900; background: #fff8d7; }
.map-popup-green { color: #08704a; background: #e8f8ef; }
.map-popup h3 { margin: 8px 0 0; font-size: 1.05rem; }
.map-popup > p { margin: 1px 0 10px; color: var(--muted); font-size: .72rem; }
.map-popup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.map-popup-grid span { padding: 8px; display: flex; flex-direction: column; color: var(--muted); background: #f6f9fa; border-radius: 9px; font-size: .59rem; }
.map-popup-grid b { color: var(--navy); font-size: .82rem; }
.map-popup > small { margin-top: 9px; display: block; color: #71818c; font-size: .58rem; }
.map-popup-photo { margin-top: 9px; padding: 8px 10px; display: block; color: #075985; background: #ecfeff; border: 1px solid #bae6e8; border-radius: 9px; font-size: .68rem; font-weight: 800; text-align: center; text-decoration: none; }
.map-popup-photo:hover { color: #064e3b; background: #dff8f3; }
.map-popup-download { margin-top: 5px; color: #475569; background: #f8fafc; border-color: #dbe4e8; }
.leaflet-container { font-family: "Noto Sans Thai","Leelawadee UI",Tahoma,sans-serif; }
.leaflet-control-attribution { font-size: 9px; }

.map-method-card { display: grid; grid-template-columns: minmax(210px,.65fr) minmax(0,1.8fr); align-items: start; gap: 22px; }
.map-method-card h2 { margin-bottom: 0; }
.map-method-card ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; list-style: none; }
.map-method-card li { padding: 10px; display: grid; grid-template-columns: 13px minmax(0,1fr); align-items: start; gap: 9px; background: #f7fafb; border-radius: 11px; }
.map-method-card li span { color: #506571; font-size: .68rem; }
.map-method-card li strong { color: var(--navy); }
.map-method-card > p { grid-column: 1 / -1; margin: -8px 0 0; color: var(--muted); font-size: .7rem; }
.map-dot { width: 11px; height: 11px; margin-top: 4px; background: #758792; border-radius: 50%; }
.map-dot.red { background: var(--red); }
.map-dot.orange { background: var(--orange); }
.map-dot.yellow { background: var(--yellow); }
.map-dot.green { background: var(--green); }

.coordinate-editor { border-top: 5px solid var(--cyan); }
.coordinate-editor-heading { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.coordinate-editor-heading h2 { margin: 2px 0; }
.coordinate-editor-heading p { margin: 0; color: var(--muted); font-size: .78rem; }
.coordinate-form { display: grid; grid-template-columns: minmax(240px,1.4fr) minmax(160px,.8fr) minmax(160px,.8fr) auto; align-items: end; gap: 10px; }
.coordinate-form .button { min-height: 48px; }
.coordinate-help { margin-top: 15px; padding: 11px 13px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); background: #f4f9f9; border-radius: 12px; font-size: .68rem; }
.coordinate-help span { width: 23px; height: 23px; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 50%; font-weight: 800; }
.coordinate-help b { color: #93a5ae; }

@media (max-width: 1100px) {
    .map-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .map-filter-grid { grid-template-columns: 1fr 1fr; }
    .map-workspace { grid-template-columns: minmax(0,1fr) 285px; }
    .coordinate-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
    .map-content { padding-bottom: 35px; }
    .map-workspace { min-height: 0; grid-template-columns: 1fr; }
    .health-map { height: 540px; }
    .map-list-card { height: min(390px,52vh); }
    .map-method-card { grid-template-columns: 1fr; }
    .map-method-card > p { grid-column: 1; }
}

@media (max-width: 620px) {
    .map-heading { align-items: stretch; }
    .map-privacy-badge { max-width: none; }
    .map-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .map-summary-card { min-height: 102px; padding: 14px; }
    .map-filter-heading, .coordinate-editor-heading { align-items: stretch; flex-direction: column; }
    .map-filter-grid, .coordinate-form { grid-template-columns: 1fr; }
    .map-filter-grid .button, .coordinate-form .button { width: 100%; }
    .health-map { height: 480px; }
    .map-method-card ol { grid-template-columns: 1fr; }
    .coordinate-help { align-items: flex-start; flex-direction: column; }
    .coordinate-help b { display: none; }
}

/* Daily active VHV analytics */
.usage-content { max-width: 1520px; }
.usage-heading { align-items: flex-end; }
.usage-filter { min-width: 210px; }
.usage-filter label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.usage-filter select { min-height: 48px; background-color: #fff; }
.usage-summary-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 13px; }
.usage-metric { min-height: 132px; padding: 19px; display: flex; flex-direction: column; background: linear-gradient(145deg,#fff,#f8fbfc); border: 1px solid var(--border); border-top: 4px solid var(--cyan); border-radius: 17px; box-shadow: var(--shadow-sm); }
.usage-metric.accent { border-top-color: var(--green); background: linear-gradient(145deg,#fff,#edf9f3); }
.usage-metric > span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.usage-metric strong { margin: 5px 0; color: var(--navy); font-size: 2rem; line-height: 1.1; }
.usage-metric small { margin-top: auto; color: var(--muted); font-size: .64rem; }
.usage-chart-card, .usage-table-card { margin-bottom: 18px; }
.usage-chart-wrap { position: relative; min-height: 450px; }
.usage-period { padding: 6px 10px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; font-size: .68rem; font-weight: 750; white-space: nowrap; }
.usage-village-badge { min-width: 35px; margin-right: 6px; padding: 3px 7px; display: inline-flex; justify-content: center; color: #fff; background: linear-gradient(145deg,var(--brand),var(--cyan)); border-radius: 8px; font-size: .64rem; font-weight: 800; }
.usage-method-card { border-left: 5px solid var(--brand); }
.usage-method-card ul { margin: 10px 0 0; padding-left: 22px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 28px; color: var(--muted); font-size: .74rem; }
.usage-method-card b { color: var(--navy); }

@media (max-width: 980px) {
    .usage-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .usage-chart-wrap { min-height: 400px; }
}

@media (max-width: 620px) {
    .usage-heading { align-items: stretch; }
    .usage-filter { width: 100%; }
    .usage-summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .usage-metric { min-height: 120px; padding: 14px; }
    .usage-metric strong { font-size: 1.65rem; }
    .usage-chart-wrap { min-height: 360px; }
    .usage-method-card ul { grid-template-columns: 1fr; }
}

/* Dashboard and personal health book — v16 */
.dashboard-hero { min-height: 224px; padding: clamp(28px,4vw,46px); }
.dashboard-hero-copy { max-width: 760px; }
.dashboard-hero-status { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-hero-status span { padding: 7px 10px; display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.84); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; font-size: .67rem; font-weight: 650; }
.dashboard-hero-status i { width: 7px; height: 7px; background: #6ee7b7; border-radius: 50%; box-shadow: 0 0 0 4px rgba(110,231,183,.13); }
.dashboard-hero-actions { min-width: 210px; display: grid; gap: 9px; }
.dashboard-hero .dashboard-hero-primary { color: var(--brand-dark); background: #fff; box-shadow: 0 12px 26px rgba(3,52,55,.2); }
.dashboard-hero .dashboard-hero-secondary { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }

.dashboard-kpi-grid { margin: -1px 0 18px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.dashboard-kpi { min-height: 132px; padding: 18px; display: grid; grid-template-columns: 45px minmax(0,1fr); align-items: start; gap: 13px; background: rgba(255,255,255,.97); border: 1px solid var(--border); border-radius: 17px; box-shadow: var(--shadow-sm); transition: transform .18s ease,box-shadow .18s ease; }
.dashboard-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dashboard-kpi-icon { width: 45px; height: 45px; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 13px; font-size: 1.05rem; font-weight: 850; box-shadow: 0 8px 17px rgba(16,42,67,.12); }
.dashboard-kpi-icon.blue { background: linear-gradient(145deg,#2563eb,#0ea5e9); }
.dashboard-kpi-icon.red { background: linear-gradient(145deg,#dc3f4f,#f97366); }
.dashboard-kpi-icon.amber { background: linear-gradient(145deg,#e18a14,#f3ad25); }
.dashboard-kpi > div { min-width: 0; display: flex; flex-direction: column; }
.dashboard-kpi small { color: var(--muted); font-size: .7rem; font-weight: 700; }
.dashboard-kpi strong { color: var(--navy); font-size: 1.85rem; line-height: 1.3; }
.dashboard-kpi em { margin-top: 5px; color: #7c8c95; font-size: .62rem; font-style: normal; }
.dashboard-kpi.priority { border-color: #f5d6da; background: linear-gradient(145deg,#fff,#fff8f8); }
.dashboard-kpi.warning { border-color: #f7dfb9; background: linear-gradient(145deg,#fff,#fffbeb); }

.dashboard-insight-grid { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(350px,.85fr); gap: 17px; }
.dashboard-insight-grid > .card { margin-bottom: 0; }
.compact-heading { margin-bottom: 16px; align-items: center; }
.compact-heading h2 { margin-bottom: 0; }
.compact-heading a { color: var(--brand); font-size: .7rem; font-weight: 750; }
.dashboard-risk-layout { display: grid; grid-template-columns: minmax(210px,.8fr) minmax(230px,1.2fr); align-items: center; gap: 20px; }
.dashboard-risk-chart { position: relative; height: 225px; }
.dashboard-risk-total { position: absolute; inset: 0; display: grid; place-content: center; pointer-events: none; text-align: center; }
.dashboard-risk-total strong { color: var(--navy); font-size: 1.65rem; line-height: 1; }
.dashboard-risk-total span { margin-top: 5px; color: var(--muted); font-size: .62rem; }
.dashboard-risk-list { display: grid; gap: 5px; }
.dashboard-risk-list > div { padding: 9px 10px; display: grid; grid-template-columns: 10px minmax(0,1fr) auto auto; align-items: center; gap: 8px; background: #f8fafb; border-radius: 10px; }
.dashboard-risk-list b { color: #425865; font-size: .69rem; }
.dashboard-risk-list strong { color: var(--navy); font-size: .83rem; }
.dashboard-risk-list small { color: var(--muted); font-size: .57rem; }
.risk-dot { width: 9px; height: 9px; background: #b6c2c9; border-radius: 50%; }
.risk-dot.red { background: var(--red); }.risk-dot.orange { background: var(--orange); }.risk-dot.yellow { background: var(--yellow); }.risk-dot.green { background: var(--green); }
.dashboard-period { padding: 6px 9px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; font-size: .64rem; font-weight: 750; }
.coverage-value { padding: 8px 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.coverage-value strong { color: var(--navy); font-size: 2.7rem; line-height: 1; }
.coverage-value strong small { font-size: 1rem; }
.coverage-value > span { color: var(--muted); font-size: .7rem; }
.coverage-track { height: 11px; overflow: hidden; background: #e8eef1; border-radius: 999px; box-shadow: inset 0 1px 2px rgba(16,42,67,.06); }
.coverage-track i { height: 100%; display: block; background: linear-gradient(90deg,var(--brand),#19bca6); border-radius: inherit; }
.dashboard-work-queue { margin-top: 20px; display: grid; gap: 8px; }
.dashboard-work-queue a { padding: 11px; display: grid; grid-template-columns: 35px minmax(0,1fr) auto; align-items: center; gap: 10px; color: var(--navy); background: #f7fafb; border: 1px solid transparent; border-radius: 12px; transition: .16s ease; }
.dashboard-work-queue a:hover { background: #fff; border-color: #cfe2e2; box-shadow: var(--shadow-sm); transform: translateX(2px); }
.dashboard-work-queue a > span { width: 35px; height: 35px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; font-weight: 800; }
.dashboard-work-queue a div { display: flex; flex-direction: column; }
.dashboard-work-queue b { font-size: .72rem; }
.dashboard-work-queue small { color: var(--muted); font-size: .61rem; }
.dashboard-work-queue em { color: var(--brand); font-style: normal; font-weight: 800; }
.dashboard-principle-card { padding-top: 20px; padding-bottom: 20px; border-left: 5px solid var(--brand); }

.person-dashboard { --person-gap: 18px; }
.person-dashboard-hero { position: relative; min-height: 168px; margin-bottom: 12px; padding: clamp(22px,3vw,32px); display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; color: #fff; background: radial-gradient(circle at 85% 15%,rgba(255,255,255,.14),transparent 14rem),linear-gradient(125deg,#102a43,#0b5e63 62%,#0c8fa2); border-radius: 24px; box-shadow: 0 18px 38px rgba(16,42,67,.15); }
.person-dashboard-hero::after { content:""; position:absolute; right:-52px; bottom:-82px; width:210px; height:210px; border:28px solid rgba(255,255,255,.055); border-radius:50%; }
.person-dashboard-hero > * { position: relative; z-index: 1; }
.person-back-link { margin-bottom: 13px; display: inline-flex; color: #a8e9e1; font-size: .68rem; font-weight: 700; }
.person-heading-row { display: flex; align-items: center; gap: 15px; }
.person-avatar { width: 58px; height: 58px; display: grid; place-items: center; flex: 0 0 auto; color: var(--brand-dark); background: linear-gradient(145deg,#fff,#d7f4ef); border: 3px solid rgba(255,255,255,.28); border-radius: 17px; font-size: 1.45rem; font-weight: 850; }
.person-record-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.person-record-line .record-id { margin: 0; color: #8ee8dc; }
.person-record-line .pill { padding: 3px 8px; border: 0; font-size: .61rem; }
.person-dashboard-hero h1 { margin: 3px 0 2px; color: #fff; font-size: clamp(1.55rem,3vw,2.2rem); }
.person-dashboard-hero p { margin: 0; color: rgba(255,255,255,.72); font-size: .77rem; }
.person-dashboard-actions { display: grid; justify-items: end; gap: 10px; }
.person-last-update { padding: 8px 11px; display: flex; flex-direction: column; color: rgba(255,255,255,.68); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; font-size: .6rem; text-align: right; }
.person-last-update b { color: #fff; font-size: .72rem; }
.person-dashboard-actions .button.primary { color: var(--brand-dark); background: #fff; box-shadow: 0 9px 20px rgba(0,0,0,.12); }
.person-section-tabs { position: sticky; z-index: 8; top: 86px; margin: 0 0 18px; padding: 6px; display: flex; gap: 5px; overflow-x: auto; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); scrollbar-width: none; }
.person-section-tabs::-webkit-scrollbar { display:none; }
.person-section-tabs a { min-height: 39px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px; color: #4b6170; border-radius: 10px; font-size: .73rem; font-weight: 750; white-space: nowrap; }
.person-section-tabs a:hover,.person-section-tabs a:focus { color: var(--brand); background: var(--brand-soft); }
.person-section-tabs span { min-width: 22px; padding: 2px 6px; color: var(--brand); background: #dcefeb; border-radius: 999px; font-size: .59rem; text-align: center; }
.person-section-anchor { scroll-margin-top: 150px; }

.person-latest-grid { margin-bottom: var(--person-gap); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.person-latest-card { min-height: 132px; padding: 17px; display: grid; grid-template-columns: 39px minmax(0,1fr); gap: 12px; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--brand); border-radius: 16px; box-shadow: var(--shadow-sm); }
.person-latest-card.bp { border-top-color: var(--red); }.person-latest-card.sugar { border-top-color: var(--orange); }.person-latest-card.bmi { border-top-color: var(--cyan); }.person-latest-card.weight { border-top-color: #0fae84; }
.latest-card-icon { width: 39px; height: 39px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 11px; font-size: 1rem; font-weight: 850; }
.person-latest-card.bp .latest-card-icon { color: var(--red); background: #fff0f1; }.person-latest-card.sugar .latest-card-icon { color: var(--orange); background: #fff2e9; }.person-latest-card.bmi .latest-card-icon { color: var(--cyan); background: #e8f7fb; }
.person-latest-card > div { min-width: 0; display: flex; flex-direction: column; }
.person-latest-card small { color: var(--muted); font-size: .67rem; font-weight: 700; }
.person-latest-card strong { margin-top: 2px; color: var(--navy); font-size: 1.35rem; line-height: 1.25; }
.person-latest-card strong em { margin-left: 4px; color: var(--muted); font-size: .58rem; font-style: normal; font-weight: 550; }
.person-latest-card p { margin: auto 0 0; color: #687c87; font-size: .62rem; }
.person-overview-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(330px,.8fr); gap: var(--person-gap); }
.person-overview-grid > .card { margin-bottom: var(--person-gap); }
.profile-privacy { padding: 5px 8px; color: #586d78; background: #f0f5f6; border-radius: 999px; font-size: .59rem; font-weight: 700; }
.person-facts-grid { margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.person-facts-grid > div { padding: 11px 12px; background: #f7fafb; border: 1px solid #edf2f4; border-radius: 11px; }
.person-facts-grid .span-all { grid-column: 1 / -1; }
.person-facts-grid dt { color: var(--muted); font-size: .6rem; font-weight: 650; }
.person-facts-grid dd { margin: 2px 0 0; color: var(--navy); font-size: .76rem; font-weight: 700; overflow-wrap: anywhere; }
.person-advice-card { display: grid; grid-template-columns: 46px minmax(0,1fr); align-content: start; gap: 13px; color: #d9edf0; background: radial-gradient(circle at 100% 0,rgba(45,212,191,.18),transparent 13rem),linear-gradient(145deg,#102a43,#0b4349); border-color: rgba(255,255,255,.06); }
.advice-icon { width: 46px; height: 46px; display: grid; place-items: center; color: #0a4f4a; background: #a7f3d0; border-radius: 13px; font-size: 1.15rem; }
.person-advice-card .eyebrow { color: #6ee7d3; }
.person-advice-card h2 { margin-bottom: 8px; color: #fff; }
.person-advice-card p { color: #d2e2e7; font-size: .78rem; }
.person-advice-card small { color: #96b3bf; font-size: .63rem; }
.person-risk-heading { margin: 4px 0 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.person-risk-heading h2 { margin-bottom: 0; }
.person-risk-heading a { color: var(--brand); font-size: .68rem; font-weight: 750; }

.person-trends-section { margin: 24px 0; }
.person-section-heading { margin-bottom: 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.person-section-heading h2 { margin-bottom: 2px; }
.person-section-heading p { margin: 0; color: var(--muted); font-size: .7rem; }
.trend-count { padding: 6px 10px; color: var(--brand); background: var(--brand-soft); border-radius: 999px; font-size: .65rem; font-weight: 750; white-space: nowrap; }
.health-chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.health-chart-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: var(--shadow-sm); transition: box-shadow .18s ease,transform .18s ease; }
.health-chart-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.health-chart-heading { min-height: 66px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(180deg,#fff,#fbfcfd); border-bottom: 1px solid #edf2f4; }
.health-chart-heading > div { display: flex; align-items: center; gap: 10px; }
.health-chart-heading > div > span { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; font-weight: 850; }
.health-chart-heading h3 { margin: 0; font-size: .85rem; }
.health-chart-heading small { display: block; color: var(--muted); font-size: .58rem; }
.chart-live-dot { color: #647681; font-size: .58rem; font-weight: 700; }
.chart-live-dot::before { content:""; width: 6px; height: 6px; margin-right: 5px; display: inline-block; background: #10b981; border-radius: 50%; }
.health-chart-canvas { position: relative; height: 280px; padding: 14px; }
.health-chart-canvas canvas { position: relative; z-index: 1; }
.chart-empty-state { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.chart-empty-state > span { margin-bottom: 5px; color: #95a6af; font-size: 1.55rem; }
.chart-empty-state strong { color: #536873; font-size: .76rem; }
.chart-empty-state small { margin-top: 3px; font-size: .61rem; }
.health-chart-card.is-empty .health-chart-canvas canvas { display: none; }
.health-chart-card.is-empty .chart-empty-state { display: grid; }
.health-chart-card.is-empty .chart-live-dot { display: none; }
.person-history-card { margin-bottom: 0; }
.person-history-card .section-heading p { margin-bottom: 0; }
.person-history-card td > strong,.person-history-card td > small { display: block; }
.person-history-card td > small { margin-top: 2px; color: var(--muted); font-size: .61rem; }
.responsive-table { overflow-x: auto; }
.responsive-table table { min-width: 760px; }

@media (max-width: 1180px) {
    .dashboard-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-insight-grid { grid-template-columns: 1fr; }
    .person-latest-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
    .dashboard-hero { align-items: stretch; flex-direction: column; }
    .dashboard-hero-actions { width: 100%; grid-template-columns: 1fr 1fr; }
    .person-dashboard-hero { align-items: flex-start; flex-direction: column; }
    .person-dashboard-actions { width: 100%; grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; }
    .person-last-update { text-align: left; }
    .person-overview-grid,.health-chart-grid { grid-template-columns: 1fr; }
    .health-chart-canvas { height: 300px; }
}

@media (max-width: 620px) {
    .dashboard-hero { min-height: 0; padding: 24px 20px; }
    .dashboard-hero-status span:last-child { display: none; }
    .dashboard-hero-actions { grid-template-columns: 1fr; }
    .dashboard-kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .dashboard-kpi { min-height: 142px; padding: 14px; grid-template-columns: 1fr; gap: 8px; }
    .dashboard-kpi-icon { width: 38px; height: 38px; border-radius: 11px; }
    .dashboard-kpi strong { font-size: 1.55rem; }
    .dashboard-kpi em { font-size: .57rem; }
    .dashboard-risk-layout { grid-template-columns: 1fr; }
    .dashboard-risk-chart { height: 210px; }
    .dashboard-risk-list { grid-template-columns: 1fr 1fr; }
    .dashboard-risk-list > div { grid-template-columns: 8px minmax(0,1fr) auto; }
    .dashboard-risk-list small { display: none; }
    .person-dashboard-hero { margin-left: -4px; margin-right: -4px; padding: 20px 17px; border-radius: 20px; }
    .person-heading-row { align-items: flex-start; }
    .person-avatar { width: 48px; height: 48px; border-radius: 14px; }
    .person-dashboard-actions { grid-template-columns: 1fr; }
    .person-dashboard-actions .button { width: 100%; }
    .person-section-tabs { top: 69px; margin-left: -2px; margin-right: -2px; }
    .person-latest-grid { gap: 9px; }
    .person-latest-card { min-height: 148px; padding: 13px; grid-template-columns: 1fr; gap: 8px; }
    .latest-card-icon { width: 34px; height: 34px; }
    .person-latest-card strong { font-size: 1.12rem; }
    .person-facts-grid { grid-template-columns: 1fr 1fr; }
    .person-advice-card { grid-template-columns: 1fr; }
    .person-risk-heading,.person-section-heading { align-items: flex-start; flex-direction: column; }
    .health-chart-canvas { height: 260px; padding: 10px; }
    .health-chart-heading { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-kpi,.health-chart-card,.dashboard-work-queue a { transition: none; }
}

/* VHV field workspace — focused, assigned-household-only mobile experience */
.vhv-role {
    background:
        radial-gradient(circle at 8% 18%, rgba(167,139,250,.14), transparent 27rem),
        radial-gradient(circle at 94% 10%, rgba(34,211,238,.13), transparent 24rem),
        linear-gradient(150deg,#f8fbff,#f3f7ff 52%,#f7f5ff);
}
.vhv-role .content { max-width: 1280px; }
.vhv-home,.vhv-household-page { width: 100%; }
.vhv-welcome-card {
    position: relative;
    min-height: 246px;
    margin-bottom: 25px;
    padding: clamp(25px,4vw,39px);
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-content: center;
    gap: 24px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 90% 6%,rgba(255,255,255,.2),transparent 12rem),
        linear-gradient(128deg,#0b5f69,#0f766e 48%,#1a9baa);
    border-radius: 30px;
    box-shadow: 0 24px 54px rgba(16,76,88,.2);
}
.vhv-welcome-card::after { content:""; position:absolute; right:-65px; bottom:-104px; width:260px; height:260px; border:34px solid rgba(255,255,255,.08); border-radius:50%; }
.vhv-welcome-card > * { position: relative; z-index: 1; }
.vhv-welcome-main { display: flex; align-items: center; gap: 19px; }
.vhv-profile-mark { width: 76px; height: 76px; display:grid; place-items:center; flex:0 0 auto; color:#0d5c60; background:linear-gradient(145deg,#fff,#cbf5ef); border:4px solid rgba(255,255,255,.24); border-radius:24px; box-shadow:0 14px 28px rgba(0,0,0,.12); font-size:1.7rem; font-weight:850; }
.vhv-kicker { color:#9cf4e5; font-size:.69rem; font-weight:800; letter-spacing:.13em; }
.vhv-welcome-card h1 { margin:5px 0 4px; color:#fff; font-size:clamp(2rem,5vw,3.25rem); }
.vhv-welcome-card p { margin:0; color:rgba(255,255,255,.78); font-size:.82rem; }
.vhv-date-chip { min-width:210px; padding:14px 17px; align-self:center; display:grid; grid-template-columns:38px 1fr; column-gap:10px; color:#fff; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.18); border-radius:18px; backdrop-filter:blur(12px); }
.vhv-date-chip > span { width:38px; height:38px; grid-row:1 / 3; display:grid; place-items:center; background:rgba(255,255,255,.14); border-radius:11px; }
.vhv-date-chip b { font-size:.82rem; }
.vhv-date-chip small { color:rgba(255,255,255,.66); font-size:.6rem; }
.vhv-summary-chips { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:8px; }
.vhv-summary-chips span { padding:8px 12px; color:#dffcf8; background:rgba(4,42,49,.2); border:1px solid rgba(255,255,255,.12); border-radius:999px; font-size:.66rem; font-weight:650; }
.vhv-summary-chips strong { margin-right:4px; color:#fff; font-size:.85rem; }
.vhv-summary-chips .attention { color:#fff1d6; background:rgba(164,73,14,.3); }

.vhv-section-heading { margin:0 0 14px; display:flex; align-items:flex-end; justify-content:space-between; gap:18px; }
.vhv-section-heading h2 { margin:0; font-size:1.32rem; }
.vhv-section-heading small { color:var(--muted); font-size:.68rem; }
.vhv-section-heading.compact { align-items:center; }
.vhv-section-heading.compact a { color:var(--brand); font-size:.7rem; font-weight:800; }
.vhv-menu-grid { margin-bottom:27px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.vhv-menu-tile {
    position:relative;
    min-height:205px;
    padding:22px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    overflow:hidden;
    color:#fff;
    border:1px solid rgba(255,255,255,.2);
    border-radius:25px;
    box-shadow:0 18px 34px rgba(41,61,91,.15);
    transition:transform .18s ease,box-shadow .18s ease;
}
.vhv-menu-tile::after { content:""; position:absolute; right:-34px; top:-34px; width:115px; height:115px; background:rgba(255,255,255,.1); border-radius:50%; }
.vhv-menu-tile:hover,.vhv-menu-tile:focus-visible { color:#fff; transform:translateY(-3px); box-shadow:0 24px 42px rgba(41,61,91,.2); }
.vhv-menu-tile.blue { background:linear-gradient(145deg,#2467e8,#378cf3); }
.vhv-menu-tile.green { background:linear-gradient(145deg,#069b71,#13bd84); }
.vhv-menu-tile.purple { background:linear-gradient(145deg,#7143dd,#9658ef); }
.vhv-menu-tile.orange { background:linear-gradient(145deg,#e77913,#f6a116); }
.vhv-tile-icon { width:62px; height:62px; display:grid; place-items:center; background:rgba(255,255,255,.16); border-radius:20px; font-size:1.72rem; font-weight:800; }
.vhv-menu-tile div { position:relative; z-index:1; display:flex; flex-direction:column; }
.vhv-menu-tile strong { font-size:1.15rem; line-height:1.3; }
.vhv-menu-tile small { margin-top:5px; color:rgba(255,255,255,.76); font-size:.63rem; }
.vhv-menu-tile > b { position:absolute; right:20px; bottom:20px; font-size:1.1rem; }

.vhv-priority-card { margin-bottom:18px; padding:23px; background:rgba(255,255,255,.9); border:1px solid #dde7ee; border-radius:23px; box-shadow:0 14px 34px rgba(40,61,85,.08); }
.vhv-priority-list { display:grid; gap:9px; }
.vhv-priority-item { padding:12px; display:grid; grid-template-columns:45px minmax(0,1fr) auto auto; align-items:center; gap:12px; background:#f8fafc; border:1px solid #edf1f4; border-radius:15px; }
.vhv-risk-avatar,.vhv-member-avatar { width:45px; height:45px; display:grid; place-items:center; color:#fff; background:#94a3b8; border-radius:14px; font-weight:850; }
.vhv-risk-avatar.red,.vhv-member-avatar.red { background:linear-gradient(145deg,#dc3f4f,#f05266); }
.vhv-risk-avatar.orange,.vhv-member-avatar.orange { background:linear-gradient(145deg,#e46a22,#f59a48); }
.vhv-risk-avatar.yellow,.vhv-member-avatar.yellow { color:#695008; background:linear-gradient(145deg,#f5d64c,#f7e588); }
.vhv-risk-avatar.green,.vhv-member-avatar.green { background:linear-gradient(145deg,#14815c,#22b782); }
.vhv-priority-copy { min-width:0; display:flex; flex-direction:column; }
.vhv-priority-copy strong { color:var(--navy); font-size:.78rem; }
.vhv-priority-copy span { color:#536873; font-size:.65rem; }
.vhv-priority-copy small { color:var(--muted); font-size:.58rem; }
.vhv-priority-item > a { min-height:38px; padding:8px 12px; display:inline-flex; align-items:center; color:var(--brand); background:#e7f6f3; border-radius:10px; font-size:.67rem; font-weight:800; }
.vhv-empty-state { padding:20px; display:flex; align-items:center; justify-content:center; gap:13px; color:#49616e; background:#f4faf8; border:1px dashed #bee2d9; border-radius:15px; }
.vhv-empty-state > span { width:44px; height:44px; display:grid; place-items:center; flex:0 0 auto; color:#0e825f; background:#d7f5e9; border-radius:14px; font-size:1.15rem; font-weight:850; }
.vhv-empty-state strong { color:var(--navy); font-size:.76rem; }
.vhv-empty-state p { margin:2px 0 0; color:var(--muted); font-size:.63rem; }
.vhv-empty-state.small { margin:4px; padding:14px; }
.vhv-scope-note { margin:14px 0 0; padding:12px 14px; color:#5f6f79; background:rgba(255,255,255,.7); border:1px solid #e2e9ee; border-radius:13px; font-size:.64rem; text-align:center; }
.pill.neutral { color:#64748b; background:#edf2f5; border-color:#d9e1e5; }

.vhv-page-banner { position:relative; margin-bottom:18px; padding:27px 30px; display:flex; align-items:center; justify-content:space-between; gap:20px; overflow:hidden; color:#fff; background:linear-gradient(125deg,#173c61,#116b73 58%,#159a9d); border-radius:25px; box-shadow:0 18px 38px rgba(16,42,67,.16); }
.vhv-page-banner::after { content:""; position:absolute; right:-46px; bottom:-75px; width:190px; height:190px; border:25px solid rgba(255,255,255,.07); border-radius:50%; }
.vhv-page-banner > * { position:relative; z-index:1; }
.vhv-page-banner a { margin-bottom:8px; display:inline-flex; color:#b9f3ea; font-size:.65rem; font-weight:750; }
.vhv-page-banner .eyebrow { color:#8cebdc; }
.vhv-page-banner h1 { margin:1px 0 3px; color:#fff; }
.vhv-page-banner p { margin:0; color:rgba(255,255,255,.72); font-size:.72rem; }
.vhv-page-count { min-width:124px; padding:13px 15px; display:flex; flex-direction:column; color:#fff; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.14); border-radius:16px; text-align:center; }
.vhv-page-count strong { font-size:1.55rem; }
.vhv-page-count small { color:rgba(255,255,255,.7); font-size:.58rem; }
.vhv-household-search { position:relative; margin-bottom:18px; padding:16px; display:grid; grid-template-columns:42px minmax(0,1fr) auto auto; align-items:end; gap:11px; background:#fff; border:1px solid #dfe8ed; border-radius:18px; box-shadow:var(--shadow-sm); }
.vhv-household-search > span { width:42px; height:42px; display:grid; place-items:center; align-self:end; color:var(--brand); background:var(--brand-soft); border-radius:12px; font-size:1.2rem; }
.vhv-household-search label { display:flex; flex-direction:column; color:var(--navy); font-size:.68rem; font-weight:750; }
.vhv-household-search input { min-height:43px; margin-top:4px; }
.vhv-household-search > a { min-height:44px; padding:10px; display:flex; align-items:center; color:var(--muted); font-size:.66rem; font-weight:700; }
.vhv-household-list { display:grid; gap:12px; }
.vhv-household-card { overflow:hidden; background:rgba(255,255,255,.94); border:1px solid #dde6eb; border-radius:20px; box-shadow:0 10px 27px rgba(34,56,80,.07); }
.vhv-household-card[open] { border-color:#b7ddd7; box-shadow:0 15px 34px rgba(24,85,85,.11); }
.vhv-household-card summary { min-height:82px; padding:15px 18px; display:grid; grid-template-columns:48px minmax(0,1fr) auto auto 24px; align-items:center; gap:12px; cursor:pointer; list-style:none; }
.vhv-household-card summary::-webkit-details-marker { display:none; }
.vhv-house-icon { width:48px; height:48px; display:grid; place-items:center; color:#b72a69; background:#fce7f2; border-radius:15px; font-size:1.25rem; }
.vhv-house-title { min-width:0; display:flex; flex-direction:column; }
.vhv-house-title strong { color:var(--navy); font-size:.86rem; }
.vhv-house-title small { color:var(--muted); font-size:.61rem; }
.vhv-member-count { padding:5px 9px; color:#0d7180; background:#e4f7f9; border-radius:999px; font-size:.61rem; font-weight:750; }
.vhv-chevron { color:#466170; font-size:1rem; transition:transform .18s ease; }
.vhv-household-card[open] .vhv-chevron { transform:rotate(180deg); }
.vhv-household-members { padding:4px 14px 14px; display:grid; gap:9px; border-top:1px solid #edf2f4; }
.vhv-member-card { padding:13px; display:grid; grid-template-columns:45px minmax(160px,1fr) minmax(180px,.8fr) auto; align-items:center; gap:12px; background:#f8fafc; border:1px solid #edf1f4; border-radius:15px; }
.vhv-member-avatar.unassessed { color:#526574; background:#e4ebef; }
.vhv-member-identity { min-width:0; display:flex; flex-direction:column; }
.vhv-member-identity strong { color:var(--navy); font-size:.76rem; }
.vhv-member-identity small { color:var(--muted); font-size:.58rem; overflow-wrap:anywhere; }
.vhv-member-vitals { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.vhv-member-vitals span { padding:7px 9px; display:flex; flex-direction:column; color:var(--muted); background:#fff; border:1px solid #e4eaed; border-radius:9px; font-size:.55rem; }
.vhv-member-vitals b { color:var(--navy); font-size:.68rem; }
.vhv-member-actions { display:flex; gap:7px; }
.vhv-member-actions .button { min-height:39px; padding:8px 11px; font-size:.64rem; white-space:nowrap; }
.vhv-no-assignment { padding:46px 24px; display:grid; place-items:center; color:var(--muted); background:#fff; border:1px dashed #cbd8de; border-radius:20px; text-align:center; }
.vhv-no-assignment > span { width:62px; height:62px; display:grid; place-items:center; color:#9d3870; background:#fceaf3; border-radius:20px; font-size:1.55rem; }
.vhv-no-assignment h2 { margin:14px 0 4px; }
.vhv-no-assignment p { max-width:520px; margin:0; font-size:.7rem; }
.vhv-care-heading { padding:26px 28px; color:#fff; background:linear-gradient(125deg,#173c61,#116b73 58%,#159a9d); border-radius:24px; box-shadow:0 18px 38px rgba(16,42,67,.14); }
.vhv-care-heading h1 { color:#fff; }
.vhv-care-heading p { color:rgba(255,255,255,.72); }
.vhv-care-heading .eyebrow { color:#8cebdc; }
.vhv-role .care-tabs { padding:7px; overflow-x:auto; background:rgba(255,255,255,.92); border:1px solid #dde7ec; border-radius:16px; box-shadow:var(--shadow-sm); scrollbar-width:none; }
.vhv-role .care-tabs::-webkit-scrollbar { display:none; }
.vhv-role .care-tabs a { flex:1 0 auto; min-height:42px; padding:9px 14px; display:inline-flex; align-items:center; justify-content:center; border-radius:11px; white-space:nowrap; }
.vhv-role .care-tabs a.active { color:#fff; background:linear-gradient(135deg,#0f766e,#0c91a2); }

@media (max-width: 1080px) {
    .vhv-menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .vhv-menu-tile { min-height:180px; }
    .vhv-member-card { grid-template-columns:45px minmax(0,1fr) auto; }
    .vhv-member-vitals { grid-column:2 / 3; }
    .vhv-member-actions { grid-column:3; grid-row:1 / 3; flex-direction:column; }
}

@media (max-width: 820px) {
    .vhv-role .content { padding-bottom:110px; }
    .vhv-welcome-card { grid-template-columns:1fr; }
    .vhv-date-chip { width:100%; }
    .vhv-summary-chips { grid-column:auto; }
}

@media (max-width: 620px) {
    .vhv-role .content { padding:18px 13px 112px; }
    .vhv-welcome-card { min-height:0; margin:0 -2px 21px; padding:23px 18px; gap:17px; border-radius:25px; }
    .vhv-welcome-main { align-items:flex-start; gap:13px; }
    .vhv-profile-mark { width:58px; height:58px; border-radius:18px; font-size:1.3rem; }
    .vhv-welcome-card h1 { font-size:2rem; }
    .vhv-welcome-card p { font-size:.68rem; }
    .vhv-date-chip { min-width:0; padding:11px 13px; }
    .vhv-summary-chips { gap:6px; }
    .vhv-summary-chips span { padding:6px 9px; font-size:.59rem; }
    .vhv-section-heading { align-items:flex-start; }
    .vhv-section-heading > small { display:none; }
    .vhv-menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .vhv-menu-tile { min-height:168px; padding:16px; border-radius:21px; }
    .vhv-tile-icon { width:52px; height:52px; border-radius:17px; font-size:1.4rem; }
    .vhv-menu-tile strong { font-size:.92rem; }
    .vhv-menu-tile small { font-size:.55rem; }
    .vhv-menu-tile > b { right:15px; bottom:15px; }
    .vhv-priority-card { padding:16px; border-radius:19px; }
    .vhv-priority-item { grid-template-columns:41px minmax(0,1fr) auto; gap:9px; }
    .vhv-priority-item .pill { display:none; }
    .vhv-priority-item > a { padding:7px 10px; }
    .vhv-page-banner { margin:-2px -1px 14px; padding:22px 18px; align-items:flex-start; border-radius:22px; }
    .vhv-page-banner p { max-width:220px; }
    .vhv-page-count { min-width:80px; padding:9px; }
    .vhv-household-search { padding:13px; grid-template-columns:36px minmax(0,1fr); align-items:end; }
    .vhv-household-search > span { width:36px; height:42px; }
    .vhv-household-search .button { grid-column:1 / -1; width:100%; }
    .vhv-household-search > a { position:absolute; right:25px; margin-top:5px; }
    .vhv-household-card summary { padding:13px; grid-template-columns:43px minmax(0,1fr) auto 20px; gap:9px; }
    .vhv-house-icon { width:43px; height:43px; border-radius:13px; }
    .vhv-household-card summary > .pill { display:none; }
    .vhv-member-card { grid-template-columns:40px minmax(0,1fr); gap:9px; }
    .vhv-member-avatar { width:40px; height:40px; border-radius:12px; }
    .vhv-member-vitals { grid-column:1 / -1; }
    .vhv-member-actions { grid-column:1 / -1; grid-row:auto; flex-direction:row; }
    .vhv-member-actions .button { flex:1; }
    .vhv-scope-note { font-size:.58rem; }
    .vhv-care-heading { padding:22px 18px; border-radius:21px; }
    .vhv-role .care-tabs { margin-bottom:14px; }
}

@media (max-width: 360px) {
    .vhv-menu-grid { grid-template-columns:1fr; }
    .vhv-menu-tile { min-height:145px; }
}

@media (prefers-reduced-motion: reduce) {
    .vhv-menu-tile,.vhv-chevron { transition:none; }
}

/* Explainable Smart Work Queue — operational priority with a reason on every row */
.smart-queue-content { max-width:1540px; margin:0 auto; padding-bottom:44px; }
.smart-queue-hero {
    position:relative; min-height:210px; margin-bottom:18px; padding:34px 38px; display:flex;
    align-items:center; justify-content:space-between; gap:28px; overflow:hidden; color:#fff;
    background:linear-gradient(125deg,#102f4c 0%,#075f65 52%,#0c9486 100%);
    border-radius:28px; box-shadow:0 23px 50px rgba(24,57,77,.17);
}
.smart-queue-hero::after { content:""; position:absolute; right:-75px; bottom:-120px; width:300px; height:300px; border:42px solid rgba(255,255,255,.07); border-radius:50%; }
.smart-queue-hero > * { position:relative; z-index:1; }
.smart-queue-hero .eyebrow { color:#9df3df; }
.smart-queue-hero h1 { margin:3px 0 5px; color:#fff; font-size:clamp(2.15rem,4.5vw,3.5rem); }
.smart-queue-hero p { max-width:820px; margin:0; color:rgba(255,255,255,.76); font-size:.78rem; }
.smart-queue-hero-total { min-width:175px; padding:18px 22px; display:grid; grid-template-columns:1fr auto; color:#fff; background:rgba(255,255,255,.11); border:1px solid rgba(255,255,255,.17); border-radius:19px; backdrop-filter:blur(12px); }
.smart-queue-hero-total small { grid-column:1 / -1; color:rgba(255,255,255,.7); font-size:.58rem; }
.smart-queue-hero-total strong { font-size:2.35rem; line-height:1.1; }
.smart-queue-hero-total span { align-self:end; padding-bottom:5px; color:#c8f5ed; font-size:.6rem; }

.smart-queue-filters { margin-bottom:18px; padding:8px; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; overflow-x:auto; background:#e6eef1; border-radius:17px; scrollbar-width:none; }
.smart-queue-filters::-webkit-scrollbar { display:none; }
.smart-queue-filters a { min-width:145px; min-height:62px; padding:9px 11px; display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:8px; color:#4a6270; background:rgba(255,255,255,.72); border:1px solid transparent; border-radius:12px; }
.smart-queue-filters a:hover,.smart-queue-filters a.active { color:var(--navy); background:#fff; border-color:#c8dadf; box-shadow:0 6px 16px rgba(28,54,74,.08); }
.smart-queue-filters a > span { width:34px; height:34px; display:grid; place-items:center; color:#0c766e; background:#e2f6f1; border-radius:10px; font-weight:900; }
.smart-queue-filters a b { overflow:hidden; font-size:.59rem; text-overflow:ellipsis; white-space:nowrap; }
.smart-queue-filters a strong { font-size:.82rem; }
.smart-queue-filters .tone-red > span { color:#bd3047; background:#ffe6ea; }
.smart-queue-filters .tone-orange > span { color:#b95217; background:#ffeadc; }
.smart-queue-filters .tone-amber > span { color:#9a650a; background:#fff1c9; }
.smart-queue-filters .tone-blue > span { color:#236ac1; background:#e5f0ff; }
.smart-queue-filters .tone-green > span { color:#0b7f5a; background:#ddf6e9; }

.smart-queue-panel { padding:24px; border-radius:24px; }
.smart-queue-heading { align-items:flex-end; }
.smart-queue-heading h2 { font-size:1.4rem; }
.smart-queue-heading p { margin:4px 0 0; color:var(--muted); font-size:.62rem; }
.smart-queue-category-grid { margin-bottom:17px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.smart-queue-category { min-height:76px; padding:11px; display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:9px; color:var(--navy); background:#f7fafb; border:1px solid #e4ecef; border-radius:14px; }
.smart-queue-category:hover { color:var(--navy); background:#fff; border-color:#bfd8d8; box-shadow:0 8px 20px rgba(30,55,75,.08); }
.smart-queue-category > span { width:38px; height:38px; display:grid; place-items:center; border-radius:11px; font-weight:900; }
.smart-queue-category div { min-width:0; display:flex; flex-direction:column; }
.smart-queue-category b { font-size:.62rem; }
.smart-queue-category small { overflow:hidden; color:var(--muted); font-size:.48rem; text-overflow:ellipsis; white-space:nowrap; }
.smart-queue-category strong { font-size:1rem; }
.smart-queue-category.red > span { color:#bd3047; background:#ffe5ea; }
.smart-queue-category.orange > span { color:#ba5417; background:#ffe9da; }
.smart-queue-category.amber > span { color:#956108; background:#fff0c8; }
.smart-queue-category.blue > span { color:#2369c1; background:#e4f0ff; }
.smart-queue-category.green > span { color:#087b58; background:#dcf5e8; }

.smart-queue-list { display:grid; gap:9px; }
.smart-queue-item { position:relative; min-height:105px; padding:13px 14px 13px 12px; display:grid; grid-template-columns:34px minmax(190px,.75fr) minmax(310px,1.5fr) minmax(105px,.42fr); align-items:center; gap:13px; overflow:hidden; background:#f9fbfc; border:1px solid #e4ecef; border-left:4px solid #82a6b2; border-radius:16px; }
.smart-queue-item.tone-red { border-left-color:#dc3f4f; }
.smart-queue-item.tone-orange { border-left-color:#ea6a25; }
.smart-queue-item.tone-amber { border-left-color:#e0a313; }
.smart-queue-item.tone-blue { border-left-color:#397fd5; }
.smart-queue-item.tone-green { border-left-color:#17845e; }
.smart-queue-rank { width:30px; height:30px; display:grid; place-items:center; color:#fff; background:#183e59; border-radius:9px; font-size:.65rem; font-weight:900; }
.smart-queue-person { min-width:0; display:flex; flex-direction:column; }
.smart-queue-person h3 { margin:5px 0 1px; overflow:hidden; color:var(--navy); font-size:.76rem; text-overflow:ellipsis; white-space:nowrap; }
.smart-queue-person > small { overflow:hidden; color:var(--muted); font-size:.54rem; text-overflow:ellipsis; white-space:nowrap; }
.smart-queue-badge { width:max-content; max-width:100%; padding:4px 8px; overflow:hidden; border-radius:999px; font-size:.5rem; font-weight:850; text-overflow:ellipsis; white-space:nowrap; }
.smart-queue-badge.red { color:#b72e43; background:#ffe5e9; }
.smart-queue-badge.orange { color:#ac4a14; background:#ffe9db; }
.smart-queue-badge.amber { color:#926006; background:#fff0c7; }
.smart-queue-badge.blue { color:#2365b8; background:#e5f0ff; }
.smart-queue-badge.green { color:#087651; background:#ddf5e8; }
.smart-queue-reason { min-width:0; padding:10px 12px; background:#fff; border:1px solid #e6ecef; border-radius:12px; }
.smart-queue-reason b { color:#455d69; font-size:.54rem; }
.smart-queue-reason p { margin:2px 0 5px; color:#19394d; font-size:.64rem; font-weight:700; line-height:1.48; }
.smart-queue-reason small { color:#08766c; font-size:.54rem; font-weight:750; }
.smart-queue-actions { display:flex; flex-direction:column; align-items:flex-end; gap:7px; }
.smart-queue-actions small { color:#7a8c95; font-size:.5rem; }
.smart-queue-actions a { min-height:38px; padding:8px 11px; display:inline-flex; align-items:center; justify-content:center; color:#fff; background:linear-gradient(135deg,#0c766d,#07978a); border-radius:10px; font-size:.58rem; font-weight:850; white-space:nowrap; }
.smart-queue-governance { margin-top:14px; padding:11px 13px; display:flex; align-items:center; justify-content:space-between; gap:14px; color:#687b84; background:#f2f7f8; border-radius:11px; font-size:.51rem; }
.smart-queue-governance strong { color:#445b66; }
.smart-queue-policy-note { margin-top:17px; padding:17px 19px; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:13px; color:#5a6f79; background:#fffaf0; border:1px solid #f0dba8; border-radius:17px; }
.smart-queue-policy-note > span { width:42px; height:42px; display:grid; place-items:center; color:#97630b; background:#fff0c7; border-radius:13px; font-weight:900; }
.smart-queue-policy-note strong { color:#5f450e; font-size:.69rem; }
.smart-queue-policy-note p { margin:2px 0 0; font-size:.58rem; }
.smart-queue-policy-note a { color:#89600f; font-size:.58rem; font-weight:850; white-space:nowrap; }

@media (max-width:1180px) {
    .smart-queue-category-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .smart-queue-item { grid-template-columns:34px minmax(180px,.7fr) minmax(260px,1.3fr); }
    .smart-queue-actions { grid-column:2 / -1; flex-direction:row; justify-content:flex-end; align-items:center; }
}

@media (max-width:820px) {
    .smart-queue-content { padding-bottom:105px; }
    .smart-queue-hero { min-height:0; padding:26px 23px; align-items:flex-end; border-radius:24px; }
    .smart-queue-hero-total { min-width:135px; }
    .smart-queue-filters { display:flex; }
    .smart-queue-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .smart-queue-item { grid-template-columns:32px minmax(0,1fr); }
    .smart-queue-reason,.smart-queue-actions { grid-column:2; }
    .smart-queue-actions { justify-content:space-between; }
}

@media (max-width:620px) {
    .smart-queue-content { padding:15px 12px 112px; }
    .smart-queue-hero { margin:-1px 0 13px; padding:23px 18px; flex-direction:column; align-items:stretch; gap:17px; border-radius:22px; }
    .smart-queue-hero h1 { font-size:2.15rem; }
    .smart-queue-hero p { font-size:.66rem; }
    .smart-queue-hero-total { width:100%; padding:13px 15px; }
    .smart-queue-hero-total strong { font-size:1.85rem; }
    .smart-queue-filters { margin:0 -2px 13px; }
    .smart-queue-filters a { min-width:128px; min-height:55px; }
    .smart-queue-panel { padding:15px; border-radius:19px; }
    .smart-queue-heading { align-items:flex-start; }
    .smart-queue-heading p { font-size:.57rem; }
    .smart-queue-heading > a { white-space:nowrap; }
    .smart-queue-category-grid { display:flex; margin:0 -2px 14px; padding-bottom:3px; overflow-x:auto; scrollbar-width:none; }
    .smart-queue-category-grid::-webkit-scrollbar { display:none; }
    .smart-queue-category { min-width:145px; min-height:65px; }
    .smart-queue-category small { display:none; }
    .smart-queue-item { padding:12px 11px 12px 9px; grid-template-columns:29px minmax(0,1fr); align-items:start; gap:9px; border-radius:14px; }
    .smart-queue-rank { width:27px; height:27px; }
    .smart-queue-person h3 { font-size:.72rem; }
    .smart-queue-reason { padding:9px 10px; }
    .smart-queue-reason p { font-size:.61rem; }
    .smart-queue-governance { flex-direction:column; align-items:flex-start; }
    .smart-queue-policy-note { grid-template-columns:37px minmax(0,1fr); padding:14px; }
    .smart-queue-policy-note > span { width:37px; height:37px; }
    .smart-queue-policy-note > a { grid-column:2; }
}

/* Role-aware dashboards — each role receives a focused operational workspace */
.role-admin,.role-staff,.role-hospital,.role-citizen {
    background:
        radial-gradient(circle at 88% 3%,rgba(39,176,160,.09),transparent 28rem),
        linear-gradient(145deg,#f7fafb,#eef5f6 58%,#f8fafc);
}
.role-dashboard { width:100%; display:grid; gap:22px; }
.role-hero {
    position:relative; min-height:226px; padding:clamp(27px,4vw,42px); display:flex; align-items:center;
    justify-content:space-between; gap:28px; overflow:hidden; color:#fff; border-radius:30px;
    box-shadow:0 24px 52px rgba(24,57,77,.17);
}
.role-hero::after { content:""; position:absolute; right:-70px; bottom:-120px; width:300px; height:300px; border:38px solid rgba(255,255,255,.08); border-radius:50%; }
.role-hero > * { position:relative; z-index:1; }
.role-hero.admin-hero { background:linear-gradient(128deg,#172c47,#18556a 54%,#0b8a82); }
.role-hero.staff-hero { background:linear-gradient(128deg,#075b5a,#0b7d72 52%,#17a58e); }
.role-hero.hospital-hero { background:linear-gradient(128deg,#313a78,#5353a7 55%,#7663c6); }
.role-hero.citizen-hero { background:linear-gradient(128deg,#075f66,#078b86 55%,#20aa8d); }
.role-hero .eyebrow { color:rgba(194,255,242,.88); }
.role-hero h1 { max-width:760px; margin:5px 0 7px; color:#fff; font-size:clamp(2rem,4vw,3.25rem); line-height:1.14; }
.role-hero p { max-width:750px; margin:0; color:rgba(255,255,255,.75); font-size:.82rem; }
.role-hero-actions { min-width:220px; display:grid; gap:10px; }
.role-hero-actions .button { min-height:51px; justify-content:center; border:0; }
.light-button { color:#125d5c; background:#fff; }
.light-button:hover { color:#0b4a49; background:#f1fffc; }
.glass-button { color:#fff; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2)!important; backdrop-filter:blur(10px); }
.glass-button:hover { color:#fff; background:rgba(255,255,255,.2); }

.role-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.role-kpi { min-height:154px; padding:20px; display:grid; grid-template-columns:48px minmax(0,1fr); align-items:start; gap:14px; background:#fff; border:1px solid #dfe8ec; border-radius:22px; box-shadow:0 12px 30px rgba(36,61,78,.07); }
.role-kpi > span { width:48px; height:48px; display:grid; place-items:center; border-radius:15px; font-size:1.25rem; font-weight:850; }
.role-kpi > div { min-width:0; display:flex; flex-direction:column; }
.role-kpi small { color:#617583; font-size:.65rem; font-weight:700; }
.role-kpi strong { margin:3px 0; color:var(--navy); font-size:2rem; line-height:1; }
.role-kpi strong sup { font-size:.75rem; }
.role-kpi em { color:#81919a; font-size:.57rem; font-style:normal; }
.role-kpi.teal > span { color:#08776f; background:#dff7f2; }
.role-kpi.blue > span { color:#2466c9; background:#e4efff; }
.role-kpi.green > span { color:#087f58; background:#ddf7e9; }
.role-kpi.amber > span { color:#a46108; background:#fff2d7; }
.role-kpi.red > span { color:#bf3447; background:#ffe8eb; }
.role-kpi.purple > span { color:#6551b5; background:#ece8ff; }

.role-dashboard-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr); gap:18px; }
.role-panel { padding:23px; border-radius:23px; }
.role-panel-heading { margin-bottom:17px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.role-panel-heading h2 { margin:1px 0 0; font-size:1.25rem; }
.role-panel-heading > a { color:var(--brand); font-size:.66rem; font-weight:800; }
.live-chip { padding:6px 9px; display:inline-flex; align-items:center; gap:6px; color:#06785b; background:#e3f8ef; border-radius:999px; font-size:.57rem; font-weight:850; }
.live-chip i { width:7px; height:7px; background:#19b97e; border-radius:50%; box-shadow:0 0 0 4px rgba(25,185,126,.12); }

.quality-check-list { display:grid; gap:8px; }
.quality-check-list > a { min-height:65px; padding:10px 12px; display:grid; grid-template-columns:38px minmax(0,1fr) auto 18px; align-items:center; gap:10px; color:var(--navy); background:#f8fafb; border:1px solid #e8eef0; border-radius:14px; }
.quality-check-list > a:hover { color:var(--navy); border-color:#b9dcd6; background:#f3fbf9; }
.quality-state { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; font-weight:900; }
.quality-state.ok { color:#087d59; background:#dcf6e8; }
.quality-state.warn { color:#a55d08; background:#fff0d1; }
.quality-check-list div { min-width:0; display:flex; flex-direction:column; }
.quality-check-list b { font-size:.7rem; }
.quality-check-list small { color:var(--muted); font-size:.56rem; }
.quality-check-list strong { font-size:1rem; }
.quality-check-list em { color:#79909b; font-style:normal; }
.system-readiness-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.system-readiness { min-height:78px; padding:11px; display:grid; grid-template-columns:34px minmax(0,1fr); gap:9px; background:#f8fafb; border:1px solid #e5edef; border-radius:14px; }
.system-readiness > span { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; font-weight:850; }
.system-readiness.ready > span { color:#087d59; background:#dcf6e8; }
.system-readiness.attention > span { color:#ae5e0a; background:#fff0d4; }
.system-readiness div { min-width:0; display:flex; flex-direction:column; }
.system-readiness b { font-size:.66rem; }
.system-readiness small { color:var(--muted); font-size:.52rem; overflow:hidden; text-overflow:ellipsis; }
.system-readiness em { grid-column:2; color:#71838c; font-size:.52rem; font-style:normal; }
.admin-user-summary { margin-top:13px; padding-top:13px; display:grid; grid-template-columns:repeat(4,1fr); gap:7px; border-top:1px solid #e7edef; }
.admin-user-summary span { padding:8px; display:flex; flex-direction:column; background:#f4f7f8; border-radius:10px; }
.admin-user-summary small { color:var(--muted); font-size:.5rem; }
.admin-user-summary b { color:var(--navy); font-size:.85rem; }
.role-action-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.role-action-strip > a { min-height:84px; padding:15px; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:11px; color:var(--navy); background:#fff; border:1px solid #dfe8ec; border-radius:17px; box-shadow:var(--shadow-sm); }
.role-action-strip > a > span { width:42px; height:42px; display:grid; place-items:center; color:var(--brand); background:var(--brand-soft); border-radius:12px; font-weight:850; }
.role-action-strip div { display:flex; flex-direction:column; }
.role-action-strip b { font-size:.72rem; }
.role-action-strip small { color:var(--muted); font-size:.55rem; }
.role-action-strip em { color:#6e8490; font-style:normal; }

.village-coverage-list { display:grid; gap:9px; }
.village-coverage-list > div { display:grid; grid-template-columns:minmax(160px,.65fr) minmax(120px,1fr) 53px; align-items:center; gap:10px; }
.village-coverage-list span { min-width:0; display:flex; flex-direction:column; }
.village-coverage-list b { overflow:hidden; color:var(--navy); font-size:.62rem; text-overflow:ellipsis; white-space:nowrap; }
.village-coverage-list small { color:var(--muted); font-size:.52rem; }
.village-coverage-list .coverage-track { height:8px; margin:0; }
.village-coverage-list strong { color:#31505e; font-size:.61rem; text-align:right; }
.role-risk-layout { grid-template-columns:minmax(160px,.8fr) 1fr; }
.work-queue-panel { padding:23px; }
.compact-case-list { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.compact-case-list > a { min-height:78px; padding:11px; display:grid; grid-template-columns:38px minmax(0,1fr) auto 16px; align-items:center; gap:9px; color:var(--navy); background:#f8fafb; border:1px solid #e7edef; border-radius:14px; }
.case-priority { width:38px; height:38px; display:grid; place-items:center; color:#815d0b; background:#ffe9a9; border-radius:12px; font-weight:900; }
.case-priority.high { color:#a84610; background:#ffe6d5; }
.case-priority.urgent { color:#b52f44; background:#ffe2e7; }
.compact-case-list div,.compact-case-list > a > span:nth-of-type(2) { min-width:0; display:flex; flex-direction:column; }
.compact-case-list b { font-size:.68rem; }
.compact-case-list small { color:var(--muted); font-size:.52rem; }
.compact-case-list > a > span:nth-of-type(2) { align-items:flex-end; font-size:.55rem; }
.compact-case-list em { color:#77909b; font-style:normal; }
.role-empty-state { padding:20px; color:#607681; background:#f4faf8; border:1px dashed #bedfd8; border-radius:14px; font-size:.67rem; text-align:center; }
.role-empty-state.large { padding:50px 25px; font-size:.76rem; }

.hospital-panels { grid-template-columns:minmax(0,1.35fr) minmax(310px,.65fr); }
.referral-list { display:grid; gap:9px; }
.referral-list > article { padding:12px; display:grid; grid-template-columns:45px minmax(0,1fr) auto auto; align-items:center; gap:11px; background:#f9fafc; border:1px solid #e6e9f1; border-radius:15px; }
.referral-avatar { width:45px; height:45px; display:grid; place-items:center; color:#fff; background:#7e72bc; border-radius:14px; font-weight:850; }
.referral-avatar.red { background:#dc3f4f; }.referral-avatar.orange { background:#ea6a25; }.referral-avatar.green { background:#16845b; }.referral-avatar.yellow { color:#6b520d; background:#f2d454; }
.referral-identity { min-width:0; display:flex; flex-direction:column; }
.referral-identity b { color:var(--navy); font-size:.69rem; }
.referral-identity small,.referral-identity em { color:var(--muted); font-size:.52rem; font-style:normal; }
.referral-vitals { display:flex; gap:6px; }
.referral-vitals span { padding:7px 9px; display:flex; flex-direction:column; color:var(--muted); background:#fff; border:1px solid #e4e8ee; border-radius:9px; font-size:.48rem; }
.referral-vitals b { color:var(--navy); font-size:.62rem; }
.referral-actions { display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.referral-actions > a { color:#5546a3; font-size:.55rem; font-weight:800; }
.outcome-list { display:grid; gap:8px; }
.outcome-list > a { padding:11px; display:grid; grid-template-columns:36px minmax(0,1fr) 16px; gap:9px; color:var(--navy); background:#f8fafc; border:1px solid #e7eaf0; border-radius:13px; }
.outcome-list > a > span { width:36px; height:36px; display:grid; place-items:center; color:#087d59; background:#dcf6e8; border-radius:11px; }
.outcome-list div { min-width:0; display:flex; flex-direction:column; }
.outcome-list b { font-size:.65rem; }.outcome-list small { color:var(--muted); font-size:.5rem; }.outcome-list p { margin:3px 0 0; color:#526875; font-size:.53rem; }
.outcome-list em { color:#7a8e98; font-style:normal; }
.dashboard-governance-note { margin:0; padding:12px 15px; color:#60727c; background:rgba(255,255,255,.72); border:1px solid #e0e8eb; border-radius:13px; font-size:.58rem; text-align:center; }

.citizen-risk-chip { min-width:165px; padding:13px 16px; display:flex; flex-direction:column; color:#fff; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); border-radius:17px; }
.citizen-risk-chip small { color:rgba(255,255,255,.7); font-size:.56rem; }.citizen-risk-chip b { font-size:.75rem; }
.citizen-latest-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.citizen-latest-grid > article { min-height:135px; padding:17px; display:grid; grid-template-columns:46px minmax(0,1fr); gap:12px; align-items:start; background:#fff; border:1px solid #dfe8eb; border-radius:20px; box-shadow:var(--shadow-sm); }
.vital-icon { width:46px; height:46px; display:grid; place-items:center; border-radius:14px; font-size:1.15rem; font-weight:850; }
.vital-icon.red { color:#bd3449; background:#ffe6ea; }.vital-icon.orange { color:#b3610b; background:#fff0d6; }.vital-icon.blue { color:#2165c5; background:#e3efff; }.vital-icon.green { color:#087d59; background:#ddf6e9; }
.citizen-latest-grid div { display:flex; flex-direction:column; }.citizen-latest-grid small { color:var(--muted); font-size:.59rem; }.citizen-latest-grid strong { margin:3px 0; color:var(--navy); font-size:1.45rem; }.citizen-latest-grid em { color:#87969e; font-size:.52rem; font-style:normal; }
.citizen-goal-panel { padding:23px; border-radius:23px; }
.citizen-goal-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:11px; }
.citizen-goal-grid article { min-height:130px; padding:15px; display:flex; flex-direction:column; border:1px solid #dfe8ec; border-radius:17px; }
.citizen-goal-grid article > span { width:35px; height:35px; display:grid; place-items:center; margin-bottom:9px; background:rgba(255,255,255,.65); border-radius:11px; }
.citizen-goal-grid article.green { color:#086d50; background:#e7f8f0; }.citizen-goal-grid article.amber { color:#89530c; background:#fff4df; }.citizen-goal-grid article.blue { color:#24579d; background:#eaf2ff; }.citizen-goal-grid article.purple { color:#55479d; background:#eeeafe; }.citizen-goal-grid article.neutral { color:#526975; background:#f1f5f6; }
.citizen-goal-grid small { font-size:.55rem; }.citizen-goal-grid strong { margin:3px 0; color:inherit; font-size:.74rem; }.citizen-goal-grid em { font-size:.54rem; font-style:normal; opacity:.78; }
.goal-disclaimer { margin:13px 0 0; color:var(--muted); font-size:.55rem; }
.citizen-dashboard-grid { display:grid; grid-template-columns:1.2fr .8fr; gap:18px; }
.citizen-advice-panel,.citizen-followup-panel { padding:23px; border-radius:22px; }
.citizen-advice { min-height:115px; padding:17px; display:grid; grid-template-columns:46px 1fr; gap:12px; color:#1f5361; background:linear-gradient(135deg,#eefaf7,#edf8fb); border:1px solid #d8eeea; border-radius:16px; }
.citizen-advice > span { width:46px; height:46px; display:grid; place-items:center; color:#087d6e; background:#d8f5ed; border-radius:14px; font-size:1.15rem; }.citizen-advice p { margin:0; font-size:.66rem; line-height:1.7; }
.citizen-advice-panel > .button { margin-top:12px; }
.citizen-next-date { padding:17px; display:grid; grid-template-columns:47px 1fr; gap:12px; color:#4b438b; background:#f2efff; border:1px solid #e4ddff; border-radius:16px; }
.citizen-next-date > span { width:47px; height:47px; display:grid; place-items:center; background:#e2dcff; border-radius:14px; font-size:1.1rem; }.citizen-next-date div { display:flex; flex-direction:column; }.citizen-next-date small { font-size:.54rem; }.citizen-next-date strong { color:#3e357d; font-size:1.15rem; }.citizen-next-date p { margin:4px 0 0; font-size:.56rem; }
.citizen-trend-panel { padding:23px; border-radius:23px; }
.citizen-chart-grid { display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.citizen-chart-grid > article { min-width:0; padding:13px; background:#fbfcfd; border:1px solid #e6ecef; border-radius:17px; }
.citizen-chart-grid > article > div:first-child { display:flex; justify-content:space-between; gap:10px; }.citizen-chart-grid b { font-size:.68rem; }.citizen-chart-grid small { color:var(--muted); font-size:.53rem; }
.citizen-chart-grid .health-chart-canvas { height:255px; padding:8px; }

@media (max-width:1100px) {
    .role-kpi-grid,.citizen-latest-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .role-dashboard-grid,.hospital-panels { grid-template-columns:1fr; }
    .role-action-strip { grid-template-columns:1fr 1fr; }
}
@media (max-width:760px) {
    .role-hero { min-height:0; padding:25px 20px; align-items:stretch; flex-direction:column; border-radius:24px; }
    .role-hero-actions { width:100%; grid-template-columns:1fr 1fr; }
    .role-kpi-grid { grid-template-columns:1fr 1fr; gap:9px; }
    .role-kpi { min-height:144px; padding:14px; grid-template-columns:1fr; gap:8px; }
    .role-kpi > span { width:39px; height:39px; border-radius:12px; }
    .role-kpi strong { font-size:1.55rem; }
    .role-action-strip,.citizen-dashboard-grid { grid-template-columns:1fr; }
    .compact-case-list { grid-template-columns:1fr; }
    .referral-list > article { grid-template-columns:42px minmax(0,1fr) auto; }
    .referral-vitals { grid-column:2; }.referral-actions { grid-column:3; grid-row:1 / 3; }
    .citizen-goal-grid { grid-template-columns:1fr; }
    .citizen-chart-grid { grid-template-columns:1fr; }
}
@media (max-width:520px) {
    .role-dashboard { gap:15px; }
    .role-hero { margin:0 -1px; }
    .role-hero h1 { font-size:1.85rem; }
    .role-hero p { font-size:.68rem; }
    .role-hero-actions { grid-template-columns:1fr; }
    .role-kpi { min-height:134px; }
    .role-kpi small { font-size:.57rem; }.role-kpi em { font-size:.5rem; }
    .role-panel,.work-queue-panel,.citizen-goal-panel,.citizen-advice-panel,.citizen-followup-panel,.citizen-trend-panel { padding:16px; border-radius:19px; }
    .role-panel-heading { align-items:flex-start; }
    .role-panel-heading h2 { font-size:1.05rem; }
    .system-readiness-grid { grid-template-columns:1fr; }
    .admin-user-summary { grid-template-columns:1fr 1fr; }
    .role-action-strip { grid-template-columns:1fr; }
    .village-coverage-list > div { grid-template-columns:minmax(110px,.8fr) minmax(80px,1fr) 45px; }
    .role-risk-layout { grid-template-columns:1fr; }
    .referral-list > article { grid-template-columns:40px minmax(0,1fr); }
    .referral-vitals { grid-column:1 / -1; }.referral-actions { grid-column:1 / -1; grid-row:auto; flex-direction:row; justify-content:space-between; align-items:center; }
    .citizen-latest-grid { gap:8px; }
    .citizen-latest-grid > article { min-height:128px; padding:13px; grid-template-columns:1fr; gap:8px; }
    .citizen-latest-grid strong { font-size:1.16rem; }
    .citizen-risk-chip { min-width:0; }
}

@media (prefers-reduced-motion:reduce) {
    .role-kpi,.quality-check-list > a,.role-action-strip > a { transition:none; }
}

/* PWA field mode — deliberately independent from clinical page content. */
.pwa-tools { position:fixed; right:18px; bottom:18px; z-index:1200; font-family:"Noto Sans Thai","Leelawadee UI",Tahoma,sans-serif; }
.pwa-status-chip { min-height:44px; padding:8px 13px; display:inline-flex; align-items:center; gap:8px; color:#17354a; background:rgba(255,255,255,.94); border:1px solid #cfe0e3; border-radius:999px; box-shadow:0 12px 34px rgba(15,56,69,.17); backdrop-filter:blur(14px); font:inherit; font-size:.68rem; font-weight:850; cursor:pointer; }
.pwa-state-dot { width:10px; height:10px; flex:0 0 10px; display:inline-block; background:#18b981; border:3px solid #d7f8ed; border-radius:50%; box-sizing:content-box; }
.pwa-status-chip b { min-width:20px; height:20px; display:grid; place-items:center; padding:0 5px; color:#fff; background:#e44c5a; border-radius:999px; font-size:.58rem; }
html[data-pwa-state="offline"] .pwa-state-dot { background:#f59e0b; border-color:#fff0c7; }
html[data-pwa-state="syncing"] .pwa-state-dot { background:#1688dd; border-color:#dceeff; animation:pwa-pulse 1.1s infinite; }
html[data-pwa-state="attention"] .pwa-state-dot { background:#ef4a58; border-color:#ffe1e5; }
.pwa-control-panel { position:absolute; right:0; bottom:56px; width:min(355px,calc(100vw - 28px)); padding:18px; color:#17354a; background:rgba(255,255,255,.98); border:1px solid #d8e6e8; border-radius:22px; box-shadow:0 24px 70px rgba(10,46,60,.24); }
.pwa-panel-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.pwa-panel-heading > div { display:flex; flex-direction:column; }.pwa-panel-heading small { color:#0f766e; font-size:.52rem; font-weight:900; letter-spacing:.14em; }.pwa-panel-heading strong { font-size:.86rem; }
.pwa-panel-heading button { width:32px; height:32px; padding:0; display:grid; place-items:center; color:#607985; background:#f0f5f6; border:0; border-radius:10px; font-size:1.2rem; cursor:pointer; }
.pwa-panel-state { margin-top:14px; padding:12px; display:grid; grid-template-columns:18px 1fr; gap:10px; align-items:center; background:#f0f8f7; border-radius:14px; }.pwa-panel-state > div { display:flex; flex-direction:column; }.pwa-panel-state b { font-size:.68rem; }.pwa-panel-state small { color:#617985; font-size:.53rem; }
.pwa-task-summary { margin-top:10px; padding:13px; display:grid; grid-template-columns:1fr auto; gap:2px 10px; background:linear-gradient(135deg,#eef9f8,#edf6fb); border:1px solid #d8e9e9; border-radius:14px; }.pwa-task-summary span { color:#647b85; font-size:.54rem; }.pwa-task-summary b { grid-row:1 / 3; grid-column:2; align-self:center; color:#0f766e; font-size:1.4rem; }.pwa-task-summary small { color:#214553; font-size:.59rem; }
.pwa-panel-actions { margin-top:12px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }.pwa-panel-actions button { min-height:42px; padding:8px 10px; color:#1a5260; background:#eef7f7; border:1px solid #d2e5e5; border-radius:12px; font:inherit; font-size:.57rem; font-weight:850; cursor:pointer; }.pwa-panel-actions button:hover,.pwa-panel-actions button.is-ready { color:#fff; background:#0f766e; border-color:#0f766e; }.pwa-panel-actions button.danger { color:#a83b48; background:#fff2f3; border-color:#f7d9dd; }
.pwa-secure-note { margin:12px 2px 0; color:#758991; font-size:.5rem; line-height:1.55; }
.pwa-draft-note { margin:0; padding:12px 14px; color:#315f66; background:#edf9f7; border:1px solid #d6eeea; border-radius:13px; font-size:.58rem; line-height:1.65; }.pwa-draft-note span { margin-right:6px; color:#0f8a7d; }
.pwa-toast { position:fixed; left:50%; bottom:82px; z-index:1400; width:max-content; max-width:min(520px,calc(100vw - 30px)); padding:12px 16px; color:#fff; background:#17354a; border-radius:13px; box-shadow:0 14px 42px rgba(10,38,50,.25); opacity:0; transform:translate(-50%,14px); transition:.22s ease; font-size:.67rem; font-weight:750; text-align:center; }.pwa-toast.show { opacity:1; transform:translate(-50%,0); }.pwa-toast.success { background:#087d62; }.pwa-toast.warning { background:#a7620d; }.pwa-toast.info { background:#17668b; }
@keyframes pwa-pulse { 50% { transform:scale(.72); opacity:.58; } }

@media (max-width:760px) {
    .pwa-tools { right:12px; bottom:82px; }
    .pwa-control-panel { position:fixed; right:10px; bottom:136px; width:calc(100vw - 20px); max-height:calc(100vh - 160px); overflow:auto; }
    .pwa-status-chip { min-height:42px; padding:7px 11px; font-size:.61rem; }
}

@media (display-mode:standalone) {
    body { padding-top:env(safe-area-inset-top); }
    .pwa-tools { bottom:calc(18px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion:reduce) {
    .pwa-state-dot,.pwa-toast { animation:none; transition:none; }
}

/* Personal health goals — measurable, supportive and mobile-first. */
.goal-page-content { width:min(1320px,100%); margin:0 auto; padding:32px clamp(16px,4vw,44px) 50px; }
.goal-hero { min-height:210px; margin-bottom:22px; padding:clamp(26px,5vw,48px); display:flex; align-items:center; justify-content:space-between; gap:26px; overflow:hidden; color:#fff; background:radial-gradient(circle at 88% 18%,rgba(255,255,255,.2),transparent 13rem),linear-gradient(125deg,#075f59,#0d847b 52%,#089bb0); border-radius:30px; box-shadow:0 24px 58px rgba(15,118,110,.2); }
.goal-hero h1 { margin-bottom:8px; color:#fff; font-size:clamp(2rem,5vw,3.2rem); }.goal-hero p { max-width:700px; margin:0; color:rgba(255,255,255,.82); font-size:clamp(.85rem,1.5vw,1.05rem); }.goal-hero .eyebrow { color:#a7f3e8; }
.goal-hero-mark { width:170px; height:140px; padding:17px; display:grid; grid-template-columns:58px 1fr; align-items:center; gap:11px; flex:0 0 auto; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); border-radius:25px; backdrop-filter:blur(10px); }.goal-hero-mark > span { width:58px; height:58px; display:grid; place-items:center; background:rgba(255,255,255,.14); border-radius:50%; font-size:2.15rem; }.goal-hero-mark small { color:#fff; font-size:.77rem; font-weight:750; line-height:1.5; }
.goal-person-picker { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,.72fr); gap:20px; }.goal-person-picker h2,.goal-person-picker p { margin-bottom:3px; }.goal-search { display:flex; align-items:center; gap:9px; }.goal-search input { min-width:0; }
.goal-person-results { grid-column:1 / -1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }.goal-person-results > a { min-width:0; padding:12px; display:grid; grid-template-columns:42px minmax(0,1fr) 20px; gap:10px; align-items:center; color:var(--navy); background:#f8fbfc; border:1px solid #e0e9ec; border-radius:15px; }.goal-person-results > a.selected { background:#e8f8f5; border-color:#78cfc1; box-shadow:inset 3px 0 var(--brand); }.goal-person-results > a > span { width:42px;height:42px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,var(--brand),var(--cyan));border-radius:13px;font-weight:850;}.goal-person-results div { min-width:0;display:flex;flex-direction:column; }.goal-person-results b { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.78rem; }.goal-person-results small { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:.57rem; }.goal-person-results em { color:var(--brand);font-style:normal; }
.goal-person-banner { margin-bottom:16px;padding:18px 20px;display:grid;grid-template-columns:58px minmax(0,1fr) auto;gap:14px;align-items:center;background:linear-gradient(135deg,#fff,#edf9f7);border:1px solid #d3ebe6;border-radius:21px;box-shadow:var(--shadow-sm);}.goal-person-avatar { width:58px;height:58px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,#0f766e,#0891b2);border-radius:17px;font-size:1.35rem;font-weight:850;}.goal-person-banner div { min-width:0; }.goal-person-banner small,.goal-person-banner p { color:var(--muted);font-size:.62rem;}.goal-person-banner h2,.goal-person-banner p { margin:0;}.line-link-state { padding:7px 11px;color:#8b5a12;background:#fff5df;border:1px solid #f6dfab;border-radius:999px;font-size:.62rem;font-weight:800;}.line-link-state.ready { color:#08724d;background:#e6f9ef;border-color:#c6ead7; }
.goal-summary-grid { margin-bottom:17px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;}.goal-summary-grid article { min-height:118px;padding:19px;display:grid;grid-template-columns:48px minmax(0,1fr);gap:13px;align-items:center;background:#fff;border:1px solid #dfe8eb;border-radius:20px;box-shadow:var(--shadow-sm);}.goal-summary-grid article > span { width:48px;height:48px;display:grid;place-items:center;color:var(--brand);background:#e7f8f4;border-radius:15px;font-size:1.15rem;}.goal-summary-grid div { display:grid;grid-template-columns:1fr auto;}.goal-summary-grid small { grid-column:1 / -1;color:var(--muted);font-size:.61rem;}.goal-summary-grid strong { color:var(--navy);font-size:1.85rem;line-height:1.2;}.goal-summary-grid sup { font-size:.72rem;}.goal-summary-grid em { align-self:end;color:var(--muted);font-size:.56rem;font-style:normal; }
.new-goal-card { padding:0;overflow:hidden;}.new-goal-card summary { padding:20px 23px;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:center;cursor:pointer;list-style:none;}.new-goal-card summary::-webkit-details-marker { display:none;}.new-goal-card summary > span { width:44px;height:44px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,var(--brand),var(--cyan));border-radius:13px;font-size:1.25rem;}.new-goal-card summary div { display:flex;flex-direction:column;}.new-goal-card summary b { color:var(--navy);font-size:.9rem;}.new-goal-card summary small { color:var(--muted);font-size:.57rem;}.new-goal-card summary em { color:var(--brand);font-size:.62rem;font-style:normal;font-weight:800;}.new-goal-card[open],.new-goal-card details[open] { background:linear-gradient(145deg,#fff,#f4fbfa);}.goal-form { padding:22px 23px;border-top:1px solid #e2ecee;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}.goal-form label > small { color:var(--muted);font-size:.56rem;font-weight:500;}.goal-line-consent { padding:14px;display:grid;grid-template-columns:22px 1fr;align-items:start;gap:11px;color:#146354;background:#e9f9f5;border:1px solid #cdece4;border-radius:14px;}.goal-line-consent input { width:19px;min-height:19px;margin-top:3px;accent-color:#06c755;}.goal-line-consent span { display:flex;flex-direction:column;}.goal-line-consent small { color:#58776f;}.goal-line-consent.disabled { opacity:.62;}.goal-form-actions { display:flex;align-items:center;gap:16px;}.goal-form-actions p { margin:0;color:var(--muted);font-size:.58rem;line-height:1.55; }
.goal-section-heading { margin:26px 0 14px;display:flex;align-items:flex-end;justify-content:space-between;gap:15px;}.goal-section-heading h2 { margin:0;}.goal-section-heading > span { color:var(--muted);font-size:.62rem;}.personal-goal-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}.personal-goal-card { min-width:0;padding:22px;background:#fff;border:1px solid #dce7ea;border-radius:23px;box-shadow:var(--shadow-sm);}.personal-goal-card.status-achieved { border-color:#bce4cf;background:linear-gradient(145deg,#fff,#f0fbf5);}.personal-goal-card.status-paused,.personal-goal-card.status-cancelled { opacity:.78;}.goal-card-top { display:grid;grid-template-columns:92px minmax(0,1fr);gap:16px;align-items:center;}.progress-ring { width:92px;height:92px;padding:9px;display:grid;place-items:center;background:conic-gradient(#16a67a calc(var(--goal-progress) * 1%),#e6eeee 0);border-radius:50%;}.progress-ring::before { content:"";grid-area:1/1;width:72px;height:72px;background:#fff;border-radius:50%;}.progress-ring > span { z-index:1;grid-area:1/1;display:flex;align-items:center;flex-direction:column;}.progress-ring b { color:var(--navy);font-size:1.1rem;}.progress-ring small { color:var(--muted);font-size:.49rem;}.goal-card-title { min-width:0;display:grid;grid-template-columns:38px minmax(0,1fr);gap:9px;align-items:start;}.goal-type-icon { width:38px;height:38px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,var(--brand),var(--cyan));border-radius:12px;}.goal-card-title div { min-width:0;}.goal-card-title small { color:var(--brand);font-size:.55rem;font-weight:800;}.goal-card-title h3 { margin:1px 0 5px;overflow-wrap:anywhere;font-size:.92rem;}.goal-status { padding:3px 7px;display:inline-block;color:#08724d;background:#e6f9ef;border-radius:999px;font-size:.49rem;font-weight:800;}.goal-status.paused { color:#8b5a12;background:#fff4dc;}.goal-status.cancelled { color:#8b3a48;background:#fff0f2;}
.goal-progress-track { height:9px;margin:17px 0;background:#e9f0f1;border-radius:999px;overflow:hidden;}.goal-progress-track i { height:100%;display:block;background:linear-gradient(90deg,#10a893,#16ba72);border-radius:inherit;}.goal-value-row { display:grid;grid-template-columns:repeat(3,1fr);gap:7px;}.goal-value-row span { padding:10px;display:flex;min-width:0;flex-direction:column;background:#f7fafb;border-radius:12px;}.goal-value-row small { color:var(--muted);font-size:.49rem;}.goal-value-row b { overflow-wrap:anywhere;color:var(--navy);font-size:.63rem;}.goal-date-row { margin-top:12px;padding-top:11px;display:flex;justify-content:space-between;gap:10px;color:var(--muted);border-top:1px solid #edf1f2;font-size:.56rem;}.goal-date-row em { color:var(--brand);font-style:normal;font-weight:750;}.goal-date-row em.overdue { color:var(--red);}
.goal-update-box,.goal-history { margin-top:12px;border:1px solid #e0e9eb;border-radius:14px;overflow:hidden;}.goal-update-box summary,.goal-history summary { padding:11px 13px;color:var(--brand);background:#f6fafb;cursor:pointer;font-size:.61rem;font-weight:800;}.goal-progress-form { padding:13px;display:grid;grid-template-columns:1fr 1fr;gap:11px;}.goal-progress-form label { font-size:.62rem;}.goal-progress-form input { min-height:43px;font-size:.72rem;}.goal-history > div { padding:7px 12px;}.goal-history p { margin:0;padding:9px 0;display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px;border-bottom:1px solid #edf2f3;}.goal-history p:last-child { border:0;}.goal-history p span { display:flex;flex-direction:column;}.goal-history p b { font-size:.62rem;}.goal-history p small,.goal-history p em { color:var(--muted);font-size:.5rem;font-style:normal;}.goal-card-actions { margin-top:13px;display:flex;flex-wrap:wrap;gap:7px;}.goal-card-actions form { margin:0;}.button.compact { min-height:38px;padding:7px 10px;font-size:.58rem;}.button.quiet { color:#25566a;background:#eff6f7;border-color:#dbe9eb;}.button.danger-outline { color:#a23543;background:#fff;border-color:#f0cbd0;}
.goal-empty { grid-column:1 / -1;padding:50px;text-align:center;}.goal-empty > span { width:66px;height:66px;margin:0 auto 13px;display:grid;place-items:center;color:var(--brand);background:#e6f7f3;border-radius:21px;font-size:2rem;}.goal-empty p { color:var(--muted);}.goal-safety-note { margin-top:24px;padding:17px 19px;display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;color:#5f531e;background:#fff9e6;border:1px solid #f2e2a7;border-radius:17px;}.goal-safety-note > span { width:38px;height:38px;display:grid;place-items:center;color:#8a6512;background:#fff0b9;border-radius:12px;font-weight:850;}.goal-safety-note b { font-size:.7rem;}.goal-safety-note p { margin:3px 0 0;color:#776b3c;font-size:.57rem;line-height:1.6;}
.personal-dashboard-goals > a { min-height:155px;padding:15px;display:grid;grid-template-columns:44px minmax(0,1fr);gap:2px 10px;color:#24579d;background:#eaf2ff;border:1px solid #d4e4fa;border-radius:17px;}.personal-dashboard-goals > a.green { color:#086d50;background:#e7f8f0;border-color:#ceeada;}.mini-goal-ring { width:44px;height:44px;grid-row:1 / 4;display:grid;place-items:center;background:conic-gradient(currentColor calc(var(--goal-progress) * 1%),rgba(255,255,255,.72) 0);border-radius:50%;}.mini-goal-ring::before { content:"";grid-area:1/1;width:34px;height:34px;background:#fff;border-radius:50%;}.mini-goal-ring b { z-index:1;grid-area:1/1;font-size:.48rem;}.personal-dashboard-goals small { font-size:.52rem;}.personal-dashboard-goals strong { overflow-wrap:anywhere;color:inherit;font-size:.7rem;}.personal-dashboard-goals em { font-size:.51rem;font-style:normal;}.personal-dashboard-goals i { height:6px;grid-column:1 / -1;margin-top:10px;background:rgba(255,255,255,.8);border-radius:999px;overflow:hidden;}.personal-dashboard-goals i u { height:100%;display:block;background:currentColor;border-radius:inherit;text-decoration:none;}.personal-dashboard-goals .citizen-goal-empty > span { grid-row:1 / 4;display:grid;place-items:center;background:#fff;border-radius:14px;font-size:1.5rem;}
.vhv-menu-tile.teal { background:linear-gradient(145deg,#0f8a85,#08a2a3); }

@media (max-width:900px) {
    .goal-person-results { grid-template-columns:repeat(2,minmax(0,1fr)); }.personal-goal-grid { grid-template-columns:1fr; }
}
@media (max-width:680px) {
    .health-goals-page .topbar { height:66px;padding:0 13px; }.health-goals-page .live-clock,.health-goals-page .version-chip { display:none; }
    .goal-page-content { padding:18px 12px 34px; }.goal-hero { min-height:0;padding:25px 20px;align-items:flex-start;border-radius:24px;}.goal-hero-mark { display:none;}.goal-hero h1 { font-size:2rem; }
    .goal-person-picker { grid-template-columns:1fr;}.goal-search { grid-column:1;}.goal-person-results { grid-template-columns:1fr;}.goal-person-banner { grid-template-columns:48px minmax(0,1fr);padding:14px;}.goal-person-avatar { width:48px;height:48px;}.line-link-state { grid-column:1 / -1;width:max-content;}.goal-summary-grid { grid-template-columns:1fr 1fr;gap:8px;}.goal-summary-grid article { min-height:105px;padding:13px;grid-template-columns:40px minmax(0,1fr);}.goal-summary-grid article:last-child { grid-column:1 / -1;}.goal-summary-grid article > span { width:40px;height:40px;}.goal-summary-grid strong { font-size:1.5rem;}
    .new-goal-card summary { padding:16px;grid-template-columns:40px minmax(0,1fr);}.new-goal-card summary > em { display:none;}.goal-form { padding:16px;grid-template-columns:1fr;gap:13px;}.goal-form .span-2 { grid-column:1;}.goal-form-actions { align-items:stretch;flex-direction:column;}.goal-form-actions .button { width:100%;}.goal-card-top { grid-template-columns:78px minmax(0,1fr);}.progress-ring { width:78px;height:78px;}.progress-ring::before { width:60px;height:60px;}.personal-goal-card { padding:16px;border-radius:20px;}.goal-value-row span { padding:8px 6px;}.goal-value-row b { font-size:.56rem;}.goal-progress-form { grid-template-columns:1fr;}.goal-progress-form .span-2 { grid-column:1;}.goal-history p { grid-template-columns:1fr;gap:2px;}.goal-card-actions { display:grid;grid-template-columns:1fr 1fr;}.goal-card-actions form,.goal-card-actions button { width:100%;}.goal-section-heading { align-items:flex-start;flex-direction:column;}.goal-empty { padding:36px 18px;}
}
