html {
  font-size: 14px;
}

.tjs-logo { object-fit: contain; background: #fff; flex-shrink: 0; }
.brand-product { font-size: .85rem; line-height: 1.3; text-align: left; word-break: normal; }

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* WP-29 (iii) / D-25 — the Document Worklist's first cell.
   The tile is a fixed 64x64 so the column cannot jump as thumbnails arrive (the <img> carries
   explicit width/height for the same reason), and the caption is capped and ellipsised so a long
   filename cannot widen the busiest column on the page — the WP-27 complaint, answered here under
   the tile rather than with its own clamp. */
.doc-thumb {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
}

.doc-thumb-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}

.doc-thumb-icon {
  display: block;
  width: 32px;
  height: 32px;
  color: #6c757d;
}

.doc-thumb-icon svg {
  display: block;
  width: 32px;
  height: 32px;
}

.doc-thumb-caption {
  margin-top: 0.25rem;
  max-width: 220px;
  line-height: 1.2;
}

/* Cosmetic fix (2026-09-29): replaces the raw arrived-filename caption (a WAHA/WhatsApp media
   identifier, not operator-meaningful text) with a small download affordance. Sized to match
   .doc-thumb-icon's 32px so the two icon families read as one visual language in this column;
   the color transition on hover is the only feedback needed for a single-purpose icon link. */
.doc-thumb-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #6c757d;
  text-decoration: none;
}

.doc-thumb-download:hover,
.doc-thumb-download:focus-visible {
  color: #0d6efd;
}

.doc-thumb-download svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* WP-29 (ii) — click-to-enlarge. A row whose thumbnail the endpoint will render makes its tile a
   <button>, so the user agent's button chrome has to be neutralised: .doc-thumb already fixes the
   64x64 box, border and radius, and only the padding, font and background inherit need resetting.
   The cursor is the affordance — the tile is the only clickable thing in the cell. */
.doc-thumb-btn {
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
}

.doc-thumb-btn:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* The enlarged image is the document itself, so it keeps its own aspect ratio and is bounded by the
   dialog (and the viewport) rather than by the 64px thumbnail footprint. */
.doc-preview-img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
}

/* TJS application design tokens and shared surfaces. */
:root {
  --tjs-ink: #292d33;
  --tjs-muted: #606b79;
  --tjs-accent: #ffcd05;
  --tjs-surface: #ffffff;
  --tjs-page: #f4f6f8;
  --tjs-border: #dce1e7;
  --bs-primary-rgb: 41, 45, 51;
}
html { font-size: 16px; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--tjs-ink);
}

body.tjs-app {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--tjs-page);
}
body.tjs-login { margin: 0; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  padding: .75rem 1rem;
  background: var(--tjs-ink);
  color: white;
}
.skip-link:focus { top: .5rem; color: white; }
.app-header { background: white; border-bottom: 1px solid var(--tjs-border); }
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .5rem 1.5rem;
}
.app-brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--tjs-ink); }
.app-brand:hover { color: var(--tjs-ink); }
.brand-product { font-weight: 650; letter-spacing: .02em; }
.app-account { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; min-width: 0; }
.account-name { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; color: var(--tjs-muted); }
.app-frame { display: grid; grid-template-columns: 238px minmax(0, 1fr); flex: 1; }
.app-navigation { background: white; border-right: 1px solid var(--tjs-border); padding: 1.25rem .75rem; }
.navigation-content { position: sticky; top: 1rem; }
.nav-caption { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tjs-muted); margin: 1.25rem .75rem .5rem; }
.nav-caption:first-child { margin-top: .25rem; }
.nav-stack { list-style: none; margin: 0; padding: 0; }
.app-nav-link { display: flex; align-items: center; min-height: 44px; padding: .65rem .75rem; border-radius: .4rem; color: #46505e; text-decoration: none; font-size: .9rem; border-left: 3px solid transparent; }
.app-nav-link:hover { background: #f3f5f7; color: var(--tjs-ink); }
.app-nav-link[aria-current="page"] { background: #fff6cd; color: #292d33; border-left-color: #b78b00; font-weight: 650; }
.app-workspace { display: flex; flex-direction: column; min-width: 0; }
.app-main { flex: 1; padding: 2rem; min-width: 0; width: 100%; max-width: 1700px; margin-inline: auto; }
.app-main:focus { outline: none; }
.app-main > .d-flex.justify-content-between { flex-wrap: wrap; gap: 1rem; }
.app-main h1, .app-main h2 { font-size: clamp(1.55rem, 2.1vw, 2rem); font-weight: 650; letter-spacing: -.025em; }
.app-main h5 { font-size: 1rem; font-weight: 650; }
.app-main .card { border-color: var(--tjs-border); border-radius: .7rem; overflow: visible; }
.app-main .card-header { border-bottom-color: var(--tjs-border); padding: 1rem 1.25rem; border-radius: .7rem .7rem 0 0; }
.app-main .card-body { padding: 1.25rem; }
.app-main .table { margin-bottom: 0; font-size: .9rem; }
.app-main .table > :not(caption) > * > * { padding: .8rem .75rem; border-bottom-color: #e9edf1; }
.app-main .table thead th { color: #536070; font-size: .75rem; font-weight: 650; white-space: nowrap; background: #f6f8fa; }
.app-main .table-responsive { border-radius: .5rem; }
.app-main code { color: #3e4755; font-size: .9em; }
.app-main .badge { font-weight: 600; padding: .4em .6em; border-radius: .35rem; }
.app-main .nav-tabs { gap: .25rem; border-bottom-color: var(--tjs-border); }
.app-main .nav-tabs .nav-link { color: #586373; padding: .8rem 1rem; }
.app-main .nav-tabs .nav-link.active { color: var(--tjs-ink); font-weight: 650; border-top: 3px solid #c79800; background: white; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--tjs-border); padding: 1rem 2rem; color: var(--tjs-muted); font-size: .75rem; }
.intake-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font-weight: 600; border-radius: .4rem; }
.btn-primary { --bs-btn-bg: #292d33; --bs-btn-border-color: #292d33; --bs-btn-hover-bg: #111318; --bs-btn-hover-border-color: #111318; --bs-btn-active-bg: #111318; --bs-btn-active-border-color: #111318; --bs-btn-disabled-bg: #6b7280; --bs-btn-disabled-border-color: #6b7280; }
.btn-outline-primary { --bs-btn-color: #343d49; --bs-btn-border-color: #89929f; --bs-btn-hover-bg: #292d33; --bs-btn-hover-border-color: #292d33; --bs-btn-active-bg: #292d33; --bs-btn-active-border-color: #292d33; }
.form-control:not(textarea), .form-select { min-height: 44px; }
.form-control, .form-select { border-color: #bac3ce; border-radius: .4rem; }
.form-label { font-size: .875rem; font-weight: 600; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid #896600; outline-offset: 3px; box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: #796000; box-shadow: 0 0 0 .2rem rgb(255 205 5 / 25%); }
.page-intro { color: var(--tjs-muted); max-width: 48rem; }
.workflow-card { padding: 1.5rem; height: 100%; }
.workflow-step { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: #fff2b2; font-weight: 700; margin-bottom: 1rem; }
.app-main .workflow-card h2 { font-size: 1.1rem; letter-spacing: normal; }
.review-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.8fr); gap: 1.25rem; align-items: start; }
.review-source { min-width: 0; }
.review-source summary { cursor: pointer; min-height: 44px; font-weight: 600; }
.review-source summary span { font-weight: 400; margin-left: .5rem; }
.source-viewport { max-height: 65vh; overflow: auto; background: #f6f7f9; border: 1px solid var(--tjs-border); border-radius: .4rem; }
.review-source-image { display: block; width: 100%; max-width: none; height: auto; }
.review-rows { min-width: 0; }
.review-summary { display: flex; flex-wrap: wrap; gap: 1rem; padding: .75rem; border-radius: .4rem; background: #f4f6f8; color: #46505e; font-size: .875rem; }
.document-worklist { min-width: 720px; }
.document-worklist .doc-secondary { display: none; }
.document-worklist .doc-file-cell { min-width: 170px; }
.document-worklist .doc-actions { position: sticky; right: 0; z-index: 1; min-width: 165px; max-width: 230px; background: white; box-shadow: -4px 0 8px rgb(25 35 50 / 4%); }
.document-worklist thead .doc-actions { z-index: 2; }
.document-worklist .doc-actions .btn { margin-block: .2rem; }
.doc-metadata summary { display: inline-flex; align-items: center; min-height: 44px; color: #42536b; cursor: pointer; font-size: .8rem; text-decoration: underline; }
.doc-metadata dl { max-width: 230px; white-space: normal; }

@media (max-width: 1199.98px) {
  .app-frame { display: block; }
  .app-navigation { border-right: 0; border-bottom: 1px solid var(--tjs-border); padding: 1rem; }
  .navigation-content { position: static; }
  .nav-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-main { padding: 1.5rem; }
  .review-layout { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .app-topbar { padding: .5rem .75rem; gap: .5rem; }
  .app-brand { gap: .4rem; }
  .app-brand .tjs-logo { width: 74px; height: 49px; }
  .brand-product { font-size: .72rem; }
  .app-account { gap: .35rem; }
  .account-name { display: none; }
  .app-account .btn { padding: .45rem .6rem; font-size: .8rem; }
  .app-main { padding: 1rem; }
  .app-main .container-fluid { padding-inline: 0; }
  .app-main .card-body { padding: 1rem; }
  .app-main .nav-tabs .nav-link { padding: .65rem .6rem; font-size: .85rem; }
  .app-footer { padding: 1rem; }
  .nav-stack { grid-template-columns: 1fr; }
}
