/* =============================================================================
   Traducciones — arrangement only, and only what no shared piece draws.

   Everything visual comes from /ds/: the header is hb-header, the strip
   hb-strip, the gates hb-gate, the table hb-rows, the bars hb-progress, the
   rail hb-rail, the sticky footer hb-actionbar, the sheets hb-sheet, the
   timeline hb-timeline, the toggles hb-seg / hb-switch, the titles
   hb-page-head. NOTHING here re-draws one of those. What is left is this
   tool's own layout — the overview grids, the table's column template and
   its phone arrangement, the editor's two columns and the source / Spanish
   pair — plus the handful of constructs only this tool has: the diff spans,
   the link / token / mark pills inside a rich field, the publish list's
   checkbox rows, the locked chip's fade.

   Tokens only. A `#`, a bare radius, a shadow or an ease in this file is a
   bug. Reduced motion lives in base.css, once, for every tool.
   ========================================================================== */

/* ------------------------------------------------------------------ page -- */

body {
  background: var(--color-bg-page);
  min-height: 100vh;
}

/* the burger is an HBNav string inside a Preact tree; the wrapper is a flex
   box so the button sits on the row's centre line like the logo beside it */
.tr-burger { display: flex; flex: none; }

/* main: one 1200 column for the overview and recent changes (28/32/64 wide,
   16 gutters under 900). The editor is different: it is a stack of
   full-width BANDS — its head, the rail strip on a narrow screen, the body,
   the action bar — so its main has no padding or width of its own and each
   band brings its own (see "editor" below). */
.tr-main {
  width: 100%; max-width: var(--container-max); margin: 0 auto;
  padding: 28px var(--space-6) 64px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 20px;
}
.tr-main--recent { gap: 18px; }
.tr-main--editor {
  max-width: none; padding: 0; gap: 0;
  /* at least the rest of the window, so the action bar sits at the bottom
     edge even on a page with two fields */
  min-height: calc(100vh - var(--header-h) - var(--strip-h) - 1px);
}
/* a message standing in for the editor (not built, could not open) keeps
   the column's gutters */
.tr-main--editor > .hb-empty, .tr-main--editor > .hb-banner, .tr-main--editor > .tr-wait { margin: 20px 24px; }

@media (max-width: 899px) {
  .tr-main { padding: 20px var(--space-4) 48px; }
  .tr-main--editor { padding: 0; }
  .tr-main--editor > .hb-empty, .tr-main--editor > .hb-banner, .tr-main--editor > .tr-wait { margin: var(--space-4); }
}

/* a line that waits for data inside a page that is already up */
.tr-wait { display: flex; align-items: center; gap: 10px; font-size: var(--fs-ui-md); color: var(--hb-ink-soft); }

/* "Counts from 3 minutes ago · Refresh" and the other quiet lines */
.tr-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-ui-sm); color: var(--hb-muted); }
.tr-note > .hb-btn--link { padding: 0; }

/* ---------------------------------------------------------------- overview -- */

/* coverage card beside the start-here card; they stack under ~880px */
.tr-ov-cards {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.tr-ov-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tr-ov-card-title { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.tr-ov-card-title > b { font-size: var(--fs-ui-lg); font-weight: var(--fw-semibold); white-space: nowrap; }
.tr-ov-card-title > span { font-size: var(--fs-ui-md); color: var(--hb-ink-soft); }

/* the start-here banner: text on the left, the button on the right */
.tr-start { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 20px; }
.tr-start > div { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.tr-start b { font-size: var(--fs-ui-lg); font-weight: var(--fw-semibold); }
.tr-start p { margin: 0; font-size: var(--fs-ui-md); color: var(--hb-ink-soft); text-wrap: pretty; }

/* filter rows: a 52px label, then chips that wrap; the layout toggle and the
   switch sit at the far right of the type row */
.tr-filters { display: flex; flex-direction: column; gap: 10px; }
.tr-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-filter-label { width: 52px; flex: none; font-size: var(--fs-ui-sm); color: var(--hb-muted); }
.tr-filter-row > .hb-spacer { min-width: 8px; }

/* the table: no thumbnail column (section 7 of the plan) */
.tr-ov-rows { --cols: minmax(0, 2.2fr) minmax(120px, 1.4fr) 110px minmax(120px, 150px); }
.tr-ov-rows .hb-row > span { min-width: 0; }
.tr-ov-rows .hb-row-last { font-size: var(--fs-ui-sm); color: var(--hb-ink-soft); }
/* the phone row: name and address on their own line, then the bar, then the
   count and the last edit side by side */
@media (max-width: 899px) {
  .tr-ov-rows .hb-row { gap: 8px 12px; }
  .tr-ov-rows .hb-row > .tr-row-page { flex: 1 1 100%; }
  .tr-ov-rows .hb-row > .tr-progress { flex: 1 1 100%; }
  .tr-ov-rows .hb-row > .hb-row-count { flex: none; }
  .tr-ov-rows .hb-row > .hb-row-last { flex: 1; text-align: right; }
}

/* card view of the same rows */
.tr-ov-tiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.tr-tile { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; text-align: left; }
/* the tinted header block that stands where a thumbnail would be */
.tr-tile-head {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 10; border-radius: var(--radius-sm); border: 1px solid var(--hb-line);
  background: var(--hb-cloud); color: var(--hb-muted); font-size: var(--fs-ui-sm);
}
.tr-tile-count { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.tr-tile-count > b { font-size: var(--fs-ui-xl); font-weight: var(--fw-semibold); }
.tr-tile-count > small { font-size: var(--fs-ui-xs); color: var(--hb-muted); }

/* the overview's foot line */
.tr-ov-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--fs-ui-sm); color: var(--hb-muted); }

/* search results */
.tr-results { display: flex; flex-direction: column; gap: 10px; }
.tr-result { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; text-align: left; }
.tr-result-crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-ui-sm); color: var(--hb-ink-soft); }
.tr-result-crumb > b { color: var(--hb-chalkboard); }
.tr-result-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; font-size: var(--fs-ui-md); }
.tr-result-cols > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-result-cols small { font-size: var(--fs-ui-xs); color: var(--hb-muted); }
@media (max-width: 640px) { .tr-result-cols { grid-template-columns: 1fr; } }

/* the bar's caption and legend live under TrProgress's wrapper */
.tr-progress { display: block; min-width: 0; }
.tr-progress-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ------------------------------------------------------------------ editor -- */

/* The editor's bands, top to bottom, each a direct child of
   main.tr-main--editor:
     .tr-ed-top        the head: breadcrumb, title row, filter chips — white,
                       edge to edge, hairline underneath
     .hb-rail--strip   under 900 only: the rail as a sticky strip (it is the
                       shared piece; as a direct child of main it runs edge
                       to edge with nothing from here)
     .tr-editor        the body: rail on the left from 900 up (.hb-rail),
                       the sections in .tr-editor-col; 1440 at most
     .hb-actionbar     the sticky footer, edge to edge */
.tr-ed-top {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 24px 16px; background: var(--hb-paper); border-bottom: 1px solid var(--hb-line);
}
.tr-editor {
  flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; box-sizing: border-box;
  padding: 20px 24px 24px; display: flex; gap: 24px; align-items: flex-start;
}
.tr-editor-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* while the action bar is on screen the last section keeps clear of it */
.tr-main--bar > .tr-editor { padding-bottom: 40px; }
@media (max-width: 899px) {
  .tr-ed-top { padding: var(--space-4); }
  .tr-editor { flex-direction: column; gap: 12px; padding: var(--space-4) var(--space-4) 24px; }
  .tr-main--bar > .tr-editor { padding-bottom: 32px; }
}

/* inside the head: progress beside the title, actions at the far end, then
   the chips with the list / grid toggle at the far end of their row */
.tr-ed-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tr-ed-head > .tr-progress { flex: 0 1 260px; min-width: 180px; }
.tr-ed-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-ed-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* section cards */
.tr-sec { display: flex; flex-direction: column; }
.tr-sec.is-hidden { opacity: 0.8; }
.tr-sec-pos { font-size: var(--fs-ui-sm); color: var(--hb-ink-soft); }
.tr-sec-collapsed { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; font-size: var(--fs-ui-md); color: var(--hb-ink-soft); }
.tr-sec-cols {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px;
  padding: 10px 20px 0; font-size: var(--fs-ui-xs); color: var(--hb-muted);
}
.tr-sec-grid {
  display: grid; gap: 12px; padding: 14px 20px 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.tr-sec-list { display: flex; flex-direction: column; }
.tr-sec-list > .tr-field + .tr-field { border-top: 1px solid var(--hb-line); }

/* a field row and the source / Spanish pair inside it */
.tr-field { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; }
.tr-field-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tr-field-top > b { font-size: var(--fs-ui-md); font-weight: var(--fw-semibold); }
.tr-field-type { font-size: var(--fs-ui-xs); color: var(--hb-muted); }
.tr-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 640px) { .tr-pair, .tr-sec-cols { grid-template-columns: 1fr; } }
.tr-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-pane-strip { display: flex; align-items: center; gap: 6px; font-size: var(--fs-ui-xs); font-weight: var(--fw-semibold); }
.tr-pane-strip > i { width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; flex: none; display: block; }
.tr-pane-strip.is-agua { color: var(--hb-agua-ink); }
.tr-pane-strip.is-adobe { color: var(--hb-adobe-ink); }
.tr-pane-strip.is-agave { color: var(--hb-agave-ink); }
.tr-pane-hint { font-size: var(--fs-ui-2xs); color: var(--hb-muted); }
.tr-pane-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tr-pane-tools > small { margin-left: auto; font-size: var(--fs-ui-2xs); color: var(--hb-muted); }
.tr-field-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-field-line { font-size: var(--fs-ui-sm); color: var(--hb-ink-soft); }
.tr-field-notes { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-ui-sm); color: var(--hb-ink-soft); }
.tr-field-notes b { color: var(--hb-chalkboard); font-weight: var(--fw-semibold); }

/* a tile in grid view: the previews clamp to two lines */
.tr-field-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; text-align: left; min-width: 0; }
.tr-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-ui-md); line-height: 1.45; }
.tr-clamp.is-empty { color: var(--hb-adobe-ink); }
.tr-clamp.is-locked { color: var(--hb-muted); }

/* the "Keep them?" banner sits above the sections with a little air */
.tr-keep { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.tr-keep > span { flex: 1; min-width: 200px; }

/* inside a field, a banner's buttons sit on their own line */
.tr-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ------------------------------------------------------- rich-field pills -- */

/* a link: text editable, address locked */
.tr-lnk {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 3px 0 8px; margin: 0 1px;
  border-radius: var(--radius-pill); background: var(--hb-agua-light); border: 1px solid var(--hb-agua);
  vertical-align: 1px; color: var(--hb-agua-ink);
}
.tr-lnk > span:first-child { text-decoration: underline; outline: none; }
.tr-lnk-url {
  font-family: var(--font-mono); font-size: var(--fs-ui-2xs); font-weight: var(--fw-medium);
  color: var(--hb-agua-ink); background: var(--hb-paper); border-radius: var(--radius-pill); padding: 1px 7px;
  white-space: nowrap;
}
/* a placeholder the site fills in: cannot be typed into or dragged */
.tr-tok {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; margin: 0 1px;
  border-radius: var(--radius-pill); background: var(--hb-cloud); border: 1px solid var(--color-border-strong);
  font-family: var(--font-mono); font-size: var(--fs-ui-sm); font-weight: var(--fw-medium); color: var(--hb-ink-soft);
  user-select: none; -webkit-user-drag: none; vertical-align: 1px;
}
/* [bracketed] words the site highlights */
.tr-mark { background: var(--hb-sol-light); border-radius: var(--radius-xs); padding: 0 2px; box-shadow: inset 0 -2px 0 var(--hb-sol); color: inherit; }

/* the rich editor and the source pane that renders the same markup */
.tr-rich { min-height: 44px; line-height: 1.55; font-size: var(--fs-ui); outline: none; }
.tr-rich p { margin: 0 0 8px; }
.tr-rich p:last-child { margin-bottom: 0; }
.tr-src { white-space: pre-wrap; font-size: var(--fs-ui); line-height: 1.55; }

/* ------------------------------------------------------------------- diff -- */

.tr-diff { line-height: 1.6; }
.tr-diff-del { background: var(--hb-adobe-light); color: var(--hb-adobe-ink); text-decoration: line-through; border-radius: var(--radius-xs); padding: 0 2px; }
.tr-diff-add { background: var(--hb-agave-light); color: var(--hb-agave-ink); border-radius: var(--radius-xs); padding: 0 2px; }
.tr-diff-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; font-size: var(--fs-ui-md); }
.tr-diff-pair > small { font-size: var(--fs-ui-xs); color: var(--hb-muted); padding-top: 2px; }

/* --------------------------------------------------------- publish list -- */

.tr-pub-list { display: flex; flex-direction: column; gap: 10px; }
.tr-pub-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; transition: opacity var(--dur-fast); }
.tr-pub-item.is-off { opacity: 0.55; }
.tr-pub-box {
  flex: none; width: 18px; height: 18px; margin-top: 2px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs); border: 1px solid var(--color-border-strong); background: var(--hb-paper);
  color: var(--hb-agave-ink); font-size: var(--fs-ui-sm); font-weight: var(--fw-bold); cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.tr-pub-box[aria-checked="true"] { background: var(--hb-agave); border-color: var(--hb-agave-ink); }
.tr-pub-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tr-pub-why { font-size: var(--fs-ui-sm); color: var(--hb-adobe-ink); }

/* -------------------------------------------------------- recent changes -- */

.tr-rc-day { display: flex; flex-direction: column; gap: 10px; }
.tr-rc-item { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px; }
.tr-rc-item + .tr-rc-item { border-top: 1px solid var(--hb-line); }
.tr-rc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-ui-md); }
.tr-rc-top > .hb-spacer { min-width: 8px; }
.tr-rc-by { font-size: var(--fs-ui-sm); color: var(--hb-muted); white-space: nowrap; }

/* ------------------------------------------------------------- style guide -- */

.tr-guide-section { display: flex; flex-direction: column; gap: 8px; }
.tr-guide-section > h3 { margin: 0; font-size: var(--fs-ui-md); font-weight: var(--fw-semibold); }
.tr-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-pill-add { display: flex; gap: 6px; align-items: center; }
.tr-pill-add > .hb-field { flex: 1; min-width: 0; }
.tr-glossary { width: 100%; border-collapse: collapse; font-size: var(--fs-ui-md); }
.tr-glossary th { text-align: left; font-size: var(--fs-ui-xs); color: var(--hb-muted); font-weight: var(--fw-semibold); padding: 4px 8px 6px 0; }
.tr-glossary td { padding: 6px 8px 6px 0; border-top: 1px solid var(--hb-line); vertical-align: top; }

/* ------------------------------------------------------------ small bits -- */

/* the locked chip reads quieter than the others */
.tr-chip-muted { opacity: 0.75; }

/* a section number or a page address in mono */
.tr-mono { font-family: var(--font-mono); font-size: var(--fs-ui-sm); }
