:root {
    color-scheme: dark;
    --bg: #080b11;
    --surface: rgba(18, 24, 35, 0.86);
    --surface-solid: #121823;
    --surface-strong: rgba(30, 39, 55, 0.9);
    --text: #f7f9fce7;
    --muted: #99a6ba;
    --line: rgba(148, 163, 184, 0.18);
    --brand: #4f8cff;
    --brand-dark: #3772ea;
    --accent: #35d1b5;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --glow: 0 0 0 1px rgba(79, 140, 255, 0.18), 0 18px 45px rgba(79, 140, 255, 0.15);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(8, 11, 17, 0.88), rgba(8, 11, 17, 0.98)),
        url("/brand/website-background-dex-rp-optimized-v1.jpg"),
        linear-gradient(180deg, #080b11 0%, #0b0f17 48%, #080b11 100%);
    background-position: center top;
    background-size: cover;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 72px;
}

main > section + section {
    margin-top: 18px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 max(16px, calc((100vw - 1180px) / 2));
    background: rgba(8, 11, 17, 0.76);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 850;
    letter-spacing: 0;
}

.brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(79, 140, 255, 0.28));
}

nav {
    display: flex;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

nav a {
    padding: 8px 11px;
    border-radius: 999px;
}

nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 34px;
    align-items: center;
    min-height: 560px;
    padding: 56px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(18, 24, 35, 0.88), rgba(8, 11, 17, 0.7));
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(118deg, transparent 0 34%, rgba(142, 240, 220, 0.11) 34.2% 35%, transparent 35.2% 100%),
        linear-gradient(64deg, transparent 0 55%, rgba(79, 140, 255, 0.16) 55.2% 56.1%, transparent 56.3% 100%),
        linear-gradient(150deg, transparent 0 72%, rgba(255, 255, 255, 0.08) 72.2% 72.8%, transparent 73% 100%);
    opacity: 0.9;
}

.hero > div {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.home-hero-copy {
    align-self: center;
}

.home-hero-summary {
    display: grid;
    gap: 12px;
}

.home-hero-summary article {
    padding: 16px;
    background: rgba(8, 11, 17, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
}

.home-hero-summary strong,
.home-hero-summary span {
    display: block;
}

.home-hero-summary strong {
    margin-bottom: 5px;
    font-size: 0.96rem;
}

.home-hero-summary span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.92rem;
}

.hero h1,
.dashboard-head h1,
.panel h1 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: 0;
}

.hero h1 {
    max-width: 720px;
    font-size: 4.8rem;
}

.hero p {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.12rem;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #8ef0dc;
}

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

.home-section h2 {
    margin: 0 0 10px;
    font-size: 1.55rem;
    line-height: 1.2;
}

.home-section > p:last-child,
.home-section article p:last-child {
    margin-bottom: 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 22px;
}

.actions.compact {
    margin-top: 0;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button.primary,
button.primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), #7c5cff);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: var(--glow);
}

.button:hover,
button:hover {
    border-color: rgba(79, 140, 255, 0.7);
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

.button.primary:hover,
button.primary:hover {
    background: linear-gradient(135deg, var(--brand-dark), #6d4df4);
}

.button.danger,
button.danger {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.42);
}

.icon {
    width: 17px;
    height: 17px;
    margin-right: 7px;
    vertical-align: -3px;
}

.card-icon {
    width: 30px;
    height: 30px;
    color: var(--accent);
    margin-bottom: 8px;
}

.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.module-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.module-tabs a:hover {
    color: #ffffff;
    border-color: rgba(79, 140, 255, 0.6);
}

.module-tabs.contextual {
    margin: 12px 0 0;
}

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

.feature-grid article,
.community-card,
.stats article,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.feature-grid article,
.community-card,
.stats article {
    padding: 22px;
}

.feature-grid h2,
.feature-grid h3,
.community-card h2,
.panel h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.feature-grid p,
.community-card p,
.panel p {
    color: var(--muted);
}

.panel.home-section h2 {
    font-size: 1.55rem;
    line-height: 1.2;
}

.dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.dashboard-head h1 {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.dashboard-head h1 svg,
.workspace-head h1 svg,
.title-icon {
    width: clamp(34px, 0.72em, 56px);
    height: clamp(34px, 0.72em, 56px);
    flex: 0 0 auto;
    color: var(--accent);
}

.workspace-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(18, 24, 35, 0.92), rgba(12, 18, 28, 0.78));
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.workspace-head h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.workspace-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.split-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.split-layout.balanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.lookup-search-panel h2,
.lookup-search-panel p {
    margin: 0;
}

.lookup-search-panel label {
    margin-top: 2px;
}

.lookup-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.medical-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.medical-search-form button {
    min-width: 150px;
}

.medical-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 16px;
    align-items: start;
}

.medical-main-stack,
.medical-tool-stack {
    display: grid;
    gap: 16px;
}

.medical-tool-stack {
    position: sticky;
    top: 86px;
}

.settings-accordion.medical-accordion {
    background: linear-gradient(135deg, rgba(18, 24, 35, 0.82), rgba(12, 18, 28, 0.66));
    box-shadow: var(--shadow);
}

.settings-accordion > .accordion-body {
    padding: 18px;
}

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

.pcr-form-grid .wide {
    grid-column: 1 / -1;
}

.workspace-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.workspace-main,
.workspace-sidebar {
    display: grid;
    gap: 18px;
}

.workspace-sidebar {
    position: sticky;
    top: 86px;
}

.panel-stack {
    display: grid;
    gap: 16px;
}

.panel {
    padding: 24px;
}

.compact-panel {
    padding: 18px;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.36);
}

.panel.narrow {
    width: min(620px, 100%);
    margin: 40px auto;
}

.terms-page {
    width: min(860px, 100%);
    margin-inline: auto;
}

.terms-page h2 {
    margin: 24px 0 8px;
}

.terms-page p {
    color: var(--muted);
}

form {
    display: grid;
    gap: 14px;
}

form.inline-form {
    grid-template-columns: minmax(180px, 360px) auto;
    align-items: end;
}

label,
fieldset,
.form-field {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.field-label {
    display: block;
}

.field-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

fieldset {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

legend {
    padding: 0 6px;
    color: var(--text);
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(8, 11, 17, 0.58);
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:focus,
textarea:focus,
select:focus {
    background: rgba(8, 11, 17, 0.82);
    border-color: rgba(79, 140, 255, 0.72);
    box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.14);
}

button:disabled,
.button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
}

.icon-picker {
    position: relative;
    display: grid;
    grid-template-columns: 46px;
    gap: 12px;
    align-items: start;
    justify-items: start;
}

.icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: var(--accent);
    background: rgba(142, 240, 220, 0.08);
    border: 1px solid rgba(142, 240, 220, 0.24);
    border-radius: 14px;
    padding: 0;
    box-shadow: none;
}

.icon-preview .icon {
    width: 22px;
    height: 22px;
    margin: 0;
}

.icon-preview:hover,
.icon-preview[aria-expanded="true"] {
    background: rgba(142, 240, 220, 0.15);
    border-color: rgba(142, 240, 220, 0.48);
    transform: none;
}

.icon-choice-grid {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(auto-fill, 92px);
    justify-content: start;
    gap: 8px;
    width: min(520px, calc(100vw - 64px));
    max-width: 520px;
    padding: 12px;
    background: rgba(12, 18, 28, 0.98);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.icon-choice-grid[hidden] {
    display: none;
}

.icon-choice {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 92px;
    min-width: 0;
    min-height: 70px;
    padding: 10px 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: none;
    gap: 7px;
    line-height: 1.1;
    text-align: center;
}

.icon-choice .icon,
.icon-choice svg {
    width: 20px;
    height: 20px;
    margin: 0;
    flex: 0 0 auto;
}

.icon-choice span {
    display: block;
    max-width: 100%;
    color: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-choice.selected {
    color: #06100e;
    background: var(--accent);
    border-color: rgba(142, 240, 220, 0.7);
}

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

.community-card {
    display: grid;
    gap: 10px;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.community-card:hover {
    background: rgba(23, 31, 45, 0.94);
    border-color: rgba(79, 140, 255, 0.42);
    transform: translateY(-2px);
}

.community-card span {
    width: fit-content;
    padding: 4px 9px;
    color: #07110f;
    background: var(--accent);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 850;
}

.dashboard-hub {
    width: min(1040px, 100%);
    margin-inline: auto;
    display: grid;
    gap: 18px;
}

.hub-title {
    display: grid;
    gap: 10px;
    text-align: center;
    padding: 18px 0 8px;
}

.hub-title h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 1.04;
}

.hub-title p {
    width: min(680px, 100%);
    margin: 0 auto;
    color: var(--muted);
}

.hub-search-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: min(920px, 100%);
    margin: 12px auto 0;
}

.hub-search {
    position: relative;
    display: block;
    margin: 0;
}

.hub-search .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: 0;
    color: var(--accent);
    transform: translateY(-50%);
    pointer-events: none;
}

.hub-search input {
    min-height: 46px;
    padding-left: 42px;
    border-radius: 16px;
    background: rgba(8, 11, 17, 0.64);
}

.hub-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.button.compact,
button.compact {
    min-height: 38px;
    padding-inline: 14px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.community-section {
    padding: 18px;
    background: linear-gradient(135deg, rgba(18, 24, 35, 0.78), rgba(12, 18, 28, 0.62));
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.community-section .section-head {
    margin-bottom: 14px;
}

.community-section .section-head h2 {
    font-size: 1.14rem;
}

.hub-section-button {
    flex: 0 0 auto;
    align-self: center;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.hub-card {
    display: grid;
    align-content: space-between;
    gap: 14px;
    min-height: 178px;
    padding: 16px;
    background: rgba(8, 11, 17, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.hub-card:hover {
    background: rgba(23, 31, 45, 0.76);
    border-color: rgba(79, 140, 255, 0.42);
    transform: translateY(-1px);
}

.hub-card-main {
    display: grid;
    gap: 8px;
}

.hub-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.hub-card h3 {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.2;
}

.hub-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.hub-card form {
    margin: 0;
}

.hub-card .button,
.hub-card button {
    width: fit-content;
}

.hub-count {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 4px 9px;
    color: #c7d2fe;
    background: rgba(79, 140, 255, 0.14);
    border: 1px solid rgba(124, 92, 255, 0.28);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 850;
    white-space: nowrap;
}

.hub-empty {
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 26px;
    color: var(--muted);
    text-align: center;
    background: rgba(8, 11, 17, 0.36);
    border: 1px dashed rgba(148, 163, 184, 0.32);
    border-radius: 14px;
}

.hub-empty.compact {
    justify-items: start;
    padding: 16px;
    text-align: left;
}

.hub-empty strong {
    color: var(--text);
    font-size: 1rem;
}

.hub-empty p {
    max-width: 560px;
    margin: 0;
}

.hub-dialog {
    width: min(460px, calc(100% - 28px));
    padding: 0;
    color: var(--text);
    background: transparent;
    border: 0;
}

.hub-dialog::backdrop {
    background: rgba(2, 6, 12, 0.72);
    backdrop-filter: blur(10px);
}

.hub-dialog-card {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 20px;
    background: rgba(18, 24, 35, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.hub-dialog-card h2,
.hub-dialog-card p {
    margin: 0;
}

.hub-dialog-card p {
    color: var(--muted);
}

.dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 10px;
    box-shadow: none;
}

.dialog-close .icon {
    width: 17px;
    height: 17px;
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.muted {
    color: var(--muted);
}

.stats {
    margin-bottom: 16px;
}

.stats article {
    display: grid;
    gap: 2px;
}

.stats strong {
    font-size: 2rem;
}

.stats span,
.table-list small {
    color: var(--muted);
}

.table-list {
    display: grid;
    gap: 10px;
}

.table-list > div {
    display: grid;
    grid-template-columns: 1fr 120px 2fr;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.table-list.compact > div {
    grid-template-columns: 1fr 80px 1.4fr;
}

.department-grid,
.call-list {
    display: grid;
    gap: 16px;
}

.department-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.department-card,
.call-card,
.duty-banner {
    background: rgba(8, 11, 17, 0.34);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.department-card {
    display: grid;
    gap: 18px;
    padding: 18px;
}

.department-card h3,
.call-card h3 {
    margin: 8px 0 6px;
}

.department-card p,
.call-card p {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 9px;
    color: #07110f;
    background: var(--accent);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
}

.badge.danger {
    color: #fff7f7;
    background: #dc2626;
}

.badge.success {
    color: #06221a;
    background: #34d399;
}

.badge.warning {
    color: #251a02;
    background: #f59e0b;
}

.duty-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
}

.duty-banner.staged {
    border-color: rgba(245, 158, 11, 0.34);
}

.duty-banner > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.workspace-return {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.workspace-return > div {
    display: grid;
    gap: 2px;
}

.workspace-return span {
    color: var(--muted);
}

.workspace-sidebar .module-tabs {
    display: grid;
    gap: 10px;
}

.workspace-sidebar .module-tabs a {
    justify-content: flex-start;
    min-height: 46px;
    border-radius: 12px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 14px;
}

.tool-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 74px;
    padding: 18px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--line);
    border-radius: 16px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
    white-space: normal;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.workspace-sidebar .tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.workspace-sidebar .tool-card {
    min-height: 68px;
    padding: 14px 12px;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(79, 140, 255, 0.62);
    transform: translateY(-1px);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.9);
}

.status-dot.idle {
    background: #f59e0b;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.8);
}

.call-card {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.call-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

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

.section-head h2,
.section-head p {
    margin: 0;
}

.dispatch-board .split-layout {
    margin-top: 0;
}

.dispatch-call-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    background: rgba(8, 11, 17, 0.34);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.dispatch-call-card + .dispatch-call-card {
    margin-top: 12px;
}

.dispatch-call-card > div:first-child {
    display: grid;
    gap: 2px;
}

.dispatch-call-card span,
.assignment-list span {
    color: var(--muted);
}

.assignment-list {
    display: grid;
    gap: 8px;
}

.assignment-list form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.notification-tray {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    display: grid;
    width: min(360px, calc(100vw - 28px));
    gap: 10px;
}

.toast-card {
    position: relative;
    padding: 14px 42px 14px 14px;
    background: rgba(18, 24, 35, 0.96);
    border: 1px solid rgba(142, 240, 220, 0.28);
    border-radius: 14px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.toast-card strong,
.toast-card p {
    display: block;
    margin: 0;
}

.toast-card p {
    margin-top: 4px;
    color: var(--muted);
}

.toast-card a {
    display: inline-flex;
    margin-top: 8px;
    color: var(--accent);
    font-weight: 800;
}

.toast-card button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    min-height: 28px;
    padding: 0;
}

.push-enable {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 19;
}

.unit-summary {
    display: grid;
    gap: 6px;
    padding: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.inline-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.inline-editor textarea,
.inline-editor button {
    grid-column: 1 / -1;
}

code {
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.department-list {
    display: grid;
    gap: 18px;
}

.record-list {
    display: grid;
    gap: 14px;
}

.record-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    background: rgba(8, 11, 17, 0.34);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.record-card strong {
    color: var(--text);
}

.record-card span,
.record-card small {
    color: var(--muted);
}

.clickable-card {
    color: inherit;
    text-decoration: none;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.clickable-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(79, 140, 255, 0.62);
    transform: translateY(-1px);
}

.card-link-hint {
    color: var(--accent) !important;
    font-weight: 850;
}

.lookup-result {
    margin-top: 14px;
}

.record-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

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

.profile-panel {
    align-content: start;
}

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

.civilian-record-card {
    gap: 18px;
}

.license-section {
    display: grid;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.license-section h3 {
    margin: 0;
}

.license-card label {
    margin: 4px 0 0;
}

.license-card input[readonly] {
    cursor: copy;
}

.legal-action-card {
    border-color: rgba(142, 240, 220, 0.24);
}

.warrant-card.active {
    border-color: rgba(220, 38, 38, 0.46);
}

.warrant-request {
    border-color: rgba(79, 140, 255, 0.42);
}

.warrant-progress {
    display: grid;
    gap: 8px;
}

.warrant-progress-track {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.warrant-progress-track span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 45%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    animation: warrant-progress-slide 1.1s ease-in-out infinite;
}

@keyframes warrant-progress-slide {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(230%);
    }
}

.invite-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.invite-list h3 {
    margin: 0;
}

.invite-card {
    grid-template-columns: minmax(0, 1fr);
}

.invite-card strong {
    overflow-wrap: anywhere;
}

.invite-card .actions {
    margin-top: 6px;
}

.invite-card .actions input {
    min-width: min(460px, 100%);
}

.discord-link-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.discord-link-head h2 {
    margin-bottom: 8px;
}

.discord-link-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.discord-link-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.discord-link-identity,
.discord-link-empty {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.discord-link-identity > div,
.discord-link-empty > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.discord-link-identity strong,
.discord-link-identity small,
.discord-link-empty strong,
.discord-link-empty small {
    overflow-wrap: anywhere;
}

.discord-link-icon {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #8ef0dc;
    background: rgba(142, 240, 220, 0.1);
    border: 1px solid rgba(142, 240, 220, 0.22);
    border-radius: 999px;
}

.discord-link-icon .icon {
    margin: 0;
}

.discord-link-empty {
    padding: 14px 0;
    color: var(--muted);
}

.discord-link-empty strong {
    color: var(--text);
}

.discord-link-create {
    margin-top: 16px;
}

.member-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.member-card {
    grid-template-columns: minmax(0, 1fr);
}

.member-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.member-actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.member-actions label {
    margin: 0;
}

.member-actions input,
.member-actions select {
    min-width: min(260px, 100%);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    color: var(--text);
    background: rgba(142, 240, 220, 0.1);
    border: 1px solid rgba(142, 240, 220, 0.24);
    border-radius: 999px;
    font-weight: 750;
}

.error-panel {
    display: grid;
    justify-items: start;
    width: min(680px, 100%);
    margin: 48px auto;
    padding: 34px;
    background: var(--surface);
    border: 1px solid rgba(239, 68, 68, 0.34);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.error-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.05;
}

.error-panel p:not(.eyebrow) {
    max-width: 560px;
    color: var(--muted);
}

.error-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.36);
    border-radius: 16px;
}

.department-editor {
    padding: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.settings-accordion {
    overflow: hidden;
    background: rgba(8, 11, 17, 0.34);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.settings-accordion.icon-picker-open {
    overflow: visible;
}

.settings-accordion + .settings-accordion {
    margin-top: 12px;
}

.settings-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    transition: background 150ms ease, border-color 150ms ease;
}

.settings-accordion summary::-webkit-details-marker {
    display: none;
}

.settings-accordion summary:hover {
    background: rgba(255, 255, 255, 0.04);
}

.settings-accordion[open] summary {
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid var(--line);
}

.settings-accordion > form {
    padding: 18px;
}

.accordion-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.accordion-title > .icon,
.accordion-title > .card-icon {
    flex: 0 0 auto;
    margin: 0;
}

.accordion-title strong,
.accordion-title small {
    display: block;
}

.accordion-title strong {
    color: var(--text);
    font-size: 1rem;
}

.accordion-title small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.84rem;
}

.accordion-chevron {
    display: inline-flex;
    color: var(--muted);
    transition: transform 150ms ease;
}

.settings-accordion[open] .accordion-chevron {
    transform: rotate(180deg);
}

.department-accordion .badge {
    margin-left: 6px;
    vertical-align: 2px;
}

.department-accordion .department-editor {
    background: transparent;
    border: 0;
    border-radius: 0;
}

.department-delete-form {
    padding: 0 18px 18px;
}

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

.department-create-layout {
    display: grid;
    gap: 18px;
}

.department-identity {
    display: grid;
    gap: 14px;
}

.department-identity .department-fields {
    grid-template-columns: 74px minmax(220px, 1fr) minmax(120px, 180px);
    align-items: end;
}

.department-fields > .icon-field-open {
    grid-column: 1 / -1;
    position: relative;
    z-index: 40;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 650;
}

.check-row input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--brand);
}

.check-row small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.35;
}

.empty-state {
    padding: 20px;
    color: var(--muted);
    background: rgba(8, 11, 17, 0.36);
    border: 1px dashed rgba(148, 163, 184, 0.32);
    border-radius: 14px;
}

.empty-state h3,
.empty-state strong {
    display: block;
    margin: 0 0 6px;
    color: var(--text);
}

.empty-state p {
    margin: 0;
}

@media (max-width: 820px) {
    main {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
        padding-bottom: 48px;
    }

    main > section + section {
        margin-top: 14px;
    }

    .site-header {
        min-height: 58px;
        padding-inline: 12px;
    }

    .brand {
        gap: 9px;
        font-size: 1rem;
    }

    .brand img {
        width: 42px;
        height: 42px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: 0;
        padding: 28px;
    }

    .hero h1 {
        font-size: 2.7rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .home-hero-summary article {
        padding: 14px;
    }

    .feature-grid,
    .card-grid,
    .department-grid,
    .stats,
    .home-split,
    .split-layout,
    .split-layout.balanced,
    .lookup-quick-grid,
    .medical-search-form,
    .medical-workspace,
    .pcr-form-grid,
    .workspace-layout,
    .tool-grid,
    .department-fields,
    .editor-columns,
    .field-action-row,
    .inline-editor,
    form.inline-form {
        grid-template-columns: 1fr;
    }

    .dashboard-head,
    .workspace-head,
    .discord-link-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .discord-link-card {
        grid-template-columns: 1fr;
    }

    .discord-link-card form,
    .discord-link-card .button,
    .discord-link-create .button {
        width: 100%;
    }

    .workspace-head {
        gap: 14px;
        margin-bottom: 14px;
        padding: 18px;
        border-radius: 16px;
    }

    .workspace-head h1 {
        gap: 10px;
        font-size: clamp(2.3rem, 12vw, 3.5rem);
    }

    .workspace-head p {
        margin-top: 6px;
        font-size: 1rem;
        line-height: 1.4;
    }

    .workspace-head .actions {
        width: 100%;
        margin-top: 4px;
    }

    .workspace-head .actions .button {
        flex: 1 1 160px;
    }

    .dashboard-hub {
        gap: 14px;
    }

    .hub-title {
        padding-top: 10px;
        text-align: left;
    }

    .hub-title p {
        margin: 0;
    }

    .hub-search-actions {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .hub-actions {
        justify-content: stretch;
    }

    .hub-actions .button,
    .hub-actions button,
    .hub-empty .button,
    .hub-empty button,
    .hub-section-button {
        flex: 1 1 150px;
    }

    .hub-section-button {
        align-self: stretch;
        width: 100%;
    }

    .community-section {
        padding: 14px;
        border-radius: 16px;
    }

    .community-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hub-card {
        min-height: 0;
        padding: 14px;
    }

    .hub-card .button,
    .hub-card button,
    .hub-card form {
        width: 100%;
    }

    .hub-card-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .hub-empty {
        align-items: stretch;
        justify-items: stretch;
        padding: 18px;
        text-align: left;
    }

    .hub-empty .actions {
        align-items: stretch;
    }

    .hub-dialog-card {
        padding: 18px;
    }

    .title-icon {
        width: 38px;
        height: 38px;
        flex: 0 0 auto;
    }

    .workspace-layout,
    .workspace-main,
    .workspace-sidebar,
    .lookup-quick-grid,
    .medical-workspace,
    .medical-main-stack,
    .medical-tool-stack,
    .profile-grid,
    .license-grid {
        gap: 14px;
    }

    .profile-grid,
    .lookup-quick-grid,
    .medical-search-form,
    .medical-workspace,
    .pcr-form-grid,
    .license-grid {
        grid-template-columns: 1fr;
    }

    .medical-tool-stack {
        position: static;
    }

    .medical-search-form button {
        width: 100%;
    }

    .panel {
        padding: 18px;
        border-radius: 16px;
    }

    .workspace-sidebar {
        position: static;
    }

    .workspace-sidebar h2 {
        margin-bottom: 12px;
    }

    .workspace-sidebar h2:not(:first-child) {
        margin-top: 24px;
    }

    .duty-banner {
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .duty-banner > div {
        gap: 8px;
    }

    .duty-banner form {
        min-width: 0;
    }

    .duty-banner .button {
        min-height: 42px;
        padding-inline: 16px;
    }

    .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
        gap: 10px;
    }

    .tool-card {
        min-height: 62px;
        padding: 12px 10px;
        border-radius: 14px;
    }

    .icon-picker {
        grid-template-columns: 42px;
    }

    .icon-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(320px, calc(100vw - 48px));
    }

    .icon-choice {
        width: auto;
    }

    .department-identity .department-fields {
        grid-template-columns: 1fr;
    }

    .settings-accordion summary {
        align-items: flex-start;
        padding: 14px;
    }

    .settings-accordion > form,
    .settings-accordion > .accordion-body,
    .department-delete-form {
        padding: 14px;
    }

    .accordion-title {
        align-items: flex-start;
    }

    .assignment-list form,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .assignment-list form .button {
        width: 100%;
    }

    .notification-tray,
    .push-enable {
        right: 12px;
        bottom: 12px;
    }

    .workspace-return {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-list > div {
        grid-template-columns: 1fr;
    }

    .support-card {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    }

    .support-card h3 {
        margin: 0 0 0.4rem;
    }

    .support-card p {
        margin-bottom: 0.85rem;
    }
}
