:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --faint: #667085;
  --line: #e6eaf0;
  --line-strong: #d5dce6;
  --primary: #2468d8;
  --primary-hover: #1d57b5;
  --primary-soft: #edf4ff;
  --green: #159a66;
  --green-soft: #eaf8f2;
  --amber: #b66a0a;
  --amber-soft: #fff5df;
  --red: #d84d4d;
  --shadow: 0 10px 30px rgba(25, 42, 72, .055);
}

.modal-card.miniapp-pairing-card { width: min(720px, calc(100vw - 32px)); padding: 28px; }
.miniapp-pairing-heading { max-width: 580px; padding-right: 42px; margin-bottom: 22px; }
.miniapp-pairing-heading span { max-width: 66ch; font-size: 12px; line-height: 1.6; }
.miniapp-pairing-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 30px; align-items: center; }
.miniapp-pairing-credential { min-width: 0; }
.miniapp-pairing-qr-frame { width: 232px; height: 232px; display: grid; place-items: center; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #f8faff; }
.miniapp-pairing-qr-frame img { width: 100%; height: 100%; display: block; object-fit: contain; }
.miniapp-pairing-placeholder { display: grid; justify-items: center; gap: 12px; color: var(--faint); font-size: 11px; }
.miniapp-pairing-placeholder svg { width: 54px; height: 54px; color: #87a7d4; }
.miniapp-pairing-code-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 13px; padding: 10px 12px; border-radius: 11px; background: var(--surface-soft); }
.miniapp-pairing-code-row > span { color: var(--faint); font-size: 10px; }
.miniapp-pairing-code-row strong { overflow: hidden; color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: .08em; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.miniapp-pairing-code-row button { min-width: 42px; min-height: 30px; padding: 0 8px; border: 0; border-radius: 7px; color: var(--primary); background: #fff; font-size: 11px; font-weight: 650; cursor: pointer; }
.miniapp-pairing-code-row button:hover:not(:disabled) { background: var(--primary-soft); }
.miniapp-pairing-code-row button:disabled { color: var(--faint); cursor: not-allowed; }
.miniapp-pairing-status { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; text-align: center; }
.miniapp-pairing-status.success { color: var(--green); font-weight: 650; }
.miniapp-pairing-status.error { color: var(--red); }
.miniapp-pairing-guide h3 { margin: 0 0 16px; color: var(--text); font-size: 15px; }
.miniapp-pairing-guide ol { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.miniapp-pairing-guide li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.miniapp-pairing-guide li > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 750; }
.miniapp-pairing-guide li strong, .miniapp-pairing-guide li small { display: block; }
.miniapp-pairing-guide li strong { color: var(--text); font-size: 12px; line-height: 1.45; }
.miniapp-pairing-guide li small { margin-top: 3px; color: var(--faint); font-size: 11px; line-height: 1.5; }
.miniapp-pairing-guide > p { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.miniapp-pairing-actions { align-items: center; }
.miniapp-pairing-actions .button { min-width: 104px; }

@media (max-width: 640px) {
  .modal-card.miniapp-pairing-card { padding: 24px 20px; }
  .miniapp-pairing-layout { grid-template-columns: 1fr; gap: 24px; }
  .miniapp-pairing-qr-frame { width: min(232px, 68vw); height: min(232px, 68vw); }
  .miniapp-pairing-guide h3 { margin-bottom: 13px; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

:focus-visible { outline: 3px solid rgba(36, 104, 216, .2); outline-offset: 2px; }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #172033;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand-lockup small {
  margin-left: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #347fe9, #1854b5);
  box-shadow: 0 5px 14px rgba(32, 103, 215, .2), inset 0 1px rgba(255,255,255,.28);
  font-size: 17px;
  font-weight: 800;
}

.brand-mark-small { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }

.loading-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  gap: 24px;
  background: var(--bg);
}

.loading-shell { display: flex; gap: 8px; justify-content: center; }
.loading-shell i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7d7ee;
  animation: loading 1.05s ease-in-out infinite;
}
.loading-shell i:nth-child(2) { animation-delay: .14s; }
.loading-shell i:nth-child(3) { animation-delay: .28s; }
@keyframes loading { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

.portal { min-height: 100vh; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(222, 227, 234, .92);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1440px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 34px;
}

.top-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.top-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 610;
}
.top-nav a:hover { color: var(--text); background: var(--surface-soft); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.button:hover { transform: translateY(-1px); border-color: #c6d1e0; box-shadow: 0 7px 18px rgba(28, 50, 88, .08); }
.button-primary { border-color: var(--primary); color: #fff; background: var(--primary); }
.button-primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.button-compact { min-height: 38px; padding: 0 16px; }
.button-danger { border-color: #c83d43; color: #fff; background: #c83d43; }
.button-danger:hover { border-color: #bd3636; background: #bd3636; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.service-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #ccebdd;
  border-radius: 999px;
  color: #137a50;
  background: #f2fbf7;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.service-button i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.service-button.warning { border-color: #f3d7a7; color: #8b590f; background: #fff9ec; }
.service-button.warning i { background: var(--amber); }

.profile-area { position: relative; }
.profile-button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 7px 2px 3px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.profile-button:hover, .profile-button[aria-expanded="true"] { border-color: var(--line); background: var(--surface-soft); }
.profile-button > svg { width: 16px; height: 16px; color: var(--faint); }
.avatar { display: grid; flex: none; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: #315f9f; font-weight: 760; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small { width: 34px; height: 34px; font-size: 13px; }

.profile-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(31, 45, 70, .15);
}
.profile-menu-heading { padding: 9px 10px 11px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.profile-menu-heading strong, .profile-menu-heading span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-heading strong { font-size: 13px; }
.profile-menu-heading span { margin-top: 4px; color: var(--faint); font-size: 11px; }
.profile-menu a, .profile-menu button {
  width: 100%; min-height: 36px; display: flex; align-items: center; padding: 0 10px; border: 0; border-radius: 8px;
  color: var(--muted); background: transparent; text-decoration: none; text-align: left; font-size: 12px; cursor: pointer;
}
.profile-menu a:hover, .profile-menu button:hover { color: var(--text); background: var(--surface-soft); }

.portal-main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 56px; }

.hero-panel {
  min-height: 252px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 46px;
  padding: 34px 38px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-copy { max-width: 760px; }
.eyebrow { display: block; margin-bottom: 11px; color: var(--primary); font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.hero-copy h1 { margin: 0; color: #111827; font-size: clamp(29px, 3vw, 42px); line-height: 1.18; letter-spacing: -.045em; }
.hero-copy p { max-width: 690px; margin: 14px 0 22px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-overview { padding: 22px; border: 1px solid #dfe7f1; border-radius: 16px; background: #f7f9fc; }
.overview-heading { display: flex; align-items: center; gap: 11px; }
.overview-heading strong, .overview-heading span { display: block; }
.overview-heading strong { font-size: 13px; }
.overview-heading span { margin-top: 4px; color: var(--faint); font-size: 10px; }
.overview-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0 14px; }
.overview-stats div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.overview-stats strong, .overview-stats span { display: block; }
.overview-stats strong { font-size: 23px; letter-spacing: -.04em; }
.overview-stats span { margin-top: 3px; color: var(--faint); font-size: 10px; }
.overview-list { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--muted); font-size: 10px; }
.overview-list span { display: inline-flex; align-items: center; gap: 6px; }
.overview-list i { width: 7px; height: 7px; border-radius: 50%; }
.overview-list i.blue { background: #4c8fec; }
.overview-list i.green { background: #2ca778; }
.overview-list i.violet { background: #8a6dd4; }

.content-section { margin-top: 28px; }
.section-heading { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.section-heading > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.section-heading h2 { margin: 0; color: #172033; font-size: 18px; letter-spacing: -.025em; }
.section-heading span { color: var(--faint); font-size: 11px; }
.section-heading > a { color: var(--primary); text-decoration: none; font-size: 12px; font-weight: 650; }
.section-actions { display: flex !important; align-items: center !important; gap: 10px !important; }
.section-actions > a { color: var(--primary); text-decoration: none; font-size: 12px; font-weight: 650; }
.section-actions .button { min-height: 32px; padding: 0 11px; font-size: 11px; }

.continue-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.continue-card, .continue-empty {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(25, 42, 72, .025);
}
.continue-card:hover, .continue-empty:hover { border-color: #cbd7e7; box-shadow: 0 8px 20px rgba(25,42,72,.06); }
.continue-card > span:nth-child(2) { min-width: 0; flex: 1; }
.continue-card small, .continue-card strong, .continue-card em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-card small { color: var(--primary); font-size: 9px; font-weight: 680; }
.continue-card strong { margin-top: 3px; font-size: 13px; }
.continue-card em { margin-top: 4px; color: var(--faint); font-size: 10px; font-style: normal; }
.continue-card .open-icon { width: 15px; height: 15px; color: var(--faint); }
.continue-empty { grid-column: 1 / -1; border-style: dashed; color: var(--muted); }
.continue-empty-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; color: #b67813; background: #fff8e8; }
.continue-empty-icon svg { width: 18px; height: 18px; }
.continue-empty strong, .continue-empty small { display: block; }
.continue-empty strong { color: var(--text); font-size: 13px; }
.continue-empty small { margin-top: 5px; color: var(--faint); font-size: 11px; }

.application-heading { align-items: flex-end; }
.application-search {
  width: min(300px, 38vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.application-search:focus-within { border-color: #9bbce9; box-shadow: 0 0 0 3px rgba(36,104,216,.08); }
.application-search svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
.application-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.application-search input::placeholder { color: var(--faint); }

.application-toolbar { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.category-filter { min-height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; font-size: 11px; }
.category-filter:hover { color: var(--text); background: var(--surface-soft); }
.category-filter.active { border-color: #cfe0f9; color: #1d5cb6; background: var(--primary-soft); font-weight: 650; }
.count-label { color: var(--faint); font-size: 11px; }

.application-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.application-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 42, 72, .025);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.application-card:hover { transform: translateY(-2px); border-color: #c8d5e7; box-shadow: 0 10px 24px rgba(25,42,72,.065); }
.application-main { min-height: 130px; display: flex; align-items: flex-start; gap: 13px; padding: 17px; color: inherit; text-decoration: none; }
.application-card:has(.favorite-button) .application-main { padding-right: 44px; }
.app-icon { width: 42px; height: 42px; display: grid; flex: none; place-items: center; border-radius: 11px; }
.app-icon svg { width: 20px; height: 20px; }
.app-icon.blue, .tool-card-icon.blue { color: #1d64cc; background: #eaf2ff; }
.app-icon.violet, .tool-card-icon.violet { color: #7751cc; background: #f2edff; }
.app-icon.amber, .tool-card-icon.amber { color: #a36212; background: #fff4dd; }
.app-icon.slate, .tool-card-icon.slate { color: #52657d; background: #eef2f6; }
.app-icon.green, .tool-card-icon.green { color: #147b55; background: #e8f7ef; }
.app-icon.rose, .tool-card-icon.rose { color: #b34865; background: #fff0f4; }
.app-copy { min-width: 0; flex: 1; }
.app-title-row { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.application-card strong { display: block; min-width: 0; margin: 2px 0 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.application-card p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.application-card .open-icon { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--faint); }
.app-badges { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.app-badge { min-height: 22px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.app-badge.success { color: #137a50; background: var(--green-soft); }
.app-badge.warning { color: #8a5d18; background: var(--amber-soft); }
.app-badge.neutral { color: #667085; background: #f0f2f5; }
.favorite-button { position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #a2acba; background: transparent; cursor: pointer; }
.favorite-button:hover { color: #b67813; background: #fff8e8; }
.favorite-button.active { color: #b67813; }
.favorite-button.active svg { fill: #f6c453; }
.favorite-button svg { width: 16px; height: 16px; }
.pinned-indicator { position: absolute; right: 12px; bottom: 11px; padding: 3px 7px; border-radius: 6px; color: #1d5cb6; background: var(--primary-soft); font-size: 11px; font-weight: 650; }
.application-empty { grid-column: 1 / -1; min-height: 110px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 13px; background: rgba(255,255,255,.55); }

.tool-showcase { display: grid; gap: 12px; }
.tool-card { min-height: 132px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(25,42,72,.025); }
.tool-card:hover { border-color: #c8d5e7; box-shadow: 0 10px 24px rgba(25,42,72,.06); }
.tool-card-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; }
.tool-card-icon svg { width: 25px; height: 25px; }
.tool-card-copy { min-width: 0; }
.tool-card-copy > strong { display: block; margin-top: 7px; font-size: 15px; }
.tool-card-copy > p { margin: 5px 0 10px; color: var(--muted); font-size: 11px; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-tags i { padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-soft); font-size: 9px; font-style: normal; }
.tool-open { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); font-size: 12px; font-weight: 680; white-space: nowrap; }
.tool-open svg { width: 15px; height: 15px; }

.updates-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 14px; align-items: stretch; }
.updates-panel, .account-panel { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 14px rgba(25,42,72,.025); }
.updates-panel .section-heading { margin-bottom: 4px; }
.updates-list { display: grid; }
.update-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 15px 0; border-top: 1px solid #edf0f4; }
.update-item:first-child { border-top: 0; }
.update-date { color: var(--faint); font-size: 10px; }
.update-item div { min-width: 0; }
.update-tag { display: inline-flex; margin-bottom: 6px; color: var(--primary); font-size: 9px; font-weight: 680; }
.update-item strong { display: block; font-size: 13px; }
.update-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.account-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; gap: 14px; }
.account-panel-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.account-panel-icon svg { width: 21px; height: 21px; }
.account-panel strong { display: block; font-size: 14px; }
.account-panel p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.account-panel .button { grid-column: 1 / -1; width: 100%; }

.private-badge { padding: 5px 8px; border-radius: 6px; color: #8a5d18 !important; background: #fff5df; font-size: 10px !important; font-weight: 650; }
.admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-heading-actions { display: flex !important; align-items: center !important; gap: 9px !important; }
.empty-state { padding: 22px; color: var(--faint); text-align: center; font-size: 11px; }

.admin-page-active .hero-panel,
.admin-page-active #personalized,
.admin-page-active #applications,
.admin-page-active #tools,
.admin-page-active #updates,
.admin-page-active #adminSection { display: none !important; }
.admin-page { min-height: calc(100vh - 176px); }
.admin-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 3px 0 20px; }
.admin-back { display: inline-flex; margin-bottom: 10px; color: var(--muted); font-size: 11px; text-decoration: none; }
.admin-back:hover { color: var(--primary); }
.admin-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.admin-title-row .admin-page-title { margin: 0; color: #172033; font-size: 24px; letter-spacing: -.035em; }
.admin-title-row span { color: var(--faint); font-size: 12px; }
.admin-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-summary > div { min-height: 86px; display: flex; flex-direction: column; justify-content: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(25,42,72,.025); }
.admin-summary span, .admin-summary strong { display: block; }
.admin-summary span { color: var(--faint); font-size: 12px; }
.admin-summary strong { margin-top: 7px; font-size: 22px; letter-spacing: -.035em; }
.admin-table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 14px rgba(25,42,72,.025); }
.admin-table-heading { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.admin-table-heading strong, .admin-table-heading span { display: block; }
.admin-table-heading strong { font-size: 14px; }
.admin-table-heading span { margin-top: 4px; color: var(--faint); font-size: 12px; }
.admin-table-scroll { overflow-x: auto; }
.admin-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 13px 14px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.admin-table th { color: var(--faint); background: #fbfcfd; font-size: 12px; font-weight: 650; white-space: nowrap; }
.admin-table td { color: var(--muted); font-size: 13px; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr.disabled { background: #fafbfc; }
.admin-table tbody tr.disabled .managed-application { opacity: .58; }
.admin-actions-column { width: 176px; }
.managed-application { min-width: 280px; display: flex; align-items: center; gap: 11px; }
.managed-application .app-icon { width: 38px; height: 38px; border-radius: 10px; }
.managed-application .app-icon svg { width: 18px; height: 18px; }
.managed-application > span:last-child { min-width: 0; }
.managed-application strong, .managed-application small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.managed-application strong { color: var(--text); font-size: 12px; }
.managed-application small { max-width: 330px; margin-top: 4px; color: var(--faint); font-size: 11px; }
.order-controls { display: flex; align-items: center; gap: 3px; }
.order-controls span { min-width: 20px; color: var(--faint); text-align: center; font-size: 9px; }
.table-action { min-height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fff; font-size: 10px; cursor: pointer; }
.table-action:hover { color: var(--primary); border-color: #cbdaf0; background: var(--primary-soft); }
.table-action.danger:hover { color: #b93838; border-color: #f0cccc; background: #fff3f3; }
.table-action:disabled { opacity: .35; cursor: not-allowed; }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.table-badge { min-height: 24px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.table-badge.success { color: #137a50; background: var(--green-soft); }
.table-badge.warning { color: #8a5d18; background: var(--amber-soft); }
.table-badge.danger { color: #b93838; background: #fff0f0; }
.table-badge.neutral { color: #667085; background: #f0f2f5; }

.analytics-header-actions { display: flex; align-items: center; gap: 9px; }
.analytics-range-filters { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.analytics-range-filters button { min-height: 34px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 620; cursor: pointer; }
.analytics-range-filters button:hover { color: var(--text); background: #f5f7fa; }
.analytics-range-filters button.active { color: var(--primary); background: var(--primary-soft); }
.analytics-loading { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.analytics-loading i { min-height: 86px; border: 1px solid #edf0f4; border-radius: 14px; background: linear-gradient(100deg, #f6f8fa 20%, #eef2f6 38%, #f6f8fa 56%); background-size: 220% 100%; animation: analytics-loading 1.2s ease-in-out infinite; }
.analytics-summary small { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; font-style: normal; }
.analytics-overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); align-items: start; gap: 14px; margin-bottom: 14px; }
.analytics-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 14px rgba(25,42,72,.025); }
.analytics-card-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 17px; border-bottom: 1px solid #edf0f4; }
.analytics-card-heading strong, .analytics-card-heading span { display: block; }
.analytics-card-heading strong { font-size: 13px; }
.analytics-card-heading span { margin-top: 4px; color: var(--faint); font-size: 11px; }
.analytics-chart { width: 100%; height: 320px; display: block; }
.analytics-empty { min-height: 190px; display: grid; place-items: center; padding: 20px; color: var(--faint); font-size: 12px; text-align: center; }
.analytics-services { display: grid; padding: 2px 17px 7px; }
.analytics-services-card { max-height: 386px; }
.analytics-services-card .analytics-services { max-height: 319px; overflow: auto; overscroll-behavior: contain; }
.analytics-service { min-height: 72px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; border-top: 1px solid #edf0f4; }
.analytics-service:first-child { border-top: 0; }
.analytics-service-copy, .analytics-service-metric { min-width: 0; }
.analytics-service-copy strong, .analytics-service-copy small, .analytics-service-metric strong, .analytics-service-metric small { display: block; }
.analytics-service-copy strong, .analytics-service-metric strong { color: var(--text); font-size: 11px; }
.analytics-service-copy small, .analytics-service-metric small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.analytics-service-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-service-metric { text-align: right; }
.analytics-service-metric strong { font-variant-numeric: tabular-nums; }
.analytics-table-card { margin-bottom: 16px; }
.analytics-funnel-card { overflow: hidden; }
.analytics-funnels { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; padding: 14px; }
.analytics-funnel { min-width: 0; padding: 13px; border: 1px solid #e7ebf1; border-radius: 12px; background: #fbfcfe; }
.analytics-funnel header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.analytics-funnel header strong { color: var(--text); font-size: 12px; }
.analytics-funnel header small { color: var(--faint); font-size: 9px; white-space: nowrap; }
.analytics-funnel ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.analytics-funnel li { display: grid; gap: 5px; }
.analytics-funnel li > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.analytics-funnel li strong { color: var(--muted); font-size: 10px; font-weight: 620; }
.analytics-funnel li small { color: var(--faint); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-funnel li > i { height: 5px; overflow: hidden; border-radius: 999px; background: #edf1f6; }
.analytics-funnel li > i > b { height: 100%; display: block; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #75a9ee, #755bd7); }
.analytics-table { min-width: 860px; }
.analytics-table .analytics-rank { width: 56px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.analytics-table .analytics-number { color: var(--text); font-weight: 680; font-variant-numeric: tabular-nums; }
.analytics-application { min-width: 220px; }
.analytics-updated-at { white-space: nowrap; }
.analytics-error { min-height: 230px; display: grid; place-content: center; gap: 6px; border: 1px dashed #dce2ea; border-radius: 15px; color: var(--muted); background: #fff; text-align: center; }
.analytics-error strong { color: var(--text); font-size: 13px; }
.analytics-error span { color: var(--faint); font-size: 12px; }
.analytics-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.analytics-detail-table { min-width: 560px; }

.role-header-actions { display: flex; align-items: center; gap: 9px; }
.role-table { min-width: 880px; }
.role-name { display: block; min-width: 230px; }
.role-name strong, .role-name small { display: block; }
.role-name strong { color: var(--text); font-size: 11px; }
.role-name small { max-width: 360px; margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.role-member-count { min-width: 34px; min-height: 32px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; color: var(--primary); background: transparent; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.role-member-count:hover { border-color: #d8e5f7; background: var(--primary-soft); }
.role-member-count:focus-visible { border-color: #91b4ec; outline: 3px solid rgba(36,104,216,.14); outline-offset: 1px; }
.role-permission-summary { min-width: 180px; }
.role-management-grid { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(440px, 1.2fr); gap: 14px; margin: 14px 0; }
.binding-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 17px; }
.binding-form label, .role-reason-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.binding-form input, .binding-form select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; font: inherit; outline: none; }
.binding-form input:focus, .binding-form select:focus { border-color: #9abcf5; box-shadow: 0 0 0 3px var(--primary-soft); }
.binding-submit { display: flex; justify-content: flex-end; }
.binding-list { max-height: 420px; overflow-y: auto; padding: 0 17px; }
.binding-item { min-height: 68px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border-top: 1px solid #edf0f4; }
.binding-item:first-child { border-top: 0; }
.binding-item > span:first-child { min-width: 0; }
.binding-item strong, .binding-item small { display: block; }
.binding-item strong { overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.binding-item small { margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.binding-role { padding: 4px 7px; border-radius: 6px; color: #4b5f7e; background: #edf3fb; font-size: 9px; white-space: nowrap; }
.audit-card { margin-bottom: 16px; }
.audit-table { min-width: 860px; }
.role-editor-card { width: min(860px, calc(100vw - 28px)); }
.role-permission-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 20px 0 10px; }
.role-permission-heading > div { min-width: 0; }
.role-permission-heading strong { display: block; font-size: 13px; }
.role-permission-heading span { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; }
.role-permission-heading .role-permission-count { flex: none; color: var(--primary); font-size: 12px; font-variant-numeric: tabular-nums; }
.role-permission-list { max-height: min(42vh, 430px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-y: auto; padding: 2px; }
.role-permission-group { min-width: 0; margin: 0; padding: 8px 11px 4px; border: 1px solid var(--line); border-radius: 10px; }
.role-permission-group.has-selection { border-color: #c9d9f0; }
.role-permission-group legend { padding: 0 5px; color: var(--text); font-size: 12px; font-weight: 700; }
.role-permission-group-toolbar { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -2px; }
.role-permission-group-count { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.role-permission-toggle { min-height: 30px; padding: 0 7px; border: 0; border-radius: 6px; color: var(--primary); background: transparent; font-size: 11px; cursor: pointer; }
.role-permission-toggle:hover { background: var(--primary-soft); }
.role-permission-toggle:focus-visible { outline: 3px solid rgba(36,104,216,.18); outline-offset: 1px; }
.role-permission-item { min-height: 54px; display: grid; grid-template-columns: auto minmax(0, 1fr) 84px; align-items: center; gap: 9px; border-top: 1px solid #edf0f4; }
.role-permission-item:first-of-type { border-top: 0; }
.role-permission-item > span { min-width: 0; }
.role-permission-item strong, .role-permission-item small { display: block; }
.role-permission-item strong { color: var(--text); font-size: 12px; }
.role-permission-item small { margin-top: 3px; overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.role-permission-item select { min-height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fff; font-size: 11px; }
.role-permission-item select:disabled { opacity: .45; }
.role-reason-grid { margin-top: 13px; }
.role-enabled { display: flex; align-items: center; gap: 9px; margin-top: 13px; color: var(--muted); }
.role-enabled span, .role-enabled strong, .role-enabled small { display: block; }
.role-enabled strong { font-size: 12px; }
.role-enabled small { margin-top: 3px; color: var(--faint); font-size: 11px; }

@keyframes analytics-loading { to { background-position: -120% 0; } }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { width: min(1440px, calc(100% - 48px)); min-height: 70px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--faint); font-size: 10px; }
.footer-inner div { display: flex; align-items: center; gap: 14px; }
.footer-inner button { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; cursor: pointer; }
.footer-inner button:hover { color: var(--text); }

.modal { max-width: none; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 0; border: 0; background: transparent; }
.modal::backdrop { background: rgba(20, 28, 42, .38); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(430px, calc(100vw - 32px)); margin: 0; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(16, 24, 40, .22); }
.modal-close { position: absolute; top: 13px; right: 13px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; color: var(--faint); background: transparent; cursor: pointer; }
.modal-close:hover { color: var(--text); background: var(--surface-soft); }
.modal-close svg { width: 17px; height: 17px; }
.modal-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); }
.modal-icon svg { width: 22px; height: 22px; }
.modal-card h2 { margin: 18px 0 0; font-size: 19px; }
.modal-card > p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.service-modal-card { width: min(480px, calc(100vw - 32px)); }
.modal-heading { margin-bottom: 12px; }
.modal-heading h2 { margin: 0; }
.modal-heading span { display: block; margin-top: 5px; color: var(--faint); font-size: 11px; }
.delete-dialog-heading { display: flex; align-items: center; gap: 12px; padding-right: 34px; }
.delete-dialog-heading h2 { margin: 0; }
.modal-card.role-editor-card { width: min(900px, calc(100vw - 28px)); }
.service-list { display: grid; margin-bottom: 18px; }
.service-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #edf0f4; }
.service-item:first-child { border-top: 0; }
.service-state { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #9aa4b3; }
.service-state.online { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.service-state.unavailable { background: var(--red); box-shadow: 0 0 0 4px #fff0f0; }
.service-copy { min-width: 0; flex: 1; }
.service-copy strong, .service-copy span { display: block; }
.service-copy strong { font-size: 12px; }
.service-copy span { margin-top: 4px; color: var(--faint); font-size: 10px; }
.application-editor-card { width: min(720px, calc(100vw - 32px)); padding: 24px; }
.application-editor-heading { margin-right: 40px; }
.application-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.application-form-grid label { min-width: 0; }
.application-form-grid label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.application-form-grid input,
.application-form-grid select,
.application-form-grid textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--text); background: #fff; font-size: 12px; }
.application-form-grid textarea { min-height: 66px; resize: vertical; line-height: 1.5; }
.application-form-grid input:focus,
.application-form-grid select:focus,
.application-form-grid textarea:focus { border-color: #9bbce9; box-shadow: 0 0 0 3px rgba(36,104,216,.08); }
.application-form-grid input:disabled { color: var(--faint); background: #f5f6f8; }
.application-form-grid input[readonly] { color: var(--muted); background: #f5f6f8; }
.form-span-2 { grid-column: 1 / -1; }
.application-form-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.application-form-switches label { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.application-form-switches input { width: 16px; height: 16px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }
.application-form-switches strong, .application-form-switches small { display: block; }
.application-form-switches strong { font-size: 11px; }
.application-form-switches small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.form-error { margin-top: 12px; padding: 10px 12px; border: 1px solid #f2cccc; border-radius: 9px; color: #aa3737; background: #fff5f5; font-size: 11px; }
.delete-dialog-card { width: min(440px, calc(100vw - 32px)); }
.danger-icon { color: #c64040; background: #fff0f0; }
.authorization-delete-form + .form-error { margin-top: 10px; }
.delete-dialog-card #authorizationDeleteTitle { margin-top: 0; }
.authorization-delete-form { margin-top: 16px; }

.workspace-layout-card { width: min(820px, calc(100vw - 32px)); padding: 24px; }
.workspace-layout-heading { margin-right: 42px; }
.workspace-layout-toolbar { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(250px, 1.3fr); gap: 12px; margin: 18px 0 14px; }
.workspace-layout-toolbar label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.workspace-layout-toolbar select,
.workspace-layout-toolbar input { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--text); background: #fff; font-size: 12px; }
.workspace-layout-toolbar select:focus,
.workspace-layout-toolbar input:focus { border-color: #9bbce9; box-shadow: 0 0 0 3px rgba(36,104,216,.08); }
.workspace-layout-columns,
.workspace-layout-row { display: grid; grid-template-columns: minmax(260px, 1fr) 58px 58px 58px 76px; align-items: center; gap: 8px; }
.workspace-layout-columns { padding: 0 12px 7px; color: var(--faint); font-size: 9px; text-align: center; }
.workspace-layout-columns span:first-child { text-align: left; }
.workspace-layout-list { max-height: min(430px, 50vh); overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.workspace-layout-row { min-height: 66px; padding: 9px 11px; border-top: 1px solid #edf0f4; transition: background .15s ease, opacity .15s ease; }
.workspace-layout-row:first-child { border-top: 0; }
.workspace-layout-row:hover { background: #fbfcfe; }
.workspace-layout-row.dragging { opacity: .45; background: var(--primary-soft); }
.workspace-layout-row.hidden-application .workspace-layout-application { opacity: .5; }
.workspace-layout-application { min-width: 0; display: flex; align-items: center; gap: 10px; }
.workspace-layout-application .app-icon { width: 36px; height: 36px; border-radius: 9px; }
.workspace-layout-application .app-icon svg { width: 17px; height: 17px; }
.workspace-layout-application > span:last-child { min-width: 0; }
.workspace-layout-application strong,
.workspace-layout-application small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-layout-application strong { font-size: 12px; }
.workspace-layout-application small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.workspace-drag-handle { flex: none; color: #b0bac7; cursor: grab; font-size: 13px; letter-spacing: -2px; user-select: none; }
.workspace-toggle { position: relative; width: 32px; height: 19px; justify-self: center; cursor: pointer; }
.workspace-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.workspace-toggle span { position: absolute; inset: 0; border-radius: 999px; background: #d9dee6; transition: background .16s ease; }
.workspace-toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.2); transition: transform .16s ease; }
.workspace-toggle input:checked + span { background: var(--primary); }
.workspace-toggle input:checked + span::after { transform: translateX(13px); }
.workspace-toggle input:focus-visible + span { outline: 3px solid rgba(36,104,216,.2); outline-offset: 2px; }
.workspace-order-controls { display: flex; justify-content: flex-end; gap: 4px; }
.workspace-order-controls .table-action { width: 31px; padding: 0; }
.workspace-layout-empty { min-height: 100px; display: grid; place-items: center; color: var(--faint); font-size: 11px; }
.workspace-layout-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.workspace-sync-state { color: var(--faint); font-size: 11px; }
.workspace-layout-actions { flex: none; margin-top: 0; }
.workspace-layout-actions .button { min-height: 38px; padding: 0 13px; font-size: 11px; }

.toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 48px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; box-shadow: 0 16px 40px rgba(20,33,61,.14); font-size: 12px; }

@media (max-width: 1180px) {
  .application-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-panel { grid-template-columns: minmax(0, 1fr) 330px; gap: 30px; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 126px; }
  .header-inner { flex-wrap: wrap; gap: 8px 20px; padding: 12px 0 9px; }
  .top-nav { order: 3; width: 100%; overflow-x: auto; }
  .top-nav a { min-height: 32px; padding: 0 10px; white-space: nowrap; }
  .header-actions { margin-left: auto; }
  .hero-panel { grid-template-columns: 1fr; min-height: 0; gap: 26px; }
  .hero-overview { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(260px, 1fr); gap: 16px; align-items: center; }
  .overview-stats { margin: 0; }
  .overview-list { grid-column: 1 / -1; }
  .application-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .continue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .updates-layout { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-overview-grid { grid-template-columns: 1fr; }
  .role-management-grid { grid-template-columns: 1fr; }
  .analytics-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 118px; }
  .header-inner, .portal-main, .footer-inner { width: min(100% - 28px, 560px); }
  .header-inner { min-height: 64px; padding-top: 9px; }
  .brand-lockup small { display: none; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .profile-button > span:nth-child(2), .service-button { display: none; }
  .top-nav { gap: 1px; }
  .top-nav a { font-size: 11px; }
  .portal-main { padding: 14px 0 38px; }
  .hero-panel { padding: 24px 21px; border-radius: 16px; }
  .hero-copy h1 { font-size: 29px; }
  .hero-copy p { font-size: 13px; }
  .hero-actions .button { flex: 1; padding: 0 12px; }
  .hero-overview { display: block; padding: 18px; }
  .overview-stats { margin: 16px 0 13px; }
  .content-section { margin-top: 23px; }
  .section-heading { align-items: flex-start; }
  .section-heading > div:first-child { display: block; }
  .section-heading span { display: block; margin-top: 4px; }
  .application-heading { flex-direction: column; }
  .application-search { width: 100%; }
  .application-toolbar { align-items: flex-start; flex-direction: column-reverse; }
  .application-grid, .continue-grid, .admin-grid { grid-template-columns: 1fr; }
  .application-card, .application-main { min-height: 116px; }
  .tool-card { grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; padding: 18px; }
  .tool-open { grid-column: 1 / -1; justify-self: end; }
  .updates-panel, .account-panel { padding: 18px; }
  .footer-inner { min-height: 84px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
  .footer-inner div { align-items: flex-start; flex-direction: column; gap: 5px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .section-actions { width: 100%; justify-content: space-between; }
  .workspace-layout-card { padding: 20px 16px; }
  .workspace-layout-toolbar { grid-template-columns: 1fr; }
  .workspace-layout-columns { display: none; }
  .workspace-layout-list { max-height: 48vh; }
  .workspace-layout-row { grid-template-columns: minmax(0, 1fr) repeat(3, 38px); gap: 5px; }
  .workspace-layout-application { grid-column: 1 / -1; padding-bottom: 3px; }
  .workspace-order-controls { grid-column: 1 / -1; justify-content: flex-start; padding-left: 28px; }
  .workspace-layout-footer { align-items: stretch; flex-direction: column; }
  .workspace-layout-actions { flex-direction: column-reverse; }
  .workspace-sync-state { text-align: center; }
  .admin-page-header { align-items: stretch; flex-direction: column; }
  .admin-page-header > .button { width: 100%; }
  .admin-summary { gap: 8px; }
  .admin-summary > div { min-height: 74px; padding: 13px 14px; }
  .analytics-header-actions { align-items: stretch; flex-direction: column; }
  .analytics-header-actions .button { width: 100%; }
  .analytics-range-filters { width: 100%; }
  .analytics-range-filters button { flex: 1; }
  .analytics-loading { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .analytics-loading i { min-height: 74px; }
  .analytics-card-heading { align-items: flex-start; flex-direction: column; }
  .role-header-actions { align-items: stretch; flex-direction: column; }
  .role-header-actions .button { width: 100%; }
  .binding-form, .role-permission-list { grid-template-columns: 1fr; }
  .binding-item { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 0; }
  .binding-item .table-action { grid-column: 2; }
  .role-permission-heading { align-items: flex-start; flex-direction: column; }
  .analytics-chart { min-height: 210px; padding-inline: 4px; }
  .analytics-service { grid-template-columns: auto minmax(0, 1fr); padding: 11px 0; }
  .analytics-service-metric { grid-column: 2; text-align: left; }
  .application-form-grid, .application-form-switches { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Immersive workbench home */
.portal-main { width: 100%; margin: 0; padding: 0 0 72px; background: #fff; }
.hero-carousel { position: relative; width: 100%; min-height: clamp(420px, 38vw, 540px); overflow: hidden; color: #fff; background: #0b2345; }
.hero-slides, .hero-slide { position: absolute; inset: 0; }
.hero-slide { opacity: 0; visibility: hidden; background-image: linear-gradient(90deg, rgba(4,12,28,.82) 0%, rgba(4,12,28,.54) 42%, rgba(4,12,28,.12) 74%), var(--hero-image); background-position: center; background-size: cover; transition: opacity .55s ease, visibility .55s ease; }
.hero-slide-portal { --hero-image: url('/assets/banners/workspace-portal.jpg'); }
.hero-slide-collaboration { --hero-image: url('/assets/banners/connected-collaboration.jpg'); }
.hero-slide-workflows { --hero-image: url('/assets/banners/intelligent-workflows.jpg'); }
.hero-slide.active { z-index: 1; opacity: 1; visibility: visible; }
.hero-slide-inner { width: min(1440px, calc(100% - 112px)); height: 100%; margin: 0 auto; display: flex; align-items: center; }
.hero-carousel .hero-copy { position: relative; z-index: 1; max-width: 760px; padding: 58px 0 70px; transform: translateY(10px); opacity: 0; transition: transform .35s ease .06s, opacity .35s ease .06s; }
.hero-carousel .hero-slide.active .hero-copy { transform: translateY(0); opacity: 1; }
.hero-carousel .eyebrow { margin-bottom: 17px; color: rgba(255,255,255,.74); font-size: 12px; letter-spacing: .18em; }
.hero-carousel .hero-copy h1, .hero-carousel .hero-copy h2 { max-width: 760px; margin: 0; color: #fff; font-size: clamp(38px, 4vw, 60px); font-weight: 720; line-height: 1.08; letter-spacing: -.055em; text-wrap: balance; }
.hero-carousel .hero-copy p { max-width: 620px; margin: 22px 0 30px; color: rgba(255,255,255,.79); font-size: clamp(14px, 1.25vw, 18px); line-height: 1.8; }
.button-light { border-color: #fff; color: #142038; background: #fff; }
.button-light:hover { border-color: #fff; color: #142038; background: #fff; }
.button-ghost-light { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(255,255,255,.08); backdrop-filter: blur(12px); }
.button-ghost-light:hover { border-color: rgba(255,255,255,.82); color: #fff; background: rgba(255,255,255,.14); }
.hero-arrow { position: absolute; z-index: 3; top: 50%; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: #fff; background: rgba(8,18,38,.28); backdrop-filter: blur(10px); cursor: pointer; transform: translateY(-50%); transition: background .2s ease, border-color .2s ease; }
.hero-arrow:hover { border-color: rgba(255,255,255,.58); background: rgba(8,18,38,.48); }
.hero-arrow span { font-size: 34px; font-weight: 260; line-height: 1; transform: translateY(-2px); }
.hero-arrow-prev { left: 24px; }
.hero-arrow-next { right: 24px; }
.hero-dots { position: absolute; z-index: 3; left: 50%; bottom: 24px; display: flex; gap: 9px; transform: translateX(-50%); }
.hero-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.48); cursor: pointer; transition: width .2s ease, background .2s ease; }
.hero-dots button.active { width: 30px; background: #fff; }
.hero-playback { position: absolute; z-index: 3; right: 28px; bottom: 17px; min-height: 32px; padding: 0 11px; border: 1px solid rgba(255,255,255,.34); border-radius: 7px; color: rgba(255,255,255,.88); background: rgba(8,18,38,.3); backdrop-filter: blur(10px); font-size: 11px; cursor: pointer; }
.hero-playback:hover { color: #fff; border-color: rgba(255,255,255,.62); background: rgba(8,18,38,.5); }
.workspace-metrics { width: min(1440px, calc(100% - 48px)); min-height: 82px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: clamp(22px, 5vw, 76px); border-bottom: 1px solid #edf0f4; color: var(--muted); font-size: 12px; }
.workspace-metrics span { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.workspace-metrics strong { color: var(--text); font-size: 22px; }
.content-section { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding-top: 70px; }
.content-section + .content-section { margin-top: 0; }
.section-heading { margin-bottom: 24px; }
.section-heading h2 { font-size: 26px; }
.section-heading span { font-size: 12px; }
.application-toolbar { margin-bottom: 22px; }
.application-grid { gap: 0; border-top: 1px solid var(--line); }
.application-card { min-height: 156px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.application-card:hover { z-index: 1; border-color: #b8c8de; background: #f8fafc; box-shadow: none; transform: none; }
.application-main { min-height: 155px; padding: 28px 20px; }
.application-card strong { font-size: 15px; }
.application-card p { margin-top: 11px; font-size: 12px; }
.continue-grid { gap: 0; border-top: 1px solid var(--line); }
.continue-card, .continue-empty { min-height: 108px; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.continue-card:hover, .continue-empty:hover { border-color: var(--line); background: #f8fafc; box-shadow: none; }
.tool-showcase { border-top: 1px solid var(--line); }
.tool-card { min-height: 148px; padding: 26px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.tool-card:hover { border-color: var(--line); background: #f8fafc; box-shadow: none; }
.platform-story { width: 100%; margin-top: 64px; padding: 72px max(24px, calc((100vw - 1440px) / 2)); color: #fff; background: radial-gradient(circle at 16% 0%, rgba(56,110,255,.2), transparent 38%), radial-gradient(circle at 90% 85%, rgba(54,214,174,.12), transparent 32%), #09111f; }
.platform-story-heading { max-width: 760px; }
.platform-story-heading h2 { margin: 0; font-size: clamp(28px, 3vw, 44px); line-height: 1.2; letter-spacing: -.04em; }
.platform-story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 44px; border-top: 1px solid rgba(255,255,255,.16); }
.platform-story-grid article { min-width: 0; padding: 26px 30px 12px 0; border-right: 1px solid rgba(255,255,255,.13); }
.platform-story-grid article + article { padding-left: 30px; }
.platform-story-grid article:last-child { border-right: 0; }
.platform-story-grid h3 { margin: 0; font-size: 17px; }
.platform-story-grid p { max-width: 34em; margin: 10px 0 0; color: rgba(255,255,255,.67); font-size: 12px; line-height: 1.7; text-wrap: pretty; }

/* Standard admin shell */
.admin-page-active { overflow-x: hidden; background: #f4f6f9; }
.admin-page-active .site-header, .admin-page-active .site-footer { display: none; }
.admin-page-active .portal-main { min-height: 100vh; padding: 0; background: #f4f6f9; }
.admin-page-active #overview, .admin-page-active .workspace-metrics, .admin-page-active #personalized, .admin-page-active #applications, .admin-page-active #tools, .admin-page-active #platformStory, .admin-page-active #adminSection { display: none !important; }
.admin-shell { --muted: #475467; --faint: #667085; }
.admin-shell:not([hidden]) { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.admin-sidebar { position: sticky; z-index: 42; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid #e5e9ef; background: #fff; }
.admin-brand { min-height: 66px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid #edf0f4; color: var(--text); text-decoration: none; }
.admin-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 15px; }
.admin-brand small { margin-top: 2px; color: var(--faint); font-size: 11px; font-weight: 550; }
.admin-navigation { min-height: 0; flex: 1; overflow-y: auto; padding: 10px 12px 18px; }
.admin-nav-group { display: block; padding: 17px 10px 7px; color: #667085; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.admin-navigation a { min-height: 42px; display: flex; align-items: center; gap: 10px; margin: 2px 0; padding: 0 11px; border-radius: 7px; color: #475467; text-decoration: none; font-size: 13px; font-weight: 610; transition: color .15s ease, background .15s ease; }
.admin-navigation a:hover { color: #1d2b3e; background: #f3f5f8; }
.admin-navigation a.active { color: #174eaa; background: #eaf1fc; }
.admin-nav-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: #7b8796; background: #f1f3f6; font-size: 10px; }
.admin-navigation a.active .admin-nav-icon { color: #1d60c6; background: #dce9fc; }
.admin-sidebar-footer { min-height: 66px; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid #edf0f4; }
.admin-sidebar-avatar { width: 32px; height: 32px; display: grid; flex: none; place-items: center; border-radius: 50%; color: #fff; background: #315f9f; font-size: 11px; font-weight: 750; }
.admin-sidebar-identity { min-width: 0; flex: 1; }
.admin-sidebar-footer strong, .admin-sidebar-footer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar-footer strong { font-size: 12px; }
.admin-sidebar-footer small { margin-top: 3px; color: var(--faint); font-size: 11px; }
.admin-logout-button { min-height: 30px; flex: none; padding: 0 8px; border: 1px solid #e1e6ed; border-radius: 7px; color: #667085; background: #fff; font-size: 11px; font-weight: 650; cursor: pointer; }
.admin-logout-button:hover, .admin-logout-button:focus-visible { color: #a33a3a; border-color: #e8caca; background: #fff8f8; }
.admin-workspace { min-width: 0; }
.admin-topbar { position: sticky; z-index: 40; top: 0; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; border-bottom: 1px solid #e5e9ef; background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
.admin-sidebar-toggle { display: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.admin-breadcrumb { display: flex; align-items: center; gap: 9px; margin-right: auto; color: var(--faint); font-size: 12px; }
.admin-breadcrumb i { color: #c1c7d0; font-style: normal; }
.admin-breadcrumb strong { color: var(--text); font-weight: 650; }
.admin-topbar-actions { display: flex; align-items: center; gap: 10px; }
.admin-topbar-actions a, .admin-topbar-actions button { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fff; text-decoration: none; font-size: 12px; cursor: pointer; }
.admin-content { min-width: 0; padding: 24px 28px 42px; }
.admin-page { min-height: calc(100vh - 124px); }
.admin-page-header { align-items: center; margin: 0 0 18px; }
.admin-title-row .admin-page-title { font-size: 21px; }
.admin-title-row span { font-size: 12px; }
.admin-summary { gap: 10px; }
.admin-summary > div { min-height: 76px; border-radius: 7px; box-shadow: none; }
.admin-summary span { font-size: 12px; }
.admin-summary small { font-size: 11px; }
.admin-table-card, .analytics-card { border-radius: 7px; box-shadow: none; }
.admin-table-heading { min-height: 60px; }
.admin-table-heading span { font-size: 11px; }
.admin-table th, .admin-table td { padding: 12px 14px; }
.admin-table th { color: #5d6b7f; font-size: 12px; }
.admin-table td { color: var(--muted); font-size: 13px; }
.table-badge { min-height: 24px; padding-inline: 8px; font-size: 11px; }
.managed-application strong, .operation-action strong, .analytics-service-copy strong, .analytics-service-metric strong { font-size: 13px; }
.managed-application small, .operation-action small, .analytics-service-copy small, .analytics-service-metric small { font-size: 11px; }
.role-name strong { font-size: 13px; }
.role-name small { font-size: 11px; }
.authorization-tabs { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #eef1f5; scrollbar-width: thin; }
.authorization-tabs a { min-height: 36px; display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; padding: 0 14px; border-radius: 6px; color: #536174; text-decoration: none; font-size: 12px; font-weight: 650; white-space: nowrap; }
.authorization-tabs a:hover { color: var(--text); background: rgba(255,255,255,.62); }
.authorization-tabs a.active { color: #174eaa; background: #fff; box-shadow: 0 1px 3px rgba(25,42,72,.08); }
.authorization-tabs a:focus-visible { outline: 3px solid rgba(36,104,216,.18); outline-offset: 1px; }
.authorization-context-bar { min-height: 48px; display: flex; align-items: center; gap: 0; margin-bottom: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.authorization-context-bar span { padding: 0 14px; border-right: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.authorization-context-bar span:last-child { border-right: 0; }
.authorization-context-bar strong { margin-left: 4px; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.admin-list-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.admin-list-toolbar > strong { font-size: 13px; }
.operation-filters { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.operation-filters .admin-search { margin-right: auto; }
.operation-filters select { min-height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); font: inherit; font-size: 12px; }
.authorization-filters .admin-list-hint { flex-basis: 100%; margin-left: 2px; }
.analytics-loading.compact { min-height: 54px; }
.operation-action { display: grid; gap: 2px; }
.operation-action strong { font-size: 12px; }
.operation-action small { max-width: 360px; overflow: hidden; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.feedback-table { min-width: 1080px; }
.feedback-table th, .feedback-table td { white-space: nowrap; }
.feedback-table td:last-child button { white-space: nowrap; }
.feedback-summary { max-width: 430px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.feedback-dialog-card { width: min(660px, calc(100vw - 30px)); }
.feedback-dialog-card label small { justify-self: end; color: var(--faint); font-size: 11px; }
.feedback-message-detail { max-height: 220px; overflow: auto; margin: 4px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #f8fafc; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-table-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.table-pagination-footer { justify-content: space-between; }
.table-pagination-controls, .table-pagination-buttons { display: inline-flex; align-items: center; gap: 7px; }
.table-pagination-summary { white-space: nowrap; }
.table-pagination-buttons select, .table-pagination-buttons button { height: 28px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; font: inherit; }
.table-pagination-buttons select { padding: 0 24px 0 8px; }
.table-pagination-buttons button { width: 28px; padding: 0; color: var(--text); cursor: pointer; }
.table-pagination-buttons button:hover:not(:disabled) { color: var(--primary); border-color: #bfd1ec; background: var(--primary-soft); }
.table-pagination-buttons button:disabled { opacity: .35; cursor: not-allowed; }
.table-pagination-page { min-width: 44px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.operation-table-footer { display: grid; grid-template-columns: minmax(100px, auto) 1fr minmax(260px, auto); }
.operation-table-footer .table-pagination-controls { justify-content: center; }
.operation-table-footer > :last-child { text-align: right; }
.system-summary small { margin-top: 5px; color: var(--faint); font-size: 12px; }
.system-summary strong { font-variant-numeric: tabular-nums; }
.ai-header-actions { display: flex; align-items: center; gap: 9px; }
.ai-section-tabs { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #eef1f5; scrollbar-width: thin; }
.ai-section-tabs button { min-height: 36px; display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; padding: 0 14px; border: 0; border-radius: 6px; color: #536174; background: transparent; font-size: 12px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.ai-section-tabs button:hover { color: var(--text); background: rgba(255,255,255,.62); }
.ai-section-tabs button.active { color: #174eaa; background: #fff; box-shadow: 0 1px 3px rgba(25,42,72,.08); }
.ai-section-tabs button:focus-visible { outline: 3px solid rgba(36,104,216,.18); outline-offset: 1px; }
.ai-summary strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.ai-summary .ai-status-ok { color: var(--green); }
.ai-summary .ai-status-warning { color: var(--amber); }
.ai-security-notice { min-height: 58px; display: flex; align-items: center; gap: 11px; margin-bottom: 12px; padding: 10px 14px; border: 1px solid #f0dba8; border-radius: 7px; color: #7b571a; background: #fffaec; }
.ai-security-icon { width: 30px; height: 30px; display: grid; flex: none; place-items: center; border-radius: 8px; color: #8a5d18; background: #fff0c9; font-size: 13px; }
.ai-security-notice strong, .ai-security-notice small { display: block; }
.ai-security-notice strong { font-size: 12px; }
.ai-security-notice small { margin-top: 3px; color: #8a6b35; font-size: 11px; }
.ai-settings-card { margin-bottom: 14px; }
.ai-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0 16px 14px; }
.ai-settings-section { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; margin-top: 10px; padding: 12px 4px 7px; border-bottom: 1px solid #dfe5ec; }
.ai-settings-section strong { color: var(--text); font-size: 12px; }
.ai-settings-section small { color: var(--faint); font-size: 12px; }
.ai-setting-toggle { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 4px; border-bottom: 1px solid #edf0f4; }
.ai-setting-toggle:nth-child(odd) { margin-right: 16px; }
.ai-setting-toggle:nth-child(even) { margin-left: 16px; }
.ai-setting-toggle > span:first-child { min-width: 0; }
.ai-setting-toggle strong, .ai-setting-toggle small { display: block; }
.ai-setting-toggle strong { color: var(--text); font-size: 12px; }
.ai-setting-toggle small { margin-top: 4px; color: var(--faint); font-size: 11px; }
.ai-setting-select { display: grid; gap: 6px; padding: 14px 4px 0; color: var(--muted); font-size: 12px; }
.ai-setting-select:nth-of-type(odd) { margin-right: 16px; }
.ai-setting-select:nth-of-type(even) { margin-left: 16px; }
.ai-setting-select select, .ai-setting-select input { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #fff; font: inherit; }
.ai-setting-select small { color: var(--faint); font-size: 11px; }
.ai-setting-select select:focus, .ai-setting-select input:focus { border-color: #91b4ec; box-shadow: 0 0 0 3px rgba(36,104,216,.08); outline: 0; }
.ai-alert-status { grid-column: 1 / -1; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 9px 11px; border: 1px solid #e1e7ef; border-radius: 7px; background: #f8fafc; }
.ai-alert-status strong, .ai-alert-status small { display: block; }
.ai-alert-status strong { color: var(--text); font-size: 12px; }
.ai-alert-status small { margin-top: 3px; color: var(--faint); font-size: 12px; }
.ai-settings-card .form-error { margin: 0 16px 14px; }
.ai-profile-table { min-width: 1240px; }
.ai-account-table { min-width: 1180px; }
.ai-accounts-card { margin-bottom: 14px; }
.ai-profile-name, .ai-profile-endpoint { min-width: 160px; display: block; }
.ai-profile-endpoint { min-width: 240px; }
.ai-profile-name strong, .ai-profile-name small, .ai-profile-endpoint strong, .ai-profile-endpoint small { display: block; }
.ai-profile-name strong, .ai-profile-endpoint strong { color: var(--text); font-size: 12px; }
.ai-profile-name small, .ai-profile-endpoint small { max-width: 300px; margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ai-profile-endpoint small { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ai-profile-statuses { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-profile-readonly { color: var(--faint); font-size: 11px; white-space: nowrap; }
.ai-profile-editor-card { width: min(980px, calc(100vw - 30px)); padding: 24px; }
.ai-credential-editor-card { width: min(660px, calc(100vw - 30px)); padding: 24px; }
.ai-credential-editor-card .modal-heading { margin-right: 44px; }
.ai-profile-editor-card .modal-heading { margin-right: 44px; }
.ai-profile-editor-card input:read-only { color: #738095; background: #f5f7fa; }
.ai-profile-type-row { min-height: 60px; display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 2px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.ai-profile-type-row label { min-width: 180px; }
.ai-profile-type-row label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.ai-profile-type-row select { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: #fff; font-size: 12px; }
.ai-profile-type-row small { padding-bottom: 9px; color: var(--faint); font-size: 11px; text-align: right; }
.ai-profile-layout { display: grid; grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ai-profile-layout.search-mode { grid-template-columns: minmax(0, 1fr); }
.ai-profile-layout.search-mode .ai-profile-config-panel { max-width: 620px; }
.ai-model-catalog-panel, .ai-profile-config-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ai-model-catalog-panel { padding: 12px; background: #f8fafc; }
.ai-model-catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 1px 9px; }
.ai-model-catalog-heading strong { color: var(--text); font-size: 12px; }
.ai-model-catalog-heading span { color: var(--faint); font-size: 11px; }
.ai-model-search { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--faint); background: #fff; }
.ai-model-search:focus-within { border-color: #91b4ec; box-shadow: 0 0 0 3px rgba(36,104,216,.08); }
.ai-model-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.ai-model-catalog-results { max-height: 376px; overflow-y: auto; margin: 10px -4px 0 0; padding-right: 4px; scrollbar-width: thin; }
.ai-model-provider-group + .ai-model-provider-group { margin-top: 13px; }
.ai-model-provider-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 5px 6px; }
.ai-model-provider-heading > span { display: inline-flex; align-items: center; gap: 7px; }
.ai-model-provider-heading b { min-width: 23px; height: 23px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 7px; color: #2459a8; background: #e9f1ff; font-size: 9px; }
.ai-model-provider-heading strong { color: var(--muted); font-size: 11px; }
.ai-model-provider-heading small { color: var(--faint); font-size: 9px; }
.ai-model-provider-list { display: grid; gap: 5px; }
.ai-model-option { width: 100%; min-height: 52px; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid transparent; border-radius: 9px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.ai-model-option:hover { border-color: #dbe6f6; background: #fff; }
.ai-model-option.selected { border-color: #bcd2f2; background: #edf4ff; box-shadow: 0 1px 2px rgba(36,104,216,.08); }
.ai-model-option > span:first-child { min-width: 0; }
.ai-model-option strong, .ai-model-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-model-option strong { font-size: 12px; font-weight: 650; }
.ai-model-option small { margin-top: 3px; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.ai-model-option-tags, .ai-selected-model-tags { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.ai-model-option-tags span, .ai-selected-model-tags span { padding: 2px 5px; border-radius: 5px; color: #3d5e8f; background: #eaf2ff; font-size: 9px; white-space: nowrap; }
.ai-model-option-tags span:nth-child(n+3) { display: none; }
.ai-model-option-check { color: var(--primary); font-size: 13px; text-align: center; }
.ai-model-catalog-empty { padding: 30px 8px; color: var(--faint); font-size: 11px; text-align: center; }
.ai-custom-model-button { width: 100%; min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 8px 10px; border: 1px dashed #cdd6e2; border-radius: 9px; color: var(--muted); background: #fff; text-align: left; cursor: pointer; }
.ai-custom-model-button:hover, .ai-custom-model-button.selected { color: var(--primary); border-color: #a9c2e8; background: #f4f8ff; }
.ai-custom-model-button strong, .ai-custom-model-button small { display: block; }
.ai-custom-model-button strong { font-size: 11px; }
.ai-custom-model-button small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.ai-custom-model-button b { font-size: 14px; }
.ai-model-catalog-date { display: block; margin-top: 9px; color: var(--faint); font-size: 9px; text-align: center; }
.ai-profile-config-panel { padding: 15px; }
.ai-selected-model-summary { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #dbe6f5; border-radius: 10px; background: #f6f9fe; }
.ai-selected-model-mark { min-width: 42px; height: 42px; display: inline-grid; flex: none; place-items: center; padding: 0 6px; border-radius: 10px; color: #2459a8; background: #e4eeff; font-size: 11px; font-weight: 750; }
.ai-selected-model-copy { min-width: 0; flex: 1; }
.ai-selected-model-copy > strong, .ai-selected-model-copy > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-selected-model-copy > strong { color: var(--text); font-size: 13px; }
.ai-selected-model-copy > small { margin: 4px 0 7px; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.ai-selected-model-tags { justify-content: flex-start; }
.ai-profile-core-fields { margin-top: 14px; }
.ai-field-hint { display: block; margin-top: 6px; color: var(--faint); font-size: 11px; line-height: 1.5; }
.ai-profile-advanced { margin-top: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ai-profile-advanced summary { padding: 11px 12px; color: var(--muted); font-size: 11px; font-weight: 650; cursor: pointer; list-style-position: inside; }
.ai-profile-advanced summary span { margin-left: 5px; color: var(--faint); font-size: 9px; font-weight: 400; }
.ai-profile-advanced[open] summary { border-bottom: 1px solid var(--line); }
.ai-profile-advanced .application-form-grid { margin: 0; padding: 13px; }
.ai-profile-advanced select[multiple] { min-height: 108px; padding: 5px; }
.ai-profile-advanced select[multiple] option { padding: 7px 8px; border-radius: 5px; }
.ai-profile-enabled { margin-top: 13px; padding-top: 4px; }
.ai-usage-card { margin-bottom: 14px; }
.ai-usage-range { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 11px; }
.ai-usage-range select { min-height: 32px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: #fff; font: inherit; }
.ai-usage-summary { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.ai-usage-table { min-width: 760px; }
.ai-usage-card > .admin-list-hint { display: block; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.ai-knowledge-summary { margin-bottom: 14px; }
.ai-knowledge-card { margin-bottom: 14px; }
.ai-knowledge-heading { align-items: center; }
.ai-knowledge-toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(126px, 170px)); gap: 9px; padding: 12px 14px; border-top: 1px solid var(--line); }
.ai-knowledge-toolbar > label:not(.ai-knowledge-search) { display: grid; gap: 4px; color: var(--faint); font-size: 11px; }
.ai-knowledge-toolbar select { width: 100%; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #fff; font-size: 11px; }
.ai-knowledge-search { min-height: 36px; display: flex; align-items: center; gap: 7px; align-self: end; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--faint); background: #fff; }
.ai-knowledge-search:focus-within, .ai-knowledge-toolbar select:focus { border-color: #91b4ec; box-shadow: 0 0 0 3px rgba(36,104,216,.08); outline: 0; }
.ai-knowledge-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.ai-knowledge-table { min-width: 1060px; }
.ai-knowledge-title { min-width: 280px; max-width: 420px; display: block; }
.ai-knowledge-title strong, .ai-knowledge-title small, .ai-knowledge-classification strong, .ai-knowledge-classification small { display: block; }
.ai-knowledge-title strong, .ai-knowledge-classification strong { color: var(--text); font-size: 12px; }
.ai-knowledge-title small { margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ai-knowledge-classification { min-width: 120px; display: block; }
.ai-knowledge-classification small { margin-top: 4px; color: var(--faint); font-size: 11px; }
.ai-knowledge-count { padding: 0 14px 10px; color: var(--faint); font-size: 11px; }
.ai-knowledge-preview { margin-bottom: 14px; }
.ai-knowledge-preview-input { padding: 13px 14px; border-top: 1px solid var(--line); }
.ai-knowledge-preview-input input { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: #fff; font-size: 12px; outline: 0; }
.ai-knowledge-preview-input input:focus { border-color: #91b4ec; box-shadow: 0 0 0 3px rgba(36,104,216,.08); }
.ai-knowledge-preview-result { margin: 0 14px 14px; padding: 13px 0 0; border-top: 1px solid var(--line); }
.ai-knowledge-preview-result > p { margin: 0; color: var(--text); font-size: 12px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-knowledge-preview-sources { display: grid; gap: 0; margin-top: 10px; border-top: 1px solid var(--line); }
.ai-knowledge-preview-sources a { min-height: 39px; display: flex; align-items: center; color: #355675; border-bottom: 1px solid var(--line); font-size: 11px; text-decoration: none; }
.ai-knowledge-preview-sources a:hover { color: var(--primary); }
.ai-knowledge-preview .form-error { margin: 0 14px 14px; }
.ai-knowledge-editor-card { width: min(900px, calc(100vw - 28px)); max-height: min(90dvh, 980px); overflow-y: auto; padding: 24px; }
.ai-knowledge-editor-card .modal-heading { margin-right: 44px; }
.ai-knowledge-form-grid textarea { resize: vertical; }
.ai-knowledge-form-grid #aiKnowledgeArticleBody { min-height: 170px; }

@media (max-width: 760px) {
  .ai-profile-editor-card { width: min(100vw - 18px, 620px); padding: 18px; }
  .ai-credential-editor-card { width: min(100vw - 18px, 620px); padding: 18px; }
  .ai-profile-type-row { align-items: stretch; flex-direction: column; }
  .ai-profile-type-row small { padding: 0; text-align: left; }
  .ai-profile-layout { grid-template-columns: 1fr; }
  .ai-model-catalog-results { max-height: 310px; }
  .ai-model-option { grid-template-columns: minmax(0, 1fr) 16px; }
  .ai-model-option-tags { display: none; }
  .ai-profile-layout.search-mode .ai-profile-config-panel { max-width: none; }
  .ai-section-tabs { margin-top: 0; }
  .ai-section-tabs button { min-height: 42px; }
  .ai-knowledge-toolbar { grid-template-columns: 1fr 1fr; }
  .ai-knowledge-search { grid-column: 1 / -1; }
  .ai-knowledge-editor-card { width: min(100vw - 18px, 620px); max-height: 94dvh; padding: 18px; }
  .ai-setting-toggle, .ai-setting-select { margin-right: 0 !important; margin-left: 0 !important; }
  .ai-usage-range { align-items: stretch; flex-direction: column; }
}
.admin-search { width: min(330px, 45vw); min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--faint); background: #fff; }
.admin-search:focus-within { border-color: #91b4ec; box-shadow: 0 0 0 3px rgba(36,104,216,.08); }
.admin-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.admin-list-hint { color: var(--faint); font-size: 12px; }
.binding-target, .permission-capability { min-width: 200px; display: block; }
.binding-target strong, .binding-target small, .permission-capability strong, .permission-capability small { display: block; }
.binding-target strong, .permission-capability strong { color: var(--text); font-size: 13px; }
.binding-target small, .permission-capability small { max-width: 320px; margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.permission-table { min-width: 1040px; }
.permission-table code { padding: 4px 6px; border-radius: 5px; color: #344e73; background: #eef2f7; font-size: 11px; }
.role-editor-card, .binding-editor-card { --muted: #475467; --faint: #667085; }
.binding-editor-card { width: min(700px, calc(100vw - 32px)); }
.binding-editor-card .binding-form { padding: 8px 0 0; }
.role-members-card { width: min(780px, calc(100vw - 32px)); padding: 24px; border: 0; }
.role-members-heading { margin-right: 42px; }
.role-members-heading span { font-size: 12px; line-height: 1.5; }
.role-members-search { width: 100%; margin: 16px 0 12px; }
.role-members-search svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.role-members-table-wrap { max-height: min(56vh, 480px); overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.role-members-table { min-width: 650px; }
.role-members-table thead { position: sticky; z-index: 1; top: 0; }
.role-members-table .binding-target { min-width: 250px; }
.role-members-card .modal-actions { margin-top: 16px; }
.binding-form input[readonly] { color: #738095; background: #f5f7fa; cursor: default; }
.binding-target-picker { position: relative; }
.binding-target-picker > small { color: var(--faint); font-size: 12px; line-height: 1.5; }
.binding-target-results { position: absolute; z-index: 6; top: 66px; right: 0; left: 0; max-height: 230px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 16px 38px rgba(20,33,61,.16); }
.binding-target-results button { width: 100%; min-height: 50px; display: block; padding: 8px 10px; border: 0; border-radius: 7px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.binding-target-results button:hover, .binding-target-results button:focus-visible { background: var(--primary-soft); }
.binding-target-results strong, .binding-target-results small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binding-target-results strong { font-size: 12px; }
.binding-target-results small { margin-top: 4px; color: var(--faint); font-size: 12px; }
.binding-target-empty { padding: 18px 12px; color: var(--faint); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .hero-carousel { min-height: 480px; }
  .hero-slide-inner { width: min(100% - 70px, 760px); }
  .hero-carousel .hero-copy { max-width: 620px; }
  .workspace-metrics { justify-content: flex-start; overflow-x: auto; }
  .platform-story-grid { grid-template-columns: 1fr; margin-top: 48px; }
  .platform-story-grid article, .platform-story-grid article + article { padding: 24px 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.13); }
  .platform-story-grid article:last-child { border-bottom: 0; }
  .admin-shell:not([hidden]) { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; left: 0; width: 224px; transform: translateX(-102%); box-shadow: 18px 0 48px rgba(16,24,40,.15); transition: transform .2s ease; }
  .admin-nav-open .admin-sidebar { transform: translateX(0); }
  .admin-sidebar-toggle { display: grid; place-items: center; }
  .admin-content { padding: 20px; }
}

@media (max-width: 620px) {
  .portal-main { padding-bottom: 50px; }
  .hero-carousel { min-height: 450px; }
  .hero-slide { background-position: 68% center; }
  .hero-slide-inner { position: relative; z-index: 1; width: calc(100% - 40px); align-items: flex-end; }
  .hero-carousel .hero-copy { padding: 64px 0 58px; }
  .hero-carousel .hero-copy h1, .hero-carousel .hero-copy h2 { font-size: 36px; }
  .hero-carousel .hero-copy p { margin: 16px 0 22px; font-size: 13px; line-height: 1.65; }
  .hero-arrow { display: none; }
  .hero-playback { right: 18px; bottom: 15px; }
  .workspace-metrics, .content-section { width: calc(100% - 32px); }
  .workspace-metrics { min-height: 68px; gap: 24px; }
  .workspace-metrics strong { font-size: 18px; }
  .content-section { padding-top: 48px; }
  .section-heading h2 { font-size: 22px; }
  .application-grid, .continue-grid { grid-template-columns: 1fr; }
  .application-card, .application-main { min-height: 126px; }
  .application-main { padding: 21px 4px; }
  .tool-card { padding-inline: 4px; }
  .platform-story { margin-top: 58px; padding: 68px 20px; }
  .platform-story-heading h2 { font-size: 32px; }
  .admin-topbar { padding: 0 14px; }
  .admin-breadcrumb > span, .admin-breadcrumb i, .admin-topbar-actions a { display: none; }
  .admin-content { padding: 17px 12px 32px; }
  .admin-page-header { align-items: stretch; }
  .admin-title-row { display: block; }
  .admin-title-row span { display: block; margin-top: 5px; }
  .role-header-actions { flex-direction: row; }
  .role-header-actions .button { width: auto; flex: 1; }
  .authorization-tabs { margin-top: 0; }
  .authorization-tabs a { min-height: 42px; padding-inline: 13px; }
  .authorization-context-bar { overflow-x: auto; }
  .authorization-context-bar span { white-space: nowrap; }
  .admin-list-toolbar { align-items: stretch; flex-direction: column; }
  .admin-search { width: 100%; }
  .operation-filters select { width: 100%; }
  .role-permission-group-toolbar { min-height: 40px; }
  .role-permission-toggle { min-height: 38px; }
  .admin-table-footer { align-items: flex-start; flex-direction: column; }
  .operation-table-footer { display: flex; }
  .operation-table-footer .table-pagination-controls, .table-pagination-footer { width: 100%; }
  .operation-table-footer .table-pagination-controls, .table-pagination-footer { justify-content: space-between; }
  .operation-table-footer > :last-child { text-align: left; }
  .ai-header-actions { width: 100%; }
  .ai-header-actions .button { flex: 1; }
  .ai-settings-grid { grid-template-columns: 1fr; }
  .ai-settings-section { align-items: flex-start; flex-direction: column; gap: 3px; }
  .ai-alert-status { align-items: stretch; flex-direction: column; }
  .ai-setting-toggle:nth-child(n), .ai-setting-select:first-of-type, .ai-setting-select:last-of-type { margin-right: 0; margin-left: 0; }
}

/* Usage analytics keeps primary traffic and resource readings together. */
.analytics-header-actions select { min-height: 38px; max-width: 200px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #fff; font: inherit; font-size: 13px; }
.analytics-definitions { margin: -2px 0 14px; color: var(--muted); font-size: 12px; }
.analytics-definitions summary, .analytics-secondary > summary { width: fit-content; padding: 8px 0; cursor: pointer; font-weight: 600; }
.analytics-definitions p { max-width: 90ch; margin: 4px 0 10px; line-height: 1.8; }
.analytics-definitions summary:focus-visible, .analytics-secondary > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.analytics-page .analytics-overview-grid { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: stretch; }
.resource-monitor { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.resource-monitor-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.resource-monitor-heading strong { font-size: 13px; }
.resource-monitor-heading > span { order: 3; flex-basis: 100%; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.resource-monitor-heading a { margin-left: auto; color: var(--primary); font-size: 12px; text-underline-offset: 3px; }
.resource-monitor-grid { display: grid; gap: 16px; margin-top: 18px; }
.resource-monitor-grid > div > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.resource-monitor-grid strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.resource-monitor-grid small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.resource-monitor meter { display: block; width: 100%; height: 8px; margin-top: 6px; accent-color: #2676db; border: 0; background: #edf1f6; border-radius: 4px; }
.resource-monitor meter::-webkit-meter-bar { border: 0; border-radius: 4px; background: #edf1f6; }
.resource-monitor meter::-webkit-meter-optimum-value { background: #2676db; border-radius: 4px; }
.resource-monitor meter::-webkit-meter-suboptimum-value { background: #b87512; border-radius: 4px; }
.resource-monitor meter::-webkit-meter-even-less-good-value { background: #d03b3b; border-radius: 4px; }
.resource-monitor meter::-moz-meter-bar { background: #2676db; border-radius: 4px; }
.resource-scope { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.resource-monitor-heading .resource-stale { color: #a35b12; }
.analytics-secondary { margin: 2px 0 16px; }
.analytics-secondary > summary { color: var(--muted); font-size: 13px; }
.analytics-secondary-metrics { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 14px 0; color: var(--muted); font-size: 12px; }
.analytics-secondary-metrics strong { margin-left: 5px; color: var(--text); font-variant-numeric: tabular-nums; }
.analytics-secondary .analytics-services-card { max-height: none; }
.analytics-secondary .analytics-services { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.analytics-page .analytics-table { min-width: 960px; }
@media (max-width: 1100px) {
  .analytics-page .analytics-overview-grid { grid-template-columns: 1fr; }
  .resource-monitor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .analytics-header-actions select { max-width: none; width: 100%; min-height: 44px; font-size: 16px; }
  .resource-monitor-grid { grid-template-columns: 1fr; gap: 14px; }
  .analytics-secondary .analytics-services { grid-template-columns: 1fr; }
  .analytics-page .analytics-chart { height: 275px; }
}
@media (prefers-reduced-motion: reduce) {
  .analytics-loading i { animation: none; }
}
@media (max-width: 650px) {
  .analytics-page .analytics-table { min-width: 0; width: 100%; }
  .analytics-page .analytics-table th:nth-child(1), .analytics-page .analytics-table td:nth-child(1),
  .analytics-page .analytics-table th:nth-child(n+5), .analytics-page .analytics-table td:nth-child(n+5) { display: none; }
  .analytics-page .analytics-table th:nth-child(2), .analytics-page .analytics-table td:nth-child(2) { width: 50%; }
  .analytics-page .analytics-table th:nth-child(3), .analytics-page .analytics-table td:nth-child(3),
  .analytics-page .analytics-table th:nth-child(4), .analytics-page .analytics-table td:nth-child(4) { text-align: right; white-space: nowrap; }
  .analytics-page .analytics-table th, .analytics-page .analytics-table td { padding-inline: 10px; }
  .analytics-page .analytics-application { min-width: 0; gap: 8px; }
  .analytics-page .analytics-application .app-icon { width: 28px; height: 28px; flex: 0 0 28px; }
  .analytics-page .analytics-application strong { font-size: 12px; }
}
.analytics-overview-grid:has(#analyticsResourceMonitor[hidden]) { grid-template-columns: 1fr; }

.operation-detail-dialog { width: min(800px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); overflow: auto; }
.operation-detail-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.operation-detail-header h2 { margin: 0; font-size: 19px; }
.operation-detail-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.operation-detail-content { padding: 4px 24px 20px; }
.operation-detail-content section + section { border-top: 1px solid var(--line); }
.operation-detail-content h3 { margin: 20px 0 12px; font-size: 14px; }
.operation-detail-content dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 28px; margin: 0 0 20px; }
.operation-detail-content dl > div { min-width: 0; }
.operation-detail-content dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.operation-detail-content dd { margin: 0; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.operation-detail-content .operation-detail-missing { color: #737d8d; }
.operation-detail-wide { grid-column: 1 / -1; }
.operation-detail-footer { padding: 14px 24px; border-top: 1px solid var(--line); color: var(--muted); background: #fafbfd; font-size: 12px; line-height: 1.7; }
.operation-detail-loading, .operation-detail-error { padding: 40px 24px; color: var(--muted); font-size: 13px; }
@media(max-width:650px) {
 .operation-detail-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
 .operation-detail-header { padding: 16px; }
 .operation-detail-content { padding: 0 16px 12px; }
 .operation-detail-content dl { gap: 14px 16px; }
 .operation-detail-footer { padding: 12px 16px; }
 .operation-table { min-width: 1100px; }
}
.operation-actor-detail { padding: 0; border: 0; color: var(--primary); background: transparent; text-align: left; font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; }
.operation-actor-detail:hover { text-decoration-color: currentColor; }
.operation-actor-detail:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 2px; }

@media(max-width:650px) { .operation-detail-header .button { min-height: 44px; } }

.feedback-mail-panel { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.feedback-mail-panel summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 16px 20px; cursor: pointer; list-style: none; }
.feedback-mail-panel summary::-webkit-details-marker { display: none; }
.feedback-mail-panel summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.feedback-mail-panel[open] summary::after { transform: rotate(225deg); }
.feedback-mail-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; }
.feedback-mail-title svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
#feedbackMailSummary { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.feedback-mail-form { display: grid; gap: 14px; padding: 4px 20px 20px; }
.feedback-mail-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.feedback-mail-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }
.feedback-mail-recipient { display: grid; gap: 7px; max-width: 440px; font-size: 12px; font-weight: 600; }
.feedback-mail-recipient input { width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; font: inherit; font-weight: 400; }
.feedback-mail-hint { max-width: 70ch; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.feedback-mail-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.feedback-mail-detail { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .feedback-mail-panel summary { padding: 14px 16px; }
  #feedbackMailSummary { order: 2; flex-basis: 100%; }
  .feedback-mail-form { padding: 4px 16px 16px; }
  .feedback-mail-actions .button { flex: 1; min-height: 42px; }
}

/* Visitor analytics follows the existing admin controls and responsive table. */
.analytics-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.analytics-range-filters button { white-space: nowrap; }
.analytics-date-range { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.analytics-date-range label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.analytics-date-range input { min-height: 38px; min-width: 156px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #fff; font: inherit; }
.analytics-date-range input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.analytics-date-range p { flex-basis: 100%; margin: 0; color: #b42318; font-size: 12px; }
.analytics-visitor-coverage { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.analytics-traffic-context { padding: 8px 0; gap: 8px 24px; }
.analytics-traffic-context small { margin-left: 8px; font-size: inherit; }
.analytics-daily-table { min-width: 560px; font-variant-numeric: tabular-nums; }
@media (max-width: 650px) {
  .analytics-range-filters button { min-height: 40px; padding: 0 7px; }
  .analytics-date-range { gap: 12px 10px; }
  .analytics-date-range label { flex: 1; min-width: 0; }
  .analytics-date-range input { min-width: 0; width: 100%; min-height: 44px; font-size: 16px; }
  .analytics-date-range .button { width: 100%; min-height: 44px; }
  .analytics-page .analytics-table th:nth-child(5), .analytics-page .analytics-table td:nth-child(5) { display: table-cell; width: 16%; }
  .analytics-page .analytics-table th:nth-child(2), .analytics-page .analytics-table td:nth-child(2) { width: 40%; }
  .analytics-page .analytics-table th:nth-child(3), .analytics-page .analytics-table td:nth-child(3),
  .analytics-page .analytics-table th:nth-child(4), .analytics-page .analytics-table td:nth-child(4) { width: 22%; }
}

.analytics-self-exclusion { display: flex; align-items: baseline; gap: 8px 18px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.analytics-self-exclusion label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; color: var(--text); font-weight: 600; cursor: pointer; }
.analytics-self-exclusion input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.analytics-self-exclusion input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.analytics-self-exclusion p { flex: 1 1 280px; margin: 0; line-height: 1.7; }
@media (max-width: 650px) { .analytics-self-exclusion { gap: 2px; } .analytics-self-exclusion label { min-height: 44px; } }
