body.practice-open { overflow: hidden; }

.practice-dialog {
    --practice-navy: #071b3a;
    --practice-blue: #1687ff;
    --practice-jade: #20b486;
    --practice-purple: #7c3aed;
    --practice-ink: #162033;
    --practice-muted: #667085;
    --practice-line: #dfe5ee;
    --practice-soft: #f5f7fa;
    position: fixed;
    inset: 0;
    z-index: 820;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.practice-dialog.is-open { display: flex; }

.practice-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 13, 29, .68);
    backdrop-filter: blur(7px);
}

.practice-shell {
    position: relative;
    width: min(1420px, 96vw);
    height: min(880px, 94vh);
    min-height: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(179, 197, 223, .78);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 28px 75px rgba(3, 15, 35, .32);
}

.practice-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--practice-line);
    background: #fff;
}

.practice-header-copy,
.practice-header-actions,
.practice-meta-row,
.practice-section-heading,
.practice-action-row,
.practice-resource-actions,
.practice-status-row,
.practice-inline-fields,
.practice-upload-copy {
    display: flex;
    align-items: center;
}

.practice-header-copy { gap: 12px; min-width: 0; }
.practice-header-copy h2 { margin: 0; color: var(--practice-ink); font-size: 18px; font-weight: 850; }
.practice-header-copy p { margin: 2px 0 0; color: var(--practice-muted); font-size: 12px; }
.practice-header-actions { gap: 10px; }

.practice-header-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    background: var(--practice-navy);
}

.practice-header-icon svg,
.practice-icon-button svg,
.practice-primary-button svg,
.practice-secondary-button svg,
.practice-danger-button svg,
.practice-sidebar-boundary svg,
.practice-empty-icon svg,
.practice-upload-copy svg { width: 18px; height: 18px; }

.practice-version-note {
    padding: 5px 8px;
    border: 1px solid #d8e1ef;
    border-radius: 6px;
    color: #47607e;
    background: #f7f9fc;
    font-size: 11px;
    font-weight: 750;
}

.practice-icon-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--practice-line);
    border-radius: 7px;
    color: #56657a;
    background: #fff;
    cursor: pointer;
}

.practice-icon-button:hover { color: var(--practice-blue); border-color: #a9cdf7; background: #f3f8ff; }

.practice-workspace {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    background: var(--practice-soft);
}

.practice-sidebar {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-right: 1px solid var(--practice-line);
    background: #fff;
}

.practice-primary-button,
.practice-secondary-button,
.practice-danger-button,
.practice-text-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.practice-primary-button { color: #fff; background: var(--practice-blue); }
.practice-primary-button:hover { background: #0574e7; }
.practice-secondary-button { color: #31557f; border-color: #bfd2e9; background: #fff; }
.practice-secondary-button:hover { color: #0b67c9; border-color: #88b7ed; background: #f3f8ff; }
.practice-danger-button { color: #b42318; border-color: #f1c3bf; background: #fff; }
.practice-danger-button:hover { background: #fff3f2; }
.practice-text-button { min-height: 32px; padding: 5px 9px; color: #2563a9; background: transparent; }
.practice-text-button:hover { background: #edf6ff; }
.practice-primary-button:disabled,
.practice-secondary-button:disabled,
.practice-danger-button:disabled { cursor: not-allowed; opacity: .48; }
.practice-create-button { width: 100%; }

.practice-sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 2px 8px;
    color: #6b7789;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.practice-sidebar-title span:last-child {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 6px;
    text-align: center;
    background: #eef3f8;
}

.practice-instance-list {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.practice-list-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    text-align: left;
    color: var(--practice-ink);
    background: transparent;
    cursor: pointer;
}

.practice-list-item:hover { background: #f4f7fb; }
.practice-list-item.is-active { border-color: #b7d8ff; background: #edf6ff; }
.practice-list-indicator { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #98a2b3; }
.practice-list-item[data-state="in_progress"] .practice-list-indicator { background: var(--practice-jade); }
.practice-list-item[data-state="submitted"] .practice-list-indicator,
.practice-list-item[data-state="reviewed"] .practice-list-indicator { background: var(--practice-purple); }
.practice-list-title { display: block; overflow: hidden; color: #203049; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.practice-list-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; color: #78869a; font-size: 10px; }

.practice-sidebar-boundary {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid var(--practice-line);
    color: #66758a;
}
.practice-sidebar-boundary svg { color: var(--practice-jade); }
.practice-sidebar-boundary p { margin: 0; font-size: 11px; line-height: 1.55; }

.practice-detail {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 22px clamp(18px, 3vw, 42px) 34px;
    outline: none;
}

.practice-detail-inner { width: min(980px, 100%); margin: 0 auto; }

.practice-loading-state,
.practice-empty-state {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #7a8798;
    text-align: center;
}

.practice-loading-state svg { width: 24px; height: 24px; animation: practice-spin .85s linear infinite; }
@keyframes practice-spin { to { transform: rotate(360deg); } }
.practice-empty-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 8px; color: var(--practice-blue); background: #eaf4ff; }
.practice-empty-state h3 { margin: 2px 0 0; color: var(--practice-ink); font-size: 18px; }
.practice-empty-state p { max-width: 520px; margin: 0; font-size: 13px; line-height: 1.7; }

.practice-detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--practice-line);
}
.practice-detail-header h3 { margin: 8px 0 7px; color: var(--practice-ink); font-size: clamp(20px, 2.2vw, 28px); font-weight: 860; line-height: 1.3; }
.practice-detail-header p { max-width: 780px; margin: 0; color: #5f6d80; font-size: 13px; line-height: 1.75; }
.practice-meta-row { flex-wrap: wrap; gap: 6px; }

.practice-chip,
.practice-status-chip,
.practice-resource-kind {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid #d7e0eb;
    border-radius: 6px;
    padding: 3px 7px;
    color: #55667d;
    background: #fff;
    font-size: 10px;
    font-weight: 800;
}
.practice-status-chip { color: #075f4d; border-color: #a9decf; background: #ecfbf6; }
.practice-status-chip[data-state="submitted"],
.practice-status-chip[data-state="reviewed"] { color: #5f2fba; border-color: #d5c1fa; background: #f5f0ff; }
.practice-status-chip[data-state="cancelled"] { color: #8a413b; border-color: #efcbc6; background: #fff5f3; }

.practice-score-summary {
    min-width: 172px;
    padding: 12px;
    border: 1px solid #cbd9e9;
    border-radius: 8px;
    background: #fff;
}
.practice-score-summary small { display: block; color: #728095; font-size: 10px; font-weight: 750; }
.practice-score-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.practice-score-values span { display: grid; place-items: center; min-height: 42px; border-radius: 6px; color: #17355e; background: #edf4fb; font-size: 16px; font-weight: 900; }
.practice-score-summary p { margin-top: 8px; font-size: 10px; line-height: 1.45; }

.practice-section { padding: 21px 0; border-bottom: 1px solid var(--practice-line); }
.practice-section:last-child { border-bottom: 0; }
.practice-section-heading { justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.practice-section-heading h4 { margin: 0; color: #23324a; font-size: 14px; font-weight: 850; }
.practice-section-heading p { margin: 0; color: #7b8796; font-size: 11px; }
.practice-relation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.practice-relation-item { padding: 12px; border-left: 3px solid #6aa9ee; background: #f6f9fd; }
.practice-relation-item span { display: block; color: #758399; font-size: 10px; font-weight: 750; }
.practice-relation-item strong { display: block; margin-top: 5px; color: #26364d; font-size: 12px; line-height: 1.55; }

.practice-plan-form,
.practice-submit-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #d9e1ea;
    border-radius: 8px;
    background: #fff;
}
.practice-field { display: grid; gap: 6px; }
.practice-field label { color: #39475a; font-size: 11px; font-weight: 850; }
.practice-field input,
.practice-field textarea,
.practice-field select {
    width: 100%;
    border: 1px solid #cfd8e4;
    border-radius: 6px;
    padding: 9px 10px;
    color: #1d2939;
    background: #fff;
    font: inherit;
    font-size: 12px;
    outline: none;
}
.practice-field textarea { min-height: 92px; resize: vertical; line-height: 1.65; }
.practice-field input:focus,
.practice-field textarea:focus,
.practice-field select:focus { border-color: #79afe9; box-shadow: 0 0 0 3px rgba(22, 135, 255, .11); }
.practice-inline-fields { align-items: stretch; gap: 10px; }
.practice-inline-fields .practice-field { flex: 1; }

.practice-step-list,
.practice-resource-list,
.practice-feedback-list,
.practice-attachment-list { display: grid; gap: 8px; }
.practice-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
}
.practice-step + .practice-step { border-top: 1px solid #edf0f4; }
.practice-step-number { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #b9c9da; border-radius: 50%; color: #4d627c; background: #fff; font-size: 11px; font-weight: 900; }
.practice-step.is-complete .practice-step-number { color: #fff; border-color: var(--practice-jade); background: var(--practice-jade); }
.practice-step h5 { margin: 0; color: #26364c; font-size: 13px; font-weight: 850; }
.practice-step p { margin: 4px 0 0; color: #66758a; font-size: 11px; line-height: 1.6; }
.practice-step-output { color: #286596 !important; }

.practice-resource {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #d9e2ec;
    border-radius: 7px;
    background: #fff;
}
.practice-resource h5 { margin: 0; color: #26364d; font-size: 12px; font-weight: 850; }
.practice-resource p { margin: 5px 0 0; color: #6d7a8d; font-size: 11px; line-height: 1.55; }
.practice-resource-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.practice-resource-kind[data-kind="required"] { color: #9a6700; border-color: #edcf8f; background: #fff9e8; }
.practice-resource-kind[data-kind="remedial"] { color: #6f42c1; border-color: #d7c5f3; background: #f8f4ff; }
.practice-resource-actions { flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.practice-resource-visit { color: #16815f; font-size: 10px; font-weight: 750; }

.practice-notice-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.practice-notice-list li { position: relative; padding-left: 17px; color: #59687b; font-size: 11px; line-height: 1.65; }
.practice-notice-list li::before { content: ''; position: absolute; left: 2px; top: .65em; width: 5px; height: 5px; border-radius: 50%; background: #7c8fa8; }

.practice-rubric-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.practice-rubric-check { display: flex; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid #e1e6ed; border-radius: 6px; color: #48566a; background: #fafbfc; font-size: 11px; line-height: 1.5; }
.practice-rubric-check input { margin-top: 2px; accent-color: var(--practice-blue); }

.practice-upload {
    position: relative;
    display: block;
    padding: 12px;
    border: 1px dashed #9fb4cb;
    border-radius: 7px;
    color: #4d627d;
    background: #f8fbff;
    cursor: pointer;
}
.practice-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.practice-upload-copy { gap: 9px; font-size: 11px; font-weight: 750; }
.practice-upload-copy svg { color: var(--practice-blue); }
.practice-attachment-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.practice-attachment { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid #d7dfe9; border-radius: 6px; background: #f4f6f8; }
.practice-attachment img { width: 100%; height: 100%; object-fit: cover; }
.practice-attachment button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(8, 19, 35, .75); cursor: pointer; }

.practice-feedback {
    padding: 13px;
    border-left: 3px solid var(--practice-purple);
    background: #f8f5ff;
}
.practice-feedback h5 { margin: 0; color: #4f2b91; font-size: 12px; font-weight: 850; }
.practice-feedback p { margin: 6px 0 0; color: #5e5272; font-size: 11px; line-height: 1.7; }
.practice-boundary-callout { padding: 12px; border: 1px solid #b9ddd2; border-radius: 7px; color: #175b4b; background: #f0fbf7; font-size: 11px; line-height: 1.65; }
.practice-action-row { flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.practice-toast {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 16px);
    max-width: min(620px, calc(100% - 36px));
    padding: 9px 13px;
    border-radius: 7px;
    color: #fff;
    background: #16253b;
    box-shadow: 0 10px 28px rgba(7, 19, 38, .26);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.practice-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.practice-toast.is-error { background: #9d2b25; }

.practice-empty-note {
    padding: 12px;
    border: 1px dashed #cbd6e3;
    border-radius: 7px;
    color: #69788d;
    background: #f8fafc;
    font-size: 11px;
    line-height: 1.6;
}

.profile-practice-evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-practice-evidence-card { padding: 13px; border: 1px solid #cbd9e8; border-radius: 7px; background: #f8fbff; }
.profile-practice-evidence-card h4 { margin: 0; color: #23364f; font-size: 13px; font-weight: 850; }
.profile-practice-evidence-card p { margin: 7px 0 0; color: #607087; font-size: 11px; line-height: 1.65; }
.profile-practice-evidence-card button { margin-top: 9px; }

@media (max-width: 980px) {
    .practice-dialog { padding: 8px; }
    .practice-shell { width: 100%; height: 98vh; min-height: 0; }
    .practice-header { min-height: 64px; padding: 10px 12px; }
    .practice-version-note { display: none; }
    .practice-workspace { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .practice-sidebar { max-height: 172px; border-right: 0; border-bottom: 1px solid var(--practice-line); }
    .practice-instance-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 42vw); overflow-x: auto; overflow-y: hidden; }
    .practice-sidebar-title { margin-top: 10px; }
    .practice-sidebar-boundary { display: none; }
    .practice-detail { padding: 18px 14px 28px; }
    .practice-detail-header { grid-template-columns: 1fr; }
    .practice-score-summary { width: 100%; }
    .practice-relation-grid,
    .practice-rubric-list,
    .profile-practice-evidence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .practice-header-copy p { display: none; }
    .practice-header-icon { width: 34px; height: 34px; }
    .practice-detail-header h3 { font-size: 20px; }
    .practice-step { grid-template-columns: 28px minmax(0, 1fr); }
    .practice-step > :last-child { grid-column: 2; justify-self: start; }
    .practice-resource { grid-template-columns: 1fr; }
    .practice-resource-actions { justify-content: flex-start; }
    .practice-inline-fields { flex-direction: column; }
    .practice-attachment-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .practice-action-row > button { flex: 1 1 140px; }
}

@media (max-height: 720px) and (min-width: 981px) {
    .practice-shell { height: 96vh; min-height: 560px; }
    .practice-header { min-height: 62px; }
    .practice-detail { padding-top: 16px; }
}
