:root {
    --bg: #eef3f7;
    --panel: #ffffff;
    --panel-soft: rgba(255, 255, 255, 0.78);
    --line: #d8e0e8;
    --line-strong: #b8c3cf;
    --ink: #1f2937;
    --muted: #617182;
    --brand: #1f4f7a;
    --brand-deep: #14324b;
    --accent: #2b78c5;
    --accent-soft: #e7f0fb;
    --head: #edf3f9;
    --danger: #c44545;
    --shadow: 0 18px 40px rgba(31, 41, 55, 0.08);
    --shadow-soft: 0 10px 26px rgba(31, 41, 55, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background:
        radial-gradient(circle at top right, rgba(43, 120, 197, 0.08), transparent 28%),
        linear-gradient(180deg, #f6f8fb 0%, var(--bg) 100%);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.6rem;
    background: linear-gradient(90deg, var(--brand-deep), #223649);
    color: #fff;
    box-shadow: 0 8px 24px rgba(20, 50, 75, 0.2);
}

.topbar__title {
    font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
    font-size: 1.38rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.topbar__support {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
}

.topbar__session {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar__user {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
}

.topbar__logout {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.45rem 0.8rem;
    font: inherit;
    cursor: pointer;
}

.page-shell {
    width: min(1360px, calc(100vw - 28px));
    margin: 1.4rem auto 2rem;
}

.alert-stack {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.alert {
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    color: #294154;
    box-shadow: var(--shadow-soft);
}

.alert--success {
    border-color: #b8dfc4;
    background: #eefaf1;
    color: #1f5b33;
}

.alert--error {
    border-color: #efc8c8;
    background: #fff2f2;
    color: #8a2b2b;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hero__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.25rem;
    font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
    font-size: clamp(1.75rem, 2.4vw, 2.5rem);
    line-height: 1.08;
}

h2 {
    font-size: 1.12rem;
    line-height: 1.2;
}

h3 {
    font-size: 1rem;
    line-height: 1.25;
}

.hero__meta,
.panel__header p {
    color: var(--muted);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.panel {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
    border: 1px solid rgba(184, 195, 207, 0.8);
    border-radius: 18px;
    padding: 1.1rem;
    box-shadow: var(--shadow-soft);
}

.panel + .panel {
    margin-top: 1rem;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.panel__header--stack {
    align-items: flex-start;
}

.panel__header-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.panel--narrow {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.searchbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.dashboard-list-shell {
    width: 100%;
    margin: 0 auto;
}

.dashboard-table-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.9rem;
}

.searchbar input {
    flex: 1;
    min-width: 0;
    padding: 0.74rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fbfdff;
    font-size: 0.92rem;
    box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.04);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.64rem 0.95rem;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
}

.button--primary {
    background: linear-gradient(180deg, var(--accent), #1f6db3);
    color: #fff;
    box-shadow: 0 10px 18px rgba(43, 120, 197, 0.18);
}

.button--ghost {
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
}

.button--compact {
    padding: 0.48rem 0.72rem;
    font-size: 0.82rem;
}

.button--danger {
    background: linear-gradient(180deg, #d85d5d, #b94141);
    color: #fff;
    box-shadow: 0 10px 18px rgba(196, 69, 69, 0.18);
}

.button--disabled,
.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    filter: saturate(0.6);
}

.inline-form {
    margin: 0;
}

.quick-upload {
    display: flex;
    align-items: center;
    margin: 0;
}

.quick-upload__trigger {
    position: relative;
    cursor: pointer;
}

.action-pill {
    min-width: 210px;
    padding: 0.88rem 1.85rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #2181c0 0%, #2181c0 46%, #2181c0 100%);
    color: #fff;
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 28px rgba(21, 81, 192, 0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.action-pill:hover,
.action-pill:focus-visible {
    color: #fff;
    transform: translateY(-1px);
    filter: saturate(1.03);
    box-shadow: 0 18px 30px rgba(21, 81, 192, 0.24);
}

.action-pill:focus-visible {
    outline: 3px solid rgba(21, 81, 192, 0.22);
    outline-offset: 3px;
}

.has-tooltip {
    position: relative;
}

.has-tooltip::before,
.has-tooltip::after,
.quick-upload__trigger::before,
.quick-upload__trigger::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 20;
}

.has-tooltip::before,
.quick-upload__trigger::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 12px);
    min-width: 220px;
    max-width: 340px;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: rgba(20, 50, 75, 0.96);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: 0 12px 22px rgba(20, 50, 75, 0.22);
}

.has-tooltip::after,
.quick-upload__trigger::after {
    content: "";
    bottom: calc(100% + 5px);
    border-width: 7px 6px 0;
    border-style: solid;
    border-color: rgba(20, 50, 75, 0.96) transparent transparent;
}

.has-tooltip:hover::before,
.has-tooltip:hover::after,
.has-tooltip:focus-visible::before,
.has-tooltip:focus-visible::after,
.quick-upload__trigger:hover::before,
.quick-upload__trigger:hover::after,
.quick-upload__trigger:focus-visible::before,
.quick-upload__trigger:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

body.tooltips-enhanced .has-tooltip::before,
body.tooltips-enhanced .has-tooltip::after,
body.tooltips-enhanced .quick-upload__trigger::before,
body.tooltips-enhanced .quick-upload__trigger::after {
    display: none;
}

.app-tooltip {
    --tooltip-arrow-left: 50%;
    position: fixed;
    left: 0;
    top: 0;
    max-width: min(340px, calc(100vw - 24px));
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(125, 148, 171, 0.22);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 50, 75, 0.98), rgba(28, 63, 93, 0.98));
    color: #fff;
    font-size: 0.77rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: 0 18px 34px rgba(20, 50, 75, 0.28);
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 2200;
}

.app-tooltip::after {
    content: "";
    position: absolute;
    left: var(--tooltip-arrow-left);
    width: 12px;
    height: 12px;
    background: rgba(28, 63, 93, 0.98);
    border-right: 1px solid rgba(125, 148, 171, 0.22);
    border-bottom: 1px solid rgba(125, 148, 171, 0.22);
    transform: translateX(-50%) rotate(45deg);
}

.app-tooltip--top::after {
    top: calc(100% - 7px);
}

.app-tooltip--bottom::after {
    bottom: calc(100% - 7px);
    transform: translateX(-50%) rotate(225deg);
}

.app-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-tooltip.is-measuring {
    transition: none;
}

.quick-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.table-wrap--compact {
    margin-top: 0.8rem;
}

.registry-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    font-size: 0.88rem;
}

.registry-table--dense {
    min-width: 720px;
    font-size: 0.8rem;
    table-layout: fixed;
}

.registry-table th,
.registry-table td {
    padding: 0.62rem 0.78rem;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid #edf2f7;
    vertical-align: top;
    text-align: left;
}

.registry-table th:last-child,
.registry-table td:last-child {
    border-right: 0;
}

.registry-table th {
    background: linear-gradient(180deg, #f7fbff 0%, var(--head) 100%);
    color: #314659;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.sort-link:hover,
.sort-link:focus-visible {
    color: var(--accent);
}

.sort-link--active {
    color: var(--accent);
}

.sort-link__indicator {
    flex-shrink: 0;
    font-size: 0.7rem;
    line-height: 1;
}

.registry-table tbody tr:hover {
    background: #f9fbfe;
}

.registry-table td {
    color: #2f3f50;
    line-height: 1.35;
}

.registry-table--dense th,
.registry-table--dense td {
    padding: 0.48rem 0.56rem;
}

.registry-table--dense th {
    font-size: 0.66rem;
    line-height: 1.1;
    white-space: normal;
}

.registry-table--dense td {
    font-size: 0.79rem;
    overflow-wrap: anywhere;
}

.registry-table--dense th:nth-child(1),
.registry-table--dense td:nth-child(1) {
    width: 118px;
}

.registry-table--dense th:nth-child(2),
.registry-table--dense td:nth-child(2) {
    width: 92px;
}

.registry-table--dense th:nth-child(3),
.registry-table--dense td:nth-child(3) {
    width: 150px;
}

.registry-table--dense th:nth-child(4),
.registry-table--dense td:nth-child(4) {
    width: 82px;
}

.registry-table--dense th:nth-child(5),
.registry-table--dense td:nth-child(5),
.registry-table--dense th:nth-child(7),
.registry-table--dense td:nth-child(7) {
    width: 110px;
}

.registry-table--dense th:nth-child(6),
.registry-table--dense td:nth-child(6) {
    width: 180px;
}

.registry-table--dense th:nth-child(8),
.registry-table--dense td:nth-child(8) {
    width: 72px;
}

.registry-table--dense .icon-link {
    font-size: 0.8rem;
}

.table-meta {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.registry-table--dense th:last-child,
.registry-table--dense td:last-child {
    text-align: center;
}

.folder-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.folder-link:hover {
    transform: translateY(-1px);
}

.folder-link__icon {
    width: 1.1rem;
    height: 1.1rem;
}

.folder-link--closed {
    color: #567089;
    background: #f5f8fc;
}

.folder-link--closed:hover {
    background: #e8f0f8;
    color: var(--brand);
}

.folder-link--open {
    color: var(--accent);
    background: var(--accent-soft);
}

.folder-link--open:hover {
    background: #d9eafc;
    color: #1f6db3;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 1.6rem;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.8rem;
    color: var(--muted);
    font-size: 0.87rem;
}

.pagination__links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination__links a,
.pagination__disabled {
    padding: 0.38rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.pagination__links .is-active {
    background: var(--accent-soft);
    border-color: #98bfe4;
    color: var(--brand);
    font-weight: 700;
}

.pagination__disabled {
    color: #9aa8b6;
}

.table-row--selected {
    background: rgba(231, 240, 251, 0.92);
}

.table-row--selected td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.back-link,
.text-link,
.icon-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.88rem;
}

.icon-link--danger {
    color: var(--danger);
}

.detail-shell .tabs,
.detail-shell .subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 0.95rem;
    padding: 0;
    background: #d9dde1;
    border: 1px solid #c7cfd8;
    border-radius: 0;
    overflow: hidden;
}

.detail-shell .tabs__item,
.detail-shell .subtabs__item {
    padding: 0.72rem 1rem;
    border-radius: 0;
    color: #243647;
    font-weight: 500;
    font-size: 0.92rem;
    border-top: 3px solid transparent;
    border-right: 1px solid rgba(184, 195, 207, 0.75);
    background: transparent;
}

.detail-shell .tabs__item:last-child,
.detail-shell .subtabs__item:last-child {
    border-right: 0;
}

.detail-shell .tabs__item.is-active,
.detail-shell .subtabs__item.is-active {
    background: #fff;
    box-shadow: none;
    border-top-color: var(--accent);
}

.detail-shell .subtabs--diagnosis {
    margin-bottom: 0.6rem;
}

.detail-shell .subtabs--diagnosis .subtabs__item {
    flex: 1 1 190px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.62rem 0.9rem;
    font-size: 0.86rem;
    font-weight: 500;
}

.summary-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) 1fr;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    font-size: 0.86rem;
}

.summary-grid > div {
    padding: 0.62rem 0.84rem;
    border-bottom: 1px solid #edf2f7;
    line-height: 1.22;
}

.summary-grid--tight {
    font-size: 0.82rem;
}

.summary-grid--tight > div {
    padding: 0.42rem 0.7rem;
    line-height: 1.1;
}

.summary-grid > div:nth-child(4n + 1),
.summary-grid > div:nth-child(4n + 2) {
    background: #fbfcfe;
}

.completion-tracker__legend {
    margin: -0.2rem 0 0.7rem;
}

.completion-table th,
.completion-table td {
    text-align: center;
    vertical-align: middle;
    min-width: 108px;
}

.completion-table th:first-child,
.completion-table td:first-child {
    min-width: 100px;
    text-align: left;
    font-weight: 700;
}

.completion-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.34rem;
    min-width: 76px;
    padding: 0.42rem 0.35rem;
    border-radius: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.completion-indicator:hover {
    transform: translateY(-1px);
}

.completion-indicator__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 14px;
    font-size: 1.02rem;
    font-weight: 800;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.completion-indicator__label {
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.completion-indicator--complete .completion-indicator__icon {
    background: #d9f0db;
    color: #1f6a33;
}

.completion-indicator--complete .completion-indicator__label {
    color: #2c6a3a;
}

.completion-indicator--needs_info .completion-indicator__icon {
    background: #e8f0fb;
    color: #1f5e9a;
}

.completion-indicator--needs_info .completion-indicator__label {
    color: #2d5f90;
}

.completion-indicator--incomplete .completion-indicator__icon {
    background: #f6d6d6;
    color: #a52f2f;
}

.completion-indicator--incomplete .completion-indicator__label {
    color: #8f3434;
}

.placeholder-card {
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    padding: 1.4rem;
    background: linear-gradient(180deg, rgba(231, 240, 251, 0.35), rgba(255, 255, 255, 0.9));
}

.panel__actions {
    display: flex;
    justify-content: center;
    margin-top: 0.9rem;
}

.panel--detail {
    margin-bottom: 0;
    padding: 1.1rem;
    border-radius: 14px;
    border: 1px solid #cfd7df;
    background: #fbfcfd;
    box-shadow: none;
}

.panel--auth {
    width: min(100%, 500px);
    margin: 0;
    padding: 1.35rem 1.35rem 1.2rem;
    border-radius: 24px;
    border: 1px solid rgba(184, 195, 207, 0.9);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 253, 0.94) 100%);
    box-shadow:
        0 28px 60px rgba(20, 50, 75, 0.14),
        0 10px 22px rgba(31, 41, 55, 0.08);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 32, 44, 0.48);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    width: min(920px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding: 1.15rem 1.15rem 1rem;
    border: 1px solid rgba(184, 195, 207, 0.94);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 253, 0.98) 100%);
    box-shadow:
        0 32px 70px rgba(20, 50, 75, 0.2),
        0 12px 28px rgba(31, 41, 55, 0.12);
}

.modal-card--wide {
    width: min(1180px, calc(100vw - 28px));
}

.modal-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-card__header h3 {
    margin-bottom: 0.2rem;
    font-size: 1.2rem;
}

.modal-form {
    gap: 1rem;
}

.detail-shell {
    width: 100%;
    padding: 1.15rem;
    border: 1px solid rgba(184, 195, 207, 0.88);
    border-radius: 18px;
    background: linear-gradient(180deg, #f6f8fa 0%, #f2f4f6 100%);
    box-shadow: 0 12px 22px rgba(31, 41, 55, 0.05);
}

.detail-shell--narrow {
    width: 80%;
    margin: 1rem auto 0;
}

.detail-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.15rem 8.5rem 0.95rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(184, 195, 207, 0.92);
}

.detail-header__body {
    text-align: center;
}

.detail-header__body .back-link {
    display: inline-block;
    margin-bottom: 0.45rem;
}

.section-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

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

.form-grid--single {
    grid-template-columns: 1fr;
}

.button--wide {
    width: 100%;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.field-group--full {
    grid-column: 1 / -1;
}

.field-group label {
    color: #44576a;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 500px);
    gap: 2rem;
    align-items: center;
    min-height: calc(100vh - 150px);
    padding: 1.4rem 0 0.8rem;
}

.auth-intro {
    position: relative;
    padding: 2rem 1rem 2rem 0.25rem;
}

.auth-intro::before {
    content: "";
    position: absolute;
    inset: 0 14% 10% 0;
    border-radius: 32px;
    background:
        radial-gradient(circle at top left, rgba(43, 120, 197, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(234, 241, 248, 0.2));
    filter: blur(2px);
    z-index: -1;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.72rem;
    border: 1px solid rgba(43, 120, 197, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(43, 120, 197, 0.08);
}

.auth-copy {
    max-width: 560px;
    margin: 0.85rem 0 0;
    color: #46586a;
    font-size: 1rem;
    line-height: 1.6;
}

.auth-feature-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.6rem;
    max-width: 620px;
}

.auth-feature {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(184, 195, 207, 0.78);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 14px 26px rgba(31, 41, 55, 0.06);
    backdrop-filter: blur(8px);
}

.auth-feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #1f6db3, var(--accent));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 12px 20px rgba(43, 120, 197, 0.18);
}

.auth-feature h2 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
    line-height: 1.2;
}

.auth-feature p {
    margin: 0;
    color: #5e7081;
    font-size: 0.88rem;
    line-height: 1.5;
}

.auth-card__header {
    margin-bottom: 1rem;
}

.auth-card__header h2 {
    margin-bottom: 0.25rem;
    font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
    font-size: 1.95rem;
    line-height: 1.05;
}

.auth-card__header p {
    color: var(--muted);
}

.section-form--auth .field-group {
    gap: 0.42rem;
}

.section-form--auth input[type="text"],
.section-form--auth input[type="password"] {
    width: 100%;
    border: 1px solid rgba(184, 195, 207, 0.92);
    border-radius: 14px;
    padding: 0.86rem 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    color: var(--ink);
    font: inherit;
    line-height: 1.35;
    box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.section-form--auth input[type="text"]::placeholder,
.section-form--auth input[type="password"]::placeholder {
    color: #8b99a7;
}

.section-form--auth input[type="text"]:focus,
.section-form--auth input[type="password"]:focus {
    outline: none;
    border-color: #7eaddb;
    box-shadow:
        0 0 0 4px rgba(43, 120, 197, 0.12),
        inset 0 1px 2px rgba(31, 41, 55, 0.04);
    transform: translateY(-1px);
}

.form-actions--auth {
    margin-top: 0.25rem;
}

.text-input,
.textarea-input,
.select-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.58rem 0.72rem;
    background: #fbfdff;
    color: var(--ink);
    font: inherit;
    line-height: 1.32;
    box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.04);
}

.file-input {
    width: 100%;
    border: 1px dashed #a9bfd5;
    border-radius: 12px;
    padding: 0.72rem 0.85rem;
    background: #f8fbff;
    color: var(--ink);
    font: inherit;
}

.file-input::file-selector-button {
    margin-right: 0.7rem;
    border: 1px solid #b8cde1;
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    background: #fff;
    color: #294154;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.file-input:hover {
    border-color: #8fb4d8;
    background: #f3f9ff;
}

.file-input:focus {
    outline: none;
    border-color: #99bde0;
    box-shadow: 0 0 0 3px rgba(43, 120, 197, 0.12);
}

.textarea-input {
    min-height: 3.8rem;
    resize: vertical;
}

.split-datetime {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
    gap: 0.55rem;
    align-items: center;
}

.split-datetime input {
    width: 100%;
}

.select-input {
    min-height: 2.75rem;
    background: #fbfdff;
}

.select-input[multiple] {
    min-height: 8.5rem;
    padding: 0.45rem 0.5rem;
}

.medical-history-builder {
    padding: 0.9rem;
    border: 1px solid #d4dbe3;
    border-radius: 12px;
    background: #fcfdfe;
}

.medical-history-builder__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
}

.medical-history-builder__controls select {
    flex: 1 1 200px;
    min-width: 0;
}

.medical-history-builder__controls [data-medical-history-other],
.medical-history-builder__controls [data-laboratory-other] {
    flex: 1 1 180px;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.medical-history-builder__controls [data-medical-history-other]:focus,
.medical-history-builder__controls [data-laboratory-other]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.formset-add-row {
    margin-bottom: 0.7rem;
    text-align: right;
}

.formset-delete-hidden {
    display: none;
}

.formset-delete-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    color: var(--danger);
    transition: background 0.2s, transform 0.15s;
    line-height: 1;
}

.formset-delete-btn:hover {
    background: rgba(196, 69, 69, 0.1);
    transform: scale(1.15);
}

.formset-delete-btn.active {
    background: rgba(196, 69, 69, 0.15);
    color: #7c2424;
}

.formset-delete-btn.active + .formset-delete-hidden,
tr.formset-row-deleted {
    opacity: 0.4;
}

.row-delete-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.row-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.18rem;
    border-radius: 999px;
    color: #667788;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.row-delete-button:hover,
.row-delete-button:focus-visible {
    color: #a94444;
    background: rgba(169, 68, 68, 0.1);
    transform: scale(1.08);
    outline: none;
}

.row-delete-button svg {
    display: block;
}

tr.formset-row-deleted td:not(:last-child) {
    text-decoration: line-through;
    opacity: 0.4;
}

.medical-history-table {
    min-width: 0;
}

.medical-history-table th,
.medical-history-table td {
    padding: 0.7rem 0.8rem;
}

.medical-history-builder__detail {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid #dfe6ee;
}

.medical-history-builder__detail label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.medical-history-remove {
    border: 0;
    background: transparent;
    color: #9d3b3b;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.medical-history-remove:hover,
.medical-history-remove:focus-visible {
    color: #7c2424;
    text-decoration: underline;
}

.checkbox-builder {
    padding: 0.9rem;
    border: 1px solid #d4dbe3;
    border-radius: 12px;
    background: #fcfdfe;
}

.checkbox-builder--grouped {
    padding: 1rem;
}

.checkbox-collection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.65rem;
}

.referral-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.8rem;
}

.referral-group-card {
    padding: 0.9rem 0.95rem;
    border: 1px solid #d8e1ea;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.referral-group-card h4 {
    margin: 0 0 0.7rem;
    color: #284258;
    font-size: 0.93rem;
    line-height: 1.25;
}

.referral-group-card__options {
    display: grid;
    gap: 0.5rem;
}

.referral-option-card {
    display: grid;
    gap: 0.45rem;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid #dbe4ec;
    border-radius: 12px;
    background: #fff;
    color: #304455;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.checkbox-card:hover {
    border-color: #9dbfe0;
    box-shadow: 0 8px 18px rgba(43, 120, 197, 0.08);
    transform: translateY(-1px);
}

.checkbox-card input {
    margin-top: 0.12rem;
    flex-shrink: 0;
}

.checkbox-card span {
    line-height: 1.3;
    font-weight: 500;
}

.checkbox-card--compact {
    padding: 0.58rem 0.68rem;
    border-radius: 10px;
}

.referral-option-card.is-selected .checkbox-card {
    border-color: #98bbdd;
    background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
    box-shadow:
        0 10px 18px rgba(43, 120, 197, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.referral-note-shell {
    margin: -0.05rem 0 0 2.35rem;
    padding: 0.72rem 0.8rem 0.78rem;
    border: 1px dashed #c7d7e7;
    border-radius: 12px;
    background: rgba(231, 240, 251, 0.55);
}

.referral-note-shell.is-hidden {
    display: none;
}

.referral-note-shell__label {
    display: block;
    margin-bottom: 0.38rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-note-input {
    width: 100%;
}

.checkbox-card--compact span {
    font-size: 0.86rem;
}

.checkbox-builder__other {
    margin-top: 0.9rem;
}

.text-input:focus,
.textarea-input:focus,
.select-input:focus {
    outline: none;
    border-color: #99bde0;
    box-shadow: 0 0 0 3px rgba(43, 120, 197, 0.12);
}

.checkbox-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

.field-help,
.field-error {
    margin: 0;
    font-size: 0.74rem;
}

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

.field-error {
    color: var(--danger);
    font-weight: 600;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.formset-block {
    margin-top: 0.25rem;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.registry-table--edit {
    min-width: 760px;
}

.registry-table--edit th,
.registry-table--edit td {
    padding: 0.46rem 0.56rem;
}

.registry-table--edit .text-input,
.registry-table--edit .textarea-input {
    padding: 0.48rem 0.58rem;
    border-radius: 8px;
}

.registry-table--edit .textarea-input {
    min-height: 3rem;
}

.registry-table--edit td:last-child,
.registry-table--edit th:last-child {
    text-align: center;
}

.registry-table--edit .field-error {
    margin-top: 0.25rem;
}

.detail-header__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    position: absolute;
    top: 0;
    right: 0;
}

.detail-shell .panel__header {
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e1e6eb;
}

.detail-shell .table-wrap {
    border: 1px solid #d3dae2;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.detail-shell .table-wrap--compact {
    margin-top: 0.65rem;
}

.detail-shell .registry-table {
    min-width: 0;
}

.detail-shell .registry-table th {
    background: #fff;
    color: #1f2f3f;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid #d7dfe7;
}

.detail-shell .registry-table td {
    padding: 0.7rem 0.78rem;
    line-height: 1.3;
}

.detail-shell .registry-table--snapshot th,
.detail-shell .registry-table--snapshot td {
    vertical-align: top;
}

.detail-shell .registry-table--snapshot th:first-child,
.detail-shell .registry-table--snapshot td:first-child {
    width: 52px;
    text-align: center;
}

.detail-shell .registry-table--snapshot th:last-child,
.detail-shell .registry-table--snapshot td:last-child {
    width: 110px;
    text-align: center;
}

.detail-shell .registry-table--snapshot td {
    font-size: 0.82rem;
}

.detail-shell .registry-table--snapshot .chip-list {
    gap: 0.35rem;
}

.detail-block + .detail-block {
    margin-top: 0.8rem;
}

.entry-action-row {
    display: flex;
    justify-content: center;
    margin-top: 0.8rem;
}

.detail-copy {
    margin: 0.28rem 0 0;
    color: #304355;
    font-size: 0.88rem;
    line-height: 1.38;
}

.panel__subcopy {
    margin: 0.22rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.eyebrow--compact {
    margin-bottom: 0.18rem;
    font-size: 0.64rem;
    letter-spacing: 0.12em;
}

.section-form--intraoral {
    gap: 1rem;
}

.intraoral-editor-card,
.intraoral-visual-card {
    border: 1px solid rgba(184, 195, 207, 0.84);
    border-radius: 20px;
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 253, 0.96) 100%);
    box-shadow: 0 12px 22px rgba(31, 41, 55, 0.05);
}

.intraoral-visual-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr);
    gap: 1rem;
}

.intraoral-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.intraoral-metric-card {
    padding: 0.85rem;
    border: 1px solid rgba(216, 224, 232, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.section-counter {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    background: #eef5fc;
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 700;
}

.tooth-chart {
    display: grid;
    gap: 0.95rem;
}

.tooth-chart__row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.85rem;
    align-items: center;
}

.tooth-chart__label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #42576b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tooth-chart__teeth {
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 0.35rem;
}

.tooth-chart__legend {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.tooth-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    color: #516476;
    font-size: 0.74rem;
    font-weight: 600;
}

.tooth-legend__swatch {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 7px;
    border: 1px solid rgba(184, 195, 207, 0.96);
    background: linear-gradient(180deg, #ffffff, #f3f7fb);
}

.tooth-legend__swatch--recorded {
    border-color: rgba(43, 120, 197, 0.28);
    background: linear-gradient(180deg, #dff0ff, #c7e1ff);
}

.tooth-legend__swatch--active {
    border-color: rgba(20, 50, 75, 0.2);
    background: linear-gradient(180deg, #1f6db3, #174b78);
}

.tooth-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.2rem;
    border: 1px solid rgba(184, 195, 207, 0.92);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
    color: #3f5366;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

button.tooth-chip {
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

button.tooth-chip:hover,
button.tooth-chip:focus-visible {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(43, 120, 197, 0.42);
    box-shadow: 0 10px 18px rgba(43, 120, 197, 0.12);
}

.tooth-chip.is-recorded {
    border-color: rgba(43, 120, 197, 0.32);
    background: linear-gradient(180deg, #e4f1ff 0%, #cfe4ff 100%);
    color: #184c7a;
}

.tooth-chip.is-active {
    border-color: rgba(20, 50, 75, 0.12);
    background: linear-gradient(180deg, #1f6db3 0%, #174b78 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(23, 75, 120, 0.2);
}

.tooth-chip--display {
    cursor: default;
}

.tooth-chart__helper {
    margin-top: 0.9rem;
    padding: 0.78rem 0.9rem;
    border: 1px dashed rgba(143, 180, 216, 0.96);
    border-radius: 14px;
    background: #f6fbff;
    color: #40607f;
    font-size: 0.82rem;
    font-weight: 600;
}

.tooth-entry-list,
.soft-tissue-card-grid,
.observation-card-grid,
.soft-tissue-display-grid,
.radiology-card-grid {
    display: grid;
    gap: 0.85rem;
}

.tooth-entry-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tooth-entry-card,
.soft-tissue-card,
.observation-card,
.soft-tissue-display-card {
    border: 1px solid rgba(216, 224, 232, 0.92);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 18px rgba(31, 41, 55, 0.04);
}

.tooth-entry-card {
    padding: 0.95rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tooth-entry-card.is-active {
    border-color: rgba(43, 120, 197, 0.38);
    box-shadow: 0 14px 26px rgba(43, 120, 197, 0.12);
    transform: translateY(-1px);
}

.tooth-entry-card__header,
.soft-tissue-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.tooth-entry-card__header h4,
.soft-tissue-card__header h4,
.observation-card__content h4 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.2;
}

.tooth-entry-card__delete {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: #617182;
    font-size: 0.76rem;
    font-weight: 700;
}

.tooth-entry-grid {
    display: grid;
    grid-template-columns: minmax(90px, 110px) repeat(3, minmax(0, 1fr)) 84px;
    gap: 0.7rem;
    align-items: start;
}

.tooth-entry-grid__sort .text-input {
    text-align: center;
}

.soft-tissue-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.soft-tissue-card {
    padding: 0.95rem;
}

.soft-tissue-card__sort {
    margin-top: 0.72rem;
    max-width: 88px;
}

.intraoral-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
}

.intraoral-overview-tile {
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbfe 0%, #eef4fa 100%);
    border: 1px solid rgba(216, 224, 232, 0.92);
}

.intraoral-overview-tile span,
.soft-tissue-display-card span,
.observation-card__metrics span {
    display: block;
    margin-bottom: 0.26rem;
    color: #66788a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.intraoral-overview-tile strong,
.soft-tissue-display-card strong,
.observation-card__metrics strong {
    color: #223649;
    font-size: 0.9rem;
    line-height: 1.42;
}

.intraoral-overview-tile--wide,
.soft-tissue-display-card--wide {
    grid-column: 1 / -1;
}

.observation-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.observation-card {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 0.9rem;
    padding: 0.95rem;
}

.observation-card__tooth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    border-radius: 20px;
    background: linear-gradient(180deg, #1f6db3 0%, #174b78 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 14px 24px rgba(31, 109, 179, 0.18);
}

.observation-card__metrics {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.soft-tissue-display-grid,
.radiology-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.soft-tissue-display-card {
    padding: 0.95rem 1rem;
}

.empty-state-card {
    padding: 1rem 1.05rem;
    border: 1px dashed rgba(184, 195, 207, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    color: #66788a;
    font-size: 0.84rem;
    text-align: center;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.chip-list--flush {
    margin-top: 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    background: #edf4fb;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 600;
}

.chip--muted {
    background: #f4f6f8;
    color: var(--muted);
}

.login-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.84rem;
}

.login-note p {
    margin-bottom: 0.45rem;
}

.login-note--card {
    margin-top: 1.05rem;
    padding: 0.95rem 1rem 0.5rem;
    border: 1px solid rgba(184, 195, 207, 0.78);
    border-radius: 16px;
    background: linear-gradient(180deg, #f7fbff 0%, #f2f6fa 100%);
}

.login-note__label {
    margin-bottom: 0.5rem;
    color: var(--brand);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@media (max-width: 860px) {
    .page-shell {
        width: min(100vw - 16px, 100%);
        margin-top: 1rem;
    }

    .topbar {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .hero,
    .detail-header,
    .pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-table-actions,
    .quick-upload {
        align-items: stretch;
    }

    .dashboard-table-actions {
        flex-direction: column;
    }

    .action-pill {
        width: 100%;
        min-width: 0;
    }

    .medical-history-builder__controls {
        flex-direction: column;
    }

    .medical-history-builder__controls select,
    .medical-history-builder__controls [data-medical-history-other],
    .medical-history-builder__controls [data-laboratory-other] {
        flex: 1 1 auto;
        width: 100%;
    }

    .referral-note-shell {
        margin-left: 0;
    }

    .detail-header {
        padding: 0.1rem 0 0.9rem;
    }

    .detail-header__body {
        text-align: left;
    }

    .detail-header__actions {
        position: static;
        justify-content: flex-end;
        margin-top: 0.55rem;
    }

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

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

    .intraoral-visual-layout,
    .intraoral-metric-grid,
    .intraoral-overview-grid,
    .tooth-entry-grid {
        grid-template-columns: 1fr;
    }

    .tooth-chart__row {
        grid-template-columns: 1fr;
    }

    .tooth-chart__teeth {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

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

    .observation-card__tooth {
        min-height: 64px;
    }

    .section-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        min-height: auto;
        padding-top: 0.5rem;
    }

    .auth-intro {
        padding: 0.25rem 0 0;
    }

    .auth-intro::before {
        inset: 0;
    }

    .panel--narrow,
    .detail-shell--narrow,
    .panel--auth {
        width: 100%;
    }

    .modal-shell {
        padding: 0.75rem;
        align-items: flex-start;
    }

    .modal-card,
    .modal-card--wide {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .registry-table {
        min-width: 760px;
    }

    .registry-table--dense {
        min-width: 680px;
    }
}
