:root {
  color-scheme: light dark;
  --ink: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #6e6e73;
  --surface: #ffffff;
  --canvas: #f5f5f7;
  --line: #d2d2d7;
  --line-strong: #8e8e93;
  --accent: #704bda;
  --accent-strong: #5e3bc4;
  --accent-soft: #efebf8;
  --success: #237a45;
  --success-soft: #e8f3eb;
  --warning: #765600;
  --danger: #b4232f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--canvas);
}
body.sidebar-open { overflow: hidden; }

button, input { font: inherit; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, white);
  outline-offset: 3px;
}

::selection { background: var(--accent-strong); color: #fff; }

.login-page {
  display: grid;
  place-items: center;
  padding: 26px;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(470px, 0.92fr) minmax(460px, 1.08fr);
  width: min(1180px, 100%);
  min-height: min(720px, calc(100svh - 52px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(34 24 71 / 9%), 0 2px 8px rgb(25 24 32 / 4%);
}

.login-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 38px clamp(36px, 5vw, 68px) 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 14px;
}

.brand-copy { display: grid; gap: 3px; }
.brand-name { font-size: 16px; font-weight: 680; letter-spacing: -0.025em; }
.brand-company { color: var(--secondary); font-size: 12px; letter-spacing: 0.01em; }

.login-content {
  width: min(100%, 390px);
  margin: auto;
  padding-block: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.login-content h1 {
  margin: 17px 0 8px;
  font-size: clamp(32px, 3.2vw, 39px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.login-intro { margin: 0; color: var(--secondary); font-size: 15px; line-height: 1.65; }

.login-form { display: grid; gap: 21px; margin-top: 35px; }
.field-group { display: grid; gap: 9px; }
.field-group label { color: var(--ink); font-size: 13px; font-weight: 600; }

.field-group input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-group input:hover { border-color: #bdb6d1; }
.field-group input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }

.form-message {
  min-height: 18px;
  margin: -9px 0 -8px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.4;
}

.form-message.is-error { color: var(--danger); }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 49px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 5px 13px color-mix(in srgb, var(--accent) 21%, transparent);
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:hover:not(:disabled) { background: var(--accent-strong); box-shadow: 0 8px 17px color-mix(in srgb, var(--accent) 27%, transparent); transform: translateY(-1px); }
.primary-button:active:not(:disabled) { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: 0.72; }
.primary-button.is-loading svg { visibility: hidden; }

.login-security {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--secondary);
  font-size: 12px;
}

.login-security svg { width: 16px; height: 16px; fill: none; stroke: var(--tertiary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.mfa-step { display: grid; gap: 17px; width: min(100%, 390px); margin: auto; padding-block: 34px; }
.mfa-enrollment-instructions, .mfa-verification-instructions, .mfa-recovery-panel { display: grid; gap: 10px; }
.mfa-step h2 { margin: 0; font-size: 22px; font-weight: 660; letter-spacing: -.035em; line-height: 1.22; }
.mfa-step p { margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.65; }
.mfa-form { margin-top: 1px; }
.mfa-form input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: .08em; }
.mfa-secret-panel { display: grid; justify-items: start; gap: 9px; margin-top: 3px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--canvas) 65%, var(--surface)); }
.mfa-secret-label { color: var(--secondary); font-size: 11px; font-weight: 600; }
.mfa-secret-panel code { max-width: 100%; overflow-wrap: anywhere; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 650; letter-spacing: .08em; }
.mfa-copy-button { min-height: 37px; margin-top: 1px; }
.mfa-recovery-panel { gap: 12px; }
.mfa-recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.mfa-recovery-codes li { display: grid; min-height: 38px; place-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--canvas) 60%, var(--surface)); }
.mfa-recovery-codes code { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 650; letter-spacing: .035em; }
.mfa-recovery-confirm { display: flex; align-items: center; gap: 9px; margin-top: 2px; color: var(--ink); cursor: pointer; font-size: 12px; line-height: 1.45; }
.mfa-recovery-confirm input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.mfa-recovery-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 10px; margin-top: 2px; }
.mfa-recovery-actions .primary-button { min-height: 44px; font-size: 12px; }
.mfa-recovery-actions .quiet-button { min-height: 44px; font-size: 12px; }

.login-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--tertiary);
  font-size: 11px;
}

.language-toggle {
  min-height: 32px;
  min-width: 43px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}
.language-toggle:hover { border-color: var(--line-strong); color: var(--ink); }

.console-page { background: var(--canvas); }
.console-layout { display: grid; min-height: 100svh; grid-template-columns: 250px minmax(0, 1fr); }

.console-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 0;
  height: 100svh;
  flex-direction: column;
  padding: 25px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-brand { padding: 0 10px 24px; }
.sidebar-brand .brand-icon, .mobile-brand .brand-icon { width: 38px; height: 38px; border-radius: 12px; }
.sidebar-brand .brand-name { font-size: 15px; }
.sidebar-brand .brand-company { font-size: 11px; }
.sidebar-navigation { display: grid; align-content: start; min-height: 0; flex: 1; gap: 13px; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 8px; scrollbar-width: thin; }
.navigation-group { display: grid; align-content: start; gap: 3px; }
.sidebar-section-label { margin: 0; padding: 0 12px 4px; color: var(--tertiary); font-size: 10px; font-weight: 680; letter-spacing: 0.08em; line-height: 1.45; text-transform: uppercase; }
.navigation-group-items { display: grid; align-content: start; gap: 1px; }

.navigation-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 560;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.navigation-item:hover { background: color-mix(in srgb, var(--canvas) 72%, var(--surface)); color: var(--ink); }
.navigation-item.is-current { border-color: #e8e2f7; background: var(--accent-soft); color: #5535ad; font-weight: 640; }
.module-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--canvas) 75%, var(--surface));
}

.sidebar-note-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--surface); color: var(--accent); }
.sidebar-note-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-note-copy { display: grid; min-width: 0; gap: 4px; }
.sidebar-note-copy strong { overflow: hidden; font-size: 11px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-note-copy small { color: var(--secondary); font-size: 10px; }
.sidebar-bottom { display: flex; align-items: center; gap: 8px; padding: 17px 12px 0; color: var(--secondary); font-size: 11px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

.console-main { min-width: 0; }
.console-topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; min-height: 66px; gap: 12px; padding: 0 clamp(22px, 4.5vw, 60px); border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-spacer { flex: 1; }
.mobile-brand { display: none; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 650; text-decoration: none; }
.mobile-navigation-toggle { display: none !important; }
.account-menu { display: flex; align-items: center; gap: 10px; }
.account-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.account-name { max-width: 170px; overflow: hidden; font-size: 12px; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.account-role { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 650; line-height: 1; white-space: nowrap; }
.quiet-button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--secondary); cursor: pointer; font-size: 11px; font-weight: 600; }
.quiet-button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--canvas); color: var(--ink); }
.quiet-button:disabled { cursor: wait; opacity: 0.6; }

.icon-button { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--secondary); cursor: pointer; }
.icon-button:hover { border-color: var(--line); background: var(--surface); color: var(--ink); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.module-search-button { display: flex; width: min(310px, 32vw); min-width: 170px; height: 40px; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--secondary); cursor: pointer; text-align: left; }
.module-search-button:hover { border-color: var(--line-strong); color: var(--ink); }
.module-search-button > svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.module-search-label { flex: 1; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.module-search-button kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--tertiary); font-family: inherit; font-size: 10px; white-space: nowrap; }

.command-dialog { width: min(550px, calc(100vw - 32px)); max-height: min(650px, calc(100svh - 48px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgb(20 17 32 / 22%); }
.command-dialog::backdrop { background: rgb(17 15 24 / 36%); }
.command-dialog-header { display: flex; align-items: center; gap: 8px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.command-search-field { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; }
.command-search-field > svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--secondary); stroke-width: 1.6; stroke-linecap: round; }
.command-search-field input { width: 100%; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.command-search-field input::placeholder { color: var(--tertiary); opacity: 1; }
.command-search-field input:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
.command-close-button { width: 44px; height: 44px; }
.module-search-results { display: grid; max-height: min(510px, calc(100svh - 150px)); gap: 2px; margin: 0; padding: 8px; overflow: auto; list-style: none; }
.module-search-result { display: flex; width: 100%; min-height: 50px; align-items: center; gap: 12px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.module-search-result:hover, .module-search-result:focus-visible { background: var(--accent-soft); }
.module-search-result-icon { width: 19px; height: 19px; color: var(--accent-strong); }
.module-search-result-copy { display: grid; min-width: 0; gap: 3px; }
.module-search-result-label { overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.module-search-result-group { color: var(--secondary); font-size: 11px; }
.module-search-empty { margin: 0; padding: 28px 18px 34px; color: var(--secondary); font-size: 13px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.overview-content { width: min(1050px, 100%); margin: 0 auto; padding: clamp(34px, 5vw, 64px) clamp(22px, 4.5vw, 60px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 12px 0 6px; font-size: clamp(30px, 3.1vw, 37px); font-weight: 650; letter-spacing: 0; line-height: 1.25; }
.page-heading p { margin: 0; color: var(--secondary); font-size: 14px; line-height: 1.6; }
.overview-filter-bar { display: flex; align-items: flex-end; gap: 9px; }
.overview-filter-bar label { display: grid; gap: 5px; color: var(--secondary); font-size: 10px; font-weight: 650; }
.overview-filter-bar input { width: 142px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; }
.overview-filter-submit { min-height: 44px; padding: 0 13px; border: 1px solid var(--accent-strong); border-radius: 8px; background: var(--accent-strong); color: #fff; cursor: pointer; font-size: 12px; font-weight: 650; }
.overview-filter-submit:hover { background: var(--accent-strong); }

.integration-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  column-gap: 19px;
  padding: clamp(22px, 3vw, 35px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 9px 28px rgb(34 24 71 / 4%);
}

.integration-icon { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid #e3dcf6; border-radius: 15px; background: var(--accent-soft); color: var(--accent); }
.integration-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.integration-copy { min-width: 0; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid #e8e3f4; border-radius: 999px; background: #f5f2fb; color: #5e4b83; font-size: 10px; font-weight: 650; }
.status-pill span:first-child { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #9a85c8; }
.status-pill span:last-child { flex: 0 1 auto; }
.integration-copy h2 { margin: 14px 0 7px; font-size: 18px; font-weight: 660; letter-spacing: -0.025em; }
.integration-copy p { max-width: 650px; margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.75; }
.integration-footer { display: flex; grid-column: 1 / -1; align-items: center; gap: 8px; margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--secondary); font-size: 11px; }
.integration-footer-icon { display: grid; width: 19px; height: 19px; place-items: center; color: var(--tertiary); }
.integration-footer-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.overview-footnote { display: flex; align-items: flex-start; gap: 9px; margin-top: 19px; color: var(--secondary); font-size: 11px; line-height: 1.65; }
.footnote-check { display: grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; margin-top: 1px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.footnote-check svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.overview-results { margin-top: 26px; }
.overview-results-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.overview-results-header h2 { margin: 0; font-size: 15px; font-weight: 660; }
.overview-results-header p { margin: 0; color: var(--secondary); font-size: 10px; }
.overview-metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.overview-metric-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 18px rgb(34 24 71 / 3%); }
.overview-metric-card h3 { margin: 0 0 10px; color: var(--secondary); font-size: 11px; font-weight: 600; }
.overview-metric-value { display: block; overflow-wrap: anywhere; font-size: clamp(21px, 2.4vw, 27px); font-weight: 680; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.overview-metric-status { display: inline-block; margin-top: 7px; color: var(--tertiary); font-size: 10px; font-weight: 600; }
.overview-metric-card.status-complete .overview-metric-status { color: var(--success); }
.overview-metric-card.status-partial .overview-metric-status,
.overview-metric-card.status-stale .overview-metric-status { color: var(--warning); }
.overview-metric-definition { min-height: 34px; margin: 11px 0 0; color: var(--secondary); font-size: 10px; line-height: 1.6; }
.overview-metric-source { margin: 9px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--tertiary); font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }

@media (max-width: 850px) {
  .login-page { padding: 0; }
  .login-layout { grid-template-columns: minmax(0, 1fr); width: min(520px, 100%); min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
  .login-panel { padding: max(25px, env(safe-area-inset-top)) clamp(25px, 7vw, 42px) max(22px, env(safe-area-inset-bottom)); }
  .login-content { margin-block: auto; padding-block: 58px; }
  .login-art { display: none; }
  .console-layout { grid-template-columns: minmax(0, 1fr); }
  .console-sidebar { position: fixed; z-index: 42; inset: 0 auto 0 0; width: min(310px, calc(100vw - 54px)); height: 100svh; transform: translateX(-105%); visibility: hidden; border-right: 1px solid var(--line); box-shadow: none; transition: transform 220ms ease, visibility 220ms ease; }
  .console-sidebar.is-open { transform: translateX(0); visibility: visible; box-shadow: 16px 0 42px rgb(20 17 32 / 14%); }
  .navigation-item { min-height: 44px; }
  .sidebar-backdrop { position: fixed; z-index: 41; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(17 15 24 / 38%); cursor: default; }
  .console-topbar { min-height: 60px; gap: 8px; padding-inline: 16px; }
  .mobile-navigation-toggle { display: grid !important; }
  .mobile-brand { display: inline-flex; }
  .mobile-brand .brand-icon { width: 34px; height: 34px; }
  .module-search-button { width: 190px; min-width: 0; }
  .module-search-label { font-size: 11px; }
  .overview-content { padding: 39px 22px 52px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .overview-filter-bar { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .login-panel { padding-inline: 24px; }
  .brand-icon { width: 42px; height: 42px; }
  .login-content { padding-block: 46px; }
  .mfa-step { padding-block: 34px; }
  .login-content h1 { font-size: 34px; }
  .login-form { margin-top: 30px; }
  .login-footer { font-size: 10px; }
  .console-topbar { gap: 6px; padding-inline: 12px; }
  .console-topbar .language-toggle { min-width: 44px; min-height: 44px; border-radius: 12px; }
  .mobile-brand { gap: 0; }
  .mobile-brand > span { display: none; }
  .module-search-button { width: 44px; min-width: 0; height: 44px; justify-content: center; padding: 0; border-color: transparent; background: transparent; }
  .module-search-button > svg { width: 20px; height: 20px; }
  .module-search-label, .module-search-button kbd { display: none; }
  .account-menu { gap: 5px; }
  .account-avatar, .account-name { display: none; }
  .account-role { display: none; }
  .quiet-button { min-height: 44px; padding-inline: 8px; font-size: 11px; }
  .account-name { max-width: 94px; }
  .integration-card { grid-template-columns: 43px minmax(0, 1fr); column-gap: 14px; padding: 20px; }
  .overview-filter-bar { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-filter-bar input { width: 100%; }
  .overview-filter-submit { grid-column: 1 / -1; }
  .overview-results-header { align-items: flex-start; flex-direction: column; }
  .overview-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .overview-metric-card { padding: 13px; }
  .integration-icon { width: 42px; height: 42px; border-radius: 13px; }
  .integration-icon svg { width: 23px; height: 23px; }
  .integration-copy h2 { margin-top: 12px; font-size: 16px; }
  .integration-copy p { font-size: 12px; }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f0f7;
    --secondary: #b2afbd;
    --tertiary: #908d9b;
    --surface: #1c1a23;
    --canvas: #141319;
    --line: #302d38;
    --line-strong: #45414e;
    --accent: #b49af8;
    --accent-strong: #c4b0ff;
    --accent-soft: #2d263e;
    --success: #70cf91;
    --success-soft: #1e3326;
    --warning: #f0c76d;
    --danger: #ff9e9e;
  }
  .login-layout { box-shadow: 0 26px 80px rgb(0 0 0 / 34%); }
  .navigation-item.is-current { border-color: #42365d; color: #d0c2ff; }
  .status-pill { border-color: #443a58; background: #2a2535; color: #d3c8ec; }
}

@media (prefers-color-scheme: dark) {
  .sidebar-backdrop { background: rgb(0 0 0 / 58%); }
}

.pwa-notice-stack {
  position: fixed;
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  display: grid;
  width: min(520px, calc(100vw - 28px));
  gap: 8px;
  transform: translateX(-50%);
}
.pwa-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(25 20 36 / 13%);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}
.pwa-notice[hidden] { display: none; }
.pwa-notice-network { border-color: #e4d2a3; background: #fff9e8; color: #604c21; }
.pwa-notice-update button { flex: 0 0 auto; min-height: 32px; padding: 0 11px; border: 0; border-radius: 9px; background: var(--accent); color: white; cursor: pointer; font: inherit; font-weight: 650; }
.pwa-notice-update button:disabled { cursor: wait; opacity: .6; }

@media (prefers-color-scheme: dark) {
  .pwa-notice { box-shadow: 0 8px 28px rgb(0 0 0 / 38%); }
  .pwa-notice-network { border-color: #615438; background: #332d1e; color: #eed9a2; }
}

@media (max-width: 520px) {
  .pwa-notice-stack { width: calc(100vw - 24px); }
  .pwa-notice { padding: 10px 11px; font-size: 11px; }
}

.security-panel { display: grid; gap: 14px; }
.security-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.security-toolbar > p { margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.55; }
.security-refresh-button { min-height: 40px; flex: 0 0 auto; }
.security-refresh-button:disabled { cursor: wait; opacity: .65; }
.security-status { margin: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--secondary); font-size: 12px; line-height: 1.5; }
.security-status.is-error { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); color: var(--danger); }
.security-grid { display: grid; gap: 16px; }
.security-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 8px 24px rgb(34 24 71 / 3%); }
.security-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 22px 17px; }
.security-card-heading h2 { margin: 0; font-size: 15px; font-weight: 660; letter-spacing: -.015em; }
.security-card-heading p { margin: 5px 0 0; color: var(--secondary); font-size: 11px; line-height: 1.5; }
.security-count { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 680; }
.security-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.security-table { width: 100%; min-width: 680px; border-collapse: collapse; text-align: left; }
.security-events-table { min-width: 530px; }
.security-table th { padding: 10px 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--canvas) 68%, var(--surface)); color: var(--tertiary); font-size: 10px; font-weight: 650; letter-spacing: .035em; white-space: nowrap; }
.security-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); color: var(--secondary); font-size: 11px; line-height: 1.45; white-space: nowrap; }
.security-table tbody tr:last-child td { border-bottom: 0; }
.security-table td:first-child { color: var(--ink); }
.security-account-name { display: block; font-size: 12px; font-weight: 630; }
.security-session-id { display: block; margin-top: 3px; color: var(--tertiary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.security-current-tag { display: inline-flex; margin-top: 5px; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 9px; font-weight: 650; }
.security-current-label { color: var(--tertiary); font-size: 10px; }
.security-revoke-button { min-height: 40px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--line)); border-radius: 10px; background: transparent; color: var(--danger); cursor: pointer; font-size: 11px; font-weight: 620; }
.security-revoke-button:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.security-revoke-button:disabled { cursor: wait; opacity: .58; }
.security-empty { margin: 0; padding: 22px; color: var(--secondary); font-size: 12px; text-align: center; }

.infrastructure-panel { display: grid; gap: 14px; }
.infrastructure-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.infrastructure-check { min-width: 0; padding: 18px 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 7px 22px rgb(34 24 71 / 3%); }
.infrastructure-check-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.infrastructure-check h3 { min-width: 0; margin: 0; font-size: 13px; font-weight: 650; line-height: 1.5; }
.infrastructure-check > p { margin: 8px 0 0; color: var(--secondary); font-size: 11px; line-height: 1.65; }
.infrastructure-check-state { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; color: var(--secondary); font-size: 10px; font-weight: 620; }
.infrastructure-check-state > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--tertiary); }
.infrastructure-check--operational .infrastructure-check-state { color: var(--success); }
.infrastructure-check--operational .infrastructure-check-state > span:first-child { background: var(--success); }
.infrastructure-check--configured .infrastructure-check-state { color: var(--accent-strong); }
.infrastructure-check--configured .infrastructure-check-state > span:first-child { background: var(--accent); }
.infrastructure-check--needs_attention .infrastructure-check-state,
.infrastructure-check--not_connected .infrastructure-check-state { color: var(--warning); }
.infrastructure-check--needs_attention .infrastructure-check-state > span:first-child,
.infrastructure-check--not_connected .infrastructure-check-state > span:first-child { background: var(--warning); }
.infrastructure-check--unavailable .infrastructure-check-state { color: var(--danger); }
.infrastructure-check--unavailable .infrastructure-check-state > span:first-child { background: var(--danger); }
.infrastructure-checked-at { margin: 0; color: var(--tertiary); font-size: 10px; text-align: right; }

@media (max-width: 520px) {
  .security-toolbar { align-items: flex-start; }
  .security-toolbar > p { padding-top: 3px; font-size: 11px; }
  .security-refresh-button { min-height: 42px; padding-inline: 10px; }
  .security-card-heading { padding: 18px 17px 15px; }
  .security-table th, .security-table td { padding-inline: 12px; }
  .infrastructure-checks { grid-template-columns: minmax(0, 1fr); }
  .infrastructure-check { padding: 17px; }
}

@media (prefers-color-scheme: dark) {
  .security-table th { background: color-mix(in srgb, var(--canvas) 78%, var(--surface)); }
}

/* Spark Console UI refresh: clearer hierarchy, restrained surfaces, and compact navigation. */
body { line-height: 1.7; }

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.login-page { padding: 32px; }
.login-layout {
  display: block;
  width: min(448px, 100%);
  min-height: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(29 29 31 / 4%);
}
.login-panel { min-width: 0; min-height: 0; padding: 32px; }
.brand { gap: 12px; }
.brand-icon { width: 40px; height: 40px; border-radius: 10px; }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: 0; }
.brand-company { font-size: 12px; letter-spacing: 0; }
.login-content { width: min(100%, 392px); max-width: 100%; margin: auto; padding-block: 40px; }
.eyebrow { gap: 0; color: var(--secondary); font-size: 11px; font-weight: 600; letter-spacing: 0.035em; }
.eyebrow-dot { display: none; }
.login-content h1 {
  margin: 16px 0 8px;
  font-size: clamp(29px, 3.2vw, 34px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.3;
}
.login-intro { font-size: 14px; line-height: 1.75; }
.login-form { min-width: 0; gap: 16px; margin-top: 28px; }
.field-group { min-width: 0; gap: 7px; }
.field-group label { font-size: 13px; font-weight: 600; }
.field-group input {
  min-width: 0;
  height: 48px;
  border-radius: 8px;
  transition: border-color 120ms ease;
}
.field-group input:hover { border-color: var(--secondary); }
.field-group input:focus { border-color: var(--accent-strong); outline: none; box-shadow: none; }
.field-group input:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.form-message { min-height: 20px; margin: -4px 0 -2px; line-height: 1.55; }
.primary-button {
  min-height: 48px;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  box-shadow: none;
  transition: background 120ms ease;
}
.primary-button:hover:not(:disabled) { background: #4d2fa7; box-shadow: none; transform: none; }
.primary-button:active:not(:disabled) { background: #41268f; }
.overview-filter-submit { background: var(--accent-strong); color: #fff; }
.pwa-notice-update button { min-height: 44px; border-radius: 8px; background: var(--accent-strong); color: #fff; }
.pwa-notice-update button:hover { background: #4d2fa7; }
.login-security { gap: 8px; margin-top: 20px; font-size: 12px; line-height: 1.65; }
.login-security svg { color: var(--secondary); stroke: currentColor; }
.login-footer { gap: 12px; padding-top: 16px; color: var(--secondary); }
.language-toggle { min-width: 44px; min-height: 44px; border-radius: 8px; color: var(--secondary); }

.console-layout { grid-template-columns: 232px minmax(0, 1fr); }
.console-sidebar { padding: 24px 14px 16px; background: var(--surface); }
.sidebar-brand { padding: 0 10px 24px; }
.sidebar-brand .brand-icon, .mobile-brand .brand-icon { width: 36px; height: 36px; border-radius: 9px; }
.sidebar-brand .brand-name { font-size: 14px; }
.sidebar-brand .brand-company { font-size: 11px; }
.sidebar-navigation { gap: 16px; }
.navigation-group { gap: 4px; }
.sidebar-section-label { padding: 0 10px 4px; color: var(--secondary); font-size: 11px; font-weight: 600; letter-spacing: 0.015em; text-transform: none; }
.navigation-group-items { gap: 2px; }
.navigation-item {
  min-height: 40px;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
}
.navigation-item:hover { background: var(--canvas); color: var(--ink); }
.navigation-item.is-current { background: var(--accent-soft); color: var(--accent-strong); font-weight: 620; }
.module-icon { width: 16px; height: 16px; stroke-width: 1.6; }
.sidebar-note {
  gap: 10px;
  margin-top: auto;
  padding: 16px 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.sidebar-note-icon { width: 24px; height: 24px; border-radius: 0; background: transparent; color: var(--secondary); }
.sidebar-note-icon svg { width: 17px; height: 17px; }
.sidebar-note-copy { gap: 2px; }
.sidebar-note-copy strong { font-size: 12px; font-weight: 600; }
.sidebar-note-copy small { color: var(--secondary); font-size: 11px; line-height: 1.5; }
.sidebar-bottom { padding: 14px 10px 0; color: var(--secondary); font-size: 11px; }
.secure-dot { display: none; }

.console-topbar {
  min-height: 60px;
  padding-inline: clamp(22px, 4vw, 48px);
  background: var(--surface);
}
.account-avatar { width: 32px; height: 32px; background: var(--accent-soft); color: var(--accent-strong); }
.account-role { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--secondary); font-size: 11px; font-weight: 500; }
.quiet-button { min-height: 40px; border-radius: 8px; font-size: 12px; }
.icon-button { border-radius: 8px; }
.module-search-button { min-width: 180px; height: 44px; border-radius: 8px; }
.module-search-button kbd { border-radius: 4px; }

.overview-content { width: min(1000px, 100%); padding: 48px clamp(24px, 4vw, 56px) 56px; }
.page-heading { align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 8px 0 8px; font-size: clamp(30px, 3.1vw, 36px); font-weight: 650; line-height: 1.3; }
.page-heading p { max-width: 640px; font-size: 14px; line-height: 1.75; }
.integration-card {
  display: block;
  width: min(820px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}
.integration-copy { display: grid; gap: 0; }
.status-pill { width: fit-content; gap: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--secondary); font-size: 12px; font-weight: 600; }
.status-pill span:first-child { width: 7px; height: 7px; background: var(--secondary); }
.integration-copy h2 { margin: 12px 0 6px; font-size: 18px; font-weight: 650; letter-spacing: 0; line-height: 1.4; }
.integration-copy p { max-width: 640px; font-size: 13px; line-height: 1.8; }
.source-details { display: grid; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.source-details > div { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 16px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); }
.source-details dt { color: var(--secondary); font-size: 12px; }
.source-details dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.integration-footer { margin-top: 16px; padding-top: 0; border-top: 0; color: var(--secondary); font-size: 12px; line-height: 1.7; }
.integration-footer-icon { display: none; }
.overview-footnote { display: block; margin-top: 16px; color: var(--secondary); font-size: 12px; line-height: 1.7; }
.footnote-check { display: none; }
.overview-results { margin-top: 32px; }
.overview-results-header { margin-bottom: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.overview-results-header h2 { font-size: 15px; font-weight: 650; }
.overview-results-header p { color: var(--secondary); font-size: 11px; }
.overview-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.overview-metric-card { padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.overview-metric-card h3 { margin-bottom: 4px; font-size: 12px; font-weight: 550; }
.overview-metric-value { font-size: 24px; font-weight: 650; letter-spacing: 0; }
.overview-metric-status { color: var(--secondary); font-size: 11px; }
.overview-metric-definition { min-height: 0; margin-top: 8px; color: var(--secondary); font-size: 11px; line-height: 1.7; }
.overview-metric-source { margin-top: 8px; padding-top: 8px; color: var(--secondary); font-size: 10px; }
.module-disconnected-panel .integration-icon { display: none; }
.module-disconnected-panel .integration-copy h2 { margin-top: 0; }

@media (max-width: 850px) {
  .console-layout { grid-template-columns: minmax(0, 1fr); }
  .console-sidebar { box-shadow: none; }
  .console-sidebar.is-open { box-shadow: none; }
  .navigation-item { min-height: 44px; }
  .console-topbar { padding-inline: 16px; }
  .overview-content { padding: 36px 24px 48px; }
  .page-heading { margin-bottom: 24px; }
}

@media (max-width: 520px) {
  .login-page { padding: 16px; }
  .login-layout { width: 100%; min-width: 0; border-radius: 12px; }
  .login-panel { min-width: 0; padding: 24px 24px 20px; }
  .login-content { width: 100%; max-width: 100%; margin: auto; padding-block: 30px; }
  .login-content h1 { font-size: 29px; line-height: 1.35; }
  .login-intro { font-size: 14px; }
  .login-form { margin-top: 24px; }
  .field-group input { width: 100%; height: 48px; }
  .primary-button { min-height: 48px; }
  .login-footer { flex-wrap: wrap; font-size: 11px; }
  .console-topbar { gap: 6px; padding-inline: 12px; }
  .console-topbar .language-toggle { min-width: 44px; min-height: 44px; border-radius: 8px; }
  .console-topbar .language-toggle,
  .module-search-button,
  .account-menu { flex: 0 0 auto; }
  .mobile-brand { flex: 0 0 auto; gap: 0; }
  .mobile-brand > span { display: none; }
  .mobile-brand .brand-icon { width: 34px; height: 34px; }
  .module-search-button { width: 44px; min-width: 0; height: 44px; justify-content: center; padding: 0; border-color: transparent; background: transparent; }
  .module-search-button > svg { width: 20px; height: 20px; }
  .module-search-label, .module-search-button kbd { display: none; }
  .account-menu { gap: 5px; }
  .account-avatar, .account-name, .account-role { display: none; }
  .quiet-button { min-height: 44px; padding-inline: 8px; font-size: 11px; }
  .account-menu .quiet-button { flex: 0 0 auto; min-width: 44px; padding-inline: 8px; white-space: nowrap; }
  .overview-content { width: 100%; padding: 32px 20px 44px; }
  .page-heading { gap: 8px; }
  .page-heading h1 { font-size: 30px; }
  .page-heading p { font-size: 13px; }
  .integration-card { width: 100%; padding: 20px; }
  .integration-copy h2 { font-size: 17px; }
  .integration-copy p { font-size: 12px; }
  .source-details { margin-top: 16px; }
  .source-details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-block: 10px; }
  .source-details dt, .source-details dd { font-size: 12px; }
  .integration-footer { font-size: 11px; }
  .overview-metrics-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --secondary: #b1b1b6;
    --tertiary: #98989d;
    --surface: #1c1c1e;
    --canvas: #111113;
    --line: #38383a;
    --line-strong: #8e8e93;
    --accent: #b8a2f7;
    --accent-strong: #c5b4ff;
    --accent-soft: #302840;
    --success: #7bc895;
    --success-soft: #1d3325;
    --warning: #f1cf77;
    --danger: #ff9d9d;
  }
  ::selection { background: var(--accent); color: #211936; }
  .primary-button,
  .overview-filter-submit,
  .pwa-notice-update button { background: var(--accent); color: #211936; }
  .primary-button:hover:not(:disabled) { background: #c5b4ff; }
  .primary-button:active:not(:disabled) { background: #d1c4ff; }
  .overview-filter-submit:hover { background: #c5b4ff; }
  .pwa-notice-update button:hover { background: #c5b4ff; }
  .navigation-item.is-current { color: #d5c8ff; }
  .login-layout { box-shadow: 0 1px 2px rgb(0 0 0 / 30%); }
}

@media (prefers-contrast: more) {
  :root { --line: #8e8e93; --line-strong: #636366; }
}
