/* When the app is hidden (inactive tab), never override display:none */
#documentary-app.doc101-app.hidden {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

#documentary-app.doc101-app {
  --doc101-ink: #241711;
  --doc101-muted: #7a604b;
  --doc101-paper: #f8eddc;
  --doc101-paper-2: #fff9ed;
  --doc101-line: rgba(78, 45, 24, 0.18);
  --doc101-red: #9e342c;
  --doc101-gold: #c89445;
  --doc101-green: #51694a;
  --doc101-shadow: 0 24px 60px rgba(43, 28, 14, 0.18);
  min-height: calc(100vh - 72px);
  height: calc(100dvh - 68px) !important;
  display: block !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  padding: 24px clamp(14px, 2.2vw, 34px) 120px;
  background:
    radial-gradient(circle at 12% 0%, rgba(158, 52, 44, 0.11), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(200, 148, 69, 0.16), transparent 30%),
    linear-gradient(135deg, #efe0c5 0%, #d9bd8b 46%, #c9a36b 100%);
  color: var(--doc101-ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

#documentary-app.doc101-app > .ss78-flow-shell,
#documentary-app.doc101-app > .sxu-shell,
#documentary-app.doc101-app > .ss73-shell {
  display: none !important;
}

.doc101-app * {
  box-sizing: border-box;
}

.doc101-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
}

.doc101-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) auto;
  gap: 20px;
  align-items: stretch;
  height: auto !important;
  min-height: 216px;
  padding: clamp(20px, 2vw, 30px);
  border: 1px solid var(--doc101-line);
  border-radius: 34px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.77), rgba(255,249,237,0.92)),
    repeating-linear-gradient(0deg, transparent 0, transparent 32px, rgba(122,96,75,0.06) 33px);
  box-shadow: var(--doc101-shadow);
  overflow: hidden;
}

.doc101-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 18%, rgba(158, 52, 44, 0.18) 18.2%, transparent 18.7%),
    linear-gradient(32deg, transparent 66%, rgba(158, 52, 44, 0.13) 66.2%, transparent 66.7%);
}

.doc101-case-stamp {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 156px;
  padding: 18px;
  border: 2px dashed rgba(158, 52, 44, 0.42);
  border-radius: 24px;
  background: rgba(255, 249, 237, 0.72);
  transform: rotate(-1deg);
}

.doc101-case-stamp span,
.doc101-eyebrow,
.doc101-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--doc101-red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.doc101-case-stamp b {
  font-family: "Courier New", monospace;
  font-size: clamp(26px, 2.4vw, 42px);
  letter-spacing: 0.04em;
  color: var(--doc101-ink);
}

.doc101-title-stack {
  position: relative;
  min-width: 0;
  align-self: center;
}

.doc101-title-stack h1 {
  margin: 0;
  color: var(--doc101-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 82px);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.doc101-title-stack p:not(.doc101-eyebrow) {
  max-width: 820px;
  margin: 14px 0 0;
  color: #61462f;
  font-size: clamp(16px, 1.3vw, 22px);
  line-height: 1.45;
}

.doc101-hero-actions {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
  align-content: center;
}

.doc101-btn,
.doc101-icon-btn,
.doc101-tab,
.doc101-template {
  border: 1px solid rgba(90, 58, 33, 0.22);
  color: var(--doc101-ink);
  background: rgba(255, 249, 237, 0.86);
  box-shadow: 0 8px 22px rgba(71, 41, 17, 0.1);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.doc101-btn {
  min-height: 44px;
  border-radius: 16px;
  padding: 10px 16px;
  font-weight: 900;
}

.doc101-btn:hover,
.doc101-icon-btn:hover,
.doc101-tab:hover,
.doc101-template:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(71, 41, 17, 0.15);
}

.doc101-btn.primary {
  background: linear-gradient(135deg, #f3c66d, #d08a35);
  color: #27160c;
}

.doc101-btn.dark {
  background: linear-gradient(135deg, #2a1a14, #4b2c1d);
  color: #fff5df;
}

.doc101-status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.doc101-status-strip article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--doc101-line);
  border-radius: 22px;
  background: rgba(255, 249, 237, 0.82);
  box-shadow: 0 12px 24px rgba(53, 31, 14, 0.08);
}

.doc101-status-strip span,
.doc101-status-strip small {
  display: block;
  color: var(--doc101-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc101-status-strip strong {
  display: block;
  margin: 5px 0 2px;
  font-size: clamp(24px, 2.6vw, 42px);
  line-height: 1;
}

.doc101-tabs {
  position: sticky;
  top: 48px;
  z-index: 12;
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid rgba(90, 58, 33, 0.18);
  border-radius: 24px;
  background: rgba(50, 31, 21, 0.78);
  box-shadow: 0 18px 32px rgba(41, 26, 15, 0.18);
  backdrop-filter: blur(16px);
  overflow-x: auto;
}

.doc101-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 10px 15px;
  border-radius: 18px;
  color: #fff2d5;
  background: rgba(255, 249, 237, 0.12);
  white-space: nowrap;
}

.doc101-tab b {
  min-width: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #2d180e;
  background: #f3c66d;
}

.doc101-tab.active {
  color: #251409;
  background: linear-gradient(135deg, #f7dd9a, #c9802c);
}

.doc101-page {
  animation: doc101Fade 0.22s ease both;
}

@keyframes doc101Fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.doc101-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.doc101-span-4 { grid-column: span 4; }
.doc101-span-5 { grid-column: span 5; }
.doc101-span-6 { grid-column: span 6; }
.doc101-span-7 { grid-column: span 7; }
.doc101-span-8 { grid-column: span 8; }
.doc101-span-12 { grid-column: span 12; }

.doc101-card,
.doc101-record,
.doc101-empty,
.doc101-evidence {
  border: 1px solid var(--doc101-line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.74), rgba(255,249,237,0.93)),
    repeating-linear-gradient(0deg, transparent 0, transparent 30px, rgba(122,96,75,0.055) 31px);
  box-shadow: var(--doc101-shadow);
}

.doc101-card {
  padding: clamp(18px, 1.8vw, 26px);
}

.doc101-card-head,
.doc101-record-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.doc101-card h2 {
  margin: 0;
  color: var(--doc101-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 2.3vw, 42px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.doc101-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.doc101-form-grid.one {
  grid-template-columns: 1fr;
}

.doc101-field,
.doc101-check {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.doc101-field.wide {
  grid-column: 1 / -1;
}

.doc101-field span,
.doc101-check {
  color: #5e4028;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc101-field input,
.doc101-field textarea,
.doc101-field select,
.doc101-table input,
.doc101-table textarea,
.doc101-table select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(90, 58, 33, 0.22);
  border-radius: 15px;
  padding: 11px 13px;
  color: var(--doc101-ink);
  background: rgba(255, 253, 246, 0.9);
  font: 800 15px/1.35 "Aptos", "Segoe UI", sans-serif;
  outline: none;
}

.doc101-field textarea,
.doc101-table textarea {
  min-height: 96px;
  resize: vertical;
}

.doc101-field input:focus,
.doc101-field textarea:focus,
.doc101-field select:focus,
.doc101-table input:focus,
.doc101-table textarea:focus,
.doc101-table select:focus {
  border-color: rgba(158, 52, 44, 0.58);
  box-shadow: 0 0 0 4px rgba(158, 52, 44, 0.12);
}

.doc101-stack,
.doc101-list,
.doc101-record-grid {
  display: grid;
  gap: 16px;
}

.doc101-record-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc101-record,
.doc101-evidence {
  padding: 18px;
  box-shadow: 0 14px 32px rgba(54, 32, 14, 0.12);
}

.doc101-record strong,
.doc101-mini strong {
  color: var(--doc101-ink);
  font-size: 17px;
}

.doc101-icon-btn {
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 11px;
  color: #7a1d16;
  font-size: 12px;
  font-weight: 900;
}

.doc101-empty {
  padding: 30px;
  text-align: center;
}

.doc101-empty strong {
  display: block;
  font-size: 22px;
}

.doc101-empty p,
.doc101-mini p {
  color: var(--doc101-muted);
  line-height: 1.5;
}

.doc101-template-card {
  padding: 18px;
}

.doc101-template-grid {
  display: grid;
  gap: 10px;
}

.doc101-start-panel {
  margin-bottom: 16px;
}

.doc101-lede {
  margin: 0 0 16px;
  color: var(--doc101-muted);
  font-size: 16px;
  line-height: 1.55;
}

.doc101-soft-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(90, 58, 33, 0.18);
  border-radius: 999px;
  background: rgba(255, 249, 237, 0.76);
  color: var(--doc101-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc101-type-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.doc101-type-card,
.doc101-flow-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid rgba(90, 58, 33, 0.2);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255, 249, 237, 0.9), rgba(244, 226, 196, 0.74));
  color: var(--doc101-ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(71, 41, 17, 0.1);
}

.doc101-type-card.active,
.doc101-flow-card.warm {
  border-color: rgba(158, 52, 44, 0.46);
  background: linear-gradient(150deg, rgba(247, 221, 154, 0.96), rgba(255, 249, 237, 0.9));
}

.doc101-type-card strong,
.doc101-flow-card strong {
  font-size: 18px;
}

.doc101-type-card span,
.doc101-flow-card span {
  color: var(--doc101-muted);
  line-height: 1.35;
}

.doc101-flow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.doc101-flow-card {
  min-height: 112px;
}

.doc101-flow-card b {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(158, 52, 44, 0.12);
  color: var(--doc101-red);
}

.doc101-flow-card.dark {
  background: linear-gradient(145deg, #2a1a14, #4b2c1d);
  color: #fff5df;
}

.doc101-flow-card.dark span,
.doc101-flow-card.dark b {
  color: #fff5df;
}

.doc101-template {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  text-align: left;
}

.doc101-template span {
  color: var(--doc101-muted);
  font-size: 13px;
  line-height: 1.35;
}

.doc101-mini {
  padding: 14px;
  border: 1px solid var(--doc101-line);
  border-radius: 18px;
  background: rgba(255, 249, 237, 0.72);
}

.doc101-list.compact {
  gap: 10px;
}

.doc101-checklist {
  display: grid;
  gap: 10px;
}

.doc101-checklist span {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: #2f1b10;
  background: rgba(255, 249, 237, 0.82);
  font-weight: 900;
}

.doc101-checklist span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--doc101-green);
}

.doc101-evidence {
  position: relative;
}

.doc101-pin {
  position: absolute;
  top: -9px;
  left: 28px;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.84);
  border-radius: 50%;
  background: var(--doc101-red);
  box-shadow: 0 8px 14px rgba(86, 31, 21, 0.25);
}

.doc101-table {
  display: grid;
  gap: 10px;
}

.doc101-table-head,
.doc101-table-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(140px, 1fr) minmax(150px, 0.9fr) minmax(130px, 0.9fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: start;
}

.doc101-table-head {
  color: #5e4028;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc101-table-row {
  padding: 12px;
  border: 1px solid var(--doc101-line);
  border-radius: 18px;
  background: rgba(255, 249, 237, 0.68);
}

.doc101-table-row > * {
  min-width: 0;
}

.doc101-table-row textarea {
  grid-column: 1 / -1;
}

.doc101-table.compact .doc101-table-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc101-table.compact .doc101-table-row textarea {
  grid-column: 1 / -1;
}

.doc101-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.doc101-summary-list div {
  padding: 15px;
  border-radius: 18px;
  background: rgba(255, 249, 237, 0.78);
}

.doc101-summary-list strong,
.doc101-summary-list span,
.doc101-summary-list small {
  display: block;
}

.doc101-summary-list strong {
  font-size: 26px;
}

.doc101-summary-list span {
  font-weight: 900;
}

.doc101-summary-list small {
  color: var(--doc101-muted);
}

.doc101-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.doc101-action-row.tight {
  margin-top: 0;
  gap: 8px;
}

.doc101-bridge-card {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 16px;
  border: 1px dashed rgba(158, 52, 44, 0.32);
  border-radius: 20px;
  background: rgba(158, 52, 44, 0.08);
}

.doc101-bridge-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.doc101-bridge-metrics article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(90, 58, 33, 0.18);
  border-radius: 20px;
  background: rgba(255, 249, 237, 0.8);
  box-shadow: 0 10px 20px rgba(58, 35, 17, 0.08);
}

.doc101-bridge-metrics strong {
  display: block;
  color: var(--doc101-ink);
  font-size: clamp(25px, 2.2vw, 38px);
  line-height: 1;
}

.doc101-bridge-metrics span,
.doc101-bridge-metrics small {
  display: block;
  color: var(--doc101-muted);
  font-weight: 900;
}

.doc101-bridge-metrics span {
  margin-top: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.doc101-bridge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px dashed rgba(158, 52, 44, 0.28);
  border-radius: 20px;
  background: rgba(158, 52, 44, 0.07);
}

.doc101-bridge-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── Core Bridge Banner ─────────────────────────────────────── */
/* Fixed footer bar — sits at bottom so it never covers any view content */
.doc101-core-bridge {
  position: fixed;
  bottom: 0;
  top: auto;
  left: 0;
  right: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
  padding: 7px 18px;
  border-top: 1px solid rgba(243, 198, 109, 0.28);
  background: linear-gradient(90deg, rgba(22, 13, 7, 0.96) 0%, rgba(48, 28, 12, 0.96) 100%);
  color: #fff5df;
  box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.32);
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.doc101-bridge-icon {
  font-size: 18px;
  flex: 0 0 auto;
  line-height: 1;
}

.doc101-bridge-text {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.doc101-bridge-text strong {
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f3c66d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc101-bridge-text span {
  display: block;
  font-size: 11px;
  color: rgba(255, 245, 223, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc101-bridge-btns {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.doc101-core-bridge .doc101-btn {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 12px;
  font-size: 12px;
  background: rgba(255, 249, 237, 0.14);
  border-color: rgba(255, 249, 237, 0.22);
  color: #fff5df;
}

.doc101-core-bridge .doc101-btn.dark {
  background: linear-gradient(135deg, #f3c66d, #d08a35);
  border-color: transparent;
  color: #27160c;
}

/* legacy stats — no longer rendered but kept for compat */
.doc101-core-stats { display: none; }

.doc101-check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.doc101-subject-rail {
  position: sticky;
  top: 124px;
  max-height: calc(100dvh - 170px);
  overflow-y: auto;
}

.doc101-subject-list {
  display: grid;
  gap: 10px;
}

.doc101-subject-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 15px;
  border: 1px solid rgba(90, 58, 33, 0.2);
  border-radius: 18px;
  background: rgba(255, 249, 237, 0.76);
  color: var(--doc101-ink);
  text-align: left;
  cursor: pointer;
}

.doc101-subject-card.active {
  border-color: rgba(158, 52, 44, 0.48);
  background: linear-gradient(135deg, rgba(247, 221, 154, 0.92), rgba(255, 249, 237, 0.9));
  box-shadow: 0 12px 24px rgba(83, 48, 20, 0.12);
}

.doc101-subject-card strong {
  font-size: 17px;
}

.doc101-subject-card span,
.doc101-subject-card small,
.doc101-subline,
.doc101-help {
  color: var(--doc101-muted);
  line-height: 1.35;
}

.doc101-subline {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc101-nested-card {
  margin-top: 16px;
  padding: 14px;
  box-shadow: none;
}

.doc101-question-lab {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed rgba(90, 58, 33, 0.26);
}

.doc101-question-lab .doc101-field {
  margin-top: 14px;
}

.doc101-question-lab textarea {
  min-height: 240px;
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.doc101-batch-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.doc101-card-lane {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.doc101-broll-card {
  background:
    radial-gradient(circle at 95% 5%, rgba(81, 105, 74, 0.12), transparent 28%),
    rgba(255, 249, 237, 0.88);
}

.compact-record textarea {
  min-height: 78px;
}

.doc101-help {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(158, 52, 44, 0.08);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .doc101-hero {
    grid-template-columns: 1fr;
  }

  .doc101-hero-actions,
  .doc101-status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .doc101-span-4,
  .doc101-span-5,
  .doc101-span-6,
  .doc101-span-7,
  .doc101-span-8 {
    grid-column: span 12;
  }

  .doc101-record-grid {
    grid-template-columns: 1fr;
  }

  .doc101-type-grid,
  .doc101-flow-strip,
  .doc101-card-lane,
  .doc101-bridge-metrics,
  .doc101-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc101-core-bridge {
    grid-template-columns: 1fr;
  }

  .doc101-core-stats {
    justify-content: flex-start;
    min-width: 0;
  }

  .doc101-subject-rail {
    position: static;
    max-height: none;
  }

  .doc101-batch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc101-table-head {
    display: none;
  }

  .doc101-table-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc101-table-row textarea {
    grid-column: 1 / -1;
  }

  .doc101-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .doc101-tab {
    flex: 1 1 178px;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  #documentary-app.doc101-app {
    min-height: calc(100dvh - 58px);
    padding: 12px 10px 108px;
  }

  .doc101-hero {
    border-radius: 24px;
    padding: 16px;
  }

  .doc101-case-stamp {
    min-height: 112px;
  }

  .doc101-hero-actions,
  .doc101-status-strip,
  .doc101-form-grid,
  .doc101-type-grid,
  .doc101-flow-strip,
  .doc101-card-lane,
  .doc101-bridge-metrics,
  .doc101-check-grid,
  .doc101-table-head,
  .doc101-table-row,
  .doc101-summary-list {
    grid-template-columns: 1fr;
  }

  .doc101-bridge-card {
    display: grid;
  }

  .doc101-bridge-mini {
    display: grid;
  }

  .doc101-tabs {
    top: 44px;
    margin-inline: -4px;
    border-radius: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc101-tab {
    width: 100%;
    min-width: 0;
    flex: none;
    padding-inline: 10px;
  }

  .doc101-tab span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .doc101-card,
  .doc101-record,
  .doc101-evidence {
    border-radius: 20px;
    padding: 15px;
  }

  .doc101-card-head,
  .doc101-record-head {
    display: grid;
  }

  .doc101-batch-grid {
    grid-template-columns: 1fr;
  }

  .doc101-question-lab textarea {
    min-height: 220px;
  }
}

/* ── Subject card enhancements ────────────────────────────────── */

.doc101-subject-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.doc101-subject-badges {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.doc101-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.doc101-dot.green { background: #51a848; }
.doc101-dot.amber { background: #c89445; }
.doc101-dot.red   { background: #c84040; }

.doc101-subject-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(90, 58, 33, 0.18);
}

.doc101-interview-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--doc101-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc101-inline-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border: 1px solid rgba(158, 52, 44, 0.36);
  border-radius: 8px;
  background: rgba(158, 52, 44, 0.08);
  color: var(--doc101-red);
  cursor: pointer;
  letter-spacing: 0.04em;
}
.doc101-inline-btn:hover {
  background: rgba(158, 52, 44, 0.16);
}

.doc101-legend-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--doc101-muted);
}
.doc101-legend-list span {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Status badges ────────────────────────────────────────────── */

.doc101-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.doc101-badge.green { background: rgba(81, 168, 72, 0.15); color: #2e7229; }
.doc101-badge.amber { background: rgba(200, 148, 69, 0.18); color: #8a5c10; }
.doc101-badge.red   { background: rgba(200, 60, 60, 0.14); color: #9b2020; }
.doc101-badge.blue  { background: rgba(60, 100, 200, 0.13); color: #24408a; }

.doc101-thread-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

/* ── Field report cards ───────────────────────────────────────── */

.doc101-field-card .doc101-record-head {
  flex-wrap: wrap;
  gap: 8px;
}

.doc101-linked-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(81, 168, 72, 0.14);
  color: #2e7229;
}

/* ── Stringout thread cards ───────────────────────────────────── */

.doc101-thread-card .doc101-form-grid {
  margin-top: 14px;
}

/* ── Stacked action column ────────────────────────────────────── */

.doc101-action-row.stack {
  flex-direction: column;
  align-items: stretch;
}
.doc101-action-row.stack button {
  width: 100%;
  justify-content: center;
}

/* ── Readiness bar (used in header) ──────────────────────────── */

.doc101-readiness-bar {
  position: relative;
  height: 6px;
  border-radius: 4px;
  background: rgba(90, 58, 33, 0.16);
  overflow: hidden;
  margin-top: 8px;
}

.doc101-readiness-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #c84040, #c89445, #51a848);
  background-size: 200% 100%;
  transition: width 0.4s ease;
}

/* ── Stat strip nav items ─────────────────────────────────────── */

.doc101-stat-nav {
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.doc101-stat-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(90, 58, 33, 0.18);
}

/* ── Doc type icon ────────────────────────────────────────────── */

.doc101-type-icon {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

/* ── Interview question checklist ─────────────────────────────── */

.doc101-q-checklist {
  margin: 0 0 18px 0;
  border: 1.5px solid rgba(158, 52, 44, 0.2);
  border-radius: 18px;
  background: rgba(255, 249, 237, 0.6);
  overflow: hidden;
}

.doc101-q-checklist.empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
}
.doc101-q-checklist.empty p {
  font-size: 13px;
  color: var(--doc101-muted);
  margin: 0;
}

.doc101-q-checklist-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(158, 52, 44, 0.08), transparent);
  border-bottom: 1px solid rgba(158, 52, 44, 0.14);
}
.doc101-q-checklist-head strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--doc101-red);
  flex: 0 0 auto;
}
.doc101-q-checklist-head span {
  font-size: 11px;
  color: var(--doc101-muted);
  flex: 1 1 0;
}

.doc101-q-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 12px;
  align-items: start;
  padding: 10px 16px;
  border-bottom: 1px dashed rgba(90, 58, 33, 0.12);
}
.doc101-q-item:last-child { border-bottom: none; }

.doc101-q-type {
  grid-column: 1;
  grid-row: 1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--doc101-muted);
  padding-top: 2px;
  white-space: nowrap;
}

.doc101-q-prompt {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--doc101-ink);
  line-height: 1.45;
}

.doc101-q-followup {
  grid-column: 2;
  grid-row: 2;
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--doc101-muted);
  font-style: italic;
  line-height: 1.4;
}

.doc101-q-item .doc101-badge {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
}

/* ── Horizontal subject rail ──────────────────────────────────── */

.doc101-subjects-header {
  margin-bottom: 14px;
}

.doc101-subject-rail-h {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 6px 0 14px;
  align-items: flex-start;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 58, 33, 0.2) transparent;
}
.doc101-subject-rail-h::-webkit-scrollbar { height: 4px; }
.doc101-subject-rail-h::-webkit-scrollbar-thumb {
  background: rgba(90, 58, 33, 0.2);
  border-radius: 4px;
}

.doc101-subject-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 11px 14px;
  min-width: 130px;
  max-width: 190px;
  border: 1.5px solid rgba(90, 58, 33, 0.2);
  border-radius: 16px;
  background: rgba(255, 249, 237, 0.82);
  color: var(--doc101-ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.doc101-subject-chip:hover {
  border-color: rgba(158, 52, 44, 0.35);
  box-shadow: 0 4px 14px rgba(83, 48, 20, 0.1);
}
.doc101-subject-chip.active {
  border-color: rgba(158, 52, 44, 0.55);
  background: linear-gradient(135deg, rgba(247, 221, 154, 0.88), rgba(255, 249, 237, 0.94));
  box-shadow: 0 6px 18px rgba(83, 48, 20, 0.14);
}
.doc101-subject-chip strong {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.doc101-chip-meta {
  font-size: 11px;
  color: var(--doc101-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.doc101-chip-dots {
  display: flex;
  gap: 4px;
  margin-bottom: 2px;
}
.doc101-subject-chip .doc101-interview-count {
  margin-top: 2px;
}
.doc101-subject-chip .doc101-inline-btn {
  margin-top: 6px;
  width: 100%;
  text-align: center;
}

.doc101-legend-pills {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 14px;
  font-size: 11px;
  color: var(--doc101-muted);
  border-left: 1.5px solid rgba(90, 58, 33, 0.16);
  margin-left: 4px;
  align-self: stretch;
  justify-content: center;
}
.doc101-legend-pills span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc101-legend-pills small {
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.7;
}

.doc101-subject-detail-card {
  min-height: 200px;
}

/* ── Doc type hints / cast suggestions ───────────────────────── */

.doc101-type-hints {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(158, 52, 44, 0.05);
  border: 1px solid rgba(158, 52, 44, 0.18);
}
.doc101-type-hints.empty {
  background: transparent;
  border-color: rgba(90, 58, 33, 0.14);
}
.doc101-type-hints-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.doc101-type-hints-head > div {
  flex: 1;
}
.doc101-type-hints-head .doc101-kicker {
  margin: 0 0 2px;
}
.doc101-type-hints-head strong {
  font-size: 14px;
}

.doc101-hint-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.doc101-hint-pill {
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--doc101-paper);
  border: 1px solid rgba(90, 58, 33, 0.2);
  font-size: 12px;
  font-weight: 600;
  color: var(--doc101-ink);
}

/* ── Question bank picker (quick-add dropdown) ────────────────── */

.doc101-bank-picker {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(81, 105, 74, 0.07);
  border: 1px solid rgba(81, 105, 74, 0.2);
}
.doc101-bank-picker .doc101-field {
  flex: 1;
  margin: 0;
}
.doc101-bank-picker .doc101-field select {
  font-size: 13px;
}

/* ── Batch toggle buttons + question pool ─────────────────────── */

.doc101-field-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--doc101-muted);
  margin: 16px 0 8px;
}

.doc101-batch-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.doc101-batch-toggle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1.5px solid rgba(90, 58, 33, 0.2);
  border-radius: 14px;
  background: rgba(255, 249, 237, 0.7);
  color: var(--doc101-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.doc101-batch-toggle:hover {
  border-color: rgba(158, 52, 44, 0.35);
  background: rgba(255, 249, 237, 0.95);
}
.doc101-batch-toggle.active {
  border-color: rgba(158, 52, 44, 0.6);
  background: linear-gradient(135deg, rgba(247, 221, 154, 0.7), rgba(255, 249, 237, 0.9));
  box-shadow: 0 4px 14px rgba(83, 48, 20, 0.1);
}
.doc101-batch-toggle strong {
  font-size: 13px;
  font-weight: 800;
}
.doc101-batch-toggle span {
  font-size: 10px;
  color: var(--doc101-muted);
  line-height: 1.3;
}

.doc101-batch-pool {
  margin: 4px 0 14px;
  border: 1.5px solid rgba(158, 52, 44, 0.24);
  border-radius: 18px;
  background: rgba(255, 249, 237, 0.75);
  overflow: hidden;
}

.doc101-batch-pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(158, 52, 44, 0.08), transparent);
  border-bottom: 1px solid rgba(158, 52, 44, 0.14);
}
.doc101-batch-pool-head strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--doc101-red);
}
.doc101-batch-pool-head span {
  display: block;
  font-size: 11px;
  color: var(--doc101-muted);
}

.doc101-pool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px dashed rgba(90, 58, 33, 0.12);
}
.doc101-pool-item:last-child { border-bottom: none; }

.doc101-pool-q {
  flex: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--doc101-ink);
  line-height: 1.4;
}

.doc101-pool-item .doc101-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 11px;
  font-size: 12px;
}

/* ── Interview scheduling card ────────────────────────────────── */

.doc101-schedule-card {
  border-color: rgba(81, 105, 74, 0.28);
  background:
    radial-gradient(circle at 96% 6%, rgba(81, 105, 74, 0.1), transparent 26%),
    rgba(255, 249, 237, 0.8);
}
.doc101-schedule-card .doc101-kicker {
  color: var(--doc101-green);
}

/* ── Bridge button tweaks (sleeker in footer bar) ─────────────── */

.doc101-bridge-btns {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.doc101-core-bridge .doc101-btn {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff5df;
  white-space: nowrap;
}
.doc101-core-bridge .doc101-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.doc101-core-bridge .doc101-bridge-text strong {
  font-size: 11px;
}
.doc101-core-bridge .doc101-bridge-text span {
  font-size: 10px;
}
.doc101-core-bridge .doc101-bridge-icon {
  font-size: 16px;
}
