/* Dashboards (/dashboards): the gallery and the canvas. Colours are app
 * tokens; the series' colours are canvas.js's (the validated palette). */

.dv-page { padding: 18px 28px 40px; }
.dv-gallery { display: flex; flex-direction: column; gap: 32px; max-width: 1280px; }
.dv-mine { display: flex; flex-direction: column; gap: 28px; position: relative; }
.dv-cols { display: flex; flex-direction: column; gap: 28px; }
/* Side by side, each column only as wide as its tiles: two short lists
   sit together and the room left stays on the right (Lucas, 2026-10-16).
   A long one wraps its tiles and pushes the other below. */
.dv-cols.is-two { display: flex; flex-wrap: wrap; gap: 28px 40px; align-items: flex-start; }
.dv-cols.is-two > .dv-section { flex: 0 1 auto; min-width: 0; }
.dv-cols.is-two .dv-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.dv-cols.is-two .dv-tile { flex: 0 0 300px; }
/* One height for every tile of the gallery, across both columns: the title
   keeps two lines at most and the description three. */
.dv-mine .dv-tile { min-height: 160px; }
.dv-mine .dv-grid { grid-auto-rows: 1fr; }
.dv-mine .dv-tile-title, .dv-mine .dv-tile-desc { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.dv-mine .dv-tile-title { -webkit-line-clamp: 2; line-height: 1.35; }
.dv-mine .dv-tile-desc { -webkit-line-clamp: 3; }
@media (max-width: 720px) { .dv-cols.is-two > .dv-section { flex-basis: 100%; } .dv-cols.is-two .dv-tile { flex: 1 1 100%; } }
.dv-h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.dv-h2-ic {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: var(--hover); color: var(--text-2);
}
.dv-count { font-size: 12px; font-weight: 500; color: var(--muted); }
.dv-lead { margin: -6px 0 12px; font-size: 12.5px; color: var(--muted); }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dv-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; min-height: 118px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  transition: border-color 90ms linear, transform 90ms ease-out;
}
.dv-tile:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-1px); }
/* The gallery's "Seleccionar": tiles of your own views pick instead of open. */
.dv-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 44px; }
.dv-pick-bar, .dv-pick-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Above the first section's heading, at its right end. */
.dv-pick-bar { position: absolute; top: -6px; right: 0; z-index: 1; }
.dv-pick-count { font-size: 12.5px; color: var(--muted); }
.dv-tile { position: relative; }
.dv-pick-box { position: absolute; top: 10px; right: 10px; color: var(--primary); }
.dv-mine.is-picking .dv-tile[data-pick] { cursor: pointer; }
.dv-mine.is-picking .dv-tile:not([data-pick]) { opacity: .55; pointer-events: none; }
.dv-tile.is-picked { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.dv-tile-kicker { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.dv-tile-kicker i { font-style: normal; opacity: .6; }
.dv-tile-title { font-size: 14.5px; font-weight: 700; }
.dv-tile-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }

.dv-actions { display: flex; align-items: center; gap: 8px; }
.dv-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.dv-btn:hover { background: var(--hover); }
.dv-btn.is-primary { background: var(--text); color: var(--bg); border-color: transparent; }
.dv-btn.is-primary:hover { opacity: .9; }
.dv-btn.is-quiet { border-color: transparent; color: var(--muted); }

.dv-canvas { display: flex; flex-direction: column; gap: 14px; }
.dv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* A view's title: "Dashboards / <title>", the first part the way back. */
.dv-crumb { color: var(--muted); font-weight: 500; }
.dv-crumb:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.dv-crumb-sep { margin: 0 8px; color: var(--muted); font-weight: 400; }
.dv-back { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-right: 6px; }
.dv-back:hover { color: var(--text); }
.dv-bar .h-seg { margin-left: 0; }
.dv-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 10px; border-radius: 20px; font-size: 12px;
  background: color-mix(in srgb, var(--primary) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border)); color: var(--text);
}
.dv-chip:hover { background: color-mix(in srgb, var(--primary) 16%, var(--card)); }

.dv-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.dv-slot, .dv-block { min-width: 0; }
.dv-w1 { grid-column: span 1; } .dv-w2 { grid-column: span 2; } .dv-w3 { grid-column: span 3; } .dv-w4 { grid-column: span 4; }
.dv-block {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  animation: dv-in 240ms ease-out both;
}
@keyframes dv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dv-block { animation: none; } }
.dv-block.is-loading { min-height: 120px; }
.dv-slot.dv-h2x .dv-block.is-loading, .dv-slot.dv-h3x .dv-block.is-loading { min-height: 300px; }
.dv-sk { flex: 1; min-height: 70px; }
.dv-head { display: flex; align-items: flex-start; gap: 8px; }
.dv-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dv-title { font-size: 13.5px; font-weight: 700; letter-spacing: .1px; }
.dv-sub { font-size: 11.5px; color: var(--muted); }
.dv-tools { display: flex; gap: 2px; opacity: .55; transition: opacity 90ms linear; }
.dv-block:hover .dv-tools, .dv-block:focus-within .dv-tools { opacity: 1; }
.dv-tool { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); }
.dv-tool:hover { background: var(--hover); color: var(--text); }

.dv-kpi { display: flex; flex-direction: column; gap: 4px; }
.dv-kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.3px; }
.dv-kpi-delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.dv-kpi-delta b { color: var(--c); }
.dv-kpi-delta svg { color: var(--c); }

/* The plot fills its block: a block stretched to its row (the table beside
 * it is taller) gets a taller plot, not empty space under it. */
.dv-chart { flex: 1 1 auto; min-height: 240px; }
.dv-h2x .dv-chart { min-height: 420px; }
.dv-h3x .dv-chart { min-height: 600px; }
.dv-chart.is-filterable { cursor: pointer; }

.dv-table-wrap { overflow: auto; max-height: 340px; }
.dv-h2x .dv-table-wrap, .dv-h3x .dv-table-wrap { max-height: 620px; }
.dv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dv-table th { position: sticky; top: 0; background: var(--card); text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.dv-table td { padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.dv-table .is-num { text-align: right; white-space: nowrap; }
.dv-table tr:hover td { background: var(--hover); }
.dv-bar-cell { position: relative; display: inline-flex; justify-content: flex-end; min-width: 92px; }
.dv-bar-cell i { position: absolute; right: 0; top: 50%; height: 16px; margin-top: -8px; border-radius: 3px; background: color-mix(in srgb, var(--primary) 14%, transparent); }
.dv-bar-cell b { position: relative; font-weight: 500; padding-left: 6px; }
.dv-filter { color: var(--text); border-bottom: 1px dotted var(--muted); }
.dv-filter:hover { color: var(--primary); border-bottom-color: var(--primary); }

.dv-insight { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text); }
.dv-insight b { font-weight: 700; }
.dv-error, .dv-empty { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dv-error svg { color: var(--warning); }
.dv-why { padding: 10px 12px; border-radius: 8px; background: var(--surface-light); font-size: 12px; line-height: 1.5; color: var(--text-2); }
.dv-why p { margin: 0 0 4px; }
.dv-why p:last-child { margin: 0; }
.dv-caveat { color: var(--warning); }

.dv-toasts { position: fixed; z-index: var(--z-toast, 70); left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; }
.dv-toast { padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.dv-toast.is-bad { background: var(--error); color: #fff; }

@container (max-width: 980px) { .dv-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dv-w3, .dv-w4 { grid-column: span 2; } }
@media (max-width: 980px) { .dv-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dv-w3, .dv-w4 { grid-column: span 2; } }
@media (max-width: 640px) { .dv-page { padding: 14px 16px 32px; } .dv-board { grid-template-columns: 1fr; } .dv-w1, .dv-w2, .dv-w3, .dv-w4 { grid-column: span 1; } }

/* The heatmap (blocks.heat): one hue, light to dark; a cell's --l is 0 to 1. */
.dv-heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 11.5px; }
.dv-heat th { font-weight: 500; color: var(--muted); white-space: nowrap; padding: 2px 6px; text-align: left; }
.dv-heat thead th { text-align: center; position: sticky; top: 0; background: var(--card); }
.dv-heat td {
  text-align: center; padding: 6px 4px; border-radius: 4px; color: var(--text);
  background: color-mix(in srgb, #2a78d6 calc(6% + var(--l, 0) * 80%), var(--card));
}
.dv-heat td.is-strong { color: #fff; }

/* Resizing a block of one's own view (canvas.js): the corner handle, and the
 * block while it is being dragged. */
.dv-grip {
  position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize;
  touch-action: none; opacity: 0; transition: opacity 90ms linear;
  background: linear-gradient(135deg, transparent 0 55%, var(--muted) 55% 60%, transparent 60% 72%, var(--muted) 72% 77%, transparent 77%);
}
.dv-block:hover .dv-grip, .dv-block.is-resizing .dv-grip { opacity: .8; }
.dv-block.is-resizing { outline: 2px dashed color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; user-select: none; }
@media (max-width: 980px) { .dv-grip { display: none; } }

/* Ampliar: one block's chart or table in a dialog. */
.dv-modal {
  width: min(1100px, 94vw); height: min(720px, 88vh); max-width: none; max-height: none; padding: 0;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text);
  box-shadow: 0 18px 48px rgba(0,0,0,.28);
}
.dv-modal[open] { display: flex; flex-direction: column; }
.dv-modal::backdrop { background: rgba(0,0,0,.42); }
.dv-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 8px 18px; }
.dv-modal-head .rng { margin-left: auto; }
.dv-modal-title { font-size: 15px; font-weight: 700; }
.dv-modal-x { min-width: 36px; min-height: 36px; }
.dv-modal-body { flex: 1 1 auto; min-height: 0; padding: 4px 18px 18px; }
.dv-modal-body.is-chart { padding: 4px 12px 12px; }
.dv-modal-body.is-table { overflow: auto; }
.dv-modal-body.is-table .dv-table-wrap { max-height: none; }
@media (max-width: 640px) { .dv-modal { width: 100vw; height: 92vh; border-radius: 14px 14px 0 0; margin: auto 0 0; } }

/* A block pinned on Inicio: the card's frame is the block's own. */
.h-item > .dv-block { height: 100%; }
.h-top .h-item > .dv-block .dv-chart { flex: 1 1 auto; min-height: 180px; max-height: 220px; }
.h-item > .dv-block .dv-tools { margin-right: 58px; }
/* On a phone the top bar keeps the actions' icons: the labels would push the
 * page sideways. Each button carries its label as aria-label. */
@media (max-width: 640px) {
  .dv-actions { gap: 4px; }
  .dv-actions .dv-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .dv-actions .dv-btn-label { display: none; }
}

/* Claude's consent page (/conectar/claude). */
.dv-consent { max-width: 560px; display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; font-size: 14px; line-height: 1.5; }
.dv-consent p { margin: 0; }
.dv-consent-lead { font-size: 15px; }
.dv-consent-list { margin: 0; padding-left: 18px; color: var(--text-2); }
.dv-consent .dv-btn { height: 44px; padding: 0 18px; }
.dv-consent-url { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--surface-light); overflow-wrap: anywhere; }

/* "Hay cambios nuevos": on top of the canvas, until the person looks. */
.dv-canvas { position: relative; }
.dv-news {
  position: sticky; top: 8px; z-index: var(--z-sticky); align-self: center; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border-radius: 18px; font-size: 13px; color: #fff; background: var(--primary);
  box-shadow: var(--fab-shadow); animation: dv-in 240ms ease-out both;
}
.dv-news:hover { filter: brightness(1.08); }

/* A report (dashboards/report.html): an editorial note in the app's own
 * type (Lucas: a serif read apart from the rest of the app). Size and
 * weight carry the hierarchy; prose at a reading width; one figure beside
 * its text, alternating sides; kpis as figures in the text. */
.rp {
  max-width: 1120px; margin: 0 auto; padding-bottom: 24px; display: flex; flex-direction: column; gap: 40px;
}
.rp-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 0 4px; max-width: 900px; }
.rp-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card));
}
.rp-question {
  margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 700;
  line-height: 1.22; letter-spacing: -.5px; color: var(--text); text-wrap: balance;
}
.rp-byline { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.rp-byline b { color: var(--text-2); font-weight: 600; }
.rp-by { display: inline-flex; align-items: center; gap: 6px; }
.rp-claude {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, #d97757 16%, var(--card)); color: #c15f3c;
}
.rp-asof {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px;
  background: var(--hover); color: var(--text-2); font-weight: 600;
}
.rp-lede {
  position: relative; padding: 22px 26px 24px; border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--card)), var(--card) 65%);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
}
.rp-kicker {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--primary);
}
.rp-lede-text { font-size: 17.5px; line-height: 1.6; color: var(--text); max-width: 1000px; }
.rp-lede-text p { margin: 0 0 10px; }
.rp-lede-text p:last-child, .rp-lede-text ul:last-child { margin-bottom: 0; }
.rp-lede-text b { font-weight: 700; }

.rp-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 28px; border-top: 1px solid var(--border); }
.rp-section.is-side { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px 36px; align-items: start; }
.rp-section.is-side.is-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.rp-section.is-side.is-flip .rp-copy { order: 2; }
.rp-section.is-side .rp-board { grid-column: 1 / -1; order: 3; }
.rp-copy { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.rp-section.is-stack .rp-copy { max-width: 760px; }
.rp-num { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; color: var(--primary); }
.rp-h2 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.28; letter-spacing: -.3px; text-wrap: balance; }
.rp-prose { font-size: 15px; line-height: 1.72; color: var(--text); }
.rp-prose p { margin: 0 0 12px; }
.rp-prose p:last-child, .rp-prose ul:last-child { margin-bottom: 0; }
.rp-prose ul { margin: 0 0 12px; padding-left: 20px; }
.rp-prose li { margin: 4px 0; }
.rp-prose li::marker { color: var(--primary); }
.rp-prose b { font-weight: 700; }
/* Each section opens on its first word, set apart (views.lead_in). */
.rp-lead { font-weight: 700; letter-spacing: .4px; text-transform: uppercase; font-size: .86em; color: var(--primary); }
.rp-pull {
  margin: 8px 0 4px; padding: 6px 0 6px 20px; border-left: 3px solid var(--primary);
  font-size: 18px; font-weight: 600; line-height: 1.45; letter-spacing: -.2px; color: var(--text);
}
.rp-stats { grid-template-columns: repeat(auto-fill, minmax(170px, 240px)); gap: 12px; margin: 2px 0 4px; }
.rp-stats .dv-block { grid-column: auto; }
.rp-fig { margin: 0; position: sticky; top: 12px; grid-template-columns: minmax(0, 1fr); }
.rp-fig .dv-block { grid-column: 1 / -1; }
.rp-foot { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
@media (max-width: 980px) {
  .rp-section.is-side, .rp-section.is-side.is-flip { grid-template-columns: minmax(0, 1fr); }
  .rp-section.is-side.is-flip .rp-copy { order: 0; }
  .rp-fig { position: static; }
}
@media (max-width: 640px) {
  .rp { gap: 28px; }
  .rp-lede { padding: 18px; }
  .rp-lede-text { font-size: 17px; }
  .rp-h2 { font-size: 20px; }
}

/* The gallery with nothing of the person's yet. */
.dv-first {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 14px;
  border: 1px dashed var(--border); background: var(--card);
}
.dv-first > div { flex: 1; min-width: 0; }
.dv-first > .dv-first-ctas { display: flex; flex-wrap: wrap; gap: 8px; flex: none; margin-left: auto; }
.dv-first h2 { margin: 0; font-size: 15px; font-weight: 700; }
.dv-first p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.dv-first-ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--primary) 10%, var(--card)); color: var(--primary);
}

/* The templates: compact rows, two or three per line. */
.dv-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.dv-tpl {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  transition: border-color 90ms linear;
}
.dv-tpl:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.dv-tpl-ic {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--hover); color: var(--text-2);
}
.dv-tpl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dv-tpl-text b { font-size: 13.5px; font-weight: 600; }
.dv-tpl-text span {
  font-size: 12px; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.dv-tpl-n { flex: none; font-size: 11px; color: var(--muted); }

/* "Correr un research" (dashboards/_research.html): a side panel on .sp. */
.rs-sp { width: min(560px, 100vw); }
.rs-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rs-head { align-items: center; }
.rs-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 700; }
.rs-x { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); }
.rs-x:hover { background: var(--hover); }
/* The thread: the assistant's line first, the person's turn and Claude's
   answer under it, scrolled to the end. */
.rs-thread { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.rs-turn { display: flex; flex-direction: column; gap: 14px; }
.rs-msg { display: flex; align-items: flex-start; gap: 10px; }
.rs-msg.is-me { justify-content: flex-end; }
.rs-av {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--hover); color: var(--text-2);
}
.rs-av.is-claude { color: #c15f3c; }
.rs-bubble { margin: 0; max-width: 100%; font-size: 14px; line-height: 1.5; color: var(--text); }
.rs-msg.is-them .rs-bubble { padding-top: 4px; }
.rs-msg.is-me .rs-bubble {
  max-width: 85%; padding: 9px 13px; border-radius: 14px 14px 4px 14px;
  background: var(--hover); white-space: pre-wrap; overflow-wrap: anywhere;
}
.rs-handoff { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.rs-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.rs-tabs button {
  height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); border: 1px solid transparent;
}
.rs-tabs button.is-on { color: var(--text); border-color: var(--border); background: var(--card); }
.rs-prompt {
  margin: 0; padding: 12px 14px; max-height: 220px; overflow: auto; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.rs-hand-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-hand-foot small { font-size: 12.5px; color: var(--muted); }
.rs-link { font-size: 12.5px; color: var(--primary); align-self: flex-start; }
.rs-threads summary {
  cursor: pointer; font-size: 12.5px; color: var(--muted); min-height: 32px;
  display: inline-flex; align-items: center; gap: 6px; margin-left: 38px;
}
.rs-threads a { display: flex; align-items: center; min-height: 36px; margin-left: 38px; font-size: 13px; color: var(--text-2); }
/* The composer, pinned under the thread: quick replies, the box with where
   it runs and the send button. */
.rs-composer { display: flex; flex-direction: column; gap: 8px; padding: 12px 24px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.rs-suggs { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-sugg {
  text-align: left; padding: 7px 11px; min-height: 36px; border-radius: 10px; font-size: 12.5px; line-height: 1.35;
  color: var(--text-2); background: var(--card); border: 1px solid var(--border);
}
.rs-sugg:hover { color: var(--text); border-color: var(--text-2); }
.rs-box {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 8px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card);
}
.rs-box:focus-within { border-color: var(--text-2); }
.rs-box textarea {
  width: 100%; min-height: 24px; max-height: 180px; padding: 2px 0; resize: none; overflow-y: auto;
  border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; line-height: 1.5;
}
.rs-box textarea:focus { outline: none; }
.rs-tools { display: flex; align-items: center; gap: 8px; }
.rs-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.rs-eng {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid transparent;
}
.rs-eng.is-on { color: var(--text); border-color: var(--border); background: var(--hover); }
.rs-claude { color: #c15f3c; display: grid; }
.rs-send {
  margin-left: auto; width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--text); color: var(--card);
}
.rs-send:disabled { opacity: .35; cursor: default; }
.rs-hint { margin: 0; font-size: 11.5px; color: var(--muted); }
@media (max-width: 720px) {
  .dv-first { flex-direction: column; align-items: flex-start; }
  .dv-pick-bar { position: static; }
  .dv-tpls { grid-template-columns: minmax(0, 1fr); }
  .rs-head { padding: 14px 8px 12px 16px; }
  .rs-thread { padding: 16px; }
  .rs-composer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .rs-eng, .rs-tabs button { height: 44px; }
  .rs-send { width: 44px; height: 44px; }
  .rs-hint { display: none; }
}
@media (max-width: 640px) { .rp { gap: 18px; } .rp-prose { font-size: 15px; } }
