:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  color: #1d1d1b;
  background: #f4f3ef;
  font-synthesis: none;
  --ink: #1d1d1b;
  --ink-soft: #555650;
  --muted: #85867f;
  --line: #deddd7;
  --line-strong: #cac9c2;
  --paper: #fbfaf7;
  --white: #fff;
  --dark: #20211e;
  --dark-soft: #2b2c28;
  --green: #2e7d5a;
  --green-soft: #e7f2eb;
  --amber: #a56a19;
  --amber-soft: #f6ecdc;
  --red: #b4453f;
  --shadow: 0 1px 2px rgba(23, 23, 20, .05), 0 12px 36px rgba(23, 23, 20, .04);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f4f3ef; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; z-index: 99; left: 16px; top: -56px; padding: 10px 14px; color: #fff; background: var(--dark); border-radius: 8px; transition: top .2s; }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 18px; color: #f8f7f3; background: var(--dark); border-right: 1px solid #161714; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 30px; }
.brand-mark { width: 39px; height: 39px; display: block; border-radius: 9px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 3px; color: #a8aaa3; font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 13px; color: #bfc0ba; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; transition: color .16s, background .16s, border-color .16s; }
.nav-item:hover { color: #fff; background: #282925; }
.nav-item.is-active { color: #fff; background: #30312d; border-color: #44453f; box-shadow: inset 2px 0 #f4f3ef; }
.nav-icon { width: 20px; color: #9c9e97; font-size: 19px; text-align: center; }
.nav-item.is-active .nav-icon { color: #fff; }
.sidebar-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 18px 9px 2px; border-top: 1px solid #383934; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot small { margin-top: 3px; color: #92948d; font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #777; box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.status-dot.is-online { background: #51b781; box-shadow: 0 0 0 4px rgba(81,183,129,.1); }
.workspace { min-width: 0; }
.topbar { min-height: 80px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px clamp(22px, 4vw, 48px); background: rgba(251,250,247,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.crumb { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.topbar h1 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.environment { height: 28px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--ink-soft); background: #efeee9; border: 1px solid #e1e0da; border-radius: 999px; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.environment i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.avatar-button { width: 36px; height: 36px; color: #fff; background: var(--dark); border: 0; border-radius: 50%; font-weight: 750; cursor: pointer; }
main { padding: 40px clamp(22px, 4vw, 48px) 64px; }
.page { display: none; max-width: 1320px; margin: 0 auto; animation: page-in .28s var(--ease); }
.page.is-active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--green); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .14em; }
.page-heading h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.14; letter-spacing: -.04em; }
.page-heading p { max-width: 720px; margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sync-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; color: var(--green); background: var(--green-soft); border: 1px solid #cfe2d6; border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sync-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: scale(.98); }
.button.primary { color: #fff; background: var(--dark); border-color: var(--dark); }
.button.primary:hover { background: #090a08; }
.button.ghost { background: var(--white); }
.button.ghost:hover { border-color: #aaa9a1; }
.button.small { min-height: 30px; padding: 0 10px; font-size: 11px; }
.button:focus-visible, .nav-item:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .icon-button:focus-visible, .avatar-button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { min-height: 138px; position: relative; padding: 20px; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.metric-card::after { content: ""; position: absolute; right: -16px; bottom: -28px; width: 84px; height: 84px; border: 1px solid #ecebe6; border-radius: 50%; }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-card strong { display: block; margin-top: 20px; font-size: 34px; line-height: 1; letter-spacing: -.05em; }
.metric-card small { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 11px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 16px; }
.release-panel, .activity-panel { padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-head h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.tag { display: inline-flex; min-height: 23px; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.tag.neutral { color: #5d5e58; background: #efeee9; }
.tag.success { color: var(--green); background: var(--green-soft); }
.tag.warning { color: var(--amber); background: var(--amber-soft); }
.policy-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 28px; }
.policy-flow div { min-height: 92px; padding: 15px; background: #f7f6f2; border: 1px solid #e8e7e1; border-radius: 9px; }
.policy-flow span, .policy-flow strong, .policy-flow small { display: block; }
.policy-flow span { color: var(--green); font-size: 10px; font-weight: 800; }
.policy-flow strong { margin-top: 13px; font-size: 12px; }
.policy-flow small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.policy-flow b { color: #aaa9a2; font-weight: 400; }
.guardrail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.guardrail strong { margin-right: 4px; font-size: 11px; }
.guardrail code { padding: 5px 7px; color: #65665f; background: #f3f2ee; border-radius: 5px; font-size: 10px; }
.text-button { color: var(--green); background: none; border: 0; font-size: 11px; font-weight: 750; cursor: pointer; }
.activity-list { display: grid; gap: 0; margin-top: 17px; }
.activity-item { display: grid; grid-template-columns: 8px 1fr; gap: 11px; padding: 12px 0; border-top: 1px solid #ecebe6; }
.activity-item i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #b9bab3; }
.activity-item strong { display: block; font-size: 11px; }
.activity-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.table-panel { overflow: hidden; }
.table-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.skill-filters { display: flex; align-items: center; gap: 12px; flex: 1; }
.segmented { display: inline-flex; padding: 3px; background: #efeee9; border-radius: 9px; }
.segmented button { min-height: 31px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(32,33,30,.1); }
.search { width: min(420px, 100%); height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 12px; color: var(--muted); background: #f7f6f2; border: 1px solid #e2e1db; border-radius: 8px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.muted { color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
.pagination { min-height: 58px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination button:disabled { opacity: .42; cursor: default; transform: none; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 13px 16px; color: var(--muted); background: #faf9f6; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; letter-spacing: .04em; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #ecebe6; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfbf8; }
.cell-title strong, .cell-title small { display: block; }
.cell-title strong { font-size: 12px; }
.cell-title small { max-width: 440px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.empty-row { height: 200px; text-align: center; color: var(--muted); }
.notice { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 16px; padding: 15px 17px; background: var(--amber-soft); border: 1px solid #ead5b5; border-radius: 10px; }
.notice > span { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--amber); border-radius: 50%; font-size: 12px; font-weight: 800; }
.notice strong { font-size: 12px; }
.notice p { margin: 4px 0 0; color: #7b613c; font-size: 11px; line-height: 1.5; }
.relay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.relay-card { position: relative; padding: 20px; overflow: hidden; }
.relay-card.is-default { border-color: #b7cfc0; box-shadow: inset 3px 0 var(--green), var(--shadow); }
.relay-card h3 { margin: 16px 0 4px; font-size: 18px; }
.relay-id { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 10px; }
.relay-endpoints { display: grid; gap: 9px; margin: 20px 0; padding: 14px; background: #f7f6f2; border-radius: 8px; }
.relay-endpoints div { min-width: 0; }
.relay-endpoints span { display: block; color: var(--muted); font-size: 9px; font-weight: 750; }
.relay-endpoints code { display: block; margin-top: 4px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.relay-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.relay-meta span { color: var(--muted); font-size: 10px; }
.modal { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 80px rgba(20,20,18,.24); }
.modal::backdrop { background: rgba(22,22,20,.44); backdrop-filter: blur(3px); }
.modal form { padding: 24px; }
.compact-modal { width: min(430px, calc(100vw - 32px)); }
.wide-modal { width: min(840px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-head h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.modal-copy { margin: -8px 0 20px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.field > span { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 750; }
.field input, .field textarea, .field select { width: 100%; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; transition: border-color .15s, box-shadow .15s; }
.field input, .field select { height: 40px; padding: 0 11px; }
.field textarea { resize: vertical; padding: 10px 11px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46,125,90,.1); }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.file-field { padding: 13px; background: #f3f2ee; border: 1px dashed #cbc9c1; border-radius: 9px; }
.file-field input { height: auto; padding: 8px; background: transparent; border: 0; }
.switch-row { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; background: #f5f4f0; border-radius: 8px; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 11px; }
.switch-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.switch-row input { width: 38px; height: 20px; accent-color: var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.upload-progress { position: relative; height: 34px; margin-top: 16px; overflow: hidden; background: #e9e8e2; border-radius: 7px; }
.upload-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--green-soft); transition: width .2s; }
.upload-progress span { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; font-size: 10px; font-weight: 750; }
.endpoint-preview { margin-top: 16px; padding: 12px; background: #20211e; border-radius: 8px; }
.endpoint-preview span { display: block; color: #9fa19a; font-size: 9px; font-weight: 750; }
.endpoint-preview code { display: block; margin-top: 6px; color: #ecede7; font-size: 11px; word-break: break-all; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 360px; padding: 12px 16px; color: #fff; background: var(--dark); border-radius: 9px; box-shadow: 0 16px 40px rgba(0,0,0,.24); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: var(--red); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > div:last-child, .nav-item span:last-child, .sidebar-foot div { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-foot { justify-content: center; }
  .topbar { padding-inline: 18px; }
  .environment { display: none; }
  main { padding: 28px 18px 48px; }
  .page-heading { display: grid; }
  .heading-actions { justify-content: flex-start; }
  .skill-filters, .table-toolbar { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .policy-flow { grid-template-columns: 1fr; }
  .policy-flow b { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}
@media (max-width: 500px) {
  .metric-grid { grid-template-columns: 1fr; }
  .top-actions .button { display: none; }
  .page-heading h2 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
