/* The shared CaseBlocks theme supplies the page header, menu and typography. */
.td-theme-start { }
.td-shell { border: 1px solid #e5e9ef; border-radius: 14px; background: #fff; overflow: hidden; color: #0d2d44; min-width: 0; }
.td-shell, .td-shell * { box-sizing: border-box; }
.td-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #eef1f5; background: #f9fafd; }
.td-brand { margin-right: auto; padding: 6px 0; font-weight: 600; }
.td-shell .td-button { border: 1px solid transparent; border-radius: 999px; background: transparent; color: #0d2d44; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.td-shell .td-button:hover { background: #fff1e6; color: #c25700; }
.td-shell .td-button:focus-visible, .td-select:focus-visible { outline: 2px solid #f57100; outline-offset: 2px; }
.td-control { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 8px; font-size: 12px; color: #64748b; }
.td-select { border: 1px solid #e5e9ef; border-radius: 8px; padding: 6px 8px; background: #fff; color: #0d2d44; font: inherit; width: auto; height: auto; }
.td-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 420px; }
.td-tree-panel { min-width: 0; border-right: 1px solid #eef1f5; padding: 16px; }
.td-panel-heading { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #64748b; margin-bottom: 16px; }
.td-tree-frame { width: 100%; max-width: 100%; min-width: 0; border: 1px solid #e5e9ef; border-radius: 8px; overflow: hidden; }
.td-inspector { min-width: 0; padding: 16px; }
.td-hint { margin: 0 0 20px; font-size: 13px; line-height: 1.6; color: #64748b; }
.td-event { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #fff1e6; color: #c25700; font-size: 12px; font-weight: 600; }
.td-output { max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #eef1f5; border-radius: 8px; margin: 12px 0 0; padding: 12px; background: #f9fafd; font-size: 12px; line-height: 1.5; color: #4b5d6e; }
@media (max-width: 760px) {
  .td-body { grid-template-columns: minmax(0, 1fr); }
  .td-tree-panel { border-right: 0; border-bottom: 1px solid #eef1f5; }
  .td-brand { width: 100%; }
}

/* Component lab */
.td-shell { font-family: inherit; }
.td-native-event { font-size: 12px; color: #64748b; margin-top: 12px; }
.td-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 28px; background: linear-gradient(120deg, #0d2d44, #17425f); color: #fff; }
.td-eyebrow { font-size: 10px; letter-spacing: .18em; color: #ffc38f; font-weight: 700; }
.td-lab-title { margin: 8px 0; color: #fff; font-size: 28px; font-weight: 600; line-height: 1.2; }
.td-lab-subtitle { color: #c2d3df; margin: 0; font-size: 13px; }
.td-coverage { padding: 9px 14px; border: 1px solid #ffffff35; border-radius: 999px; color: #fff; font-size: 12px; white-space: nowrap; }
.td-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px 24px; background: #f9fafd; border-bottom: 1px solid #e5e9ef; }
.td-preset { min-width: 0; text-align: left; border: 1px solid #e5e9ef; border-radius: 10px; padding: 14px; background: #fff; color: #0d2d44; cursor: pointer; font: inherit; }
.td-preset strong, .td-preset span { display: block; }
.td-preset strong { font-size: 14px; margin-bottom: 6px; }
.td-preset span { color: #64748b; font-size: 11px; line-height: 1.5; }
.td-preset:hover, .td-preset[aria-pressed=true] { border-color: #f57100; background: #fff8f2; }
.td-toolbar { padding: 12px 24px; }
.td-toolbar > .td-field { display: flex; align-items: center; gap: 8px; margin: 0 0 0 10px; }
.td-body { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); min-height: 390px; }
.td-tree-panel { padding: 24px; }
.td-tree-frame { transition: width .15s; }
.td-tree-hint { margin-top: 20px; max-width: 420px; font-size: 12px; }
.td-controls { min-width: 0; padding: 24px; background: #fcfdfe; }
.td-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.td-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; min-width: 0; font-size: 12px; color: #526477; }
.td-field .td-select { width: 100%; min-width: 0; max-width: 100%; height: 36px; }
.td-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 6px 0 18px; border-bottom: 1px solid #e5e9ef; }
.td-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; margin: 0; cursor: pointer; }
.td-switch input[type=checkbox], .td-api-fields input[type=checkbox] { appearance: auto !important; -webkit-appearance: checkbox !important; position: static !important; opacity: 1 !important; visibility: visible !important; clip: auto !important; clip-path: none !important; display: inline-block !important; accent-color: #f57100; width: 16px !important; height: 16px !important; margin: 0; }
.td-node-tools { padding-top: 18px; }
.td-node-buttons, .td-api-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.td-node-buttons .td-button { padding: 6px 10px; font-size: 12px; background: #eef2f6; }
.td-shell .td-button-danger { color: #ad3232; }
.td-shell .td-button-primary { background: #0d2d44; color: #fff; border-color: #0d2d44; padding: 9px 18px; }
.td-shell .td-button-primary:hover { background: #f57100; border-color: #f57100; color: #fff; }
.td-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid #e5e9ef; }
.td-api-panel { min-width: 0; padding: 24px; border-right: 1px solid #e5e9ef; }
.td-inspector { padding: 24px; }
.td-input { width: 100%; min-width: 0; border: 1px solid #dce3eb; border-radius: 7px; padding: 9px 10px; background: #fff; color: #0d2d44; font: inherit; font-size: 12px; height: auto; }
textarea.td-input { font-family: Consolas, monospace; line-height: 1.5; resize: vertical; }
.td-api-description { font-size: 12px; color: #64748b; line-height: 1.6; margin: 0 0 16px; }
.td-status { font-size: 12px; color: #64748b; margin: 14px 0 0; min-height: 18px; }
.td-status[data-kind=error] { color: #b42318; }
.td-status[data-kind=success] { color: #315a48; }
.td-output { max-height: 260px; }
.td-event-heading { display: flex; align-items: center; justify-content: space-between; }
.td-event-heading .td-panel-heading { margin-bottom: 0; }
.td-event-heading { margin-bottom: 16px; }
.td-event-list { max-height: 200px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.td-event-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 6px; color: #334b5f; background: #f6f8fb; font: inherit; font-size: 12px; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.td-event-item:hover { background: #fff1e6; }
.td-event-tag { font-size: 8px; letter-spacing: .05em; background: #e9eef5; color: #64748b; padding: 3px 5px; border-radius: 4px; }
.td-event-tag-sub { color: #9c4700; background: #ffe5cf; }
.td-gallery { display: none; padding: 24px; border-top: 1px solid #e5e9ef; background: #f9fafd; }
.td-gallery-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.td-gallery-card { min-width: 0; background: #fff; border: 1px solid #e5e9ef; border-radius: 10px; padding: 16px; }
.td-gallery-card h3 { font-size: 16px; color: #0d2d44; margin: 0 0 8px; }
.td-gallery-card .td-hint { font-size: 11px; min-height: 32px; margin-bottom: 12px; }
.td-shell[data-layout=gallery] .td-gallery { display: block; }
.td-shell[data-layout=stacked] .td-body { grid-template-columns: minmax(0, 1fr); }
.td-shell[data-layout=stacked] .td-tree-panel { border-right: 0; border-bottom: 1px solid #e5e9ef; }
.td-shell[data-layout=compact] .td-body { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
.td-shell[data-layout=compact] .td-tree-panel { padding: 16px; }
.td-accent-warm { --tv-selected-bg: #ffe0b5; --tv-selected-color: #743600; --tv-hover-bg: #fff3e8; }
.td-accent-blue { --tv-selected-bg: #dceafb; --tv-selected-color: #1e4b80; --tv-hover-bg: #eef5fd; }
.tv-row.td-important { font-weight: 600; }
.td-glyph-folder, .td-glyph-file, .td-glyph-info { display: inline-block; width: 15px; height: 15px; background: currentColor; }
.td-glyph-folder { color: #bf833a; clip-path: polygon(0 12%, 38% 12%, 48% 28%, 100% 28%, 100% 88%, 0 88%); }
.td-glyph-file { color: #7194ad; clip-path: polygon(15% 0, 65% 0, 90% 25%, 90% 100%, 15% 100%); }
.td-glyph-info { color: #7194ad; border-radius: 50%; transform: scale(.8); }
@media (max-width: 900px) {
  .td-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-body, .td-shell[data-layout=compact] .td-body { grid-template-columns: minmax(0, 1fr); }
  .td-tree-panel { border-right: 0; border-bottom: 1px solid #e5e9ef; }
  .td-gallery-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .td-hero { flex-direction: column; align-items: flex-start; padding: 24px 18px; }
  .td-lab-title { font-size: 24px; }
  .td-presets { gap: 8px; padding: 16px; }
  .td-lower { grid-template-columns: minmax(0, 1fr); }
  .td-api-panel { border-right: 0; border-bottom: 1px solid #e5e9ef; }
  .td-tree-panel, .td-controls, .td-api-panel, .td-inspector { padding: 18px; }
  .td-toolbar { padding: 12px 18px; }
  .td-toolbar > .td-field { width: 100%; margin-left: 0; }
}

/* Two deliberately contrasting presentations of the same tree component. */
.td-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.td-catalog { --tv-line-height: 64px; --tv-font-size: 15px; --tv-bg: #f6f7fc; --tv-color: #263252; --tv-hover-bg: #eaeefe; --tv-selected-bg: #e0e6ff; --tv-selected-color: #273584; --tv-arrow-color: #7180a6; padding: 14px; border-radius: 14px; }
.td-catalog .tv-row { margin: 6px 0; padding-right: 12px; border: 1px solid #e1e7f3; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #34456a0d; }
.td-catalog .tv-row:hover { background: var(--tv-hover-bg); }
.td-catalog .tv-row.tv-selected { background: var(--tv-selected-bg); border-color: #aab7f1; }
.td-catalog .tv-icon { width: 38px; height: 38px; margin: 0 12px 0 4px; border-radius: 11px; justify-content: center; background: #ecf0ff; color: #5265bd; font-size: 20px; }
.td-catalog .tv-label { font-weight: 600; }
.td-catalog-grid::before { content: "▦"; } .td-catalog-briefcase::before { content: "▣"; } .td-catalog-device::before { content: "▤"; } .td-catalog-app::before { content: "✦"; } .td-catalog-help::before { content: "?"; font-weight: 700; }
.td-mission { --tv-line-height: 34px; --tv-font-size: 12px; --tv-bg: #101b2b; --tv-color: #d5e7f5; --tv-hover-bg: #1b3048; --tv-selected-bg: #17405a; --tv-selected-color: #fff; --tv-arrow-color: #7896b1; --tv-drop-border: #41d8c4; background: #101b2b; padding: 14px; border-radius: 12px; font-family: Consolas, monospace; }
.td-mission .tv-row { border-bottom: 1px solid #24354a; border-radius: 0; }
.td-mission .tv-icon { margin: 0 9px 0 3px; color: #70b7d5; width: 18px; justify-content: center; }
.td-mission .tv-label { letter-spacing: .015em; }
.td-mission .tv-ellipsis { filter: brightness(1.8); }
.td-mission .tv-list .tv-list { border-left: 1px solid #28445d; margin-left: 7px; }
.td-mission-pulse::before { content: "◈"; } .td-mission-server::before { content: "▥"; } .td-mission-database::before { content: "▤"; } .td-mission-ok::before { content: "●"; color: #4cddba; } .td-mission-warning::before { content: "▲"; color: #ffbb55; }
.td-mission .td-status-ok .tv-label { color: #7de6c7; } .td-mission .td-status-warning .tv-label { color: #ffc678; }
@media (max-width: 900px) { .td-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
