/* TLF mock-shell scan — Stage 1 (Add TLF AI tab + full-page flow).
   Split out of clinical-ai-wc.css so this surface owns its styles.
 */

.project-tlf-setup-ai-tab,
.project-tlf-shell-scan-flow {
    /* Grays/navy/danger already exist as global design tokens (see tlf-compare-result.css,
       tlf-validation-result.css) — reuse them instead of a page-local copy. The teal accent
       and danger-bg/border tints have no existing global equivalent, so stay page-local. */
    --tlf-scan-navy-700: var(--navy-700, #1b3147);
    --tlf-scan-teal-700: #0F7A65;
    --tlf-scan-teal-600: #14967D;
    --tlf-scan-teal-500: #1ABC9C;
    --tlf-scan-teal-200: #A6E0CF;
    --tlf-scan-teal-100: #E0F5EE;
    --tlf-scan-teal-050: #f1faf7;
    --tlf-scan-gray-900: var(--text-primary, #111827);
    --tlf-scan-gray-600: var(--text-secondary, #5C6878);
    --tlf-scan-gray-400: var(--gray-400, #9CA3AF);
    --tlf-scan-gray-300: var(--gray-300, #C6CFD8);
    --tlf-scan-gray-250: var(--border-default, #DDE3EC);
    --tlf-scan-gray-100: #F4F6F9;
    --tlf-scan-gray-050: var(--surface-sunken, #F8F9FB);
    --tlf-scan-danger: var(--danger, #bf2f2f);
    --tlf-scan-danger-bg: #fee2e2;
    --tlf-scan-danger-border: #fecaca;
}

.project-tlf-setup-ai-tab {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-height: 14.75rem;
    padding: 4px 2px 8px;
}

.project-tlf-shell-scan-intro-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.project-tlf-shell-scan-intro-icon,
.project-tlf-shell-scan-flow-ai-icon,
.project-tlf-shell-scan-block-ai-icon {
    flex-shrink: 0;
    color: var(--tlf-scan-teal-600);
}

.project-tlf-shell-scan-intro-icon {
    margin-top: 3px;
}

.project-tlf-shell-scan-flow-title-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.project-tlf-shell-scan-intro {
    font-size: 12.5px;
    color: var(--tlf-scan-gray-600);
    line-height: 1.6;
}

.project-tlf-shell-scan-doc-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--tlf-scan-gray-250);
    border-radius: 8px;
    background: #fff;
}

.project-tlf-shell-scan-doc-icon {
    width: 28px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tlf-scan-gray-250);
    border-radius: 3px;
    background: linear-gradient(#fff, var(--tlf-scan-gray-050));
    color: var(--tlf-scan-teal-600);
    flex-shrink: 0;
}

.project-tlf-shell-scan-doc-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--tlf-scan-gray-900);
}

.project-tlf-shell-scan-doc-meta {
    font-size: 11.5px;
    color: var(--tlf-scan-gray-600);
    margin-top: 2px;
}

.project-tlf-shell-scan-doc-role {
    display: inline-flex;
    margin-top: 6px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--tlf-scan-teal-700);
    background: var(--tlf-scan-teal-050);
    border: 1px solid var(--tlf-scan-teal-100);
    border-radius: 99px;
    padding: 2px 8px;
}

.project-tlf-shell-scan-empty-pin {
    font-size: 12.5px;
    color: var(--tlf-scan-gray-600);
    line-height: 1.55;
    padding: 10px 12px;
    border: 1px dashed var(--tlf-scan-gray-300);
    border-radius: 8px;
    background: var(--tlf-scan-gray-050);
}

.project-tlf-shell-scan-block-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-tlf-shell-scan-block {
    border: 1px solid var(--tlf-scan-gray-250);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.project-tlf-shell-scan-block.is-emph {
    border-color: var(--tlf-scan-teal-200);
    background: var(--tlf-scan-teal-050);
}

.project-tlf-shell-scan-block.is-halt {
    border-color: var(--tlf-scan-gray-300);
    background: var(--tlf-scan-gray-050);
}

.project-tlf-shell-scan-block.is-fail {
    border-color: var(--tlf-scan-danger-border);
    background: #fef2f2;
}

.project-tlf-shell-scan-block-hd {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tlf-scan-gray-400);
    padding: 9px 14px 0;
}

.project-tlf-shell-scan-block-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 8px 14px 12px;
}

.project-tlf-shell-scan-block-ico {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 11px;
    font-weight: 700;
}

.project-tlf-shell-scan-block-ico.is-live,
.project-tlf-shell-scan-block-ico.is-ok {
    background: var(--tlf-scan-teal-100);
    color: var(--tlf-scan-teal-700);
}

.project-tlf-shell-scan-block-ico.is-halt {
    background: #fff;
    border: 1.5px solid var(--tlf-scan-navy-700);
    color: var(--tlf-scan-navy-700);
}

.project-tlf-shell-scan-block-ico.is-fail {
    background: var(--tlf-scan-danger-bg);
    color: var(--tlf-scan-danger);
}

.project-tlf-shell-scan-block-ico.is-none {
    background: #fff;
    border: 1.5px dashed var(--tlf-scan-gray-300);
    color: var(--tlf-scan-gray-400);
}

.project-tlf-shell-scan-block-text {
    flex: 1;
    min-width: 0;
}

.project-tlf-shell-scan-block-line1 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.project-tlf-shell-scan-block-line2 {
    font-size: 11.5px;
    color: var(--tlf-scan-gray-600);
    margin-top: 2px;
    line-height: 1.55;
}

.project-tlf-shell-scan-block-error {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    color: var(--tlf-scan-danger);
    margin-top: 5px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tlf-shell-scan-block-acts {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-top: 1px;
}

.project-tlf-shell-scan-blocked-note {
    font-size: 11.5px;
    color: var(--tlf-scan-gray-600);
    line-height: 1.55;
}

.project-tlf-shell-scan-flow {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    background: var(--tlf-scan-gray-100);
}

.project-tlf-shell-scan-flow-hdr {
    background: #fff;
    border-bottom: 1px solid var(--tlf-scan-gray-250);
    padding: 12px 20px 10px;
    flex-shrink: 0;
}

.project-tlf-shell-scan-flow-hdr-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-tlf-shell-scan-flow-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--tlf-scan-gray-900);
}

.project-tlf-shell-scan-flow-spacer {
    flex: 1;
}

.project-tlf-shell-scan-flow-doc {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--tlf-scan-gray-400);
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-tlf-shell-scan-flow-hdr nph-stepper-bar {
    display: block;
    margin-top: 12px;
}

.project-tlf-shell-scan-flow-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 20px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-tlf-shell-scan-progress-wrap {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-bottom: 24px;
}

.project-tlf-shell-scan-card {
    width: 560px;
    max-width: 100%;
    background: #fff;
    border: 1px solid var(--tlf-scan-gray-250);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(13, 27, 42, 0.05);
    overflow: hidden;
}

.project-tlf-shell-scan-card-top {
    padding: 26px 28px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 9px;
}

.project-tlf-shell-scan-mark {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tlf-scan-teal-050);
    border: 1px solid var(--tlf-scan-teal-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tlf-scan-teal-600);
    font-weight: 700;
}

.project-tlf-shell-scan-mark.is-fin {
    background: var(--tlf-scan-teal-100);
    border-color: var(--tlf-scan-teal-200);
    color: var(--tlf-scan-teal-700);
}

.project-tlf-shell-scan-mark.is-err {
    background: var(--tlf-scan-danger-bg);
    border-color: var(--tlf-scan-danger-border);
    color: var(--tlf-scan-danger);
}

.project-tlf-shell-scan-head {
    font-size: 15.5px;
    font-weight: 600;
}

.project-tlf-shell-scan-sub {
    font-size: 12.5px;
    color: var(--tlf-scan-gray-600);
    line-height: 1.6;
    max-width: 400px;
}

.project-tlf-shell-scan-doc {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--tlf-scan-gray-400);
}

.project-tlf-shell-scan-steps {
    display: flex;
    align-items: flex-start;
    padding: 0 28px 22px;
}

.project-tlf-shell-scan-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    width: 96px;
}

.project-tlf-shell-scan-node {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    background: #fff;
    border: 1.5px solid var(--tlf-scan-gray-250);
    color: var(--tlf-scan-gray-400);
}

.project-tlf-shell-scan-node.is-done {
    background: var(--tlf-scan-teal-500);
    border-color: var(--tlf-scan-teal-500);
    color: #fff;
}

.project-tlf-shell-scan-node.is-active {
    border-color: var(--tlf-scan-teal-500);
    color: var(--tlf-scan-teal-600);
    box-shadow: 0 0 0 4px var(--tlf-scan-teal-100);
}

.project-tlf-shell-scan-node.is-halt {
    background: var(--tlf-scan-danger-bg);
    border-color: var(--tlf-scan-danger);
    color: var(--tlf-scan-danger);
}

.project-tlf-shell-scan-step-lbl {
    font-size: 11.5px;
    text-align: center;
    line-height: 1.35;
    color: var(--tlf-scan-gray-400);
}

.project-tlf-shell-scan-step-lbl.is-done {
    color: var(--tlf-scan-gray-600);
}

.project-tlf-shell-scan-step-lbl.is-active {
    color: var(--tlf-scan-teal-700);
    font-weight: 600;
}

.project-tlf-shell-scan-step-lbl.is-halt {
    color: var(--tlf-scan-danger);
    font-weight: 600;
}

.project-tlf-shell-scan-rail {
    flex: 1;
    height: 1.5px;
    background: var(--tlf-scan-gray-250);
    margin: 12.5px 6px 0;
    min-width: 14px;
    border-radius: 1px;
    overflow: hidden;
}

.project-tlf-shell-scan-rail.is-done {
    background: var(--tlf-scan-teal-200);
}

.project-tlf-shell-scan-meter {
    margin: 0 28px 20px;
    height: 4px;
    border-radius: 99px;
    background: var(--tlf-scan-gray-100);
    overflow: hidden;
    position: relative;
}

.project-tlf-shell-scan-meter::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 34%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--tlf-scan-teal-200), var(--tlf-scan-teal-500), var(--tlf-scan-teal-200));
    animation: project-tlf-shell-scan-meter 1.7s linear infinite;
}

.project-tlf-shell-scan-detail {
    border-top: 1px solid var(--tlf-scan-gray-250);
    background: var(--tlf-scan-gray-050);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
}

.project-tlf-shell-scan-fact {
    font-size: 11.5px;
    color: var(--tlf-scan-gray-600);
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.project-tlf-shell-scan-fact-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
    color: var(--tlf-scan-gray-900);
}

.project-tlf-shell-scan-reassure {
    font-size: 11.5px;
    color: var(--tlf-scan-gray-400);
    margin-left: auto;
}

.project-tlf-shell-scan-err {
    margin: 0 28px 16px;
    padding: 10px 12px;
    border-left: 2px solid var(--tlf-scan-danger);
    background: var(--tlf-scan-danger-bg);
    border-radius: 0 6px 6px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--tlf-scan-danger);
    line-height: 1.65;
    text-align: left;
    word-break: break-word;
}

.project-tlf-shell-scan-acts {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 28px 22px;
}

.project-tlf-shell-scan-page-hdr {
    flex-shrink: 0;
}

.project-tlf-shell-scan-page-title {
    font-size: 18px;
    font-weight: 600;
}

.project-tlf-shell-scan-page-subtitle {
    font-size: 12.5px;
    color: var(--tlf-scan-gray-600);
    margin-top: 4px;
}

.project-tlf-shell-scan-stale-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: 1px solid var(--tlf-scan-gray-300);
    border-left: 3px solid var(--tlf-scan-navy-700);
    border-radius: 6px;
    background: var(--tlf-scan-gray-050);
    font-size: 12.5px;
    color: var(--tlf-scan-gray-600);
}

.project-tlf-shell-scan-stale-emph {
    font-weight: 600;
    color: var(--tlf-scan-gray-900);
}

.project-tlf-shell-scan-stale-copy {
    flex: 1;
}

.project-tlf-shell-scan-flow-back {
    --nwc-button-color: var(--tlf-scan-gray-600);
    --button-padding: 4px 6px;
    --button-min-width: unset;
    --button-min-height: unset;
    --font-size: 12.5px;
    flex-shrink: 0;
}

.project-tlf-shell-scan-flow-back:hover,
.project-tlf-shell-scan-flow-back:focus-visible {
    --nwc-button-color: var(--tlf-scan-gray-900);
}

.project-tlf-shell-scan-flow-divider {
    width: 1px;
    height: 18px;
    background: var(--tlf-scan-gray-250);
    flex-shrink: 0;
}

.project-tlf-shell-scan-flow-body > .app-grid-page-surface {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.project-tlf-shell-scan-flow-body .app-grid-page-grid-shell {
    flex: 1;
    min-height: 0;
    height: auto;
}

@keyframes project-tlf-shell-scan-meter {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.project-tlf-shell-scan-page-hdr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.project-tlf-shell-scan-page-titles {
    min-width: 0;
    flex: 1;
}

.project-tlf-shell-scan-page-acts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.project-tlf-shell-scan-checkbox-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 28px;
}

.project-tlf-shell-scan-checkbox-cell nph-checkbox,
.project-tlf-shell-scan-checkbox-cell .wc-checkbox {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.project-tlf-shell-scan-gen-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--tlf-scan-gray-250, #e2e8f0);
    border-radius: 8px;
    background: var(--tlf-scan-gray-50, #f8fafc);
}

.project-tlf-shell-scan-gen-progress-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.project-tlf-shell-scan-gen-progress-icon.is-done {
    background: var(--tlf-scan-teal, #0d9488);
    color: #fff;
}

.project-tlf-shell-scan-gen-pstat {
    font-size: 13px;
    line-height: 16px;
    color: var(--text-secondary, #4a5568);
}

.project-tlf-shell-scan-gen-pbar {
    flex: 1;
    min-width: 120px;
    height: 6px;
    border-radius: 999px;
    background: var(--tlf-scan-gray-250, #e2e8f0);
    overflow: hidden;
}

.project-tlf-shell-scan-gen-pbar-fill {
    height: 100%;
    background: var(--tlf-scan-teal, #0d9488);
    border-radius: 999px;
}

.project-tlf-shell-scan-gen-reassure {
    font-size: 12px;
    color: var(--text-muted, #718096);
}

.project-tlf-shell-scan-gen-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    vertical-align: middle;
}

.project-tlf-shell-scan-gen-status-label {
    display: inline-flex;
    align-items: center;
    line-height: 16px;
}

.project-tlf-shell-scan-gen-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 0;
}

.project-tlf-shell-scan-gen-icon.is-done {
    background: var(--tlf-scan-teal, #0d9488);
    color: #fff;
}

.project-tlf-shell-scan-gen-icon.is-failed {
    background: var(--tlf-scan-navy, #1a2b4a);
    color: #fff;
}

.project-tlf-shell-scan-gen-icon.is-running {
    background: transparent;
}

.project-tlf-shell-scan-preview-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
}

.project-tlf-shell-scan-preview-tabs {
    width: 100%;
}

.project-tlf-shell-scan-preview-body > nph-tab-panel.project-tlf-shell-scan-preview-tabs {
    width: 100%;
}

.project-tlf-shell-scan-preview-page {
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.project-tlf-shell-scan-preview-state {
    font-size: 13px;
    color: var(--tlf-scan-gray-600);
    padding: 24px 8px;
    text-align: center;
}

.project-tlf-shell-scan-preview-image-wrap {
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--tlf-scan-gray-250);
    border-radius: 6px;
    background: var(--tlf-scan-gray-050, #f4f6f9);
}

.project-tlf-shell-scan-preview-image {
    display: block;
    width: 100%;
    height: auto;
}

.project-tlf-shell-scan-preview-footer {
    display: flex;
    justify-content: flex-end;
}

