.model-family { border: 0; margin: 0 0 22px; min-width: 0; }
.model-family legend { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.model-family-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.model-family-options label { position: relative; cursor: pointer; }
.model-family-options input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.model-family-options span { display: flex; flex-direction: column; gap: 7px; padding: 17px 15px; border: 1px solid var(--border-strong); border-radius: 12px; transition: background .18s, border-color .18s; }
.model-family-options strong { font-size: 20px; letter-spacing: -.03em; }
.model-family-options small { color: var(--text-2); font-size: 11px; }
.model-family-options label:has(input[value="p"]) { --family-color: #2467c4; --family-soft: #eaf2ff; }
.model-family-options label:has(input[value="h"]) { --family-color: #8750b8; --family-soft: #f4edfc; }
.model-family-options span { border-top: 3px solid var(--family-color); }
.model-family-options strong { color: var(--family-color); }
.model-family-options input:checked + span { background: var(--family-soft); border-color: var(--family-color); color: var(--family-color); box-shadow: inset 0 0 0 1px var(--family-color); }
.model-family-options input:checked + span small { color: var(--family-color); }
.model-family-options input:focus-visible + span { outline: 3px solid #84b8ef; outline-offset: 3px; }
.family-description { font-size: 12px; line-height: 1.65; color: var(--text-2); margin-top: 10px; min-height: 40px; }
.texture-section { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 14px; margin-top: 4px; border-top: 1px solid var(--border); }
.texture-section strong { font-size: 14px; }
.texture-section small { font-size: 11px; color: var(--text-3); }
.toggle-field { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.toggle-field > label:first-child { margin-bottom: 0; }
.toggle-field > .hint { grid-column: 1 / -1; }
.toggle-field .toggle-switch { margin-bottom: 0; }
.toggle-field .toggle-switch input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle-field .toggle-switch input:focus-visible + .toggle-slider { outline: 3px solid #84b8ef; outline-offset: 3px; }
.model-workspace .hint { color: #777b84; }
.model-workspace .right-panel { min-width: 0; }
.model-results-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 22px; }
.model-results-heading[hidden] { display: none; }
.model-results-heading h2 { font-size: 20px; font-weight: 600; }
.model-results-heading p { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.model-results-heading > span { font-size: 11px; color: var(--text-3); letter-spacing: .08em; }
.model-workspace .task-list { display: flex; flex-direction: column; max-width: none; gap: 24px; }
.model-batch[data-family="p"], .model-task[data-family="p"] { --family-color: #2467c4; --family-soft: #eaf2ff; --family-border: #c9dcf7; }
.model-batch[data-family="h"], .model-task[data-family="h"] { --family-color: #8750b8; --family-soft: #f4edfc; --family-border: #deccec; }
.model-batch { min-width: 0; padding: 0 12px 12px; border: 1px solid var(--family-border); border-top: 3px solid var(--family-color); border-radius: 16px; background: var(--family-soft); }
.model-batch-header { position: static; height: auto; min-height: 56px; padding: 12px 2px; background: transparent; border: none; box-shadow: none; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.model-batch-header > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.model-batch-header { z-index: auto; backdrop-filter: none; -webkit-backdrop-filter: none; }
.model-batch-header strong { color: var(--family-color); font-size: 15px; }
.model-batch-header span, .model-batch-header time { font-size: 11px; color: #647187; }
.model-batch-header .batch-progress { color: var(--family-color); }
.batch-models { display: flex; align-items: stretch; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: var(--family-border) transparent; }
.batch-models > .model-task { flex: 1 0 270px; max-width: 420px; scroll-snap-align: start; border-color: var(--family-border); }
.model-task .progress-bar { background: var(--family-color); }
.model-workspace .task-list-placeholder { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; border: 1px dashed var(--border-strong); border-radius: 18px; min-height: 440px; background: var(--surface); }
.model-workspace .task-list-placeholder svg { width: 72px; stroke: #adb9cc; stroke-width: 1.5; margin-bottom: 10px; }
.model-workspace .task-list-placeholder strong { color: var(--text-2); font-size: 16px; font-weight: 500; }
.model-workspace .task-list-placeholder p { font-size: 12px; }
.model-task { padding: 16px; min-width: 0; }
.model-task .task-row-header { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-height: 58px; margin-bottom: 16px; }
.model-task .task-row-header > div:last-child { margin-left: auto; }
.model-task .param-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.model-task .param-tag { font-size: 10px; padding: 4px 7px; color: #606b7b; background: #f3f5f8; border: none; }
.model-task .param-tag.family-tag { color: var(--family-color); background: var(--family-soft); font-weight: 600; }
.model-task .progress-text { text-align: left; min-height: 18px; line-height: 1.55; margin-bottom: 12px; }
.model-task .progress-wrap { height: 5px; margin-bottom: 9px; }
.model-preview-frame { position: relative; min-height: 310px; overflow: hidden; border: 1px solid #e3e8ee; border-radius: 12px; background: radial-gradient(ellipse at center, #fff 0%, #f1f4f8 100%); }
.model-preview-placeholder { height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 28px 18px; text-align: center; }
.model-preview-placeholder[hidden] { display: none; }
.model-preview-icon { width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.model-preview-icon svg { width: 80px; stroke: #9baec8; stroke-width: 1.5; }
.model-preview-icon img { width: 120px; height: 120px; object-fit: contain; border-radius: 12px; background: white; box-shadow: 0 8px 26px #234b7620; }
.preview-phase { font-weight: 500; font-size: 14px; color: #46566d; }
.preview-explanation { font-size: 11px; color: #7a8798; }
.preview-corner { position: absolute; left: 13px; top: 12px; font-size: 10px; color: #78889b; letter-spacing: .08em; pointer-events: none; z-index: 1; }
.model-task .model-cards { width: 100%; gap: 12px; }
.progressive-model-card { cursor: default; }
.progressive-model-card.preview-pending { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.preview-stage-label { font-size: 11px; color: var(--family-color); }
.preview-load-hint { margin-top: 8px; }
.preview-load-hint button { margin-left: 8px; }
#overlay-model-stage { color: white; background: #26374e; border-radius: 20px; padding: 8px 16px; margin-bottom: 12px; font-size: 13px; }
.model-task .model-card { width: 100%; height: auto; border: 0; border-radius: 0; box-shadow: none; }
.model-task .model-card:hover { transform: none; box-shadow: none; }
.model-task .model-card model-viewer { height: 310px !important; background: #eef2f7 !important; }
.model-task .model-card .card-info { min-height: 44px; }
.model-task .model-card .view3d-btn { background: transparent !important; }
.model-task .local-model-actions { gap: 7px !important; margin: 12px 0 6px !important; }
.model-task .local-model-actions .apply-btn { font-size: 11px; padding: 6px 10px; text-decoration: none; }
.model-task .local-model-hint { font-size: 11px; line-height: 1.6; }
.model-task .quad-file-link { display: inline-block; text-decoration: none; margin-top: 10px; background: #e8f3ed; color: #1e7652; }
.model-task .local-model-actions .quad-file-link { margin-top: 0; }
.model-task .quad-file-note { font-size: 11px; margin-top: 8px; }
.model-task[data-phase="complete"] .progress-bar { background: var(--family-color); }
@media (min-width: 801px) {
  .model-workspace [data-pkey="model_family"] { position: sticky; top: -24px; z-index: 3; padding-top: 18px; background: var(--surface); border-bottom: 1px solid var(--border); margin-bottom: 16px; }
  .model-workspace .model-family { margin-bottom: 12px; }
}
@media (max-width: 800px) {
  .model-workspace .left-panel { max-height: none; overflow: visible; }
  .model-workspace .right-panel { padding: 22px 16px; overflow: visible; min-height: 450px; }
  .batch-models > .model-task { flex: 0 0 min(320px, 100%); max-width: none; }
  .model-workspace .task-list-placeholder { min-height: 300px; }
  .model-task .task-row-header .time { font-size: 10px; }
}
