/* 33 Estudio de redacción: the kit sheet (from the archivo sheet, trimmed) and what this screen adds */
/* Settings (18): the Operations sheet's scoped rules for #view-studio-libre; the rv- panel, menu and error rules it shares are global and already loaded. */
#view-studio-libre { padding: 0 0 112px; color: var(--al-text); width: 100%; min-width: 0; max-width: 100%; }
#view-studio-libre * { box-sizing: border-box; }
#view-studio-libre a { color: var(--al-action); text-decoration: none; cursor: pointer; }
#view-studio-libre a:hover { text-decoration: underline; }
#view-studio-libre .rv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: var(--al-gap-card); }
#view-studio-libre .rv-head .al-title { margin: 0; }
#view-studio-libre .rv-head-r { display: flex; align-items: center; gap: 16px; min-width: 0; }
#view-studio-libre .rv-meta span { white-space: nowrap; }
#view-studio-libre .rv-meta { text-align: right; font-size: var(--al-fs-label); color: var(--al-text-2); line-height: 1.5; font-variant-numeric: tabular-nums; max-width: 560px; }
#view-studio-libre .alf-tabs { display: flex; gap: 26px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; width: 0; min-width: 100%; margin-bottom: var(--al-gap-card); border-bottom: 1px solid var(--al-divider); }
#view-studio-libre .alf-tab { height: 40px; padding: 0; flex: none; border-radius: 0; background: none; color: var(--al-text-2); font-weight: 500; }
#view-studio-libre .alf-tab[aria-selected="true"] { background: none; box-shadow: inset 0 -2px 0 var(--al-brass); color: var(--al-action); font-weight: 700; }
#view-studio-libre .rv-count { margin-left: 6px; font-size: var(--al-fs-label); font-weight: 500; color: var(--al-text-2); font-variant-numeric: tabular-nums; }
#view-studio-libre .alf-tab[aria-selected="true"] .rv-count { color: var(--al-action); }
#view-studio-libre .al-region { background: var(--al-card); border: 1px solid var(--al-divider); border-radius: var(--al-r-card); box-shadow: var(--al-shadow-card); min-width: 0; margin-bottom: var(--al-gap-card); }
#view-studio-libre .al-region-hd { display: flex; align-items: baseline; gap: 12px; padding: var(--al-pad-card) var(--al-pad-card) var(--al-gap-title); border: 0; }
#view-studio-libre .al-region-hd .al-label { font-size: var(--al-fs-card); font-weight: 700; color: var(--al-text); }
#view-studio-libre .al-region-hd .al-meta { margin-left: auto; font-size: var(--al-fs-label); color: var(--al-text-2); font-variant-numeric: tabular-nums; }
#view-studio-libre .al-region-body { padding: 0 var(--al-pad-card) var(--al-pad-card); }
#view-studio-libre .rv-pad { padding: var(--al-pad-card); }
#view-studio-libre .al-flow { display: flex; flex-direction: column; }
#view-studio-libre .al-flow-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0; margin: 0; border: 0; background: none; box-shadow: none; }
#view-studio-libre .al-flow-row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--al-divider); }
#view-studio-libre .al-flow-row:last-child::after { display: none; }
#view-studio-libre .al-flow.is-compact .al-flow-row { min-height: 44px; padding: 8px 0; }
#view-studio-libre .al-flow-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
#view-studio-libre .al-flow-title { font-size: var(--al-fs-ui); font-weight: 500; color: var(--al-text); line-height: 1.4; overflow-wrap: anywhere; }
#view-studio-libre .al-flow-meta { font-size: var(--al-fs-label); font-weight: 400; color: var(--al-text-2); line-height: 1.4; overflow-wrap: anywhere; }
#view-studio-libre .al-flow-aside { font-size: var(--al-fs-label); color: var(--al-text-2); white-space: nowrap; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
#view-studio-libre [role="button"].al-flow-row { cursor: pointer; border-radius: var(--al-r-control); padding-left: 12px; padding-right: 12px; margin: 0 -12px; }
#view-studio-libre [role="button"].al-flow-row:hover, #view-studio-libre .al-flow-row[aria-selected="true"] { background: var(--al-selected); }
#view-studio-libre .al-flow-row[aria-selected="true"] .al-flow-title { color: var(--al-action); font-weight: 600; }
#view-studio-libre [role="button"]:focus-visible, #view-studio-libre .rv-link:focus-visible { outline: none; box-shadow: var(--al-focus); }
#view-studio-libre .al-absent { font-size: var(--al-fs-ui); color: var(--al-text-2); margin: 0; }
#view-studio-libre .al-secondary { font-size: var(--al-fs-label); color: var(--al-text-2); margin: 8px 0 0; }
#view-studio-libre .rv-chev { flex: none; width: 16px; text-align: center; color: var(--al-text-2); transition: transform var(--al-t-hover, .15s); }
#view-studio-libre .rv-chev.is-open { transform: rotate(90deg); }
#view-studio-libre .rv-sub { padding: 0 0 8px 16px; }
#view-studio-libre .rv-link { border: 0; background: none; padding: 0; margin: 0; font: 500 var(--al-fs-ui)/1.4 var(--al-font-ui); color: var(--al-action); cursor: pointer; white-space: nowrap; }
#view-studio-libre .rv-link:hover { text-decoration: underline; }
#view-studio-libre .rv-dots { flex: none; width: 32px; height: 32px; border: 0; background: none; border-radius: var(--al-r-control); color: var(--al-text-2); cursor: pointer; font-size: 18px; line-height: 1; }
#view-studio-libre .rv-dots:hover { background: var(--al-selected); }
#view-studio-libre .rv-fig { flex: none; font-size: var(--al-fs-ui); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
#view-studio-libre .rv-num { font-size: var(--al-fs-ui); font-variant-numeric: tabular-nums; color: var(--al-text-2); margin-left: 12px; flex: none; }
#view-studio-libre .rv-lenses { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
#view-studio-libre .alf-filter .rv-n { margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--al-text-2); }
#view-studio-libre .alf-filter[aria-pressed="true"] .rv-n { color: var(--al-action); }
#view-studio-libre .rv-tools { display: flex; align-items: center; gap: 12px; padding: var(--al-pad-card) var(--al-pad-card) 8px; }
#view-studio-libre .rv-search { width: 320px; max-width: 100%; height: var(--al-control-h); padding: 0 12px; border: 0; border-radius: var(--al-r-control); background: var(--al-field); box-shadow: inset 0 0 0 1px var(--al-line-control); font: 400 15px/1 var(--al-font-ui); color: var(--al-text); }
#view-studio-libre .rv-search:hover { box-shadow: inset 0 0 0 1px var(--al-action); }
#view-studio-libre .rv-search:focus { outline: none; box-shadow: var(--al-focus); }
#view-studio-libre .rv-search::placeholder { color: var(--al-text-2); }
#view-studio-libre .rv-table-wrap { padding: 0 var(--al-pad-card); overflow-x: auto; }
#view-studio-libre .rv-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
#view-studio-libre .rv-table thead, #view-studio-libre .rv-table thead tr { background: none; }
#view-studio-libre .rv-table th { text-align: left; height: 44px; padding: 0 12px; font-size: var(--al-fs-label); font-weight: 600; color: var(--al-text-2); background: none; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--al-divider); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-studio-libre .rv-table td { height: 52px; padding: 0 12px; font-size: var(--al-fs-ui); border-bottom: 1px solid var(--al-divider); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
#view-studio-libre .rv-table tr:last-child td { border-bottom: 0; }
#view-studio-libre .rv-table th:first-child, #view-studio-libre .rv-table td:first-child { padding-left: 0; }
#view-studio-libre .rv-table th:last-child, #view-studio-libre .rv-table td:last-child { padding-right: 0; }
#view-studio-libre .rv-table .r { text-align: right; }
#view-studio-libre .rv-table tbody tr { cursor: pointer; }
#view-studio-libre .rv-table tbody tr:hover td, #view-studio-libre .rv-table tbody tr[aria-selected="true"] td { background: var(--al-selected); }
#view-studio-libre .rv-table tbody tr[aria-selected="true"] td:first-child { color: var(--al-action); font-weight: 600; }
#view-studio-libre .rv-table tbody tr:focus-visible { outline: none; box-shadow: inset var(--al-focus); }
#view-studio-libre .rv-nm { font-weight: 500; }
#view-studio-libre .rv-amb { margin-left: 8px; font-size: var(--al-fs-label); font-weight: 400; color: var(--al-text-2); }
#view-studio-libre .rv-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px var(--al-pad-card) var(--al-pad-card); font-size: var(--al-fs-label); color: var(--al-text-2); }
#view-studio-libre .rv-pager .rv-range { margin-right: 8px; font-variant-numeric: tabular-nums; }
#view-studio-libre .alf-button--icon.alf-button--compact { width: 32px; padding: 0; }
#view-studio-libre .rv-flag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--al-r-chip); background: var(--al-attention-wash); color: var(--al-attention); font-size: var(--al-fs-label); font-weight: 600; }
#view-studio-libre .rv-band, .rv-panel .rv-band { background: none; color: var(--al-attention); padding: 0; font-size: var(--al-fs-ui); font-weight: 600; }
#view-studio-libre .cv-error, .rv-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--al-critical-wash); color: var(--al-critical); border-radius: var(--al-r-control); padding: 12px 16px; font-size: var(--al-fs-ui); }


#view-studio-libre .rv-panel .rv-panel-body { padding-bottom: 88px; }
#view-studio-libre .rv-panel-foot { position: relative; flex: none; padding: 12px 24px 16px; border-top: 1px solid var(--al-divider); display: flex; flex-direction: column; gap: 10px; background: var(--al-raised); }
#view-studio-libre .rv-panel-foot .rv-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#view-studio-libre .rv-panel-foot .al-secondary { margin: 0; }
#view-studio-libre .rv-panel-foot .rv-acts { gap: 4px; flex-wrap: nowrap; }
#view-studio-libre .rv-panel-foot .rv-acts .alf-button { padding-inline: 10px; white-space: nowrap; }

#view-studio-libre .rv-panel-hd { align-items: flex-start; padding-top: 14px; padding-bottom: 6px; min-height: 56px; }
#view-studio-libre .rv-panel-foot::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 40px; background: linear-gradient(to bottom, transparent, var(--al-raised)); pointer-events: none; }

#view-studio-libre .rv-error { margin: 8px 0; }

#view-studio-libre { padding-bottom: 96px; }


/* 13 Invoicing: the MODO PARALELO line, the figures line, the one-row chips (SPEC B, C) */
#view-studio-libre .iv-test-mail { margin: 6px 0 0; }
#view-studio-libre #iv-modo-paralelo { margin-bottom: var(--al-gap-card); }
#view-studio-libre #iv-modo-paralelo:empty { display: none; }
#view-studio-libre .iv-figs { color: var(--al-text-2); font-size: var(--al-fs-ui); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#view-studio-libre .iv-figs .iv-a3-gen { margin-left: auto; }
#view-studio-libre .iv-chips { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 4px var(--al-pad-card) 12px; overflow-x: auto; scrollbar-width: thin; }
#view-studio-libre .iv-chips .alf-filter { flex: none; white-space: nowrap; height: 28px; display: inline-flex; align-items: center; }
#view-studio-libre .rv-table th.al-r, #view-studio-libre .rv-table td.al-r { text-align: right; }
#view-studio-libre .rv-table .al-num { font-family: var(--al-font-ui); }
#view-studio-libre .rv-table td a { color: var(--al-action); }
#view-studio-libre .iv-total { margin-top: 10px; text-align: right; font-weight: 500; color: var(--al-text); }
#view-studio-libre .rv-panel .rv-table td { height: 40px; }
#view-studio-libre .ax-dots { flex: none; width: 32px; height: 32px; margin-left: auto; border: 0; background: none; border-radius: var(--al-r-control); color: var(--al-text-2); font-size: 18px; line-height: 1; cursor: pointer; }
#view-studio-libre .ax-dots:hover, #view-studio-libre .ax-dots:focus-visible { background: var(--al-selected); outline: none; }
#view-studio-libre .rv-table td .ax-dots { margin-left: 0; }

/* IN2: one status chip per row (neutral by default, success for paid, attention for vencida) */
#view-studio-libre .alf-status { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--al-r-chip); background: var(--al-selected); color: var(--al-text-2); font-size: var(--al-fs-label); font-weight: 600; white-space: nowrap; vertical-align: middle; }
#view-studio-libre .alf-status--success { background: var(--al-success-wash); color: var(--al-success); }
#view-studio-libre .alf-status--attention { background: var(--al-attention-wash); color: var(--al-attention); }
#view-studio-libre .rv-table td .alf-status { height: 22px; padding: 0 8px; margin: 0; }
#view-studio-libre .rv-panel-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#view-studio-libre .iv-doc-test { margin-bottom: 8px; }

/* IN5: four labelled figures */
#view-studio-libre .iv-stats { display: flex; flex-wrap: wrap; gap: 8px 40px; }
#view-studio-libre .iv-stat-v { font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--al-text); }
#view-studio-libre .iv-stat-l { font-size: var(--al-fs-label); color: var(--al-text-2); margin-top: 2px; }
#view-studio-libre .iv-stat.is-attention .iv-stat-v { color: var(--al-attention); }

/* IN3: hairline label/value rows in the panel */
#view-studio-libre .iv-rows { display: flex; flex-direction: column; }
#view-studio-libre .iv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--al-divider); }
#view-studio-libre .iv-row:last-child { border-bottom: 0; }
#view-studio-libre .iv-row-l { flex: none; font-size: var(--al-fs-label); color: var(--al-text-2); }
#view-studio-libre .iv-row-v { text-align: right; font-size: var(--al-fs-ui); color: var(--al-text); overflow-wrap: anywhere; min-width: 0; }
#view-studio-libre .rv-panel .rv-sec { margin-bottom: 14px; }


/* PN3: the Firma first screen: totals and the rule on one line, filters, count and export on one row */
#view-studio-libre .pn-fhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 32px; flex-wrap: wrap; padding: 16px 24px 4px; }
#view-studio-libre .pn-fhead .iv-stats { padding: 0; }

/* the page: a grid that fills the window. Before a draft: the form on the left, what Alfred finds on the right. With a draft: the sources fold into
   one line, the draft is the white paper (D9) with the change bar pinned under it, and the right column keeps the sources and the options. */
#view-studio-libre { display: block; }
#view-studio-libre [hidden] { display: none !important; }
#view-studio-libre .sl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--al-gap-card); align-items: start; }
#view-studio-libre .sl-grid.is-draft { grid-template-columns: minmax(0, 1fr) 352px; }
@media (max-width: 1100px) { #view-studio-libre .sl-grid, #view-studio-libre .sl-grid.is-draft { grid-template-columns: minmax(0, 1fr); } }
#view-studio-libre .sl-main, #view-studio-libre .sl-side { display: flex; flex-direction: column; gap: var(--al-gap-card); min-width: 0; }
#view-studio-libre .sl-main > .al-region, #view-studio-libre .sl-side .al-region, #view-studio-libre #sl-sources-card > .al-region { margin: 0; }
#view-studio-libre .sl-band { margin: 0 0 var(--al-gap-card); padding: 10px 16px; border-radius: var(--al-r-control); background: color-mix(in srgb, var(--al-text) 6%, transparent); color: var(--al-text-2); font-size: var(--al-fs-ui); line-height: 1.5; }
#view-studio-libre .sl-note { margin: 8px 0 0; font-size: var(--al-fs-label); color: var(--al-text-2); line-height: 1.5; }
#view-studio-libre .sl-subject-row { display: flex; gap: 12px; align-items: center; }
#view-studio-libre .sl-subject-input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 0; border-radius: var(--al-r-control); background: var(--al-field); box-shadow: inset 0 0 0 1px var(--al-line-control); font: 400 var(--al-fs-ui)/1 var(--al-font-ui); color: var(--al-text); }
#view-studio-libre .sl-subject-input:focus-visible { outline: none; box-shadow: var(--al-focus); }
#view-studio-libre .sl-resume-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: var(--al-fs-ui); color: var(--al-text-2); }
#view-studio-libre .sl-case-wrap { margin-top: 12px; }
#view-studio-libre .sl-fold { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-radius: var(--al-r-card); background: var(--al-card); border: 1px solid var(--al-divider); box-shadow: var(--al-shadow-card); font-size: var(--al-fs-ui); color: var(--al-text-2); }
#view-studio-libre #sl-terreno.is-loading { opacity: .6; }
#view-studio-libre .sl-src { padding: 10px 0; border-bottom: 1px solid var(--al-divider); }
#view-studio-libre .sl-src:last-child { border-bottom: 0; }
#view-studio-libre .sl-src-name { font-size: var(--al-fs-label); font-weight: 600; color: var(--al-text-2); margin-bottom: 2px; }
#view-studio-libre .sl-src-items { font-size: var(--al-fs-ui); color: var(--al-text); line-height: 1.5; overflow-wrap: anywhere; }
#view-studio-libre .sl-src.is-empty .sl-src-items { color: var(--al-text-2); }
#view-studio-libre .sl-src-cover { margin-top: 2px; font-size: var(--al-fs-label); color: var(--al-text-2); line-height: 1.5; }
#view-studio-libre .sl-withheld { color: var(--al-text-2); }
#view-studio-libre .sl-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#view-studio-libre .sl-budget { font-size: var(--al-fs-label); color: var(--al-text-2); }
/* the draft: the title row, the paper, the pinned change bar */
#view-studio-libre .sl-reply { display: flex; flex-direction: column; gap: 12px; padding-bottom: 88px; }
#view-studio-libre .sl-paper-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
#view-studio-libre .sl-paper-title h2 { margin: 0; font-size: var(--al-fs-card); font-weight: 600; }
#view-studio-libre .sl-paper-title p { margin: 2px 0 0; font-size: var(--al-fs-label); color: var(--al-text-2); line-height: 1.4; }
#view-studio-libre .sl-paper-hd .sl-budget { font-size: var(--al-fs-label); }
#view-studio-libre .sl-fold { min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
#view-studio-libre .sl-gaps { color: var(--al-attention); font-weight: 600; }
#view-studio-libre .sl-paper-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
#view-studio-libre .sl-paper-wrap { display: flex; flex-direction: column; align-items: center; }
#view-studio-libre .sl-paper { width: 100%; max-width: var(--al-paper-w); min-height: 420px; padding: 40px 56px; background: var(--al-paper); box-shadow: var(--al-shadow-paper); font-size: 15px; line-height: 1.7; color: var(--al-text); overflow-wrap: anywhere; }
@media (max-width: 1100px) { #view-studio-libre .sl-paper { padding: 32px 28px; } }
#view-studio-libre .sl-ask { position: fixed; bottom: 16px; z-index: 30; display: flex; gap: 8px; align-items: center; padding: 12px; background: var(--al-card); border-radius: var(--al-r-card); box-shadow: var(--al-shadow-menu); }
#view-studio-libre .sl-ask input { flex: 1; min-width: 0; height: var(--al-control-h, 40px); padding: 0 12px; border: 0; border-radius: var(--al-r-control); background: var(--al-field); box-shadow: inset 0 0 0 1px var(--al-line-control); font: 400 var(--al-fs-ui)/1 var(--al-font-ui); color: var(--al-text); }
#view-studio-libre .sl-ask input:focus-visible { outline: none; box-shadow: var(--al-focus); }
/* a gap is the standard attention band, in normal type, where Alfred stopped */
#view-studio-libre .dws-hueco { margin: 14px 0; padding: 10px 14px; border: 0; border-radius: var(--al-r-control); background: var(--al-attention-wash); font-family: var(--al-font-ui); }
#view-studio-libre .dws-hueco-lbl { display: none; }
#view-studio-libre .dws-hueco-txt { margin: 0; font-size: var(--al-fs-ui); line-height: 1.5; color: var(--al-attention); }
/* the page takes the whole window, and the options sit in a card of their own */
#view-studio-libre #sl-root { flex: 1 1 auto; width: 100%; min-width: 0; padding-bottom: 96px; }
#view-studio-libre .sl-card { padding: var(--al-pad-card); background: var(--al-card); border-radius: var(--al-r-card); border: 1px solid var(--al-divider); box-shadow: var(--al-shadow-card); }
#view-studio-libre .sl-card .al-rule { display: none; }
#view-studio-libre .sl-card .al-label { margin: 0 0 8px !important; }
#view-studio-libre .sl-card .al-field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* with a draft: the subject and the sources are one card of two rows, the gaps between blocks tighten, and the head row carries the limit line short */
#view-studio-libre .sl-grid.is-draft .sl-main { gap: 12px; }
#view-studio-libre .sl-grid.is-draft .sl-side { gap: 12px; }
#view-studio-libre #sl-subject-fold { border-radius: var(--al-r-card) var(--al-r-card) 0 0; }
#view-studio-libre #sl-subject-fold + #sl-fold, #view-studio-libre #sl-subject-card + #sl-fold { margin-top: -12px; border-radius: 0 0 var(--al-r-card) var(--al-r-card); border-top: 1px solid var(--al-divider); }
#view-studio-libre .sl-paper-hd .sl-budget-src { display: none; }
