/* The API Hub's own layout. Everything visual comes from the platform's shared files (Tokens.css, Surface.css, Primitives.css, the theme palette): colours, type, control
   geometry and status tags are the shared --ui-* roles, never values written here. This file owns only the page's layout and the Swagger UI skin that maps its parts
   onto those roles. Geometry follows the design reference: 28px page gutter (16px narrow), 24px between sections, 16px header to body, 8px between related actions. */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 400; font-display: swap; src: url('/platform/assets/outfit-regular.ttf') format('truetype'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 500; font-display: swap; src: url('/platform/assets/outfit-medium.ttf') format('truetype'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 700; font-display: swap; src: url('/platform/assets/outfit-bold.ttf') format('truetype'); }

html, body { margin: 0; background: var(--theme-canvas, #fff); }
.hub { min-height: 100vh; box-sizing: border-box; background: var(--ui-base); color: var(--ui-text); font-family: var(--ui-font-family); font-size: 14px; line-height: 22px; }
.hub [hidden] { display: none !important; }

/* Brand bar: the wordmark as a theme-coloured mask, 104 x 36, as in the workspace header. */
/* Surface.css resets the background of plain div/span/header elements inside a surface at triple-attribute specificity; the rules below that need a fill repeat the attribute, as the platform's own chrome does. */
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .hub-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px 28px; background: var(--ui-chrome-surface, var(--ui-table-header)); border-bottom: 1px solid var(--ui-chrome-border, var(--ui-divider)); }

/* The fill is a background IMAGE, as the workspace header does it: a background colour is reset on this surface, an image is not. */
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .hub-wordmark { display: block; flex: none; width: 104px; height: 36px; background-color: transparent; background-image: linear-gradient(var(--ui-text), var(--ui-text)); mask: url('/platform/assets/mitus-logo.svg') center / contain no-repeat; -webkit-mask: url('/platform/assets/mitus-logo.svg') center / contain no-repeat; }
.hub-page { display: grid; gap: 24px; min-width: 0; padding: 28px; }

/* Page navigation: two links in the top bar. The current page is marked by its underline, as the platform's section tabs are. */
.hub-nav { display: flex; align-items: stretch; gap: 4px; align-self: stretch; margin: -12px 0; min-width: 0; }
.hub-nav a { display: inline-flex; align-items: center; padding: 0 12px; border-bottom: 2px solid transparent; color: var(--ui-muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.hub-nav a:hover { color: var(--ui-text); background: var(--ui-raised); }
.hub-nav a[aria-current="page"] { color: var(--ui-text); border-bottom-color: var(--ui-accent); }
.hub-nav a:focus-visible, .hub-link:focus-visible { outline: var(--ui-focus-width) solid var(--ui-accent); outline-offset: var(--ui-focus-offset); }

/* Sign-in controls: the right end of the top bar, on every page. */
.hub-signin { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 8px; margin: 0 0 0 auto; min-width: 0; }
.hub-signin .ui-field { display: grid; gap: 6px; min-width: 0; margin: 0; }
.hub-signin .ui-field > label { color: var(--ui-muted); font-size: 13px; font-weight: 500; line-height: 20px; }
.hub-signin input { width: 220px; max-width: 100%; }
.hub-message { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 20px; }
.hub-message[hidden] { display: none; }
/* The account chip in the top bar: who is signed in. */
.hub-account { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 12px 4px 4px; border: 1px solid var(--ui-border); border-radius: 18px; color: var(--ui-muted); font-size: 13px; line-height: 20px; }
.hub-account[hidden] { display: none; }
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .hub-account__avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ui-raised); color: var(--ui-accent); font-size: 11px; font-weight: 500; }
.hub-account__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* "Not an administrator": one centred card. The lock sits in the warning tone, the facts are a small bordered list, and there is a single primary action. */
.hub-denied { display: flex; justify-content: center; padding: 24px 0 32px; }
.hub-denied[hidden] { display: none; }
.hub-denied__card.ui-card { display: grid; gap: 20px; width: 100%; max-width: 480px; padding: 28px 28px 24px; }
.hub-denied__head { display: flex; align-items: flex-start; gap: 16px; }
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .hub-denied__icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ui-warning-soft); color: var(--ui-warning-text); }
.hub-denied__copy { min-width: 0; }
.hub-denied__title { margin: 0; color: var(--ui-text); font-size: 20px; font-weight: 500; line-height: 28px; letter-spacing: 0; }
.hub-denied__text { margin: 4px 0 0; color: var(--ui-muted); font-size: 14px; line-height: 22px; }
.hub-denied__facts { display: grid; margin: 0; border: 1px solid var(--ui-divider); border-radius: 4px; font-size: 13px; line-height: 20px; }
.hub-denied__facts > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 14px; }
.hub-denied__facts > div + div { border-top: 1px solid var(--ui-divider); }
.hub-denied__facts dt { color: var(--ui-muted); }
.hub-denied__facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; text-align: end; font-weight: 500; color: var(--ui-text); }
.hub-denied__facts:empty { display: none; }
.hub-denied__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .hub-denied__help { margin: 0; padding-top: 14px; border-top: 1px solid var(--ui-divider); color: var(--ui-muted); font-size: 13px; line-height: 20px; }
.hub-view { min-width: 0; }
.hub-service-picker { display: grid; gap: 6px; min-width: 220px; margin: 0; }
.hub-service-picker > label { color: var(--ui-muted); font-size: 13px; font-weight: 500; line-height: 20px; }
.hub-link { color: var(--ui-accent); font-weight: 500; text-decoration: none; white-space: nowrap; }
.hub-link:hover { color: var(--ui-primary-hover); text-decoration: underline; }

/* Services: one flat bordered surface, a compact table inside it. */
.hub-table-scroll { overflow-x: auto; }
.hub-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; line-height: 20px; }
.hub-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hub-table th, .hub-table td { padding: 10px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--ui-divider); }
.hub-table thead th { background: var(--ui-table-header); color: var(--ui-muted); font-size: 12px; font-weight: 500; line-height: 18px; }
.hub-table tbody tr:last-child > * { border-bottom: 0; }
.hub-table tbody th { font-weight: 500; color: var(--ui-text); min-width: 200px; }
.hub-table .hub-service-note { display: block; margin-top: 2px; color: var(--ui-muted); font-weight: 400; }
.hub-table .hub-detail { min-width: 160px; color: var(--ui-muted); overflow-wrap: anywhere; }
/* Not running is "not started" in the design's tones: neutral. The shared tag supplies the rest. */

/* Swagger UI, skinned with the platform's roles. Method colours (GET blue, POST green...) stay: they are meaning, not decoration. */
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .hub-reference { min-width: 0; border: 1px solid var(--ui-border); border-radius: var(--ui-card-radius); overflow: hidden; background: var(--ui-surface); }
.hub .swagger-ui { font-family: var(--ui-font-family); color: var(--ui-text); }
.hub .swagger-ui .scheme-container { display: none; }
.hub .swagger-ui .wrapper { padding: 0 20px; max-width: none; }
.hub .swagger-ui .info { margin: 20px 0; }
/* The version badge is a <small>, whose background Surface.css resets; the muted role gives it back a readable fill. The OAS badge keeps Swagger's own green: it is meaning. */
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .swagger-ui .info .title small:not(.version-stamp) { background: var(--ui-muted); border-radius: var(--ui-tag-radius); }
.hub[data-ui-surface][data-ui-surface][data-ui-surface] .swagger-ui .info .title small:not(.version-stamp) pre { color: var(--ui-primary-text); }
.hub .swagger-ui .info .title, .hub .swagger-ui .info h1, .hub .swagger-ui .info h2, .hub .swagger-ui .info h3, .hub .swagger-ui .info h4, .hub .swagger-ui .info h5 { font-family: var(--ui-font-family); font-weight: 500; letter-spacing: 0; color: var(--ui-text); }
.hub .swagger-ui .info .title { font-size: 20px; line-height: 28px; }
/* The title and its two badges (version, OAS) share one centre line: Swagger lifts the badges with position/top/vertical-align, which leaves them above the text. */
.hub .swagger-ui .info .title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.hub .swagger-ui .info .title small { position: static; top: auto; display: inline-flex; align-items: center; margin: 0; vertical-align: baseline; line-height: 18px; }
.hub .swagger-ui .info .title small pre { margin: 0; }
.hub .swagger-ui :is(.info p, .info li, .info table, .info a, .markdown p, .markdown li, .renderedMarkdown p, .opblock-description-wrapper p, .opblock-external-docs-wrapper p, .response-col_description, .parameter__type, .parameter__in, .model-title, .tab li, label, .opblock-summary-description, .opblock-tag small) { font-family: var(--ui-font-family); color: var(--ui-muted); }
.hub .swagger-ui :is(.opblock-tag, .opblock-tag a, .opblock-summary-path, .opblock-summary-path__deprecated, .parameter__name, .response-col_status, table thead tr td, table thead tr th, .model, .model-box, .prop-type, .prop-name, h4.opblock-tag, section.models h4, .opblock-section-header h4, .opblock-section-header label) { font-family: var(--ui-font-family); color: var(--ui-text); }
.hub .swagger-ui .opblock-tag { border-bottom: 1px solid var(--ui-divider); font-size: 16px; font-weight: 500; }
.hub .swagger-ui .opblock-tag:hover { background: var(--ui-raised); }
.hub .swagger-ui .opblock .opblock-section-header { background: var(--ui-table-header); box-shadow: none; }
.hub .swagger-ui .opblock .opblock-section-header h4 { font-size: 13px; font-weight: 500; }
.hub .swagger-ui table thead tr td, .hub .swagger-ui table thead tr th { border-bottom: 1px solid var(--ui-divider); }
.hub .swagger-ui section.models { border: 1px solid var(--ui-border); border-radius: var(--ui-card-radius); }
.hub .swagger-ui section.models.is-open h4 { border-bottom: 1px solid var(--ui-divider); }
.hub .swagger-ui .model-box, .hub .swagger-ui section.models .model-container { background: var(--ui-base); }
.hub .swagger-ui .btn { font-family: var(--ui-font-family); border-radius: var(--ui-control-radius); box-shadow: none; }
.hub .swagger-ui .markdown code, .hub .swagger-ui .renderedMarkdown code { background: var(--ui-raised); color: var(--ui-text); border-radius: var(--ui-tag-radius); }
.hub .swagger-ui .loading-container .loading::before { border-top-color: var(--ui-accent); }

@media (max-width: 720px) {
  .hub-brand { padding: 12px 16px; }
  .hub-page { padding: 16px; gap: 20px; }
  .hub-signin { justify-content: flex-start; margin-left: 0; width: 100%; }
  .hub-account__name { max-width: 180px; }
  .hub-denied { padding: 8px 0 24px; }
  .hub-denied__card.ui-card { padding: 20px 16px; }
  .hub-nav { margin: 0; align-self: auto; }
  .hub-nav a { min-height: 36px; }
  .hub .swagger-ui .wrapper { padding: 0 12px; }
  }
