:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --ink: #333333;
  --paper: #ffffff;
  --line: color-mix(in srgb, var(--ink) 20%, var(--paper));
  --muted: color-mix(in srgb, var(--ink) 75%, var(--paper));
  --subtle: color-mix(in srgb, var(--ink) 4%, var(--paper));
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea, pre, code { font: inherit; }
button, input, select, textarea { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.app-shell { min-height: 100vh; }
.sidebar { width: 240px; position: fixed; inset: 0 auto 0 0; background: var(--paper); border-right: 1px solid var(--line); padding: 28px 16px; display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 8px 32px; }
.brand-mark { width: 34px; height: 34px; border-radius: 6px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 18px; font-weight: 600; }
.brand strong { font-size: 18px; font-weight: 600; }
.project-label { font-size: 12px; color: var(--muted); margin: 0 8px 10px; }
.project-picker { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; text-align: left; padding: 12px 10px; gap: 10px; }
.project-avatar { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border: 1px solid var(--line); border-radius: 4px; font-weight: 600; }
.project-picker-copy { min-width: 0; flex: 1; }
.project-picker-copy strong, .project-picker-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-picker-copy strong { font-size: 13px; font-weight: 600; }
.project-picker-copy small { font-size: 11px; color: var(--muted); margin-top: 5px; }
.side-nav { display: grid; gap: 6px; margin-top: 28px; }
.nav-item { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; text-align: left; cursor: pointer; }
.nav-item span { font-size: 17px; width: 20px; text-align: center; }
.nav-item:hover { border-color: var(--line); }
.nav-item.active { background: var(--ink); color: var(--paper); }
.sidebar-bottom { margin-top: auto; color: var(--muted); padding: 18px 8px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.sidebar-bottom p { margin: 8px 0 12px; }
.sidebar-bottom a { text-decoration: none; }
.sidebar-bottom a:hover { text-decoration: underline; }
.sync-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; background: var(--ink); border-radius: 50%; }
.main-content { margin-left: 240px; min-height: 100vh; padding: 0 32px; }
.topbar { min-height: 70px; gap: 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.breadcrumbs { min-width: 0; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.breadcrumbs strong { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions, .user-card { display: flex; align-items: center; gap: 16px; }
.version-badge { font-size: 12px; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; }
.user-area { display: flex; justify-content: flex-end; }
.user-card { gap: 9px; }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 13px; font-weight: 500; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { font-size: 11px; color: var(--muted); margin-top: 3px; }
.user-avatar { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 0 24px; }
.page-heading h1, .auth-card h1 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.4; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 8px 0 0; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px; font-size: 11px; font-weight: 400; margin-left: 8px; }
.live-pill i { width: 5px; height: 5px; background: var(--ink); border-radius: 50%; }
.heading-metrics { display: flex; gap: 10px; }
.metric-card { min-width: 104px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.metric-card span, .metric-card strong { display: block; }
.metric-card span { font-size: 12px; color: var(--muted); }
.metric-card strong { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 6px; }
.toolbar-card, .table-card, .change-card, .release-card, .lua-card, .history-card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.toolbar-card { display: flex; align-items: center; justify-content: space-between; padding: 16px; margin-bottom: 16px; gap: 16px; }
.toolbar-copy strong, .toolbar-copy span { display: block; }
.toolbar-copy strong { font-size: 14px; font-weight: 600; }
.toolbar-copy span { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button { font-size: 13px; font-weight: 500; line-height: 1.4; border: 1px solid var(--line); border-radius: 5px; padding: 9px 12px; cursor: pointer; white-space: nowrap; }
.button:hover { border-color: var(--ink); }
.button:disabled, .file-button[aria-disabled="true"] { opacity: .5; cursor: default; }
.button-quiet { background: var(--paper); color: var(--ink); }
.button-primary { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.button-primary:hover { color: var(--ink); background: var(--paper); }
.button-primary span { margin-left: 6px; }
.file-button { display: inline-flex; align-items: center; }
.notice { padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; margin: 0 0 16px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.notice-error { border-color: var(--ink); border-left-width: 3px; }
.notice-warning { border-style: dashed; }
.draft-banner { padding: 12px 14px; margin-bottom: 16px; border-radius: 5px; border: 1px solid var(--ink); font-size: 13px; line-height: 1.7; }
.table-card { overflow: hidden; }
.table-tools { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.search-wrap { height: 36px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 0 10px; min-width: 220px; }
.search-wrap:focus-within { border-color: var(--ink); }
.search-wrap input { border: 0; outline: 0; width: 100%; min-width: 0; font-size: 13px; background: var(--paper); }
select, textarea { border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.table-tools select { height: 36px; padding: 0 8px; font-size: 13px; }
.table-count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 840px; }
th { text-align: left; font-size: 12px; background: var(--paper); padding: 13px 14px; font-weight: 600; border-bottom: 1px solid var(--ink); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.parameter-label strong, .parameter-label small { display: block; }
.parameter-label strong { font-size: 13px; font-weight: 600; }
.parameter-label small { color: var(--muted); margin-top: 5px; font-size: 11px; }
.key-cell { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.type-pill { font-size: 11px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; }
.value-input { width: 120px; max-width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 5px; padding: 7px 8px; font-size: 13px; font-variant-numeric: tabular-nums; background: var(--paper); }
.value-input:focus { border-color: var(--ink); }
.value-input.changed { border-color: var(--ink); border-left-width: 3px; }
.bool-control { position: relative; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; }
.bool-control input { appearance: none; width: 32px; height: 18px; margin: 0; background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; position: relative; cursor: pointer; }
.bool-control input:after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); left: 2px; top: 2px; }
.bool-control input:checked { background: var(--ink); }
.bool-control input:checked:after { left: 16px; background: var(--paper); }
.bool-control input:disabled { cursor: default; opacity: .5; }
.constraint { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.description-cell { max-width: 240px; color: var(--muted); line-height: 1.7; }
.empty-state, .empty-inline { color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; padding: 24px; }
.publish-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; margin-top: 16px; }
.change-card, .release-card, .lua-card { padding: 18px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title-row h2, .release-card h2, .view-heading-row h2 { font-size: 17px; font-weight: 600; margin: 0; }
.diff-badge { font-size: 12px; font-variant-numeric: tabular-nums; border: 1px solid var(--line); padding: 5px 8px; border-radius: 4px; white-space: nowrap; }
.diff-list { margin-top: 16px; max-height: 240px; overflow: auto; }
.diff-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(60px, .8fr) 16px minmax(60px, .8fr); gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; }
.diff-row strong { font-weight: 500; overflow-wrap: anywhere; }
.diff-value { color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.diff-value.new { color: var(--ink); font-weight: 600; }
.diff-arrow { text-align: center; }
.release-card h2 { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; margin: 12px 0 7px; }
.form-label span { margin-left: 5px; }
.release-card textarea, .release-card select { width: 100%; padding: 9px 10px; resize: vertical; font-size: 13px; }
.release-card textarea { min-height: 78px; line-height: 1.7; }
.release-actions { display: flex; gap: 8px; margin-top: 16px; }
.release-actions button { flex: 1; }
.release-note { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 12px 0 0; }
.lua-card { margin-top: 16px; }
.lua-card pre, .code-guide pre { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 16px; overflow: auto; font-size: 12px; line-height: 1.8; max-height: 360px; margin: 16px 0 0; tab-size: 2; }
.history-list { display: grid; gap: 12px; margin-top: 20px; }
.history-card { padding: 18px; }
.history-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.history-card h3 { font-size: 14px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.history-meta { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.8; overflow-wrap: anywhere; }
.history-message { font-size: 13px; margin: 12px 0; line-height: 1.7; overflow-wrap: anywhere; }
.history-change-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.history-change { font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; overflow-wrap: anywhere; }
.history-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.view-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px 0 4px; }
.agent-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.guide-card { border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.guide-number { font-size: 12px; font-variant-numeric: tabular-nums; }
.guide-card h3 { font-size: 14px; font-weight: 600; margin: 12px 0 8px; }
.guide-card p { font-size: 13px; line-height: 1.8; color: var(--muted); margin: 0; }
.code-guide { border: 1px solid var(--line); border-radius: 6px; padding: 18px; margin-bottom: 16px; }
.code-guide-header { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 1.7; }
.code-guide-header span:last-child { color: var(--muted); }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 28px 0 20px; color: var(--muted); font-size: 11px; }
.auth-gate { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 32px 20px; background: var(--paper); }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 24px; }
.auth-card .muted { margin-top: 12px; }
.auth-card .notice { margin: 20px 0 0; }
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.no-script { position: fixed; inset: auto 20px 20px; text-align: center; font-size: 13px; }
.loading-state { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 1150px) {
  .main-content { padding: 0 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-metrics { width: 100%; max-width: 480px; }
  .metric-card { flex: 1; }
  .toolbar-card { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
}
@media (max-width: 850px) {
  .sidebar { width: 68px; padding: 22px 10px; }
  .brand { padding: 0 5px 28px; }
  .brand strong, .project-label, .project-picker-copy { display: none; }
  .project-picker { justify-content: center; padding: 8px; }
  .nav-item { justify-content: center; padding: 12px 7px; font-size: 0; }
  .nav-item span { font-size: 18px; }
  .sidebar-bottom { padding: 14px 0; }
  .sidebar-bottom p, .sidebar-bottom a { display: none; }
  .sync-status { justify-content: center; font-size: 0; }
  .main-content { margin-left: 68px; }
  .publish-layout { grid-template-columns: minmax(0, 1fr); }
  .agent-guide-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .main-content { padding: 0 16px; }
  .topbar { min-height: 60px; gap: 8px; }
  .breadcrumbs { gap: 6px; font-size: 12px; }
  .version-badge { display: none; }
  .topbar-actions { gap: 8px; }
  .user-card { gap: 6px; }
  .user-card > span:nth-child(2) { display: none; }
  .page-heading { padding: 24px 0 20px; }
  .page-heading h1 { font-size: 22px; }
  .live-pill { display: none; }
  .heading-metrics { gap: 6px; }
  .metric-card { min-width: 0; padding: 9px; }
  .metric-card span { font-size: 11px; }
  .metric-card strong { font-size: 18px; }
  .toolbar-card { padding: 14px; }
  .table-tools { flex-wrap: wrap; }
  .search-wrap { width: 100%; min-width: 0; }
  .search-wrap input, .value-input, .release-card textarea, .release-card select { font-size: 16px; }
  .publish-layout { gap: 12px; }
  .change-card, .release-card, .lua-card { padding: 14px; }
  .section-title-row h2, .release-card h2, .view-heading-row h2 { font-size: 16px; }
  .view-heading-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .diff-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 12px minmax(0, 1fr); gap: 7px; }
  .code-guide-header { flex-direction: column; }
  .page-footer { font-size: 10px; }
}
