.hub-breadcrumbs { margin: 0 0 20px; font-size: 14px; color: #475569; }
.hub-sticky-navigation { position: sticky; top: 0; z-index: 40; background: #f9fafb; padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.hub-breadcrumbs ol { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.hub-breadcrumbs li { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.hub-breadcrumbs li + li::before { content: '›'; color: #64748b; }
.hub-breadcrumbs a, .hub-page-nav a, .hub-return-link { color: #1d4ed8; text-decoration: none; }
.hub-breadcrumbs a:hover, .hub-page-nav a:hover, .hub-return-link:hover { text-decoration: underline; }
.hub-page-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; border-bottom: 1px solid #e2e8f0; padding: 8px 0 12px; margin: 0 0 16px; font-size: 14px; }
.hub-page-nav a { display: inline-flex; align-items: center; min-height: 36px; }
.hub-page-nav a[aria-current] { font-weight: 600; color: #0f172a; border-bottom: 2px solid #2563eb; }
.hub-return-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; }
.hub-navigation-compact { padding: 12px 16px 0; background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.hub-navigation-compact .hub-breadcrumbs { margin-bottom: 12px; }
.hub-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hub-breadcrumbs a:focus-visible, .hub-page-nav a:focus-visible, .hub-return-link:focus-visible, .template-library button:focus-visible, .template-library input:focus-visible, .template-library select:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.template-library { color: #111827; }
.template-library-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.template-library-header p { color: #475569; margin-top: 6px; max-width: 65ch; }
.template-backups { display: flex; flex-wrap: wrap; gap: 8px; }
.template-backups button, .template-backups label { background: #fff; color: #334155; border: 1px solid #cbd5e1; border-radius: 6px; padding: 9px 12px; font-size: 14px; cursor: pointer; }
.template-backups label:focus-within { outline: 3px solid #2563eb; outline-offset: 3px; }
.template-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 0; border-top: 1px solid #e2e8f0; }
.template-toolbar label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.template-search-field { flex: 1 1 280px; }
.template-toolbar input, .template-toolbar select { width: 100%; min-height: 42px; border: 1px solid #94a3b8; border-radius: 6px; padding: 8px 12px; background: white; font-size: 14px; color: #111827; }
.template-toolbar button, .template-empty button { min-height: 42px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; font-size: 14px; }
.template-toolbar button:disabled { color: #64748b; cursor: default; }
.template-view-options { display: flex; gap: 4px; }
.template-view-options button[aria-pressed=true] { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.template-result-count { margin: 0 0 12px; font-size: 13px; color: #475569; }
.template-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.template-table thead { background: #f8fafc; }
.template-table th, .template-table td { padding: 14px 12px; vertical-align: top; border-bottom: 1px solid #e2e8f0; }
.template-table thead th { color: #475569; font-size: 12px; font-weight: 600; }
.template-table tbody th { font-weight: 400; width: 34%; }
.template-table td { overflow-wrap: anywhere; }
.template-table tbody tr:hover { background: #f8fafc; }
.template-name { font-weight: 600; overflow-wrap: anywhere; color: #0f172a; }
.template-description { font-size: 12px; color: #475569; margin: 4px 0 0; overflow-wrap: anywhere; }
.template-actions { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.template-actions button { min-height: 36px; padding: 5px 2px; color: #1d4ed8; font-size: 14px; white-space: nowrap; }
.template-actions button:hover { text-decoration: underline; }
.template-actions .template-delete { color: #b91c1c; }
.template-empty { padding: 40px 16px; border: 1px dashed #cbd5e1; text-align: center; color: #475569; }
.template-empty button { margin-top: 12px; }
.template-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.template-card { padding: 20px; border: 1px solid #e2e8f0; border-radius: 6px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.template-card .template-actions { margin-top: auto; padding-top: 8px; }
.template-preview { width: min(1180px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #cbd5e1; border-radius: 8px; color: #0f172a; background: #fff; font-family: inherit; box-shadow: 0 24px 64px #0f172a40; overflow: auto; }
.template-preview::backdrop { background: #0f172a80; }
.template-preview-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 24px 24px 16px; }
.template-preview-header > div { min-width: 0; }
.template-preview-header h2 { font-size: 22px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.template-preview-header p { margin: 6px 0 0; font-size: 14px; color: #475569; overflow-wrap: anywhere; }
.template-preview-header .template-preview-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: #475569; }
.template-preview button { min-height: 40px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 12px; font-size: 14px; background: #fff; color: #334155; }
.template-preview .template-preview-close { flex-shrink: 0; }
.template-preview button:hover:not(:disabled) { background: #f1f5f9; }
.template-preview button:disabled { color: #64748b; cursor: default; }
.template-preview button:focus-visible, .template-preview [tabindex]:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.template-preview-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0 24px; font-size: 14px; color: #334155; }
.template-preview-sections { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px; }
.template-preview-sections span { padding: 4px 8px; font-size: 12px; color: #334155; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; }
.template-preview-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid #cbd5e1; }
.template-preview-tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; color: #475569; }
.template-preview-tabs button[aria-selected=true] { border-bottom-color: #2563eb; color: #1d4ed8; font-weight: 600; }
.template-preview-content { padding: 16px 24px 24px; }
.template-preview-hint { margin: 0 0 16px; font-size: 13px; color: #475569; }
.template-preview-empty { padding: 32px 12px; border: 1px dashed #cbd5e1; text-align: center; font-size: 14px; color: #475569; }
.template-preview-scroll { max-height: 48vh; overflow: auto; border: 1px solid #e2e8f0; border-radius: 4px; }
.template-preview table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; text-align: left; }
.template-preview th, .template-preview td { padding: 12px; border-bottom: 1px solid #e2e8f0; vertical-align: top; min-width: 130px; max-width: 340px; overflow-wrap: anywhere; white-space: pre-wrap; }
.template-preview thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; color: #334155; font-weight: 600; }
.template-preview tbody th { font-weight: 500; }
.template-preview th:first-child, .template-preview td:first-child { position: sticky; left: 0; min-width: 64px; width: 64px; background: #f8fafc; }
.template-preview thead th:first-child { z-index: 3; }
.template-preview small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; color: #475569; }
.template-preview-swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid #64748b; vertical-align: middle; margin-right: 8px; }
.template-preview-pager { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.template-preview-pager p { margin-right: auto; font-size: 13px; color: #475569; }
@media (max-width: 900px) {
  .template-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-table th, .template-table td { padding: 12px 8px; }
}
@media (max-width: 680px) {
  .template-preview { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .template-preview-header { padding: 16px 16px 12px; flex-direction: column; gap: 12px; }
  .template-preview-header h2 { font-size: 20px; }
  .template-preview-header .template-preview-close { align-self: flex-end; min-height: 44px; }
  .template-preview-summary, .template-preview-tabs { padding-left: 16px; padding-right: 16px; }
  .template-preview-sections { padding: 12px 16px; }
  .template-preview-content { padding: 12px 16px 16px; }
  .template-preview-scroll { max-height: 40vh; }
  .template-preview button { min-height: 44px; }
  .template-card-grid { grid-template-columns: 1fr; }
  .template-library { padding: 16px !important; }
  .template-table, .template-table tbody, .template-table tr, .template-table tbody th, .template-table td { display: block; width: auto; }
  .template-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .template-table tbody tr { border-bottom: 1px solid #cbd5e1; padding: 12px 0; }
  .template-table tbody th, .template-table td { border: 0; padding: 5px 0; }
  .template-table td::before { content: attr(data-label) ': '; font-size: 12px; font-weight: 600; color: #475569; }
  .template-table td:last-child::before { content: none; }
  .template-table td > div, .template-table td > span { display: inline-block; }
  .template-table td .template-actions { display: flex; }
  .template-actions button { min-height: 44px; }
  .template-toolbar > div:not(.template-search-field) { flex: 1 1 auto; }
}
