:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  color: #f8fafc; background: #020617;
  font-synthesis: none; text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; line-height: 1.55; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }
[hidden] { display: none !important; }
.app-shell { min-height: 100vh; background: radial-gradient(circle at 55% -18%, #153548 0, #020617 42%); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px clamp(20px, 4vw, 56px); border-bottom: 1px solid #1e293b; background: #080f20d9; }
.brand, .top-actions, .title-line, .detail-actions, .section-head, .access-heading, .audit-heading, .filter-row, .save-bar { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #0d9488; color: #ecfeff; font-weight: 800; font-size: 20px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; line-height: 1.2; letter-spacing: -.02em; }
.brand small { color: #94a3b8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { gap: 18px; color: #cbd5e1; font-size: 13px; }
.environment-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #1f3e45; border-radius: 999px; padding: 5px 11px; color: #99f6e4; background: #092c32; }
.live-dot, .foot-indicator { width: 7px; height: 7px; border-radius: 50%; background: #2dd4bf; box-shadow: 0 0 9px #2dd4bf88; }
.viewer-name { font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; font-weight: 650; font-size: 13px; white-space: nowrap; transition: background .16s, border-color .16s, transform .16s; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn-primary { background: #14b8a6; color: #022c22; }
.btn-primary:not(:disabled):hover { background: #5eead4; }
.btn-secondary { background: #172238; color: #e2e8f0; border-color: #334155; }
.btn-secondary:not(:disabled):hover { background: #26364f; }
.btn-quiet { background: transparent; border-color: #334155; color: #cbd5e1; }
.btn-quiet:not(:disabled):hover { background: #172238; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger-ghost { background: transparent; color: #fca5a5; border-color: #7f1d1d; }
.btn-danger-ghost:not(:disabled):hover { background: #450a0a; }
.notice { position: sticky; top: 0; z-index: 10; padding: 12px clamp(20px, 4vw, 56px); border-bottom: 1px solid #155e75; background: #082f49; color: #e0f2fe; font-size: 14px; }
.notice[data-kind="error"] { background: #450a0a; border-color: #991b1b; color: #fee2e2; }
.notice[data-kind="success"] { background: #052e2b; border-color: #0f766e; color: #ccfbf1; }
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 73px); }
.sidebar { display: flex; flex-direction: column; min-width: 0; padding: 30px 20px 20px clamp(20px, 4vw, 56px); border-right: 1px solid #1e293b; background: #080f1eaa; }
.section-head { justify-content: space-between; gap: 8px; }
.eyebrow { margin: 0 0 5px; color: #2dd4bf; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 23px; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 27px; letter-spacing: -.035em; }
h3 { margin-bottom: 0; font-size: 17px; letter-spacing: -.02em; }
.sidebar-intro, .muted, .card-sub { color: #94a3b8; }
.sidebar-intro { margin: 16px 0 20px; font-size: 12px; }
.search-wrap { display: flex; align-items: center; gap: 9px; min-height: 44px; border: 1px solid #334155; border-radius: 9px; padding: 0 12px; color: #64748b; background: #0f172a; }
.search-wrap:focus-within { border-color: #2dd4bf; }
.search-wrap input { width: 100%; height: 42px; border: 0; background: transparent; color: #f8fafc; outline: none; font-size: 13px; }
.search-wrap input::placeholder { color: #64748b; }
.sidebar-meta { display: flex; gap: 4px; margin: 24px 2px 8px; color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.user-list { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 5px; min-width: 0; min-height: 80px; }
.user-item { display: flex; align-items: center; min-width: 0; width: 100%; min-height: 64px; gap: 10px; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px; text-align: left; background: transparent; color: #f8fafc; }
.user-item:hover { background: #172238; }
.user-item[aria-current="true"] { background: #0f302f; border-color: #0d9488; }
.avatar { display: grid; flex: 0 0 35px; place-items: center; width: 35px; height: 35px; border-radius: 9px; background: #213548; color: #99f6e4; font-weight: 700; }
.user-item-text { flex: 1; min-width: 0; }
.user-item-text strong, .user-item-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-item-text strong { font-size: 13px; }
.user-item-text small { font-size: 11px; color: #94a3b8; }
.user-item-badges { display: grid; justify-items: end; gap: 3px; }
.tiny-badge { color: #5eead4; font-size: 10px; }
.muted-badge { color: #94a3b8; }
.dirty-dot { color: #fbbf24; font-size: 11px; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 20px; font-size: 11px; color: #94a3b8; }
.main-panel { min-width: 0; max-width: 1500px; width: 100%; padding: 32px clamp(22px, 4vw, 56px) 56px; }
.empty-state { display: grid; justify-items: center; align-content: center; min-height: 65vh; text-align: center; color: #94a3b8; }
.empty-symbol { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 14px; border: 1px solid #334155; border-radius: 18px; color: #2dd4bf; font-size: 32px; }
.empty-state h2 { color: #f8fafc; font-size: 20px; }
.empty-state p { margin: 6px 0 0; font-size: 14px; }
.detail-top { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.title-line { flex-wrap: wrap; gap: 12px; min-width: 0; }
.title-line h2 { min-width: 0; overflow-wrap: anywhere; }
.detail-top .muted { margin: 4px 0 0; font-size: 13px; }
.detail-actions { flex-wrap: wrap; gap: 9px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 5px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge-owner { background: #164e48; color: #99f6e4; }
.badge-enabled { background: #064e3b; color: #a7f3d0; }
.badge-disabled { background: #334155; color: #cbd5e1; }
.badge-production { background: #40241a; color: #fdba74; }
.badge-local { background: #263449; color: #cbd5e1; }
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 27px 0 22px; }
.overview-card, .access-card, .account-card, .audit-card { background: #0f172a; border: 1px solid #223047; border-radius: 13px; }
.overview-card { display: flex; flex-direction: column; padding: 18px 20px; min-height: 114px; }
.card-label { color: #94a3b8; font-size: 11px; }
.overview-card strong { margin-top: 5px; font-size: 24px; line-height: 1.2; }
.card-sub { margin-top: auto; font-size: 11px; }
.text-amber { color: #fbbf24; }
.access-card { overflow: hidden; }
.access-heading { justify-content: space-between; align-items: start; gap: 20px; padding: 21px 23px; }
.access-heading p { margin: 4px 0 0; color: #94a3b8; font-size: 12px; }
.preset-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 28px; padding: 0 23px; border-bottom: 1px solid #223047; }
.tab { min-height: 46px; padding: 0 0 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: #94a3b8; font-size: 13px; font-weight: 650; }
.tab.active { color: #5eead4; border-color: #2dd4bf; }
.policy-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 23px; background: #101d31; border-bottom: 1px solid #223047; }
.policy-bar label { font-size: 13px; font-weight: 700; }
.policy-bar p { margin: 4px 0 0; color: #94a3b8; font-size: 11px; }
select { min-width: 150px; min-height: 44px; padding: 0 35px 0 12px; border: 1px solid #334155; border-radius: 8px; background: #18253b; color: #f8fafc; }
.filter-row { justify-content: space-between; gap: 12px; padding: 14px 23px; border-bottom: 1px solid #223047; font-size: 11px; }
.search-wrap.compact { width: min(100%, 340px); }
.connection-row { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 13px 23px; border-bottom: 1px solid #1e293b; }
.connection-row:last-child { border-bottom: 0; }
.connection-mark { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #153643; color: #67e8f9; font-size: 10px; font-weight: 800; }
.connection-info { flex: 1; min-width: 0; }
.connection-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.connection-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 4px; color: #94a3b8; font-size: 11px; }
.connection-control { flex: 0 0 auto; }
.list-empty { margin: 0; padding: 24px; color: #94a3b8; font-size: 12px; text-align: center; }
.security-note { display: flex; gap: 12px; margin: 18px 0 22px; padding: 16px 18px; border: 1px solid #245469; border-radius: 10px; background: #0a2233; }
.note-icon { display: grid; flex: 0 0 20px; place-items: center; width: 20px; height: 20px; border: 1px solid #67e8f9; border-radius: 50%; color: #67e8f9; font-size: 12px; font-weight: 800; }
.security-note strong { font-size: 12px; color: #a5f3fc; }
.security-note p { margin: 3px 0 0; color: #a7bac8; font-size: 11px; }
.integration-help { margin-bottom: 22px; padding: 13px 17px; border: 1px solid #223047; border-radius: 10px; background: #0b1425; color: #cbd5e1; font-size: 12px; }
.integration-help summary { min-height: 30px; cursor: pointer; color: #a5f3fc; font-weight: 700; }
.integration-help p { margin: 8px 0 12px; color: #94a3b8; }
.integration-help div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid #1e293b; }
.integration-help code { overflow-wrap: anywhere; color: #e2e8f0; text-align: right; }
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.account-card, .audit-card { padding: 19px 21px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 25px; cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { margin-top: 4px; color: #94a3b8; font-size: 11px; }
.toggle-row input { appearance: none; flex: 0 0 42px; width: 42px; height: 25px; border-radius: 999px; border: 1px solid #475569; background: #334155; position: relative; }
.toggle-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #e2e8f0; transition: transform .16s; }
.toggle-row input:checked { background: #0d9488; border-color: #0d9488; }
.toggle-row input:checked::after { transform: translateX(17px); }
#owner-help { margin: 15px 0 0; font-size: 11px; }
.audit-heading { justify-content: space-between; }
.audit-heading span { color: #64748b; font-size: 10px; }
.audit-list { list-style: none; padding: 0; margin: 15px 0 0; max-height: 185px; overflow: auto; }
.audit-item { padding: 9px 0; border-top: 1px solid #1e293b; }
.audit-item-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.audit-item-head time, .audit-item p, .audit-empty { color: #94a3b8; font-size: 10px; }
.audit-item p { margin: 3px 0 0; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 13px 16px; border: 1px solid #2c4457; border-radius: 11px; background: #132137f5; box-shadow: 0 10px 30px #0008; color: #cbd5e1; font-size: 12px; }
.modal { width: min(94vw, 460px); max-height: min(90vh, 760px); overflow: auto; padding: 24px; border: 1px solid #334155; border-radius: 14px; background: #101b2d; color: #f8fafc; box-shadow: 0 28px 80px #000b; }
.modal::backdrop { background: #020617c9; }
.modal-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.modal h2 { font-size: 21px; }
.modal p { font-size: 12px; color: #cbd5e1; }
.modal label { display: block; margin: 14px 0 6px; font-size: 12px; font-weight: 650; }
.modal input { display: block; width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid #475569; border-radius: 8px; background: #0b1425; color: #f8fafc; }
.modal-actions { display: flex; justify-content: end; gap: 9px; margin-top: 22px; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; background: none; color: #94a3b8; font-size: 25px; }
.credential-box { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #0f766e; border-radius: 9px; background: #0b302d; }
.credential-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: all; color: #ccfbf1; font-size: 15px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar { padding-left: 18px; }
  .access-heading, .detail-top { flex-direction: column; align-items: stretch; }
  .bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .environment-pill, .viewer-name { display: none; }
  .workspace { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid #1e293b; padding: 18px 16px; }
  .sidebar-intro, .sidebar-foot, .sidebar-meta { display: none; }
  .user-list { display: flex; overflow-x: auto; min-height: 0; margin-top: 10px; padding-bottom: 3px; }
  .user-item { min-width: 170px; width: auto; }
  .main-panel { padding: 24px 16px 45px; }
  .overview-grid { gap: 7px; }
  .overview-card { padding: 12px; min-height: 90px; }
  .overview-card strong { font-size: 20px; }
  .card-sub { font-size: 10px; }
  .policy-bar { align-items: stretch; flex-direction: column; }
  .connection-row { flex-wrap: wrap; padding: 13px 15px; }
  .connection-control { width: 100%; padding-left: 48px; }
  .connection-control select { width: 100%; }
  .filter-row { padding: 13px 15px; }
  .save-bar { bottom: 0; margin-left: -16px; margin-right: -16px; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }