/* Main platform adapter for the shared Yanzu Console foundation. */
:root {
  --control-height: var(--console-control-height);
  --control-height-compact: 32px;
  --radius: var(--console-radius);
  --radius-sm: var(--console-radius-small);
  --radius-lg: var(--console-radius-large);
  --z-console-nav-backdrop: 20;
  --z-console-sidebar: 21;
}

html, body { font-family: var(--console-font); }
body { font-size: 14px; line-height: 1.5; }
.app-shell { grid-template-columns: var(--console-sidebar-width) minmax(0, 1fr); }
.sidebar {
  padding: 18px 12px 12px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: var(--console-sidebar);
}
.sidebar-brand { min-height: 36px; padding: 0 8px; text-decoration: none; }
.sidebar .console-brand strong { font-size: 14px; white-space: nowrap; }
.sidebar .console-brand small { color: var(--muted); font-size: 10px; letter-spacing: .09em; }
.workspace-identity.console-context {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
  margin: 20px 8px 16px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
}
.workspace-identity span { color: var(--muted); font-size: 12px; }
.workspace-identity strong { margin: 0; color: var(--ink); font-size: 13px; }
.workspace-identity small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.nav { gap: 2px; }
.nav-label { margin: 16px 10px 5px; color: var(--muted); font-size: 11px; font-weight: 500; }
.nav button, .nav .nav-external {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--console-radius-small);
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--console-motion), background-color var(--console-motion);
}
.nav .nav-external svg { width: 16px; height: 16px; flex: 0 0 16px; fill: currentColor; opacity: .8; }
.nav .nav-external-icon { margin-left: auto; width: 12px; height: 12px; flex-basis: 12px; color: var(--muted); }
.nav button:hover, .nav .nav-external:hover { color: var(--ink); background: var(--surface-strong); }
.nav button.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 650; }
.nav button.active svg { color: var(--accent); }
.sidebar .sidebar-theme { margin: 18px 8px 12px; color: var(--muted); }
.sidebar .sidebar-theme select { min-height: 32px; border-color: var(--line); color: var(--ink-soft); background: var(--surface); font-size: 12px; }
.sidebar-status { gap: 9px; padding: 12px 8px 2px; border-top-color: var(--line); }
.sidebar-status strong { color: var(--ink-soft); font-size: 11px; font-weight: 500; }
.sidebar-status small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.sidebar-status .status-dot { width: 6px; height: 6px; background: var(--accent); box-shadow: none; }
.sidebar-status.runtime-offline .status-dot { background: var(--danger); }
.topbar {
  min-height: var(--console-topbar-height);
  padding: 8px 24px;
  gap: 16px;
  background: var(--surface);
  backdrop-filter: none;
}
.topbar-title { min-width: 0; }
.topbar .breadcrumb { display: none; }
.topbar h1 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.topbar .theme-picker { min-height: 32px; border-color: var(--line); background: var(--surface); }
.topbar .theme-picker select { min-height: 30px; padding-block: 4px; font-size: 12px; }
.topbar .theme-picker > span { font-size: 12px; }
.topbar .account-chip { min-width: 110px; padding-left: 10px; }
.topbar .account-chip strong { font-size: 12px; }
.topbar .account-chip small { font-size: 10px; }
.topbar .avatar { width: 28px; height: 28px; border-radius: 7px; color: var(--accent-text); background: var(--accent-soft); font-size: 12px; }
.topbar .button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.topbar .icon-button { width: 32px; padding: 7px; }
.content { max-width: 1800px; padding: 20px 24px 40px; }
.button { border-radius: var(--console-radius-small); box-shadow: none; }
.button:not(.full) { min-height: var(--console-control-height); padding: 6px 12px; font-size: 13px; }
.button.small { min-height: 30px; padding: 4px 9px; font-size: 12px; }
input, select { min-height: var(--console-control-height); border-radius: var(--console-radius-small); }
.table-section, .resource-panel, .supplier-workspace, .application-workspace, .supplier-monitor-workspace { border-radius: var(--console-radius); box-shadow: none; }
.page-intro { margin-bottom: 14px; }
.page-intro p { color: var(--muted); }
.section-header h2, .section-header h3 { font-size: 15px; font-weight: 650; }
.summary-line { border-radius: var(--console-radius); }
.summary-line strong { font-size: 20px; font-weight: 650; }
.page-tabs button { min-height: 38px; font-size: 13px; }
.model-binding-chip { grid-template-columns: minmax(48px, 64px) minmax(0, 1fr) auto; }
.model-binding-key { width: auto; min-width: 0; display: flex; align-items: center; }
.model-binding-key > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav button:focus-visible, .nav a:focus-visible,
.hub-action:focus-visible, .hub-site-row:focus-visible,
.hub-category-filter button:focus-visible, .button:focus-visible {
  outline: var(--console-focus);
  outline-offset: 2px;
  box-shadow: none;
}

/* A focused login surface uses the same vocabulary as the signed-in console. */
.login-view { grid-template-columns: minmax(420px, 1fr) minmax(390px, 1fr); }
.login-story { padding: 40px 48px; color: var(--ink); background: var(--surface-muted); border-right: 1px solid var(--line); }
.login-brand.console-brand strong { color: var(--ink); font-size: 15px; }
.login-brand.console-brand small { color: var(--muted); font-size: 10px; letter-spacing: .09em; }
.login-story-content { width: 100%; max-width: 470px; }
.login-story-content .context-label { color: var(--accent); font-size: 12px; font-weight: 600; }
.login-story-content h1 { margin: 16px 0 0; color: var(--ink); font-size: 38px; line-height: 1.35; letter-spacing: -.025em; font-weight: 650; }
.login-story-content > p:last-of-type { margin-top: 20px; max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.login-capabilities { gap: 14px; margin-top: 28px; color: var(--ink-soft); font-size: 12px; }
.login-capabilities span::before { background: var(--accent); }
.login-environment { border-top-color: var(--line); color: var(--muted); font-size: 11px; }
.login-environment .status-dot { background: var(--accent); box-shadow: none; }
.login-card { max-width: 360px; }
.login-card h2 { font-size: 25px; font-weight: 650; }
.login-card header > p:last-child { font-size: 13px; }
.login-form { gap: 18px; }
.login-form input { min-height: 42px; }
.login-form .button.full { min-height: 42px; }
.login-note { font-size: 12px; }

/* Workspace: a compact operating desk and a searchable list of public sites. */
.workspace-hub { width: 100%; max-width: 1440px; margin: 0 auto; }
.hub-welcome { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 3px 0 26px; }
.hub-welcome-eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.hub-welcome h2 { margin: 0; color: var(--ink); font-size: 22px; line-height: 1.45; font-weight: 650; letter-spacing: -.02em; }
.hub-welcome h2 + p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.hub-welcome .button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; }
.hub-welcome .button svg { width: 15px; height: 15px; }
.hub-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 20px 15px; }
.hub-section-heading h2 { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.4; font-weight: 650; }
.hub-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.hub-section-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hub-operations { margin-bottom: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--console-radius); background: var(--surface); }
.hub-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.hub-action { min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 16px 20px; border: 0; border-right: 1px solid var(--line-subtle); border-bottom: 1px solid var(--line-subtle); color: var(--ink); background: transparent; text-align: left; cursor: pointer; transition: background-color var(--console-motion), color var(--console-motion); }
.hub-action:nth-child(3n) { border-right: 0; }
.hub-action:nth-last-child(-n+3) { border-bottom: 0; }
.hub-action:hover { color: var(--accent-text); background: var(--surface-hover); }
.hub-action-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; color: var(--accent); }
.hub-action-icon svg { width: 22px; height: 22px; }
.hub-action > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.hub-action strong { font-size: 13px; font-weight: 600; }
.hub-action small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.hub-action > svg { width: 15px; height: 15px; flex: 0 0 15px; margin-left: auto; color: var(--muted); }
.hub-directory { overflow: hidden; border: 1px solid var(--line); border-radius: var(--console-radius); background: var(--surface); }
.hub-directory-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 0 20px 14px; }
.hub-category-filter { display: flex; flex-wrap: wrap; gap: 4px; }
.hub-category-filter button { min-height: 32px; padding: 6px 10px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 12px; line-height: 1.5; cursor: pointer; transition: background-color var(--console-motion), color var(--console-motion); }
.hub-category-filter button:hover { color: var(--ink); background: var(--surface-muted); }
.hub-category-filter button[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.hub-directory-search { position: relative; width: 250px; flex: 0 1 250px; }
.hub-directory-search > svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.hub-directory-search input { width: 100%; min-height: 34px; padding: 7px 10px 7px 32px; background: var(--surface); font-size: 12px; }
.hub-site-list { border-top: 1px solid var(--line); }
.hub-site-row { display: grid; grid-template-columns: 38px minmax(180px, 1.2fr) 90px minmax(160px, 1fr) 60px; align-items: center; gap: 14px; min-height: 76px; padding: 14px 20px; border-bottom: 1px solid var(--line-subtle); color: var(--ink); background: var(--surface); text-decoration: none; transition: background-color var(--console-motion), color var(--console-motion); }
.hub-site-row:last-child { border-bottom: 0; }
.hub-site-row[hidden], .hub-site-list[hidden], .hub-directory-empty[hidden] { display: none; }
.hub-site-row:hover { color: var(--accent-text); background: var(--surface-hover); }
.hub-site-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--console-radius); color: var(--ink-soft); background: var(--surface-muted); }
.hub-site-icon svg { width: 20px; height: 20px; }
.hub-site-main, .hub-site-location { display: grid; gap: 5px; min-width: 0; }
.hub-site-main strong { color: inherit; font-size: 13px; font-weight: 600; }
.hub-site-main > span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.hub-site-category { color: var(--muted); font-size: 12px; }
.hub-site-location > span { overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hub-site-location small { color: var(--muted); font-size: 11px; }
.hub-site-open { display: flex; justify-content: flex-end; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.hub-site-open svg { width: 14px; height: 14px; }
.hub-site-row:hover .hub-site-open { color: var(--accent); }
.hub-directory-empty { padding: 40px 20px; border-top: 1px solid var(--line); text-align: center; }
.hub-directory-empty strong { font-size: 14px; font-weight: 600; }
.hub-directory-empty p { margin: 8px 0 18px; color: var(--muted); font-size: 13px; }
.hub-directory-footer { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface-muted); font-size: 11px; }

@media (max-width: 1200px) {
  .topbar .sync-state { display: none; }
  .hub-site-row { grid-template-columns: 38px minmax(180px, 1.2fr) minmax(150px, 1fr) 60px; }
  .hub-site-category { display: none; }
}
@media (max-width: 960px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: var(--z-console-sidebar); width: var(--console-sidebar-width); }
  .sidebar-backdrop { z-index: var(--z-console-nav-backdrop); }
  .content { padding-inline: 20px; }
  .topbar { padding-inline: 20px; }
  .sidebar .nav button, .sidebar .nav-external { min-height: 40px; }
  .login-view { grid-template-columns: 1fr; }
  .login-story { min-height: 0; padding: 24px 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-story-content { max-width: none; margin: 28px 0; }
  .login-story-content h1 { font-size: 30px; }
  .login-story-content h1 br { display: none; }
  .login-story-content > p:last-of-type { max-width: 550px; margin-top: 12px; }
  .login-capabilities { margin-top: 20px; }
  .login-environment { display: none; }
  .login-panel { min-height: 470px; padding: 72px 24px 40px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 60px; gap: 12px; padding: 10px 16px; }
  .topbar h1 { max-width: none; font-size: 18px; }
  .topbar .account-chip { min-width: 0; padding-left: 0; border: 0; }
  .topbar .account-chip > div { display: none; }
  .topbar .theme-picker-topbar { display: none; }
  .topbar .icon-button { width: 36px; }
  .topbar .button, .mobile-menu { min-height: 38px; }
  .topbar .logout-button { padding-inline: 8px; }
  .content { padding: 20px 16px 32px; }
  .hub-welcome { align-items: flex-start; gap: 16px; margin-bottom: 22px; }
  .hub-welcome h2 { font-size: 20px; }
  .hub-welcome h2 + p { max-width: 380px; }
  .hub-section-heading { padding: 16px; }
  .hub-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-action { padding: 14px 16px; gap: 9px; }
  .hub-action:nth-child(3n) { border-right: 1px solid var(--line-subtle); }
  .hub-action:nth-child(2n) { border-right: 0; }
  .hub-action:nth-last-child(-n+3) { border-bottom: 1px solid var(--line-subtle); }
  .hub-action:nth-last-child(-n+2) { border-bottom: 0; }
  .hub-action > svg { display: none; }
  .hub-directory-toolbar { padding: 0 16px 14px; }
  .hub-directory-search { flex-basis: 100%; width: 100%; }
  .hub-directory-search input, .hub-category-filter button { min-height: 40px; }
  .hub-site-row { grid-template-columns: 34px minmax(0, 1fr) 20px; gap: 12px; padding: 16px; }
  .hub-site-icon { width: 34px; height: 34px; }
  .hub-site-location { grid-column: 2; grid-row: 2; gap: 3px; }
  .hub-site-location > span { white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
  .hub-site-open { grid-column: 3; grid-row: 1; font-size: 0; }
  .hub-site-open svg { width: 16px; height: 16px; }
  .hub-directory-footer { padding: 12px 16px; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .hub-welcome { display: block; }
  .hub-welcome .button { margin-top: 14px; }
  .hub-action { align-items: flex-start; min-height: 90px; gap: 7px; padding: 14px 12px; }
  .hub-action-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .hub-action-icon svg { width: 20px; height: 20px; }
  .hub-action strong { font-size: 12px; }
  .hub-action small { font-size: 11px; }
  .hub-section-meta { display: none; }
  .hub-category-filter { gap: 2px; }
  .hub-category-filter button { padding-inline: 8px; }
  .login-story { padding: 24px; }
  .login-story-content { margin: 26px 0 8px; }
  .login-story-content h1 { font-size: 27px; }
  .login-story-content > p:last-of-type { font-size: 13px; }
  .login-capabilities { display: none; }
}
