/* Tarjetas elegidas por la usuaria; conserva controles y jerarquía funcional. */
h1,h2,.brand,.action-name {font-family:var(--font-heading);}
.brand {letter-spacing:.18em;}
.work-title h2 {letter-spacing:.06em;}
.work-shortcuts {background:transparent;border:0;padding:0;}
.shortcut-cards {display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:12px;}
.shortcut-card {min-width:0;text-align:left;border:1px solid var(--border-neutral);border-radius:var(--radius-panel);padding:16px;background:var(--brand-white);display:flex;flex-direction:column;gap:8px;}
.shortcut-card strong {font-size:1rem;font-family:var(--font-heading);}
.shortcut-card span {font-size:.85rem;line-height:1.4;}
.shortcut-card.featured {background:var(--brand-blue);color:var(--brand-white);border-color:var(--brand-blue);}
.shortcut-card select {width:100%;margin:0;min-height:48px;}
.shortcut-footer {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;}
.work-task {border-radius:var(--radius-panel);}
.task-heading h4 {font-size:1.08rem;font-weight:700;}
.hierarchy-label {font-size:.75rem;letter-spacing:normal;text-transform:none;}
.work-view-switch {padding:4px;border:1px solid var(--border-neutral);border-radius:var(--radius-panel);width:fit-content;background:var(--brand-white);}
.work-view-switch button {min-height:48px;}
.work-fold {font-size:.82rem;min-height:36px;padding:.35rem .7rem;}
.icon-button {min-width:40px;padding:.45rem .65rem;}
.work-shortcuts nav,.work-shortcuts .shortcut-footer {min-width:0;}
.work-shortcuts select {max-width:100%;}
.master-content .work-shortcuts {display:flex;align-items:end;gap:12px;flex-wrap:wrap;}
.master-content .work-shortcuts label {flex:1 1 15rem;}
.master-content .work-shortcuts button {flex:0 0 auto;min-height:40px;}
.work-action > .action-body > .secondary,
.work-stage > .stage-body > .secondary {font-size:.8rem;min-height:36px;padding:.4rem .7rem;}
.work-summary .work-fold {display:block;width:fit-content;max-width:100%;margin:12px 0 8px;padding:.45rem .75rem;min-height:36px;font-size:.76rem;line-height:1.35;white-space:normal;border-radius:999px;background:transparent;color:var(--text-primary);border-color:var(--border-neutral);}
.work-summary .work-fold:hover {background:var(--surface-muted);}
.pending-row .actions-row {flex-wrap:wrap;}
@media(max-width:650px){.shortcut-cards{grid-template-columns:1fr 1fr;}.shortcut-card.featured{grid-column:1/-1;}.shortcut-card{padding:12px;}.shortcut-card strong{font-size:.92rem;}.shortcut-footer{align-items:flex-start;}.work-title{gap:8px;}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;}}

.summary-task>summary {flex-wrap:wrap;gap:8px;}
.summary-task>summary>span:first-child {flex:1 1 12rem;min-width:0;overflow-wrap:anywhere;}
.summary-room {flex-wrap:wrap;}
.summary-room>span:first-child {flex:1 1 9rem;min-width:0;overflow-wrap:anywhere;}

/* Detailed work trees and the master editor also wrap before squeezing names. */
.work-action>summary,.stage-heading {flex-wrap:wrap;}
.work-action>summary .action-name,.stage-heading>span:first-child,.task-heading h4 {
 flex:1 1 12rem;min-width:0;overflow-wrap:anywhere;
}
.task-name,.group-progress,.empty-work {max-width:100%;white-space:normal;overflow-wrap:anywhere;}
.shortcut-card {overflow-wrap:anywhere;}
.shortcut-card select {min-width:0;}
.shortcut-footer {flex-wrap:wrap;}
.shortcut-footer>p {flex:1 1 12rem;}
.shortcut-footer>button {max-width:100%;white-space:normal;}
.catalogue-card>summary .help {white-space:normal;}
.master-content .pending-row {flex-wrap:wrap;gap:12px;}
.master-content .pending-row>div:not(.entity-tools) {flex:1 1 12rem;}
.work-action>.action-body {padding-bottom:14px;}
.work-summary .summary-action-group>.summary-tasks {padding:8px 10px 14px;}
.work-summary .summary-action-group>.work-fold {margin:12px 12px 14px;max-width:calc(100% - 24px);}
.work-summary .summary-task {padding:12px;}
.work-summary .summary-stage>.work-fold {margin-top:14px;}
.work-stage>.stage-body {padding-bottom:14px;}
@media(max-width:650px){
 .shortcut-cards>label.shortcut-card {grid-column:1/-1;}
 .work-action>summary .action-name {flex:1 1 calc(100% - 36px);}
 .stage-heading>span:first-child,.task-heading h4 {flex-basis:100%;}
 .work-action>summary>.not-applicable-work {max-width:100%;}
 .not-applicable-work>span {display:block;white-space:nowrap;}
 .work-action>summary:has(>.not-applicable-work) {
  display:grid;grid-template-columns:24px minmax(0,1fr) auto auto;gap:8px;align-items:center;
 }
 .work-action>summary:has(>.not-applicable-work)>svg {grid-row:1;grid-column:1;}
 .work-action>summary:has(>.not-applicable-work)>.action-name {grid-row:1;grid-column:2/-1;}
 .work-action>summary:has(>.not-applicable-work)>.not-applicable-work {grid-row:2;grid-column:1/3;justify-self:start;}
 .work-action>summary:has(>.not-applicable-work)>.action-chevron {grid-row:2;grid-column:3;}
 .work-action>summary:has(>.not-applicable-work)>.entity-tools {grid-row:2;grid-column:4;margin-left:0;}
 .work-summary .work-fold,.work-action>.action-body>.work-fold,.work-stage>.stage-body>.work-fold {min-height:44px;}
}
/* At this breakpoint pending-row becomes a column: basis must stop reserving height. */
@media(max-width:480px){
 .master-content .pending-row>div:not(.entity-tools) {flex:0 1 auto;width:100%;}
}

/* Resumen: columnas existentes, título a la izquierda y avance lateral.
   La grilla compacta se limita a Resumen; maestra y Detalle conservan su escala. */
.work-summary .summary-stage>summary.stage-heading,
.work-summary .summary-action-group[data-summary-state]>.summary-action {
 display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;
 align-items:center;column-gap:10px;row-gap:4px;padding:10px 12px;
}
.work-summary .summary-stage>summary.stage-heading>span:first-child,
.work-summary .summary-action-group>.summary-action>span:first-child {display:contents;}
.work-summary .summary-stage>summary.stage-heading h3,
.work-summary .summary-action-group>.summary-action>span:first-child>strong {
 grid-column:1;grid-row:1;margin:0;font-size:1rem;line-height:1.3;min-height:2.6em;
 display:flex;align-items:center;overflow-wrap:anywhere;
}
.work-summary .summary-stage>summary.stage-heading .hierarchy-label,
.work-summary .summary-action-group>.summary-action>span:first-child>.hierarchy-label {
 grid-column:1;grid-row:2;margin:0;align-self:center;
}
.work-summary .summary-stage>summary.stage-heading>.summary-indicator,
.work-summary .summary-action-group>.summary-action>.summary-indicator {
 grid-column:2;grid-row:1;justify-self:end;justify-content:flex-end;text-align:right;font-size:1rem;
}
.work-summary .summary-stage>summary.stage-heading>.entity-tools,
.work-summary .summary-action-group>.summary-action>.entity-tools {
 grid-column:2;grid-row:2;justify-self:end;margin:0;
}
.work-summary .entity-tools button {min-width:36px;min-height:36px;padding:4px;font-size:20px;}
.work-summary .summary-stage>summary.stage-heading:has(>.entity-tools),
.work-summary .summary-action-group>.summary-action:has(>.entity-tools) {grid-template-rows:auto 36px;}
.work-summary .summary-action-group[data-summary-state] {margin:0 0 10px;}
.work-summary .summary-actions>.summary-action-group[data-summary-state] {margin:0;}
/* El foco del local no se superpone al encabezado fijo de Validaciones. */
.task-locations[open]>summary {margin-bottom:12px;}
@media(max-width:650px),(any-pointer:coarse){
 .work-summary .entity-tools button {min-width:44px;min-height:44px;}
 .work-summary .summary-stage>summary.stage-heading:has(>.entity-tools),
 .work-summary .summary-action-group>.summary-action:has(>.entity-tools) {grid-template-rows:auto 44px;}
}
