:root {
    color-scheme: light;
    --navy-950: #0b1f33;
    --navy-900: #102a43;
    --navy-800: #173f5f;
    --teal-700: #0c6b62;
    --teal-600: #0f7c71;
    --teal-100: #dff2ef;
    --ink: #172b3a;
    --muted: #526778;
    --faint: #6a7e8e;
    --line: #d9e2e8;
    --line-strong: #becbd4;
    --surface: #ffffff;
    --surface-soft: #f4f7f8;
    --surface-tint: #eef5f4;
    --danger: #a13b3b;
    --danger-soft: #faeaea;
    --warning: #8a5b13;
    --warning-soft: #fff3d8;
    --success: #176b4d;
    --success-soft: #e1f3ea;
    --sidebar-width: 264px;
    --shadow-float: 0 16px 42px rgba(11, 31, 51, 0.16);
}

[hidden] {
    display: none !important;
}

.inline-time-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--surface-soft);
    color: var(--ink);
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.64;
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 11px 16px;
    transform: translateY(-160%);
    border-radius: 6px;
    background: var(--navy-950);
    color: #fff;
    font-weight: 800;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid #f0b94a;
    outline-offset: 3px;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--teal-700);
    color: #fff;
    font-weight: 900;
    line-height: 1;
}

.brand-mark-large {
    width: 54px;
    height: 54px;
    margin-bottom: 32px;
    border-radius: 12px;
    font-size: 1.5rem;
}

.eyebrow {
    margin-bottom: 9px;
    color: var(--teal-700);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 800;
    line-height: 1.35;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.button-primary {
    border-color: var(--teal-700);
    background: var(--teal-700);
    color: #fff;
}

.button-primary:hover {
    border-color: var(--teal-600);
    background: var(--teal-600);
}

.button-secondary {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--navy-900);
}

.button-secondary:hover {
    border-color: var(--navy-800);
    background: #f8fafb;
}

.button-summary {
    border-color: #244b75;
    background: #244b75;
    color: #fff;
}

.button-summary:hover {
    border-color: var(--navy-950);
    background: var(--navy-950);
}

.button-danger {
    border-color: #d8aaaa;
    background: var(--surface);
    color: var(--danger);
}

.button-danger:hover {
    background: var(--danger-soft);
}

.button-small {
    min-height: 40px;
    padding: 7px 13px;
}

.button-wide {
    width: 100%;
}

.text-button,
.text-link,
.table-link {
    border: 0;
    background: transparent;
    color: var(--teal-700);
    font-weight: 800;
    text-decoration: none;
}

.text-button {
    padding: 7px 0;
}

.text-link:hover,
.table-link:hover,
.auth-switch a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.table-link.strong {
    color: var(--navy-900);
}

.boot-state {
    display: grid;
    min-height: 100vh;
    place-content: center;
    justify-items: center;
    gap: 18px;
    padding: 24px;
    color: var(--muted);
}

.boot-state p {
    margin: 0;
}

.auth-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(400px, 1fr) minmax(500px, 0.92fr);
    background: var(--surface);
}

.auth-brand {
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: clamp(48px, 7vw, 108px);
    background:
        linear-gradient(145deg, rgba(15, 124, 113, 0.14), transparent 55%),
        var(--navy-950);
    color: #fff;
}

.auth-brand-inner {
    max-width: 620px;
    animation: reveal-up 480ms ease both;
}

.auth-brand .eyebrow {
    color: #8ed4cc;
}

.auth-brand h1 {
    margin-bottom: 24px;
    font-size: clamp(2.25rem, 4.6vw, 4.5rem);
    line-height: 1.12;
    letter-spacing: -0.045em;
}

.auth-brand p:last-child {
    max-width: 520px;
    margin-bottom: 0;
    color: #d4e0e9;
    font-size: 1.125rem;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px clamp(28px, 6vw, 92px);
}

.auth-form-wrap {
    width: min(100%, 440px);
    animation: reveal-up 480ms 80ms ease both;
}

.auth-form-wrap-wide {
    width: min(100%, 620px);
}

.auth-form-wrap h2 {
    margin-bottom: 34px;
    color: var(--navy-950);
    font-size: 2rem;
    line-height: 1.2;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.stack-form label,
.operation-form label,
.filter-bar label,
.picker-toolbar label {
    display: grid;
    gap: 7px;
    color: var(--navy-900);
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    padding: 10px 13px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

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

input:hover,
select:hover,
textarea:hover {
    border-color: #91a5b3;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal-700);
    box-shadow: 0 0 0 3px rgba(12, 107, 98, 0.12);
    outline: 0;
}

input[readonly] {
    background: var(--surface-soft);
    color: var(--muted);
}

.stack-form .button {
    margin-top: 12px;
}

.compact-form {
    gap: 15px;
}

.signup-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: -12px 0 28px;
    padding: 0;
    list-style: none;
}

.signup-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.signup-steps strong,
.signup-section legend span {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--teal-100);
    color: var(--teal-700);
    font-size: 0.75rem;
}

.signup-section {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 22px 0 24px;
    border: 0;
    border-top: 1px solid var(--line);
}

.signup-section legend {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 3px;
    padding: 0;
    color: var(--navy-950);
    font-size: 1rem;
    font-weight: 850;
}

.inline-field-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.inline-field-action .button {
    min-width: 104px;
    margin: 0;
    white-space: nowrap;
}

.verification-code-field {
    max-width: 390px;
}

.field-status {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.field-status.is-success {
    color: var(--success);
}

.field-status.is-error {
    color: #962f2f;
}

.center-member-picker {
    display: grid;
    gap: 11px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.center-member-picker[hidden] {
    display: none;
}

.terms-section {
    padding-bottom: 12px;
}

.terms-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.terms-box summary {
    padding: 14px 16px;
    cursor: pointer;
    color: var(--navy-900);
    font-weight: 800;
}

.terms-box div {
    max-height: 180px;
    overflow: auto;
    padding: 0 16px 14px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.terms-box p:last-child {
    margin-bottom: 0;
}

.terms-consent {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 10px !important;
    cursor: pointer;
}

.terms-consent input {
    width: 18px;
    min-height: 18px;
    margin: 0;
    accent-color: var(--teal-700);
}

.signup-approval-note {
    margin: 0;
    padding: 13px 15px;
    border-left: 3px solid var(--teal-700);
    background: var(--surface-tint);
}

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

.two-column-fields > div {
    display: grid;
    gap: 7px;
}

.field-help,
.auth-switch,
.test-account {
    color: var(--muted);
}

.field-help {
    margin: -3px 0 5px;
}

.auth-switch {
    margin: 26px 0 0;
}

.auth-switch a {
    color: var(--teal-700);
    font-weight: 800;
}

.test-account {
    margin: 18px 0 0;
    padding: 13px 15px;
    border-left: 3px solid var(--teal-700);
    background: var(--surface-tint);
}

.test-account strong {
    color: var(--navy-900);
}

.inline-error,
.form-error {
    border: 1px solid #ddb6b6;
    border-radius: 7px;
    background: var(--danger-soft);
    color: #7f2929;
}

.inline-error {
    margin-bottom: 22px;
    padding: 13px 15px;
}

.form-error {
    margin: 7px 0;
    padding: 11px 13px;
}

.completion-message {
    padding: 12px 0;
}

.completion-message > span {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    font-size: 1.5rem;
    font-weight: 900;
}

.completion-message h2 {
    margin-bottom: 15px;
}

.completion-message p {
    margin-bottom: 28px;
    color: var(--muted);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 28px 20px 22px;
    background: var(--navy-950);
    color: #fff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 7px 31px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.sidebar-brand > div {
    display: grid;
}

.sidebar-brand strong {
    line-height: 1.25;
}

.sidebar-brand span:last-child {
    color: #aebfcd;
}

.sidebar nav {
    display: grid;
    gap: 4px;
    padding: 25px 0;
}

.nav-link {
    display: flex;
    min-height: 46px;
    align-items: center;
    padding: 10px 13px;
    border-radius: 6px;
    color: #c8d5df;
    font-weight: 750;
    text-decoration: none;
    transition: color 130ms ease, background-color 130ms ease, transform 130ms ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    transform: translateX(2px);
}

.nav-link.is-active {
    background: var(--teal-700);
    color: #fff;
}

.sidebar-user {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 11px;
    align-items: center;
    margin-top: auto;
    padding: 19px 7px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.user-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: #dff2ef;
    color: var(--teal-700);
    font-weight: 900;
}

.sidebar-user > div {
    display: grid;
    min-width: 0;
}

.sidebar-user strong,
.sidebar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user > div span {
    color: #aebfcd;
}

.sidebar-user .text-button {
    grid-column: 2;
    justify-self: start;
    color: #a9dcd6;
}

.workspace {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 48px clamp(30px, 4.5vw, 74px) 80px;
}

.workspace > * {
    width: min(100%, 1440px);
    margin-inline: auto;
}

.mobile-header,
.menu-backdrop {
    display: none;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 38px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.page-header h1 {
    margin-bottom: 8px;
    color: var(--navy-950);
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.page-header p:last-child {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 42px;
    border-block: 1px solid var(--line-strong);
    background: var(--surface);
}

.metric-strip > div {
    display: grid;
    gap: 5px;
    min-height: 120px;
    align-content: center;
    padding: 22px 28px;
    border-right: 1px solid var(--line);
}

.metric-strip > div:last-child {
    border-right: 0;
}

.metric-strip span {
    color: var(--muted);
    font-weight: 750;
}

.metric-strip strong {
    color: var(--navy-950);
    font-size: 2rem;
    line-height: 1.1;
}

.section-block {
    margin-top: 26px;
}

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

.section-heading h2 {
    margin-bottom: 4px;
    color: var(--navy-950);
    font-size: 1.375rem;
}

.section-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.filter-bar,
.picker-toolbar {
    display: grid;
    gap: 13px;
    align-items: end;
    margin-bottom: 20px;
    padding: 19px;
    border-block: 1px solid var(--line);
    background: var(--surface);
}

.filter-bar {
    grid-template-columns: minmax(280px, 1.6fr) repeat(2, minmax(150px, 0.7fr)) auto auto;
}

.picker-toolbar {
    grid-template-columns: minmax(280px, 1.6fr) repeat(3, minmax(150px, 0.7fr));
}

.filter-shell {
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(11, 31, 51, 0.05);
}

.filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
}

.filter-heading > div {
    display: grid;
    gap: 2px;
}

.filter-heading strong {
    color: var(--navy-950);
    font-size: 1.0625rem;
}

.filter-heading span {
    color: var(--muted);
}

.filter-shell .filter-bar {
    margin: 0;
    border: 0;
}

.report-filter-bar {
    grid-template-columns: minmax(300px, 1.5fr) repeat(2, minmax(170px, 0.6fr)) auto;
}

.advanced-filter {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.advanced-filter summary {
    width: fit-content;
    color: var(--teal-700);
    cursor: pointer;
    font-weight: 800;
}

.advanced-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    padding-top: 14px;
}

.filter-bar-compact {
    grid-template-columns: minmax(280px, 1fr) minmax(190px, 0.35fr) auto auto;
}

.filter-bar-search-only {
    grid-template-columns: minmax(280px, 1fr) auto auto;
}

.filter-bar label > span,
.picker-toolbar label > span {
    color: var(--muted);
    font-weight: 750;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 48px;
    color: var(--muted);
}

.result-meta strong {
    color: var(--navy-900);
}

.table-wrap {
    overflow-x: auto;
    border-top: 2px solid var(--navy-900);
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 14px 15px;
    border-bottom: 1px solid var(--line-strong);
    background: #eef2f5;
    color: var(--navy-900);
    font-weight: 850;
    white-space: nowrap;
}

.data-table td {
    min-height: 64px;
    padding: 15px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 130ms ease;
}

.data-table tbody tr:hover {
    background: #f8fbfb;
}

.record-link {
    display: grid;
    gap: 3px;
    min-width: 190px;
    text-decoration: none;
}

.record-link strong {
    color: var(--navy-900);
}

.record-link span,
.cell-subtext {
    display: block;
    color: var(--muted);
}

.record-link:hover strong {
    color: var(--teal-700);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    white-space: nowrap;
}

.table-action {
    min-width: 64px;
}

.empty-cell {
    padding: 42px 18px !important;
    color: var(--muted);
    text-align: center;
}

.type-pill,
.status-pill,
.account-status {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
}

.type-pill {
    background: #e7eef4;
    color: var(--navy-800);
}

.type-quality {
    background: var(--teal-100);
    color: var(--teal-700);
}

.status-pill {
    background: #edf1f4;
    color: var(--muted);
}

.status-in_progress,
.status-revision {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-review,
.status-signing {
    background: #e8edfa;
    color: #36538e;
}

.status-finalized {
    background: var(--success-soft);
    color: var(--success);
}

.account-status {
    background: #edf1f4;
    color: var(--muted);
}

.account-pending {
    background: var(--warning-soft);
    color: var(--warning);
}

.account-active {
    background: var(--success-soft);
    color: var(--success);
}

.account-suspended,
.account-rejected {
    background: var(--danger-soft);
    color: var(--danger);
}

.operation-form {
    border-top: 2px solid var(--navy-900);
    background: var(--surface);
}

.detail-form-section {
    display: block;
}

.detail-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.88rem;
}

.summary-connection {
    margin-bottom: 22px;
    border-top: 3px solid #244b75;
    background: linear-gradient(135deg, #f7fafc 0%, #ffffff 68%);
}

.summary-connection.is-linked {
    border-top-color: var(--teal-700);
}

.summary-connection .section-heading {
    margin-bottom: 22px;
}

.section-kicker {
    color: #244b75;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.summary-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.summary-link-row > div {
    display: grid;
    gap: 6px;
}

.summary-link-row strong {
    color: var(--navy-950);
    font-size: 1.08rem;
}

.summary-link-row span {
    color: var(--muted);
    line-height: 1.55;
}

.summary-connection-form {
    display: grid;
    gap: 24px;
}

.summary-report-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: end;
    gap: 12px;
}

.summary-report-pair label,
.summary-connection-form .assignee-picker {
    display: grid;
    gap: 8px;
    color: var(--navy-900);
    font-weight: 750;
}

.pair-symbol {
    display: grid;
    width: 34px;
    height: 48px;
    place-items: center;
    color: var(--teal-700);
    font-size: 1.35rem;
    font-weight: 900;
}

.summary-connection .form-footer {
    padding: 20px 0 0;
    border-top: 1px solid var(--line);
    background: transparent;
}

.detail-form-section > .section-heading {
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.detail-form-section fieldset {
    display: grid;
    gap: 30px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.detail-field-section {
    display: grid;
    gap: 15px;
}

.detail-field-section + .detail-field-section {
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.detail-field-section h3 {
    margin: 0;
    color: var(--navy-950);
    font-size: 1.125rem;
}

.profile-panel {
    border-top: 2px solid var(--navy-900);
    background: var(--surface);
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 30px 32px;
    border-bottom: 1px solid var(--line);
}

.profile-avatar {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--teal-100);
    color: var(--teal-700);
    font-size: 1.5rem;
    font-weight: 900;
}

.profile-summary h2,
.profile-summary p {
    margin-bottom: 0;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.profile-details > div {
    min-height: 112px;
    padding: 24px 32px;
    border-bottom: 1px solid var(--line);
}

.profile-details > div:nth-child(odd) {
    border-right: 1px solid var(--line);
}

.profile-details dt {
    margin-bottom: 7px;
    color: var(--muted);
    font-weight: 750;
}

.profile-details dd {
    margin: 0;
    color: var(--navy-950);
    font-weight: 800;
}

.verification-badge {
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid #d5a4a4;
    border-radius: 999px;
    background: var(--danger-soft);
    color: #8a2929;
    font-size: 0.78rem;
    font-weight: 850;
}

.verification-badge.is-verified {
    border-color: #add5c8;
    background: var(--success-soft);
    color: var(--success);
}

.profile-edit-form,
.profile-password-form {
    margin-top: 24px;
    border-top: 2px solid var(--navy-900);
    background: var(--surface);
}

.profile-password-form {
    margin-bottom: 24px;
}

.email-verification-panel {
    display: grid;
    gap: 16px;
    max-width: 680px;
}

.operation-form label small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.reference-admin-layout {
    display: grid;
    gap: 30px;
}

.reference-section {
    border-top: 2px solid var(--navy-900);
}

.reference-editor {
    display: grid;
    grid-template-columns: minmax(180px, 0.62fr) minmax(220px, 1fr) minmax(180px, 0.7fr) auto;
    align-items: end;
    gap: 14px;
    margin: 22px 0;
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}

.reference-editor-participation {
    grid-template-columns: minmax(170px, 0.6fr) minmax(180px, 0.72fr) minmax(220px, 1fr) minmax(110px, 0.35fr) auto;
}

.reference-editor label {
    display: grid;
    gap: 7px;
    color: var(--navy-900);
    font-weight: 750;
}

.reference-editor-title {
    display: grid;
    align-self: center;
    gap: 3px;
}

.reference-editor-title strong {
    color: var(--navy-950);
    font-size: 1rem;
}

.reference-editor-title span,
.reference-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.76rem;
}

.reference-editor .form-error {
    grid-column: 1 / -1;
}

.reference-editor > .row-actions {
    align-self: end;
    min-height: 48px;
}

.reference-filter {
    margin-bottom: 14px;
}

.reference-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 850;
}

.reference-status.is-active {
    background: var(--success-soft);
    color: var(--success);
}

.reference-status.is-inactive {
    background: var(--surface-soft);
    color: var(--muted);
}

.form-section {
    display: grid;
    grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
    gap: 40px;
    padding: 34px;
    border-bottom: 1px solid var(--line);
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.form-section-heading > span {
    color: var(--teal-700);
    font-weight: 900;
}

.form-section-heading h2 {
    margin-bottom: 6px;
    color: var(--navy-950);
    font-size: 1.25rem;
}

.form-section-heading p {
    margin: 0;
    color: var(--muted);
}

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

.field-span-2 {
    grid-column: 1 / -1;
}

.field-label {
    color: var(--navy-900);
    font-weight: 750;
}

.assignee-picker {
    align-content: start;
}

.assignee-picker input[type="search"] {
    min-height: 42px;
    background: var(--surface-soft);
}

.attachment-upload {
    margin-bottom: 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.attachment-picker {
    display: grid;
    gap: 12px;
}

.attachment-dropzone {
    position: relative;
    display: grid !important;
    min-height: 126px;
    place-content: center;
    gap: 5px !important;
    padding: 22px;
    border: 2px dashed var(--line-strong);
    border-radius: 9px;
    background: var(--surface-soft);
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.attachment-dropzone:hover,
.attachment-dropzone.is-dragging {
    border-color: var(--teal-700);
    background: var(--surface-tint);
}

.attachment-dropzone input {
    position: absolute;
    inset: 0;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.attachment-dropzone strong {
    color: var(--navy-950);
}

.attachment-dropzone span {
    color: var(--muted);
    font-weight: 500;
}

.attachment-queue {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.attachment-queue li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
}

.attachment-queue li[draggable="true"] {
    cursor: grab;
}

.attachment-queue .queue-empty {
    display: block;
    min-height: 0;
    color: var(--muted);
    text-align: center;
}

.queue-handle {
    color: var(--faint);
    font-weight: 900;
}

.queue-file {
    display: grid;
    min-width: 0;
}

.queue-file strong {
    overflow: hidden;
    color: var(--navy-900);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-file small {
    color: var(--muted);
}

.queue-actions {
    display: flex;
    gap: 5px;
}

.queue-button {
    display: grid;
    width: 36px;
    min-height: 36px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--navy-800);
    font-weight: 900;
}

.queue-button.is-remove {
    color: var(--danger);
}

.attachment-upload-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
}

.attachment-upload-actions .field-help {
    margin: 0;
}

.picker-toolbar {
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.42fr) auto;
    margin-bottom: 13px;
    padding: 0 0 16px;
    border-top: 0;
}

.selection-summary {
    align-self: center;
    justify-self: end;
    color: var(--teal-700);
    white-space: nowrap;
}

.check-list {
    max-height: 390px;
    overflow-y: auto;
    border-block: 1px solid var(--line-strong);
}

.check-row {
    display: grid !important;
    grid-template-columns: auto 1fr;
    gap: 12px !important;
    align-items: center;
    min-height: 69px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.check-row:last-child {
    border-bottom: 0;
}

.check-row:hover {
    background: var(--surface-tint);
}

.check-row input {
    width: 22px;
    min-height: 22px;
    margin: 0;
}

.check-row > span {
    display: grid;
    gap: 2px;
}

.check-row small {
    color: var(--muted);
    font-size: 1rem;
}

.empty-inline {
    margin: 0;
    padding: 30px 10px;
    color: var(--muted);
    text-align: center;
}

.form-footer {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding: 22px 34px;
}

.form-footer .form-error {
    margin: 0 auto 0 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.7fr);
    gap: 30px;
}

.detail-primary,
.detail-note {
    border-top: 2px solid var(--navy-900);
    background: var(--surface);
}

.detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--line);
}

.detail-title-row > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.definition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.definition-grid > div {
    min-height: 104px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--line);
}

.definition-grid > div:nth-child(odd) {
    border-right: 1px solid var(--line);
}

.definition-grid dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 750;
}

.definition-grid dd {
    margin: 0;
    color: var(--navy-950);
    font-weight: 800;
}

.detail-note {
    padding: 24px;
}

.detail-note h2 {
    margin-bottom: 14px;
    color: var(--navy-950);
    font-size: 1.25rem;
}

.detail-note p {
    margin: 0;
    color: var(--muted);
    white-space: pre-wrap;
}

.approval-actions {
    display: flex;
    min-width: 285px;
    gap: 8px;
}

.approval-actions select {
    min-width: 160px;
}

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

.load-state {
    display: grid;
    min-height: 340px;
    place-content: center;
    justify-items: center;
    gap: 14px;
    border-block: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    text-align: center;
}

.load-state p,
.load-state h2 {
    max-width: 600px;
    margin: 0;
}

.load-state h2 {
    color: var(--navy-900);
    font-size: 1.375rem;
}

.loading-indicator {
    width: 32px;
    height: 32px;
    border: 3px solid #c7d6dc;
    border-top-color: var(--teal-700);
    border-radius: 50%;
    animation: rotate 700ms linear infinite;
}

.toast-region {
    position: fixed;
    z-index: 100;
    right: 24px;
    bottom: 24px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 15px 18px;
    transform: translateY(18px);
    border-radius: 8px;
    box-shadow: var(--shadow-float);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast-region.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-region.is-success {
    background: var(--success);
}

.toast-region.is-error {
    background: #8f3030;
}

@keyframes reveal-up {
    from {
        transform: translateY(14px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@media (max-width: 1120px) {
    .reference-editor,
    .reference-editor-participation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reference-editor-title,
    .reference-editor .form-error {
        grid-column: 1 / -1;
    }
    .filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-filter-bar .advanced-filter {
        grid-column: 1 / -1;
    }

    .search-field {
        grid-column: 1 / -1;
    }

    .picker-toolbar {
        grid-template-columns: 1fr minmax(180px, 0.4fr);
    }

    .picker-toolbar .search-field {
        grid-column: auto;
    }

    .selection-summary {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .form-section {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 840px) {
    .summary-report-pair {
        grid-template-columns: 1fr;
    }

    .pair-symbol {
        width: 100%;
        height: 24px;
    }

    .summary-link-row {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 330px;
        padding: 46px 28px;
    }

    .auth-brand h1 {
        margin-bottom: 18px;
    }

    .auth-form-panel {
        padding: 42px 24px 64px;
    }

    .mobile-header {
        position: sticky;
        z-index: 30;
        top: 0;
        display: flex;
        min-height: 66px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 18px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--navy-950);
        font-weight: 900;
        text-decoration: none;
    }

    .icon-button {
        min-height: 44px;
        padding: 7px 12px;
        border: 1px solid var(--line-strong);
        border-radius: 7px;
        background: var(--surface);
        color: var(--navy-900);
        font-weight: 800;
    }

    .sidebar {
        width: min(84vw, 310px);
        transform: translateX(-105%);
        box-shadow: var(--shadow-float);
        transition: transform 190ms ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .menu-backdrop {
        position: fixed;
        z-index: 35;
        inset: 0;
        display: none;
        border: 0;
        background: rgba(11, 31, 51, 0.46);
    }

    .menu-backdrop.is-open {
        display: block;
    }

    .workspace {
        margin-left: 0;
        padding: 34px 22px 64px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 28px;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-strip > div:nth-child(2) {
        border-right: 0;
    }

    .metric-strip > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .field-grid,
    .two-column-fields,
    .definition-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .definition-grid > div:nth-child(odd) {
        border-right: 0;
    }
}

@media (max-width: 640px) {
    .reference-editor,
    .reference-editor-participation {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .reference-editor-title,
    .reference-editor .form-error {
        grid-column: auto;
    }
    .auth-brand {
        min-height: 290px;
    }

    .brand-mark-large {
        margin-bottom: 22px;
    }

    .workspace {
        padding-inline: 16px;
    }

    .signup-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inline-field-action {
        grid-template-columns: 1fr;
    }

    .inline-field-action .button,
    .verification-code-field {
        width: 100%;
        max-width: none;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .page-actions .button {
        width: 100%;
    }

    .metric-strip {
        grid-template-columns: 1fr 1fr;
    }

    .metric-strip > div {
        min-height: 104px;
        padding: 18px;
    }

    .filter-bar,
    .filter-bar-compact,
    .picker-toolbar {
        grid-template-columns: 1fr;
        padding-inline: 14px;
    }

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

    .advanced-filter-grid,
    .profile-details {
        grid-template-columns: 1fr;
    }

    .profile-details > div:nth-child(odd) {
        border-right: 0;
    }

    .profile-summary,
    .profile-details > div {
        padding-inline: 18px;
    }

    .profile-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .verification-badge {
        margin-left: 82px;
    }

    .attachment-upload-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar .search-field,
    .picker-toolbar .search-field,
    .selection-summary {
        grid-column: auto;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        position: relative;
        padding: 17px 4px;
        border-bottom: 1px solid var(--line-strong);
    }

    .data-table td {
        display: grid;
        min-height: 0;
        grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
        gap: 12px;
        padding: 7px 12px;
        border: 0;
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 750;
    }

    .data-table .empty-cell {
        display: block;
    }

    .data-table .empty-cell::before {
        display: none;
    }

    .record-link {
        min-width: 0;
    }

    .approval-actions {
        min-width: 0;
        flex-direction: column;
    }

    .form-section {
        padding: 27px 18px;
    }

    .form-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 20px 18px;
    }

    .form-footer .form-error {
        margin: 0;
    }

    .detail-title-row,
    .section-heading,
    .result-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .definition-grid > div {
        min-height: 0;
        padding: 18px;
    }

    .toast-region {
        right: 16px;
        bottom: 16px;
    }
}

.segmented-control,
.case-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f1f5f7;
}

.segmented-control label { flex: 1; cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span,
.case-tabs button {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 800;
}
.segmented-control input:checked + span,
.case-tabs button.is-active { background: #fff; color: var(--primary); box-shadow: 0 1px 5px rgba(9,42,63,.12); }
.case-tabs { margin-bottom: 28px; }
.case-tabs button { flex: 1; cursor: pointer; }
.case-tab-panel[hidden] { display: none; }
.case-panel-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 24px; }
.case-panel-heading span,.case-sheet-kicker { color: var(--primary); font-weight: 800; font-size: .86rem; }
.case-panel-heading h2 { margin: 4px 0 0; }
.case-panel-heading p { margin: 0; color: var(--muted); }
.case-attachment-area { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.case-attachment-area > strong { display: block; margin-bottom: 12px; }
.search-choice { min-width: 0; }
.filter-submit { align-self: end; min-height: 48px; }
.case-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 2px solid var(--navy); border-bottom: 1px solid var(--line); background:#fff; }
.case-overview > div { min-height: 94px; padding: 20px 22px; border-right:1px solid var(--line); }
.case-overview > div:last-child { border-right:0; }
.case-overview span { display:block; margin-bottom:8px; color:var(--muted); font-size:.86rem; font-weight:700; }
.case-detail-stack { display:grid; gap:28px; margin-top:28px; }
.case-summary-sheet { padding:32px; border-top:2px solid var(--navy); background:#fff; box-shadow:0 8px 28px rgba(9,42,63,.06); }
.case-sheet-title { display:flex; justify-content:space-between; gap:20px; align-items:center; margin:5px 0 24px; }
.case-sheet-title h2 { margin:0; }
.case-detail-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:0; border:1px solid var(--line); }
.case-detail-grid > div { padding:17px; border-right:1px solid var(--line); }
.case-detail-grid > div:last-child { border-right:0; }
.case-detail-grid dt { color:var(--muted); font-size:.82rem; font-weight:700; }
.case-detail-grid dd { margin:7px 0 0; font-weight:750; }
.case-note,.case-file-placeholder { margin-top:22px; padding:20px; background:#f6f9fa; }
.case-note p,.case-file-placeholder p { margin:8px 0 0; white-space:pre-wrap; color:var(--text-soft); }
.case-files { margin-top:26px; padding-top:22px; border-top:1px solid var(--line); }
.case-files .section-heading { margin-bottom:14px; }
.case-files h3 { margin:0; }
.case-file-form { display:grid; gap:12px; margin-bottom:18px; }
.case-file-form > .button { justify-self:end; }
.case-edit-shell { margin-top:26px; border-top:2px solid var(--navy); background:#fff; }
.case-edit-shell > summary { padding:20px 24px; cursor:pointer; color:var(--navy); font-weight:850; }
.case-edit-body { padding:0 24px 8px; }
.case-edit-institution { margin:0 0 24px; padding:24px; border:1px solid var(--line); }
.case-edit-institution legend { padding:0 10px; color:var(--primary); font-weight:850; }
.auth-links { display:flex; justify-content:center; gap:10px; margin:22px 0 0; color:var(--muted); }
.auth-links a { color:var(--primary); font-weight:800; text-decoration:none; }
.recovery-result { align-items:stretch; text-align:center; }
.recovery-value { display:block; margin:4px 0 18px; padding:16px; border:1px solid var(--line-strong); background:#f6f9fa; color:var(--navy); font-size:1.15rem; letter-spacing:.03em; word-break:break-all; }
.password-change-required { display:flex; gap:10px; align-items:center; margin-bottom:24px; }
.password-change-required span { color:inherit; }

@media (max-width: 840px) {
    .case-overview,.case-detail-grid { grid-template-columns:1fr 1fr; }
    .case-overview > div:nth-child(2),.case-detail-grid > div:nth-child(2) { border-right:0; }
    .case-panel-heading,.case-sheet-title { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 640px) {
    .case-overview,.case-detail-grid { grid-template-columns:1fr; }
    .case-overview > div,.case-detail-grid > div { border-right:0; border-bottom:1px solid var(--line); }
    .segmented-control { flex-direction:column; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.participation-select > span small {
    margin-left: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.participation-multi {
    min-height: 126px;
    padding: 8px;
}

.participation-multi option {
    padding: 8px 10px;
    border-radius: 6px;
}

/* Unified consulting registration */
.unified-case-form {
    overflow: visible;
    border-top: 2px solid var(--navy-900);
    background: var(--surface);
}

.case-registration-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
}

.registration-stepper {
    position: sticky;
    top: 24px;
    padding: 30px 24px;
    border-right: 1px solid var(--line);
}

.registration-stepper > strong {
    display: block;
    margin-bottom: 20px;
    color: var(--navy-950);
    font-size: .88rem;
}

.registration-stepper ol { margin: 0; padding: 0; list-style: none; }
.registration-stepper li { position: relative; padding-bottom: 28px; }
.registration-stepper li:not(:last-child)::after { content: ""; position: absolute; top: 34px; bottom: 5px; left: 16px; width: 1px; background: var(--line-strong); }
.registration-stepper a { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; color: inherit; text-decoration: none; }
.registration-stepper a > span { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--muted); font-weight: 900; transition: background-color .16s ease, color .16s ease, transform .16s ease; }
.registration-stepper a:hover > span,.registration-stepper .is-current a > span { background: var(--teal-700); color: #fff; transform: translateY(-1px); }
.registration-stepper b,.registration-stepper small { display: block; }
.registration-stepper b { color: var(--navy-900); }
.registration-stepper small { margin-top: 2px; color: var(--muted); }

.case-registration-main { min-width: 0; }
.unified-case-form .form-section { display: block; padding: 30px 34px; scroll-margin-top: 24px; }
.unified-case-form .form-section-heading { margin-bottom: 24px; }
.unified-case-form .case-tabs { max-width: 620px; margin-bottom: 28px; }
.unified-case-form .case-tab-panel { animation: case-panel-in .18s ease-out both; }

@keyframes case-panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.inline-time-fields { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.time-range-separator { color: var(--muted); font-weight: 900; text-align: center; }

.unified-case-form input[readonly] {
    border-style: dashed;
    background: #eef3f5;
    color: var(--navy-800);
    cursor: default;
}

.participation-picker {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.participation-picker legend { margin-bottom: 9px; color: var(--navy-900); font-weight: 800; }
.participation-picker legend small { margin-left: 6px; color: var(--muted); font-size: .76rem; }
.participation-chips { display: flex; min-height: 42px; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.participation-empty { color: var(--muted); font-size: .86rem; }
.participation-chip { padding: 5px 9px; border-radius: 999px; background: var(--teal-100); color: var(--teal-700); font-size: .82rem; font-weight: 800; animation: case-panel-in .14s ease-out both; }
.participation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.participation-grid label { display: flex; min-height: 44px; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.participation-grid label:hover { border-color: var(--teal-600); background: var(--surface-tint); }
.participation-grid input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--teal-700); }
.participation-grid input:checked + span { color: var(--teal-700); font-weight: 850; }

.system-field { display: grid; grid-template-columns: minmax(140px, .45fr) minmax(160px, .55fr) minmax(240px, 1fr); align-items: center; gap: 14px; min-height: 58px; padding: 12px 15px; border: 1px dashed var(--line-strong); border-radius: 8px; background: #eef3f5; }
.system-field > span { color: var(--navy-900); font-weight: 800; }
.system-field small { margin-left: 5px; color: var(--teal-700); }
.system-field strong { color: var(--navy-950); }
.system-field em { color: var(--muted); font-style: normal; }

.sticky-form-footer {
    position: sticky;
    z-index: 20;
    bottom: 0;
    border-top: 1px solid var(--line-strong);
    background: rgba(255,255,255,.96);
    box-shadow: 0 -12px 28px rgba(11,31,51,.08);
    backdrop-filter: blur(10px);
}

@media (max-width: 1040px) {
    .case-registration-layout { grid-template-columns: 170px minmax(0, 1fr); }
    .registration-stepper { padding-inline: 18px; }
    .participation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .case-registration-layout { display: block; }
    .registration-stepper { position: static; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
    .registration-stepper > strong { margin-bottom: 12px; }
    .registration-stepper ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .registration-stepper li { padding: 0; }
    .registration-stepper li::after { display: none; }
    .registration-stepper a { grid-template-columns: 28px minmax(0, 1fr); gap: 7px; }
    .registration-stepper a > span { width: 28px; height: 28px; }
    .registration-stepper small { display: none; }
    .unified-case-form .form-section { padding: 24px 18px; }
    .participation-grid { grid-template-columns: 1fr; }
    .system-field { grid-template-columns: 1fr; gap: 3px; }
    .sticky-form-footer { padding: 14px 18px; }
}

.user-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 28px;
    overflow-y: auto;
    background: rgba(5, 24, 39, .62);
    backdrop-filter: blur(3px);
    animation: modal-backdrop-in .16s ease-out both;
}

.user-modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 56px);
    overflow: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(2, 18, 31, .28);
    animation: modal-panel-in .2s cubic-bezier(.2, .8, .2, 1) both;
}

.user-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px 22px;
    border-bottom: 1px solid var(--line);
}

.user-modal-header .eyebrow { margin: 0 0 5px; }
.user-modal-header h2 { margin: 0; font-size: 1.45rem; }
.user-modal-header p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.user-modal-header .modal-close { flex: 0 0 42px; font-size: 1.7rem; line-height: 1; }
.user-modal-body { padding: 26px 30px 30px; }

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

.modal-field-grid > label,
.modal-field-grid > div > label { display: grid; gap: 8px; }
.modal-field-grid label > span { color: var(--navy); font-weight: 800; }
.modal-field-grid small { color: var(--muted); line-height: 1.45; }
.modal-field-grid .field-span-2 { grid-column: 1 / -1; }
.user-modal .form-error { margin: 22px 0 0; }

.user-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 30px;
    border-top: 1px solid var(--line);
    background: #f7fafb;
}

@keyframes modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-panel-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
    .user-modal-backdrop { align-items: end; padding: 0; }
    .user-modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
    .user-modal-header, .user-modal-body { padding-left: 20px; padding-right: 20px; }
    .modal-field-grid { grid-template-columns: 1fr; }
    .modal-field-grid .field-span-2 { grid-column: auto; }
    .user-modal-footer { padding: 16px 20px; }
}
