.g-shell { width:min(1700px,calc(100% - 32px)); margin:0 auto 48px; }
.g-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:clamp(16px,3vw,30px); margin:20px 0; }
.g-heading { font-family:var(--serif); font-size:clamp(1.8rem,4vw,3rem); }
.g-actions,.g-filters,.label-list { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:16px 0; }
.g-filters label { display:grid; gap:5px; }
.g-shell input,.g-shell select,.g-shell textarea,.g-shell button { font:inherit; }
.g-shell select,.g-shell input:not([type=checkbox]),.g-shell textarea { max-width:100%; padding:9px; border:1px solid var(--line); border-radius:6px; }
.g-shell textarea { width:100%; min-height:80px; }
.g-shell button,.g-button { display:inline-block; padding:10px 16px; border:0; border-radius:20px; background:var(--navy); color:white; text-decoration:none; cursor:pointer; line-height:1.5; }
.g-shell button:disabled { opacity:.5; cursor:not-allowed; }
.g-shell label input[type=checkbox] { accent-color:var(--teal); width:auto; margin-right:7px; }
.g-layout { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(280px,1fr); gap:24px; }
.narrative { white-space:pre-wrap; line-height:1.8; font-size:1.08rem; overflow-wrap:anywhere; }
.ner-mark { text-decoration:underline; text-decoration-color:var(--teal); text-decoration-thickness:2px; text-underline-offset:3px; cursor:pointer; background:rgba(13,148,136,.06); }
.ner-mark:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline:3px solid #0d9488; outline-offset:3px; }
.label-list label { font-size:.8rem; }

/* Colores estables por etiqueta; en solapamientos se conservan todas las líneas. */
.ner-type-0 { --ner-color: #8b1d3b; }
.ner-type-1 { --ner-color: #8a4b08; }
.ner-type-2 { --ner-color: #4d648d; }
.ner-type-3 { --ner-color: #7a367a; }
.ner-type-4 { --ner-color: #786409; }
.ner-type-5 { --ner-color: #a62636; }
.ner-type-6 { --ner-color: #376b7e; }
.ner-type-7 { --ner-color: #6846a5; }
.ner-type-8 { --ner-color: #286053; }
.ner-type-9 { --ner-color: #485a9b; }
.ner-type-10 { --ner-color: #6a563c; }
.ner-type-11 { --ner-color: #555555; }
.ner-type-12 { --ner-color: #006b62; }
.ner-type-13 { --ner-color: #8c3c64; }
.ner-type-14 { --ner-color: #126390; }
.ner-type-15 { --ner-color: #7b551a; }
.ner-type-16 { --ner-color: #a84600; }
.ner-type-17 { --ner-color: #3d6b29; }
.ner-type-18 { --ner-color: #8b3250; }
.ner-type-19 { --ner-color: #586d1a; }
.ner-type-20 { --ner-color: #695574; }
.ner-type-21 { --ner-color: #81503b; }
.ner-depth-0 { text-underline-offset: 3px; }
.ner-depth-1 { text-underline-offset: 6px; }
.ner-depth-2 { text-underline-offset: 9px; }
.ner-depth-3 { text-underline-offset: 12px; }
.ner-depth-4 { text-underline-offset: 15px; }
.ner-depth-5 { text-underline-offset: 18px; }
.ner-depth-6 { text-underline-offset: 21px; }
.ner-depth-7 { text-underline-offset: 24px; }
.ner-depth-8 { text-underline-offset: 27px; }
.ner-depth-9 { text-underline-offset: 30px; }
.ner-depth-10 { text-underline-offset: 33px; }
.ner-depth-11 { text-underline-offset: 36px; }
.ner-depth-12 { text-underline-offset: 39px; }
.ner-depth-13 { text-underline-offset: 42px; }
.ner-depth-14 { text-underline-offset: 45px; }
.ner-depth-15 { text-underline-offset: 48px; }
.ner-depth-16 { text-underline-offset: 51px; }
.ner-depth-17 { text-underline-offset: 54px; }
.ner-depth-18 { text-underline-offset: 57px; }
.ner-depth-19 { text-underline-offset: 60px; }
.ner-depth-20 { text-underline-offset: 63px; }
.ner-depth-21 { text-underline-offset: 66px; }
.ner-mark { text-decoration: none; background: transparent; }
.ner-layer { text-decoration-line: underline; text-decoration-color: var(--ner-color); text-decoration-thickness: 2px; }
.ner-key { border-left: 4px solid var(--ner-color); padding: 5px 8px; border-radius: 4px; background: color-mix(in srgb, var(--ner-color) 9%, white); }
.label-list .ner-key input[type=checkbox] { accent-color: var(--ner-color); }
.g-status { min-height:1.6em; color:var(--teal-2); }
.g-status.error { color:#a32d2d; }
.entity-row { display:grid; grid-template-columns:2fr 1fr 1fr auto; gap:8px; align-items:center; margin:8px 0; }
.g-terms { white-space:pre-wrap; max-height:300px; overflow:auto; }
.ck-consent { display:grid; grid-template-columns:22px minmax(0,1fr); align-items:start; gap:12px; padding:14px; border:1px solid var(--line); border-radius:8px; background:#f8fbfa; cursor:pointer; line-height:1.6; }
.g-shell .ck-consent input[type=checkbox] {
 appearance:none; -webkit-appearance:none; display:block; box-sizing:border-box;
 width:22px; height:22px; min-width:22px; min-height:22px; margin:2px 0 0;
 padding:0; border:2px solid #58717a; border-radius:4px; background:#fff;
 background-position:center; background-repeat:no-repeat; cursor:pointer;
}
.g-shell .ck-consent input[type=checkbox]:checked {
 border-color:#0a766c; background-color:#0a766c;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4 10-10' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.ck-consent:has(input:checked) { border-color:#0a766c; background:#edf8f4; }
.g-shell .ck-consent input[type=checkbox]:focus-visible { outline:3px solid #0d9488; outline-offset:3px; }
#cases { width:100%; min-height:200px; }
.g-summary p { line-height:1.6; }

.ner-tools { position:sticky; top:110px; z-index:8; margin:0 0 20px; padding:16px; border:1px solid rgba(13,148,136,.35); border-radius:10px; background:#f1faf7; box-shadow:0 8px 24px rgba(10,37,64,.08); }
.ner-tools__preview { margin:0 0 12px; line-height:1.5; font-weight:650; overflow-wrap:anywhere; }
.ner-tools select { width:100%; margin-top:6px; background:white; }
.ner-tools .g-actions { gap:8px; margin:12px 0; }
.ner-tools__secondary { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.g-shell .ner-tools__secondary>button { background:transparent; color:var(--navy); padding:4px 7px; text-decoration:underline; text-underline-offset:3px; }
.ner-choices { display:flex; flex-wrap:wrap; gap:8px; }
.ner-choices p { width:100%; margin:0 0 8px; }
.g-shell .ner-choices button { padding:7px 12px; margin-bottom:12px; }
@media(max-width:800px){.ner-tools{top:130px;padding:12px}.ner-tools .g-actions button{font-size:.82rem;padding:8px 10px}}

/* Constructor de experimentos GAMA-PCa LAB */
.lab-builder { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,340px); gap:24px; align-items:start; }
.lab-builder .g-card { margin:0 0 20px; }
.lab-step__number { margin:0 0 10px; font:700 .76rem var(--mono); letter-spacing:.1em; text-transform:uppercase; color:var(--teal-2); }
.lab-step h2,.lab-run-card h2 { margin-top:0; font-family:var(--serif); }
.lab-step p,.lab-run-card p { line-height:1.65; }
#archetypeSelect { display:block; width:100%; margin-top:10px; padding:14px; background:white; }
.lab-hint { color:var(--muted); font-size:.88rem; }
.lab-cases { display:grid; grid-template-columns:repeat(auto-fit,minmax(235px,1fr)); gap:12px; }
.lab-case { display:flex; align-items:flex-start; gap:10px; padding:16px; border:1px solid var(--line); border-radius:10px; background:#fff; cursor:pointer; }
.lab-case:has(input:checked) { border-color:var(--teal); background:var(--teal-soft); }
.lab-case:has(input:disabled) { opacity:.55; cursor:not-allowed; }
.lab-case__body { display:grid; gap:7px; min-width:0; overflow-wrap:anywhere; }
.lab-case__body small { color:var(--muted); }
.lab-language-fieldset { margin:0; padding:0; border:0; }
.lab-language-fieldset legend { margin-bottom:14px; }
.lab-languages { display:flex; flex-wrap:wrap; gap:12px; }
.lab-languages label { padding:10px 15px; border:1px solid var(--line); border-radius:20px; cursor:pointer; }
.lab-languages label:has(input:checked) { border-color:var(--teal); background:var(--teal-soft); }
.lab-run-card { position:sticky; top:100px; border-top:3px solid var(--teal); }
.lab-selected { padding:0; list-style:none; }
.lab-selected li { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:8px 0; font-size:.85rem; }
.lab-selected button { padding:4px 10px; }
.lab-cost { font-size:1.05rem; font-weight:700; color:var(--navy); }
.lab-run-card>button { width:100%; }
.lab-history { margin-top:32px; border-top:1px solid var(--line); padding-top:20px; }
.lab-result { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:12px; margin:18px 0; }
.lab-result details { min-width:0; }
.lab-result summary { cursor:pointer; padding:10px 0; overflow-wrap:anywhere; }
@media(max-width:600px){.lab-result{grid-template-columns:minmax(0,1fr)}.lab-result>button{justify-self:start}}
@media(max-width:900px){.lab-builder{grid-template-columns:minmax(0,1fr)}.lab-run-card{position:static}.lab-cases{grid-template-columns:minmax(0,1fr)}}
[hidden] { display:none !important; }
.lab-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:24px 0; padding-bottom:14px; border-bottom:1px solid var(--line); }
.g-shell .lab-tabs [aria-selected=false] { color:var(--navy); background:#edf2f5; }
.g-shell .lab-tabs [aria-selected=true] { background:var(--navy); box-shadow:inset 0 -3px var(--teal); }
.lab-tabs button:focus-visible,.clinical-selectors select:focus-visible { outline:3px solid var(--teal); outline-offset:3px; }
.clinical-selectors { display:grid; grid-template-columns:2fr 1.3fr .7fr 1.5fr; gap:16px; }
.clinical-selectors label { display:grid; gap:8px; min-width:0; font-weight:600; }
.clinical-selectors select { width:100%; font-weight:400; }
.clinical-workbench { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:24px; align-items:start; }
.clinical-workbench>.g-card { margin-top:0; min-width:0; }
.clinical-editor { position:sticky; top:100px; }
.g-shell .clinical-editor textarea { min-height:420px; line-height:1.8; font-size:1.08rem; resize:vertical; box-sizing:border-box; margin:12px 0; }
.clinical-editor textarea[readonly] { background:#f1f5f8; }
.clinical-aside { max-height:80vh; overflow:auto; }
.clinical-aside summary { cursor:pointer; font-weight:600; padding:10px 0; }
.clinical-aside details details { padding:0 12px; border-left:2px solid var(--line); margin:8px 0; }
.clinical-data { margin:8px 0 18px; font-size:.9rem; overflow-wrap:anywhere; }
.clinical-data dt { font-weight:600; margin-top:9px; color:var(--navy); }
.clinical-data dd { margin:4px 0 12px 12px; white-space:pre-wrap; }
.clinical-focus,.clinical-event-selected { border-left:4px solid var(--teal) !important; background:var(--teal-soft); padding:12px; border-radius:6px; }
.clinical-table-wrap { overflow:auto; }
.clinical-table { width:100%; border-collapse:collapse; font-size:.88rem; }
.clinical-table th,.clinical-table td { text-align:left; padding:12px; border-bottom:1px solid var(--line); vertical-align:top; }
.clinical-table button { padding:5px 10px; margin:0 6px 6px 0; }
@media(max-width:1100px){.clinical-selectors{grid-template-columns:1fr 1fr}}
@media(max-width:900px){.clinical-workbench{display:flex;flex-direction:column}.clinical-workbench>.g-card{width:100%;box-sizing:border-box}.clinical-aside{order:-1;max-height:none}.clinical-editor{position:static}.g-shell .clinical-editor textarea{min-height:320px}}
@media(max-width:560px){.clinical-selectors{grid-template-columns:1fr}.lab-tabs button{flex:1}.clinical-table{font-size:.82rem}}
@media(max-width:800px){.g-layout,.entity-row{grid-template-columns:minmax(0,1fr)}.g-filters{align-items:stretch;flex-direction:column}.g-filters select{width:100%}}
