:root {
  --color-primary: #1e40af;
  --color-primary-dark: #17358f;
  --color-primary-soft: #e8eefc;
  --color-secondary: #3b82f6;
  --color-cta: #f59e0b;
  --color-cta-dark: #b45309;
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-subtle: #f1f5f9;
  --color-text: #1e3a8a;
  --color-heading: #172554;
  --color-body: #334155;
  --color-muted: #64748b;
  --color-border: #dbe3ef;
  --color-border-strong: #b8c5d9;
  --color-success: #166534;
  --color-success-bg: #f0fdf4;
  --color-success-border: #86efac;
  --color-danger: #b91c1c;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-warning: #92400e;
  --color-warning-bg: #fffbeb;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
  --transition: 200ms ease;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shell-width: 80rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--color-background);
  color: var(--color-body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body:not(.auth-page) {
  display: flex;
  flex-direction: column;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--color-heading);
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: var(--space-md);
  font-size: clamp(1.8rem, 4vw, 2.65rem);
}

h2 {
  margin-bottom: var(--space-sm);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.05rem;
}

:focus-visible {
  outline: 3px solid var(--color-cta);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--color-heading);
  color: #fff;
  transform: translateY(-200%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(calc(100% - 2rem), var(--shell-width));
  margin-inline: auto;
}

.site-main {
  flex: 1;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.7rem;
  color: var(--color-heading);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 5px 16px rgba(30, 64, 175, 0.2);
}

.brand-mark svg {
  width: 1.45rem;
  height: 1.45rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.brand-copy small {
  margin-top: 0.15rem;
  color: var(--color-muted);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.primary-nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.25rem;
}

.primary-nav > a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 0.72rem;
  border-radius: var(--radius-md);
  color: var(--color-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
}

.primary-nav > a:hover {
  background: var(--color-surface-subtle);
  color: var(--color-primary);
}

.primary-nav > a[aria-current="page"] {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.primary-nav svg {
  width: 1.1rem;
  height: 1.1rem;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-primary);
  transition: background-color var(--transition), border-color var(--transition);
}

.nav-toggle:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.account-cluster {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-sm);
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-border);
}

.account-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.account-copy strong {
  max-width: 9rem;
  overflow: hidden;
  color: var(--color-heading);
  font-size: 0.9rem;
  text-overflow: ellipsis;
}

.account-copy small {
  color: var(--color-muted);
  font-size: 0.75rem;
}

.logout-form {
  margin: 0;
}

.icon-button {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-muted);
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.icon-button:hover {
  background: var(--color-surface-subtle);
  color: var(--color-primary);
}

.icon-button-bordered {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.icon-button-bordered:hover {
  border-color: var(--color-primary);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer-inner {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  color: var(--color-muted);
  font-size: 0.82rem;
}

.footer-inner p {
  margin: 0;
}

.eyebrow {
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-heading {
  max-width: 50rem;
  margin-bottom: var(--space-xl);
}

.page-heading > p:last-child {
  max-width: 46rem;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 1.03rem;
}

.page-heading-split {
  display: flex;
  max-width: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-xl);
}

.page-heading-split > div:first-child {
  max-width: 50rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.67rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.button svg {
  width: 1.05rem;
  height: 1.05rem;
}

.button-primary {
  border-color: var(--color-cta);
  background: var(--color-cta);
  color: #2b1700;
  box-shadow: 0 5px 14px rgba(245, 158, 11, 0.18);
}

.button-primary:hover:not(:disabled) {
  border-color: #d97706;
  background: #d97706;
  color: #fff;
  box-shadow: 0 7px 18px rgba(180, 83, 9, 0.2);
}

.button-secondary {
  border-color: var(--color-primary);
  background: var(--color-surface);
  color: var(--color-primary);
}

.button-secondary:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
}

.button-quiet {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-body);
}

.button-quiet:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.button-small {
  min-height: 2.25rem;
  padding: 0.48rem 0.8rem;
  font-size: 0.82rem;
}

.button-wide {
  width: 100%;
}

.button[aria-busy="true"] {
  pointer-events: none;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: var(--space-lg);
  padding: 0.8rem 0.95rem;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

.notice > svg {
  margin-top: 0.08rem;
}

.notice > span {
  flex: 1;
}

.notice-success {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.notice-error {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.notice-close {
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: currentColor;
}

.notice-close:hover {
  background: rgba(15, 23, 42, 0.08);
}

.notice-close svg {
  width: 1rem;
  height: 1rem;
}

.input,
.field input,
.field select {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.67rem 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-heading);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.input:hover,
.field input:hover,
.field select:hover {
  border-color: #94a3b8;
}

.input:focus,
.field input:focus,
.field select:focus,
.composer textarea:focus,
.search-control input:focus {
  border-color: var(--color-primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.16);
}

.stack-form {
  display: grid;
  gap: var(--space-md);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label,
.composer label {
  color: var(--color-heading);
  font-size: 0.9rem;
  font-weight: 700;
}

.field small {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  transform: translateY(-50%);
  transition: color var(--transition), background-color var(--transition);
}

.password-toggle:hover {
  background: var(--color-surface-subtle);
  color: var(--color-primary);
}

/* Login */
.auth-page {
  background: var(--color-surface);
}

.auth-main {
  min-height: 100vh;
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(24rem, 0.85fr);
}

.auth-context {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 6vw, 5rem);
  background: var(--color-primary);
  color: #fff;
}

.auth-context::before,
.auth-context::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.auth-context::before {
  top: 9%;
  right: -8rem;
  width: 28rem;
  height: 28rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.auth-context::after {
  right: 8%;
  bottom: -8rem;
  width: 20rem;
  height: 20rem;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 2rem 2rem;
  transform: rotate(10deg);
}

.brand-auth,
.auth-message,
.trust-list {
  position: relative;
  z-index: 1;
}

.brand-auth {
  color: #fff;
}

.brand-auth .brand-mark {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.brand-auth .brand-copy small {
  color: #dbeafe;
}

.brand-mark-large {
  width: 2.7rem;
  height: 2.7rem;
}

.auth-message {
  max-width: 40rem;
  margin-block: var(--space-3xl);
}

.auth-message .eyebrow {
  color: #bfdbfe;
}

.auth-message h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.auth-message > p:last-child {
  max-width: 36rem;
  margin-bottom: 0;
  color: #dbeafe;
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
  color: #eff6ff;
  font-size: 0.86rem;
  font-weight: 600;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.trust-list svg {
  width: 1rem;
  height: 1rem;
  color: #fbbf24;
}

.auth-card {
  align-self: center;
  width: min(100% - 3rem, 28rem);
  margin-inline: auto;
  padding-block: 3rem;
}

.auth-card-header {
  margin-bottom: var(--space-xl);
}

.auth-card-header h2 {
  font-size: 2rem;
}

.auth-card-header > p:last-child,
.auth-help {
  color: var(--color-muted);
}

.auth-help {
  margin: var(--space-lg) 0 0;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: 0.82rem;
}

/* Dashboard */
.release-chip {
  display: flex;
  min-width: 14rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.release-chip > svg {
  width: 1.55rem;
  height: 1.55rem;
  color: var(--color-primary);
}

.release-chip span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.release-chip small {
  color: var(--color-muted);
  font-size: 0.72rem;
}

.release-chip strong {
  overflow: hidden;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-search,
.knowledge-search {
  margin-bottom: var(--space-xl);
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid #c7d5ec;
  border-radius: var(--radius-xl);
  background: linear-gradient(120deg, #eff6ff, #fff 70%);
}

.dashboard-search {
  display: grid;
  grid-template-columns: minmax(13rem, 0.65fr) minmax(20rem, 1.35fr);
  align-items: end;
  gap: var(--space-xl);
}

.dashboard-search h2 {
  margin-bottom: 0.35rem;
}

.dashboard-search p {
  margin-bottom: 0;
  color: var(--color-muted);
}

.search-form {
  display: flex;
  align-items: stretch;
  gap: var(--space-sm);
}

.search-control {
  position: relative;
  flex: 1;
}

.search-control > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 0.85rem;
  color: var(--color-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-control input {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.9rem 0.72rem 2.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-heading);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.stats-grid {
  display: grid;
  margin-bottom: var(--space-2xl);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.stat-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-md);
  padding: 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.stat-icon,
.action-icon,
.panel-icon,
.history-icon {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.stat-icon svg,
.action-icon svg,
.panel-icon svg,
.history-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.stat-card > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-card strong {
  overflow: hidden;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card span:last-child {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.section-block {
  margin-top: var(--space-2xl);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-header h2,
.section-header p {
  margin-bottom: 0;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.action-card {
  display: flex;
  min-width: 0;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-body);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.action-card:hover {
  border-color: #9fb4d8;
  background: #fbfdff;
  box-shadow: var(--shadow-md);
}

.action-card h3 {
  margin-bottom: var(--space-sm);
}

.action-card p {
  margin-bottom: var(--space-md);
  color: var(--color-muted);
  font-size: 0.9rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-primary);
  font-size: 0.86rem;
  font-weight: 700;
}

.text-link svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* Unified DATAREON center */
.hub-hero {
  position: relative;
  display: grid;
  overflow: hidden;
  margin-bottom: var(--space-lg);
  padding: clamp(1.5rem, 4vw, 3.2rem);
  grid-template-columns: minmax(0, 1.2fr) minmax(21rem, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  border: 1px solid #1e3a6d;
  border-radius: 1.5rem;
  background-color: #0f1d3d;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
  box-shadow: 0 1.5rem 3.5rem rgba(15, 29, 61, 0.2);
}

.hub-hero::after {
  position: absolute;
  right: -5rem;
  bottom: -7rem;
  width: 19rem;
  height: 19rem;
  border: 4rem solid rgba(59, 130, 246, 0.08);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.hub-hero-copy,
.hub-overview {
  position: relative;
  z-index: 1;
}

.hub-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: var(--space-md);
  color: #f8c75c;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hub-kicker-mark {
  width: 1.5rem;
  height: 2px;
  background: currentColor;
}

.hub-hero h1 {
  max-width: 45rem;
  margin-bottom: var(--space-md);
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  letter-spacing: -0.045em;
}

.hub-lead {
  max-width: 43rem;
  margin-bottom: var(--space-xl);
  color: #cbd5e1;
  font-size: clamp(1rem, 1.7vw, 1.12rem);
}

.hub-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hub-hero .button-primary {
  border-color: #fff;
  background: #fff;
  color: #172554;
}

.hub-hero .button-primary:hover:not(:disabled) {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #172554;
}

.hub-hero .button-secondary {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.hub-hero .button-secondary:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.hub-trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: var(--space-xl) 0 0;
  padding: var(--space-lg) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #aebed3;
  font-size: 0.78rem;
  list-style: none;
}

.hub-trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hub-trust-list svg {
  width: 1rem;
  height: 1rem;
  color: #93c5fd;
}

.hub-overview {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.97);
  color: var(--color-body);
  box-shadow: 0 1rem 3rem rgba(2, 8, 23, 0.28);
}

.hub-overview-header {
  display: grid;
  padding: 1rem 1.1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.hub-overview-icon,
.hub-search-icon {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 0.65rem;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.hub-overview-header > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.hub-overview-header small {
  color: var(--color-muted);
  font-size: 0.68rem;
}

.hub-overview-header strong {
  overflow: hidden;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-live-badge,
.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.hub-live-badge {
  padding: 0.35rem 0.55rem;
  background: #eefbf3;
  color: #166534;
}

.hub-live-badge > span,
.service-badge > span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 13%, transparent);
}

.hub-pipeline {
  padding: 0.45rem 1.1rem;
}

.hub-pipeline > div {
  display: grid;
  padding: 0.85rem 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.hub-pipeline > div + div {
  border-top: 1px solid var(--color-border);
}

.pipeline-index {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid #c7d5ec;
  border-radius: 50%;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 700;
}

.hub-pipeline p {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
}

.hub-pipeline strong {
  color: var(--color-heading);
  font-size: 0.83rem;
}

.hub-pipeline small {
  color: var(--color-muted);
  font-size: 0.7rem;
}

.pipeline-state {
  padding: 0.28rem 0.48rem;
  border-radius: 0.35rem;
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.pipeline-ready {
  background: #eefbf3;
  color: #166534;
}

.pipeline-preview {
  background: #fff8e7;
  color: #92400e;
}

.hub-overview-footer {
  display: grid;
  padding: 0.9rem 1.1rem;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  border-top: 1px solid var(--color-border);
  background: #f8fafc;
}

.hub-overview-footer span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.hub-overview-footer small {
  color: var(--color-muted);
  font-size: 0.65rem;
}

.hub-overview-footer strong {
  overflow: hidden;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-search {
  display: grid;
  margin-bottom: var(--space-2xl);
  padding: 1.2rem 1.35rem;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(22rem, 1.28fr);
  align-items: center;
  gap: 0.8rem var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.hub-search-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hub-search-heading .eyebrow,
.hub-search-heading h2 {
  margin-bottom: 0;
}

.hub-search-heading h2 {
  font-size: 1.1rem;
}

.hub-search-form .search-control input {
  min-height: 3.25rem;
}

.hub-search-hints {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  color: var(--color-muted);
  font-size: 0.74rem;
}

.hub-search-hints a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

.hub-search-hints a:hover {
  text-decoration: underline;
}

.section-note {
  max-width: 24rem;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 0.84rem;
  text-align: right;
}

.service-grid {
  display: grid;
  grid-template-columns: 1.55fr repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.service-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 25rem;
  padding: clamp(1.2rem, 2.6vw, 1.65rem);
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-surface);
  color: var(--color-body);
  box-shadow: var(--shadow-sm);
}

.service-card-link {
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.service-card-link:hover {
  border-color: #9fb4d8;
  box-shadow: var(--shadow-lg);
}

.service-card-link:focus-visible {
  outline-offset: 4px;
}

.service-card-datareon {
  overflow: hidden;
  border-color: #bfd0ec;
  background-color: #f8fbff;
  background-image:
    linear-gradient(rgba(30, 64, 175, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 64, 175, 0.035) 1px, transparent 1px);
  background-size: 2rem 2rem;
}

.service-card-cloud {
  background: #fbfdff;
}

.service-card-workboard {
  background: #fbfafc;
}

.service-card-reports {
  background: #fffdf8;
}

.service-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.service-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.8rem;
}

.service-icon svg {
  width: 1.45rem;
  height: 1.45rem;
}

.service-icon-datareon {
  background: var(--color-primary);
  color: #fff;
}

.service-icon-cloud {
  background: #0f172a;
  color: #fff;
}

.service-icon-workboard {
  background: #eef2ff;
  color: #4338ca;
}

.service-icon-reports {
  background: #fff3d6;
  color: #92400e;
}

.service-badge {
  padding: 0.4rem 0.6rem;
}

.service-badge-live {
  background: #eefbf3;
  color: #166534;
}

.service-badge-preview {
  background: #eff6ff;
  color: #1d4ed8;
}

.service-badge-protected {
  background: #fff8e7;
  color: #92400e;
}

.service-badge-neutral {
  background: #f1f5f9;
  color: #475569;
}

.service-overline {
  margin-bottom: 0.45rem;
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.service-card h3 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
}

.service-card > p:not(.service-overline) {
  margin-bottom: var(--space-lg);
  color: var(--color-muted);
  font-size: 0.9rem;
}

.service-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 var(--space-xl);
  padding: 0;
  list-style: none;
}

.service-feature-list li {
  padding: 0.35rem 0.55rem;
  border: 1px solid #c7d5ec;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.service-card-actions {
  display: flex;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.service-meta {
  display: grid;
  margin-top: auto;
  padding-top: var(--space-lg);
  gap: 0.35rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.72rem;
}

.service-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.service-meta span::before {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--color-border-strong);
  content: "";
}

.service-open-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.service-open-link svg {
  width: 1rem;
  height: 1rem;
}

.hub-metrics {
  display: grid;
  margin-top: var(--space-2xl);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.hub-metrics article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  background: var(--color-surface);
}

.metric-icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.65rem;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.hub-metrics article > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.hub-metrics strong {
  overflow: hidden;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-metrics article > div > span {
  color: var(--color-muted);
  font-size: 0.76rem;
}

/* Knowledge */
.knowledge-search {
  padding: 1.2rem;
}

.search-form-large .search-control input {
  min-height: 3.2rem;
}

.results-section {
  margin-top: var(--space-xl);
}

.results-header {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.result-count {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.result-list {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.result-card:hover {
  border-color: #a8b9d5;
  box-shadow: var(--shadow-md);
}

.result-main {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: var(--space-md);
}

.document-kind {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  color: var(--color-primary);
}

.result-copy {
  min-width: 0;
}

.result-title {
  display: inline-block;
  overflow-wrap: anywhere;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
}

.result-title:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.document-path {
  margin: 0.3rem 0 0;
  overflow-wrap: anywhere;
  color: var(--color-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
}

.result-snippet {
  display: -webkit-box;
  max-width: 50rem;
  margin: 0.65rem 0 0;
  overflow: hidden;
  color: var(--color-body);
  font-size: 0.88rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 0.55rem;
  color: var(--color-muted);
  font-size: 0.76rem;
}

.result-meta span + span::before,
.history-meta span + span::before {
  margin-right: 0.9rem;
  color: var(--color-border-strong);
  content: "·";
}

.result-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-sm);
}

.empty-state {
  display: flex;
  max-width: 36rem;
  margin: var(--space-2xl) auto;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
  color: var(--color-muted);
  text-align: center;
}

.empty-state > svg {
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: var(--space-md);
  color: var(--color-primary);
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: var(--space-sm);
}

.empty-state p {
  margin-bottom: var(--space-lg);
}

.empty-state-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
}

.compact-empty {
  margin-block: var(--space-lg);
  padding: var(--space-lg);
}

.search-hints {
  margin-top: var(--space-2xl);
}

.hint-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.hint-grid article {
  padding: var(--space-lg);
  border-top: 3px solid var(--color-primary);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.hint-grid article > span {
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
}

.hint-grid h3 {
  margin-top: var(--space-md);
}

.hint-grid p {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Document */
.breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  color: var(--color-muted);
  font-size: 0.82rem;
}

.breadcrumbs a {
  flex: 0 0 auto;
}

.breadcrumbs svg {
  width: 0.8rem;
  height: 0.8rem;
}

.breadcrumbs span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.document-heading-copy {
  min-width: 0;
}

.document-heading-copy h1 {
  overflow-wrap: anywhere;
}

.document-meta-panel {
  display: grid;
  margin: 0 0 var(--space-lg);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.document-meta-panel > div {
  min-width: 0;
  padding: var(--space-md);
}

.document-meta-panel > div + div {
  border-left: 1px solid var(--color-border);
}

.document-meta-panel dt {
  margin-bottom: 0.3rem;
  color: var(--color-muted);
  font-size: 0.74rem;
}

.document-meta-panel dd {
  margin: 0;
  overflow: hidden;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-view {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.document-view-toolbar {
  display: flex;
  min-height: 3.4rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0.75rem var(--space-md);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.document-view-toolbar h2 {
  margin: 0;
  font-size: 1rem;
}

.document-view-toolbar span {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.document-content {
  max-height: 70vh;
  margin: 0;
  overflow: auto;
  padding: clamp(1rem, 3vw, 2rem);
  color: #1e293b;
  font-family: var(--font-heading);
  font-size: 0.86rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  tab-size: 2;
  white-space: pre-wrap;
}

/* Chat */
.ask-heading {
  align-items: center;
}

.agent-state {
  display: flex;
  min-width: 15rem;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.agent-state > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.agent-state small {
  color: var(--color-muted);
  font-size: 0.72rem;
}

.agent-state strong {
  color: var(--color-heading);
  font-size: 0.9rem;
}

.agent-state em {
  margin-top: 0.15rem;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-style: normal;
}

.state-dot {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.35rem;
  flex: 0 0 auto;
  border-radius: 50%;
}

.agent-online {
  border-color: var(--color-success-border);
}

.agent-online .state-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px #dcfce7;
}

.agent-offline {
  border-color: #fcd34d;
  background: var(--color-warning-bg);
}

.agent-offline .state-dot {
  background: #d97706;
  box-shadow: 0 0 0 4px #fef3c7;
}

.chat-layout {
  display: grid;
  min-height: 38rem;
  grid-template-columns: 17rem minmax(0, 1fr);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.conversation-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: var(--space-md);
  border-right: 1px solid var(--color-border);
  background: #fbfdff;
}

.sidebar-heading,
.chat-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.sidebar-heading {
  margin-bottom: var(--space-md);
}

.sidebar-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.conversation-list {
  display: grid;
  gap: var(--space-xs);
}

.conversation-list a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-body);
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition);
}

.conversation-list a:hover {
  background: var(--color-surface-subtle);
}

.conversation-list a[aria-current="page"] {
  border-color: #c7d5ec;
  background: var(--color-primary-soft);
}

.conversation-list strong {
  overflow: hidden;
  color: var(--color-heading);
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-list span {
  margin-top: 0.2rem;
  color: var(--color-muted);
  font-size: 0.7rem;
}

.sidebar-history-link {
  margin-top: auto;
  padding-top: var(--space-lg);
}

.sidebar-empty {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.chat-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.chat-panel-heading {
  min-height: 4.5rem;
  padding: 0.8rem var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.chat-panel-heading p,
.chat-panel-heading h2 {
  margin-bottom: 0;
}

.chat-panel-heading h2 {
  font-size: 1rem;
}

.conversation-id {
  color: var(--color-muted);
  font-family: var(--font-heading);
  font-size: 0.72rem;
}

.message-stream {
  display: flex;
  min-height: 24rem;
  max-height: 48rem;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-lg);
  background: #fff;
}

.message {
  display: flex;
  max-width: 55rem;
  gap: 0.75rem;
  margin-bottom: var(--space-lg);
}

.message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.message-user .message-avatar {
  background: var(--color-surface-subtle);
  color: var(--color-body);
}

.message-avatar svg {
  width: 1.15rem;
  height: 1.15rem;
}

.message-body {
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  background: var(--color-background);
}

.message-user .message-body {
  border-color: #b7c8e8;
  border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
  background: var(--color-primary-soft);
}

.message-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 0.4rem;
}

.message-body header strong {
  color: var(--color-heading);
  font-size: 0.8rem;
}

.message-body time {
  color: var(--color-muted);
  font-size: 0.68rem;
}

.message-content {
  overflow-wrap: anywhere;
  color: var(--color-body);
  font-size: 0.93rem;
  white-space: pre-wrap;
}

.message-sources {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.message-sources h3 {
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.message-sources ol {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding-left: 1.3rem;
}

.message-sources li {
  padding-left: 0.25rem;
  font-size: 0.8rem;
}

.message-sources li a {
  font-weight: 700;
}

.message-sources li span {
  display: block;
  margin-top: 0.1rem;
  overflow-wrap: anywhere;
  color: var(--color-muted);
  font-family: var(--font-heading);
  font-size: 0.68rem;
}

.chat-empty {
  display: flex;
  max-width: 30rem;
  margin: auto;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
  color: var(--color-muted);
  text-align: center;
}

.chat-empty > span {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: var(--space-md);
  place-items: center;
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.chat-empty > span svg {
  width: 1.7rem;
  height: 1.7rem;
}

.chat-empty p {
  margin-bottom: 0;
}

.composer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: #fbfdff;
}

.composer label {
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 5.5rem;
  max-height: 16rem;
  resize: vertical;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-heading);
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.composer textarea:disabled {
  background: var(--color-surface-subtle);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.composer-footer p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.75rem;
}

/* History */
.history-list {
  display: grid;
  gap: var(--space-sm);
}

.history-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-body);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.history-card:hover {
  border-color: #9fb4d8;
  background: #fbfdff;
  box-shadow: var(--shadow-md);
}

.history-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.history-copy > strong {
  overflow: hidden;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-preview {
  display: -webkit-box;
  margin-top: 0.3rem;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.84rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.history-meta {
  display: flex;
  margin-top: 0.45rem;
  color: var(--color-muted);
  font-size: 0.72rem;
}

.history-arrow {
  color: var(--color-muted);
}

/* Admin */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 0.7fr) minmax(30rem, 1.3fr);
  align-items: start;
  gap: var(--space-lg);
}

.panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.create-user-panel {
  padding: var(--space-lg);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.panel-heading h2,
.panel-heading p {
  margin-bottom: 0;
}

.panel-heading p:not(.eyebrow) {
  margin-top: 0.3rem;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.panel-heading-row {
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--color-surface-subtle);
  color: var(--color-muted);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfdff;
}

.data-table td strong {
  color: var(--color-heading);
}

.self-label {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.65rem;
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge > span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
}

.status-active {
  color: var(--color-success);
}

.status-active > span {
  background: #22c55e;
}

.status-inactive {
  color: var(--color-muted);
}

.status-inactive > span {
  background: #94a3b8;
}

.table-action {
  text-align: right !important;
  white-space: nowrap;
}

.table-action form {
  margin: 0;
}

.muted {
  color: var(--color-muted);
  font-size: 0.76rem;
}

/* Error */
.error-page {
  position: relative;
  display: flex;
  max-width: 40rem;
  min-height: 32rem;
  margin: var(--space-2xl) auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  text-align: center;
}

.error-code {
  position: absolute;
  z-index: -1;
  color: #edf2fa;
  font-family: var(--font-heading);
  font-size: clamp(8rem, 24vw, 15rem);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.error-symbol {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin-bottom: var(--space-lg);
  place-items: center;
  border-radius: var(--radius-xl);
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.error-symbol svg {
  width: 2rem;
  height: 2rem;
}

.error-page > p:not(.eyebrow) {
  max-width: 32rem;
  color: var(--color-muted);
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

@media (max-width: 74rem) {
  .header-inner {
    gap: var(--space-md);
  }

  .primary-nav > a {
    padding-inline: 0.55rem;
    font-size: 0.84rem;
  }

  .primary-nav > a svg {
    display: none;
  }

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

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 62rem) {
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    left: 1rem;
    display: none;
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav > a {
    padding: 0.8rem;
  }

  .primary-nav > a svg {
    display: block;
  }

  .account-cluster {
    padding-left: 0;
    border-left: 0;
  }

  .account-copy {
    display: none;
  }

  .auth-layout {
    grid-template-columns: 1fr 24rem;
  }

  .trust-list {
    display: grid;
    gap: var(--space-sm);
  }

  .dashboard-search {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .document-meta-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-meta-panel > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }

  .document-meta-panel > div:nth-child(4) {
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 48rem) {
  .shell {
    width: min(calc(100% - 1.5rem), var(--shell-width));
  }

  .site-main {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-2xl);
  }

  .header-inner {
    min-height: 4rem;
  }

  .brand-copy small {
    display: none;
  }

  .site-footer {
    padding-block: var(--space-md);
  }

  .footer-inner,
  .page-heading-split,
  .document-header,
  .composer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-inner {
    min-height: 0;
    gap: var(--space-xs);
  }

  .page-heading-split {
    display: flex;
  }

  .page-heading-split > .button,
  .document-header > .button {
    width: 100%;
  }

  .auth-layout {
    display: block;
  }

  .auth-context {
    min-height: 18rem;
    padding: var(--space-xl) var(--space-lg);
  }

  .auth-message {
    margin-block: var(--space-xl) 0;
  }

  .auth-message h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .auth-message > p:last-child,
  .trust-list {
    display: none;
  }

  .auth-card {
    width: min(100% - 2rem, 30rem);
    padding-block: var(--space-xl);
  }

  .search-form {
    flex-direction: column;
  }

  .search-form .button {
    width: 100%;
  }

  .stats-grid,
  .action-grid,
  .hint-grid {
    grid-template-columns: 1fr;
  }

  .action-card {
    padding: var(--space-md);
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-card {
    align-items: stretch;
    flex-direction: column;
    padding: var(--space-md);
  }

  .result-actions {
    justify-content: flex-end;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
  }

  .result-actions .button-secondary {
    flex: 1;
  }

  .chat-layout {
    display: flex;
    min-height: auto;
    flex-direction: column;
  }

  .conversation-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .conversation-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    scroll-snap-type: x proximity;
  }

  .conversation-list a {
    min-width: 12rem;
    scroll-snap-align: start;
  }

  .sidebar-history-link {
    margin-top: var(--space-md);
    padding-top: 0;
  }

  .message-stream {
    min-height: 19rem;
    padding: var(--space-md);
  }

  .message {
    max-width: 100%;
  }

  .message-body {
    padding: 0.75rem;
  }

  .composer {
    padding: var(--space-md);
  }

  .composer-footer .button {
    width: 100%;
  }

  .history-card {
    align-items: flex-start;
    padding: var(--space-md);
  }

  .history-icon {
    width: 2.4rem;
    height: 2.4rem;
  }

  .history-arrow {
    margin-top: 0.6rem;
  }

  .panel-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .error-actions {
    width: 100%;
    flex-direction: column;
  }
}

@media (max-width: 23.5rem) {
  .shell {
    width: calc(100% - 1rem);
  }

  .brand-mark {
    width: 2rem;
    height: 2rem;
  }

  .header-inner {
    gap: var(--space-sm);
  }

  .primary-nav {
    right: 0.5rem;
    left: 0.5rem;
  }

  .account-cluster .icon-button,
  .nav-toggle {
    width: 2.25rem;
    height: 2.25rem;
  }

  .stat-card,
  .result-main,
  .action-card {
    align-items: flex-start;
  }

  .document-meta-panel {
    grid-template-columns: 1fr;
  }

  .document-meta-panel > div + div {
    border-top: 1px solid var(--color-border);
    border-left: 0;
  }

  .message-avatar {
    display: none;
  }
}

@media (max-width: 74rem) {
  .hub-hero {
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.72fr);
    gap: var(--space-xl);
  }

  .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-card-datareon {
    min-height: auto;
    grid-column: 1 / -1;
  }

  .service-card-cloud,
  .service-card-workboard,
  .service-card-reports {
    min-height: 22rem;
  }
}

@media (max-width: 62rem) {
  .hub-hero {
    grid-template-columns: 1fr;
  }

  .hub-overview {
    width: min(100%, 40rem);
  }

  .hub-search {
    grid-template-columns: 1fr;
  }

  .hub-search-hints {
    grid-column: 1;
  }

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

@media (max-width: 48rem) {
  .hub-hero {
    padding: var(--space-xl) var(--space-lg);
    border-radius: 1rem;
  }

  .hub-hero-actions,
  .service-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hub-hero-actions .button,
  .service-card-actions .button {
    width: 100%;
  }

  .hub-trust-list {
    align-items: flex-start;
    flex-direction: column;
  }

  .hub-search {
    padding: var(--space-md);
  }

  .hub-search-heading {
    align-items: flex-start;
  }

  .hub-services-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-note {
    max-width: none;
    text-align: left;
  }

  .service-grid,
  .hub-metrics {
    grid-template-columns: 1fr;
  }

  .service-card-datareon {
    grid-column: auto;
  }

  .service-card,
  .service-card-cloud,
  .service-card-workboard,
  .service-card-reports {
    min-height: auto;
  }
}

@media (max-width: 23.5rem) {
  .hub-hero {
    padding: var(--space-lg) var(--space-md);
  }

  .hub-overview-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hub-live-badge {
    display: none;
  }

  .hub-overview-footer {
    grid-template-columns: 1fr;
  }

  .hub-pipeline > div {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pipeline-state {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .document-header .button,
  .notice {
    display: none !important;
  }

  body,
  .document-view,
  .document-content {
    background: #fff;
    box-shadow: none;
  }

  .site-main {
    width: 100%;
    padding: 0;
  }

  .document-content {
    max-height: none;
    overflow: visible;
  }
}
