/* The Oficina (Living Office, E02): the rooms, their grid and the «Próximo paso» dock, as in the pinned design
   (docs/design/living-office/iteracion-1): its floor, grid, order, room sizes and type. Only E01 tokens (D8).
   The layout follows the width of its container (the Oficina inside main), not the window's: with Notas or Jarwan
   open, main narrows and the grid answers to that width. */
.oficina { --floor-pad: 16px; container: oficina / inline-size; position: relative; overflow-x: clip; margin: 0 calc(-1 * var(--lo-main-pad-x)); padding: 4px var(--floor-pad) 0;
  background: radial-gradient(600px 300px at 50% 40%, var(--lo-floor-glow), transparent 70%), radial-gradient(500px 300px at 85% 10%, var(--lo-floor-glow-amber), transparent 70%),
    linear-gradient(var(--lo-floor-line) 1px, transparent 1px), linear-gradient(90deg, var(--lo-floor-line) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px; background-position: center, center, center top, center top; }
/* The rooms sit 28 px from the edges, as the design's floor; at most 1400 px wide, centred. */
.office-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); max-width: 1424px; margin: 0 auto; padding: 0 12px; }

/* A room: a section named by its title; the title is the button that opens its view (D4). */
.room { container: room / inline-size; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--lo-edge); border-radius: 10px; background: var(--lo-room); box-shadow: var(--lo-shadow); }
.room-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.room-head h2, .room-label { margin: 0; font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); line-height: 1.5; }
.room-head h2:focus-visible { outline-offset: 4px; border-radius: 4px; }
.room-title { min-height: 24px; padding: 0; gap: 6px; border: 0; border-radius: 4px; background: transparent; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--subtle); }
.room-title:hover { background: transparent; color: var(--lo-ivory); text-decoration: underline; text-underline-offset: 3px; }
.room-title .icon { width: 12px; height: 12px; }
.room-meta { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--subtle); }
.room-note, .room-empty { margin: 0; font-size: 12px; color: var(--muted); }
.room-source { margin: 0; font-size: 12px; color: var(--subtle); }
.room-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.room-actions button { min-height: 32px; padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.room-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.oficina details.room-more, .oficina details.waiting-more, .oficina details.home-more { margin: 0; padding: 0; border: 0; background: none; }
.room-more > summary, .waiting-more > summary, .home-more > summary { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--lo-ivory-3); }
.room-more[open] > summary, .waiting-more[open] > summary, .home-more[open] > summary { margin-bottom: 10px; }
/* A long screen folds under «Ver N más» (E04, stress test): the Ala de proyectos, the activity logs and the search groups. */
.oficina details.wing-more { margin-top: 10px; }
.work-more { margin: 0; padding: 4px 14px; }
.work-more-toggle { min-height: 32px; padding: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--lo-ivory-3); }

/* Piso de agentes: one row per agent, then the map's candidates (dashed), as in the design. */
.agent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.agent-row { width: 100%; min-height: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 0 12px; padding: 10px; border: 1px solid var(--lo-edge-soft); border-radius: 8px; background: var(--lo-sheen-soft); color: var(--lo-ivory); text-align: left; justify-content: stretch; font: inherit; }
button.agent-row:hover { border-color: var(--lo-line-hover); background: var(--lo-sheen-strong); }
.agent-candidate, .agent-pending { border-style: dashed; border-color: var(--lo-edge-strong); background: transparent; }
.agent-pending .agent-mark { border-style: dashed; }
.agent-mark { grid-row: span 2; width: 34px; height: 34px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 2px; padding: 4px; border: 1px solid var(--lo-edge); border-radius: 6px; background: var(--lo-bg); color: var(--subtle); }
.agent-candidate .agent-mark { border-style: dashed; }
.agent-mark > span { border-radius: 1px; }
.agent-mark > span.on { background: currentColor; }
.agent-mark.tone-amber { color: var(--orange); }
.agent-mark.tone-ivory { color: var(--lo-ivory); }
.agent-mark.tone-violet { color: var(--lo-violet); }
.agent-mark.tone-crimson { border-color: var(--lo-crimson-ring); color: var(--brand); }
.agent-name { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.agent-role { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--subtle); }
.agent-state, .agent-claims { grid-column: 3; grid-row: 1 / span 2; justify-self: start; }
.agent-state { padding: 3px 8px; border: 1px solid currentColor; border-radius: 4px; font-family: var(--font-mono); font-size: 12px; white-space: nowrap; color: var(--subtle); }
.agent-state.state-reading, .agent-state.state-writing, .agent-state.state-tool, .agent-state.state-running, .agent-state.state-executing { color: var(--orange); }
.agent-state.state-permission { color: var(--lo-crimson-light); }
.agent-state.state-declared { color: var(--lo-violet); }
.agent-state.state-configured, .agent-state.state-connected { color: var(--success); }
.agent-state.state-pending { color: var(--orange); border-style: dashed; }
.agent-claims { display: grid; justify-items: start; gap: 4px; }
.agent-claims .map-state { padding: 3px 8px; border: 1px dashed var(--subtle); border-radius: 4px; background: transparent; font-family: var(--font-mono); font-size: 12px; white-space: nowrap; color: var(--subtle); }
.agent-group { margin: 4px 0 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); }
/* The design puts the state under the name when the floor is not wide (below 1240 px of main). */
@container oficina (max-width: 1207px) {
  .agent-row { grid-template-columns: 34px minmax(0, 1fr); row-gap: 0; }
  .agent-mark { grid-row: span 3; }
  .agent-state, .agent-claims { grid-column: 2; grid-row: auto; margin-top: 6px; }
}

/* Sala de mando: one row of decision cards (D5); what waits for Vijay in crimson, the blocks in amber. */
.room-mando { padding: 18px 20px; border-color: var(--lo-edge-mid); background: var(--lo-room-warm); box-shadow: var(--lo-shadow-warm); }
/* It keeps the old «Necesita atención» class (§2) without that panel's top margin. */
.room-mando.home-attention { margin-top: 0; }
.room-mando .room-meta { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.meta-needs { color: var(--lo-crimson-light); }
.meta-blocked { color: var(--orange); }
.room-head .room-head-link { min-height: 24px; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--lo-ivory-3); }
.room-head .room-head-link:hover { color: var(--lo-ivory); text-decoration: underline; text-underline-offset: 3px; }
#sala-mando-more { margin-top: -2px; }
.waiting-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.waiting-item { display: grid; align-content: start; gap: 4px; min-width: 0; }
.waiting-card { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: start; justify-content: stretch; gap: 4px; padding: 12px 14px; border: 1px solid var(--lo-crimson-card-edge); border-radius: 8px; background: var(--lo-crimson-wash); color: var(--lo-ivory); font: inherit; text-align: left; }
.waiting-card:hover { border-color: var(--lo-crimson-hot-edge); background: var(--lo-crimson-hot); }
.waiting-blocked .waiting-card { border-color: var(--lo-amber-card-edge); background: var(--lo-amber-wash); }
.waiting-blocked .waiting-card:hover { border-color: var(--lo-amber-line); }
.waiting-kind { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--lo-crimson-light); }
.waiting-blocked .waiting-kind { color: var(--orange); }
.waiting-title { font-size: 13px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.waiting-detail { max-width: 100%; font-size: 12px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waiting-item > .fact-provenance, .waiting-item > small { font-size: 12px; }

/* Jarwan: the room opens the panel that already exists (E03 renews it). */
.room-jarwan { min-height: 220px; align-items: center; justify-content: center; gap: 14px; padding: 22px; text-align: center; border-color: var(--lo-crimson-edge); background: radial-gradient(400px 200px at 50% 100%, var(--lo-crimson-glow), transparent 70%), var(--lo-room-jarwan); box-shadow: var(--lo-shadow-jarwan); }
.room-jarwan { position: relative; }
.room-jarwan .room-head { position: absolute; top: 14px; left: 18px; right: 18px; }
.jarwan-mark { margin-top: 18px; width: 72px; height: 72px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 3px; padding: 8px; border: 1px solid var(--lo-crimson-ring); border-radius: 12px; background: var(--lo-bg); }
.jarwan-mark > span { border-radius: 1px; }
.jarwan-mark > span.on { background: var(--brand); }
.jarwan-lead { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; color: var(--lo-ivory); }
.jarwan-limit { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.room-jarwan .room-actions { justify-content: center; margin-top: 0; }
.room-jarwan .room-actions .primary { min-height: 30px; padding: 6px 12px; font-weight: 600; }
.jarwan-voice { padding: 6px 12px; border: 1px solid var(--lo-edge-strong); border-radius: 6px; font-size: 12px; color: var(--muted); }

/* Proyecto en foco: warm, as in the design; four facets two by two and the next action. */
.room-foco { gap: 12px; border-color: var(--lo-amber-room-edge); background: radial-gradient(300px 200px at 100% 0%, var(--lo-amber-glow), transparent 70%), var(--lo-room-focus); box-shadow: var(--lo-shadow-warm); }
.room-foco .room-label { color: var(--orange); }
.room-foco .room-meta { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.focus-name { margin: 0; font-size: 22px; line-height: 1.25; }
.focus-name .room-title { min-height: 28px; font-family: var(--font-sans); font-size: 22px; font-weight: 700; letter-spacing: -.01em; text-transform: none; color: var(--lo-ivory); text-align: left; white-space: normal; }
.focus-name .room-title .icon { width: 16px; height: 16px; }
.focus-sub { margin: -10px 0 0; font-size: 12px; color: var(--muted); }
.focus-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.focus-facts > div { min-width: 0; padding: 8px 10px; border: 1px solid var(--lo-edge); border-radius: 8px; background: var(--lo-sheen); }
.focus-facts dt { font-size: 12px; font-weight: 600; color: var(--lo-ivory); }
.focus-facts dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.focus-facts .fact-hot dd { color: var(--lo-crimson-light); }
.focus-next { display: grid; gap: 2px; }
.focus-status { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 12px; line-height: 1.45; color: var(--lo-ivory-3); }
.focus-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); transform: translateY(-1px); }
.focus-label { color: var(--subtle); }
.focus-next > small, .focus-next > .fact-provenance { padding-left: 14px; font-size: 12px; color: var(--subtle); }
.focus-mission { margin: 0; font-size: 12px; color: var(--lo-ivory-3); }
/* Discreet links instead of buttons (Vijay, 2026-10-02): the same actions, in the room's small type. */
.focus-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: auto 0 0; font-size: 12px; color: var(--subtle); }
.focus-links .text-button { min-height: 24px; padding: 0; gap: 4px; font-size: 12px; font-weight: 500; color: var(--lo-ivory-3); text-decoration: underline; text-decoration-color: var(--lo-edge-strong); text-underline-offset: 3px; }
.focus-links .text-button:hover { color: var(--lo-ivory); text-decoration-color: currentColor; }
.focus-links .text-button .icon { width: 12px; height: 12px; }

/* Ala de proyectos: no room box, as in the design; a label and one card per project. */
.room.room-open { padding: 0; gap: 10px; border: 0; background: none; box-shadow: none; }
.room-open .room-head { padding: 0 4px; }
.project-grid.wing-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.project-card.project-card-compact { display: grid; align-content: start; gap: 6px; min-width: 0; margin: 0; padding: 14px 16px; border: 1px solid var(--lo-edge); border-radius: 10px; background: var(--lo-room-card); box-shadow: var(--lo-shadow-card); }
.wing-head { display: flex; align-items: center; gap: 4px 8px; min-width: 0; }
.wing-head h3 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; }
.wing-head .project-title { min-height: 20px; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--lo-ivory); text-align: left; justify-content: flex-start; overflow-wrap: anywhere; }
.wing-head .project-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.wing-status { flex: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--lo-ivory); }
.wing-status.wing-verify { color: var(--orange); }
.wing-status.wing-paused { color: var(--muted); }
.wing-status.wing-closed { color: var(--subtle); }
.wing-pin { flex: none; width: 22px; min-width: 22px; height: 20px; min-height: 0; padding: 0; border: 0; background: none; color: var(--subtle); }
.wing-pin .icon { width: 14px; height: 14px; }
.wing-pin.pinned { color: var(--lo-crimson-light); }
.wing-tag { margin: 0; font-size: 12px; color: var(--subtle); }
.wing-next { margin: 0; font-size: 12px; line-height: 1.35; color: var(--lo-ivory-4); }
.project-card-compact .obs-card-line { margin: 0; font-size: 12px; }

/* Sala de misiones: the four real phases (D2) as the design's row of boxes. */
.phase-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 3px; }
.phase-list li { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 6px; }
.phase-count { width: 100%; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--lo-edge); border-radius: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--subtle); }
.phase-some .phase-count { background: var(--lo-sheen-strong); color: var(--lo-ivory); }
.phase-hot .phase-count { border-color: var(--lo-crimson-hot-edge); background: var(--lo-crimson-hot); color: var(--lo-crimson-light); }
.phase-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--subtle); }
.mission-waiting { width: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; justify-content: stretch; gap: 3px; padding: 10px 12px; border: 1px solid var(--lo-crimson-card-edge); border-radius: 8px; background: var(--lo-crimson-wash); color: var(--lo-ivory); font: inherit; font-size: 12px; text-align: left; }
.mission-waiting:hover { border-color: var(--lo-crimson-hot-edge); background: var(--lo-crimson-hot); }
.mission-waiting .waiting-title { font-size: 12px; }

/* Incubadora and Archivo: short lists, as in the design. */
.room-incubadora, .room-archivo { gap: 10px; background: var(--lo-room-quiet); }
.idea-list li { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 12px; }
.idea-kind { flex: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--lo-violet); }
.idea-title { min-width: 0; overflow-wrap: anywhere; color: var(--lo-ivory-4); }
.handoff-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; font-size: 12px; }
.handoff-list .text-button { min-height: 24px; padding: 0; font-size: 12px; font-weight: 400; color: var(--lo-ivory-4); text-align: left; justify-content: flex-start; }
.handoff-when { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--subtle); white-space: nowrap; }
.room-archivo .home-more { margin: auto 0 0; padding: 0; border: 0; }

/* Núcleo del sistema: one band of chips, as in the design. */
.room-nucleo { gap: 10px; padding: 14px 18px; background: var(--lo-room-core); }
.room-nucleo .room-head { align-items: center; }
.room-nucleo .room-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.core-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.core-chip { padding: 5px 8px; border: 1px solid var(--lo-edge-mid); border-radius: 4px; background: var(--lo-sheen); font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; color: var(--lo-ivory); }
.core-state { color: var(--subtle); }
.core-connected .core-state, .core-configured .core-state { color: var(--success); }
.core-pending .core-state { color: var(--orange); }
.core-when { white-space: nowrap; }
.room-nucleo .core-link { min-height: 24px; padding: 2px 6px; font-family: var(--font-sans); font-size: 12px; }

/* The dock: opaque, in the flow at the top when compact; at the bottom and sticky when wide. */
.dock { position: relative; }
.dock-top { margin-bottom: 24px; }
.dock-bottom { display: none; z-index: 5; margin: 16px calc(-1 * var(--floor-pad)) 0; padding: 0 28px 20px; background: var(--lo-bg); }
.dock-inner { max-width: 1400px; margin: 0 auto; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.dock .resume-card { display: flex; flex-wrap: nowrap; align-items: center; gap: 14px; min-width: 0; margin: 0; padding: 14px 16px; border: 1px solid var(--lo-crimson-dock-edge); border-radius: 10px; background: var(--lo-dock-main); box-shadow: var(--lo-shadow-dock); }
.dock .dock-label { margin: 0; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--lo-crimson-light); white-space: nowrap; }
.dock-body { flex: 1 1 0; min-width: 0; display: grid; }
.dock-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--lo-ivory); }
.dock-body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.dock-actions { flex: none; display: flex; gap: 6px; }
.dock-actions button { min-height: 30px; padding: 6px 12px; font-size: 12px; font-weight: 600; border-radius: 6px; }
.dock-chips { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dock-chips > li { min-width: 0; display: flex; }
.dock-chip { width: 100%; min-width: 0; min-height: 0; display: grid; align-content: start; justify-content: stretch; gap: 4px; padding: 10px 12px; border: 1px solid var(--lo-edge-mid); border-radius: 10px; background: var(--lo-surface); color: var(--lo-ivory-3); font: inherit; text-align: left; }
button.dock-chip:hover { border-color: var(--lo-line-hover); background: var(--lo-surface-hover); }
/* When label and figure do not fit side by side, the figure drops a line instead of cutting the label. */
.chip-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; min-width: 0; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.chip-label { white-space: nowrap; }
.chip-count { flex: none; font-size: 12px; letter-spacing: 0; text-transform: none; }
.chip-needs .chip-head { color: var(--lo-crimson-light); }
.chip-blocked .chip-head { color: var(--orange); }
.chip-continue .chip-head { color: var(--success); }
.chip-recent .chip-head { color: var(--lo-violet); }
.chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--lo-ivory-3); }

/* From 960 px of container: the twelve-column floor of the design, seen in slight perspective, and the dock at the bottom.
   The tilt is the design's 3°, or less on a floor so tall that 3° would push its outer columns past the margin (app.js). */
@container oficina (min-width: 960px) {
  .office-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas:
      "agentes agentes agentes mando mando mando mando mando mando foco foco foco"
      "agentes agentes agentes jarwan jarwan jarwan jarwan jarwan jarwan foco foco foco"
      "agentes agentes agentes incubadora incubadora incubadora archivo archivo archivo proyectos proyectos proyectos"
      "misiones misiones misiones nucleo nucleo nucleo nucleo nucleo nucleo proyectos proyectos proyectos";
    transform: perspective(2200px) rotateX(var(--lo-floor-tilt, 3deg)); transform-origin: 50% 0; margin-bottom: var(--lo-floor-overshoot, 0px);
  }
  .room-agentes { grid-area: agentes; }
  .room-mando { grid-area: mando; }
  .room-foco { grid-area: foco; }
  .room-jarwan { grid-area: jarwan; }
  .room-incubadora { grid-area: incubadora; }
  .room-archivo { grid-area: archivo; }
  .room-proyectos { grid-area: proyectos; }
  .room-misiones { grid-area: misiones; }
  .room-nucleo { grid-area: nucleo; align-self: start; }
  .dock-top { display: none; }
  .dock-bottom { display: block; position: sticky; bottom: 0; }
  .dock-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dock-chip { padding: 10px 14px; box-shadow: var(--lo-shadow-chip); }
  .dock .resume-card { padding: 14px 18px; gap: 16px; }
}
/* From 1240 px of main (the design's width for one dock row): the next step and the four chips side by side. */
@container oficina (min-width: 1208px) {
  .dock-inner { grid-template-columns: minmax(0, 2.2fr) minmax(0, 4fr); }
}

/* ── E06: the Trabajo layer as dense lists and the project ficha as the design's dashboard (LIVING-OFFICE §9). Only tokens. ── */
.layout[data-layer="work"] .main { padding-top: 8px; padding-left: 20px; padding-right: 20px; }
.work-list { container: worklist / inline-size; margin: 0 0 24px; }
.work-list-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: var(--lo-subtle); }
.work-list-title { flex: 1 1 auto; margin: 0; font: inherit; letter-spacing: inherit; text-transform: uppercase; color: inherit; }
.work-list-count { flex: none; font-size: 12px; letter-spacing: .06em; white-space: nowrap; }
.work-list-link { flex: none; min-height: 24px; padding: 0; font-family: var(--font-sans); font-size: 12px; letter-spacing: 0; color: var(--lo-ivory-3); }
h2.work-list-title { font-size: 11px; }
.work-search-head .work-list-title { text-transform: none; letter-spacing: .02em; font-size: 12px; }
.work-list-note { padding: 0 14px; }
/* A tab's own tools (the design has none; the app keeps them): one line under the header, before the rows. */
.work-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0 14px 12px; }
.work-tools-row > .meta { font-size: 12px; color: var(--lo-subtle); }
.work-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.work-filters .filter { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.work-tools-row > .small, .work-tools-row > .primary { min-height: 30px; padding: 5px 12px; font-size: 12px; }
.work-tools-row > .small .icon, .work-tools-row > .primary .icon { width: 14px; height: 14px; }
.work-tools-row .source-refresh { flex: 1 1 360px; margin: 0; padding: 6px 6px 6px 12px; gap: 12px; border-radius: 8px; }
.work-tools-row .source-refresh button { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.work-tools-row .source-refresh strong { font-size: 12px; }
.work-tools-row .source-refresh small { margin-top: 2px; }
.work-tools-row .filter-notice { flex: 1 1 100%; margin: 0; }
.work-tools-row .mission-flow { flex: 1 1 520px; margin: 0; padding: 8px 12px; }
.work-tools-row .filter-field { min-width: 0; max-width: 100%; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.work-tools-row .filter-field label { margin: 0; font-size: 12px; color: var(--lo-subtle); }
.work-tools-row .filter-field select { width: auto; min-width: 0; max-width: 100%; min-height: 32px; padding: 4px 28px 4px 10px; font-size: 12px; text-overflow: ellipsis; }
.work-focus { flex: 1 1 100%; margin: 0; font-size: 12px; color: var(--lo-muted); }
.work-focus-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--lo-amber); }
.work-focus .text-button { min-height: 24px; padding: 0; font-size: 12px; }
.work-rows { list-style: none; margin: 0; padding: 0; }
.work-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; border-top: 1px solid var(--lo-edge-soft); border-radius: 6px; }
.row-main { width: 100%; min-height: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; justify-content: stretch; align-items: center; gap: 14px; padding: 14px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-weight: 400; text-align: left; }
button.row-main:hover { background: var(--lo-sheen); }
button.row-main:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.row-text { min-width: 0; display: block; }
.row-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.row-code { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: uppercase; color: var(--lo-subtle); }
.row-title { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--lo-ivory); overflow-wrap: anywhere; }
.row-sub { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--lo-muted); overflow-wrap: anywhere; }
.row-from, .row-flag { color: var(--lo-subtle); }
.row-warn { color: var(--lo-crimson-light); }
.row-sub.manual-note { margin: 3px 0 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: 12px; color: var(--lo-ivory-4); }
.row-badge { justify-self: end; max-width: 46cqi; padding: 4px 10px; border: 1px solid currentColor; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; line-height: 14px; text-align: center; text-transform: uppercase; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding: 8px 14px 8px 0; }
.row-actions .small { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.row-actions .text-button, .row-actions a { font-size: 12px; }
.row-actions .links { margin: 0; }
.row-pin { min-width: 30px; min-height: 30px; padding: 6px; }
.row-pin.pinned { color: var(--lo-amber); }
.tone-crimson { color: var(--lo-crimson-light); }
.tone-amber { color: var(--lo-amber); }
.tone-violet { color: var(--lo-violet); }
.tone-green { color: var(--lo-green); }
.tone-ivory { color: var(--lo-ivory); }
.tone-muted { color: var(--lo-muted); }
.tone-subtle { color: var(--lo-subtle); }
.work-empty .empty { margin: 8px 14px; }
/* A narrow list (a phone, or main narrowed by a panel): a row's actions go under its text, as its badge stays at its right. */
@container worklist (max-width: 720px) {
  .work-row:has(.row-actions.wide) { grid-template-columns: minmax(0, 1fr); }
  .row-actions.wide { justify-content: flex-start; padding: 0 14px 12px; }
  .row-actions:not(.wide) { padding-right: 6px; }
  .row-main { gap: 10px; }
  .row-badge { max-width: 40cqi; padding: 4px 8px; }
  .work-tools-row .source-refresh, .work-tools-row .mission-flow { flex-basis: 100%; }
}
/* The map's whole document stays below its list. */
.map-detail { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--lo-edge); }
.map-detail-head h2 { margin: 0; font-size: 22px; }
.map-detail-head p { margin: 6px 0 18px; max-width: 760px; color: var(--lo-muted); }

/* The ficha: the design's header and board, 1400 px at most and centred; below, everything that does not fit a card. */
.ficha { max-width: 1400px; margin: 0 auto; padding: 0 12px; display: flex; flex-direction: column; gap: 20px; }
.ficha > .back { align-self: flex-start; margin: 0 0 -8px; }
.ficha-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--lo-edge); }
.ficha-id { flex: 1 1 260px; min-width: 0; }
.ficha-eyebrow { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--lo-muted); }
.ficha-title { margin: 6px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: var(--lo-ivory); overflow-wrap: anywhere; }
.ficha-lead { margin: 6px 0 0; max-width: 640px; font-size: 14px; line-height: 1.5; color: var(--lo-muted); }
.ficha-lead-empty { color: var(--lo-subtle); }
.ficha-id .fact-provenance, .ficha-id .ficha-from { display: block; margin-top: 4px; }
.ficha-tools { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ficha-chips, .ficha-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ficha-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--lo-edge-mid); border-radius: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--lo-ivory-4); overflow-wrap: anywhere; }
a.ficha-chip:hover { border-color: var(--lo-line-hover); color: var(--lo-ivory); }
.ficha-buttons .small { min-height: 34px; font-size: 12px; }
.ficha-jarwan { border: 1px solid var(--lo-crimson-line); background: transparent; color: var(--lo-ivory); font-weight: 600; }
.ficha-jarwan:hover { border-color: var(--brand); background: transparent; }
.ficha-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.ficha-top { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ficha-card { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--lo-edge); border-radius: 10px; background: var(--lo-room); }
.ficha-proxima { border-color: var(--lo-crimson-line); background: var(--lo-card-hot); }
.ficha-blocked { border-color: var(--lo-crimson-line); }
.ficha-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.ficha-label { margin: 0; font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--lo-subtle); }
.ficha-proxima .ficha-label, .ficha-blocked .ficha-label { color: var(--lo-crimson-light); }
.ficha-card-link { min-height: 24px; padding: 0; font-size: 12px; }
.ficha-text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--lo-ivory); overflow-wrap: anywhere; }
.ficha-strong { font-weight: 600; }
.ficha-soft { font-size: 13px; color: var(--lo-ivory-3); }
.ficha-text-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--lo-ivory); overflow-wrap: anywhere; }
.ficha-from { font-size: 12px; color: var(--lo-subtle); }
.ficha-card .fact-provenance { font-size: 12px; }
.ficha-computed { margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--lo-muted); }
.ficha-empty { margin: 0; font-size: 12px; color: var(--lo-subtle); }
.ficha-meta { margin: 0; font-size: 12px; color: var(--lo-subtle); }
.ficha-meta .text-button { min-height: 24px; padding: 0; font-size: 12px; }
.ficha-actions { margin-top: auto; padding-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ficha-actions .text-button { min-height: 28px; padding: 0; font-size: 12px; }
.ficha-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ficha-item { width: 100%; min-height: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px; border: 1px solid var(--lo-edge-soft); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 12px; font-weight: 400; text-align: left; }
.ficha-item:hover { background: var(--lo-sheen-strong); }
.ficha-item-title { min-width: 0; overflow-wrap: anywhere; color: var(--lo-ivory); }
.ficha-requirement { flex-direction: column; gap: 2px; }
.ficha-item-state { flex: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.ficha-agent { width: 100%; min-height: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 400; text-align: left; }
.ficha-agent .agent-mark { grid-row: auto; width: 22px; height: 22px; gap: 1px; padding: 3px; border-radius: 4px; }
.ficha-agent-name { font-weight: 600; color: var(--lo-ivory); }
.ficha-agent-role { font-size: 12px; color: var(--lo-subtle); }
.ficha-agent-state { margin-left: auto; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; }
.ficha-decision { width: 100%; min-height: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 0 0 10px; border: 0; border-left: 2px solid var(--lo-edge-strong); border-radius: 0; background: transparent; color: var(--lo-ivory-3); font: inherit; font-size: 12px; font-weight: 400; line-height: 1.4; text-align: left; }
.ficha-decision small { color: var(--lo-subtle); }
.ficha-bloqueos .waiting-card { padding: 10px 12px; }
.ficha-evidence { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ficha-evidence li { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: var(--lo-ivory-4); overflow-wrap: anywhere; }
.ficha-evidence li::before { content: '▫'; position: absolute; transform: translateX(-14px); color: var(--lo-subtle); }
.ficha-evidence { padding-left: 14px; }
.ficha-evidence li { position: relative; }
.ficha-evidence small { font-family: var(--font-sans); color: var(--lo-subtle); }
.ficha-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ficha-activity li { display: flex; gap: 10px; font-size: 12px; color: var(--lo-ivory-3); }
.ficha-when { flex: none; font-family: var(--font-mono); color: var(--lo-subtle); white-space: nowrap; }
.ficha-below { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.ficha-below > .section-title { margin-top: 12px; }
@media (max-width: 760px) {
  .ficha { padding: 0 8px; }
  .ficha-tools { align-items: flex-start; }
  .ficha-chips, .ficha-buttons { justify-content: flex-start; }
}
