
/* 不指定、不打包任何厂商字体。只使用 system-ui 和 sans-serif。 */
:root {
  --ink: #1d2129;
  --muted: #86909c;
  --faint: #b0b7c3;
  --line: #e6ebf2;
  --bg: #f4f7fb;
  --sidebar: #ffffff;
  --card: #ffffff;
  --accent: #2f6bff;
  --accent-dark: #1d4ed8;
  --soft: #eef3ff;
  --teal: #14b8a6;
  --orange: #f5a524;
  --danger: #e11d48;
  --up: #16a34a;
  --shadow: 0 8px 20px rgba(31, 56, 88, 0.05);
  --sans: system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boot, .missing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand-lockup { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; }
.mark {
  width: 22px; height: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  background: var(--accent); border-radius: 6px; padding: 4px 4px 3px;
}
.mark i { display: block; background: #fff; border-radius: 1px; }
.mark i:nth-child(1) { height: 6px; align-self: end; }
.mark i:nth-child(2) { height: 12px; align-self: end; }
.mark i:nth-child(3) { height: 4px; align-self: end; }
.mark i:nth-child(4) { height: 9px; align-self: end; }
.brand-name { font-size: 18px; letter-spacing: 0.04em; font-weight: 650; }
.side-tools { display: flex; gap: 4px; position: relative; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: #f2f5f9; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--soft); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 650;
}
.pop {
  position: absolute; top: 38px; right: 0; width: 240px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px; z-index: 5;
}
.pop p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.pop input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.search { margin: 16px 0 12px; position: relative; }
.search input {
  width: 100%; border: 1px solid var(--line); background: #f7f9fc; border-radius: 8px; padding: 8px 10px 8px 32px;
}
.search input:focus { background: #fff; border-color: #c5d4f5; outline: none; }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--faint); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 9px 10px;
  display: flex; align-items: center; justify-content: space-between; color: #4e5969;
}
.nav-btn:hover { background: #f2f5f9; color: var(--ink); }
.nav-btn.active { background: var(--soft); color: var(--accent); font-weight: 650; }
.nav-btn span, .count {
  min-width: 18px; height: 18px; border-radius: 99px; background: var(--accent); color: white;
  font-size: 11px; display: inline-grid; place-items: center; padding: 0 5px;
}
.nav-btn.active span { background: var(--accent); color: white; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.side-foot button { text-align: left; border: 0; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 8px; }
.side-foot button:hover { background: #f2f5f9; color: var(--ink); }
.local-note { font-size: 12px; color: var(--faint); padding: 8px 10px 0; }
.main { padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }

.page-title { font-size: 28px; margin: 0; font-weight: 600; letter-spacing: -0.02em; }
.sub { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 12px; line-height: 1.2; color: #4e5969;
}
.btn:hover { background: #f7f9fc; border-color: #d5deea; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: white; }
.btn.danger { color: var(--danger); border-color: #f8d0da; background: #fff; }
.btn.danger:hover { background: #fff5f7; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.banner {
  background: var(--soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; color: #1d4ed8;
}
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tab { border: 0; background: transparent; border-radius: 8px; padding: 6px 12px; color: var(--muted); }
.tab.active { background: var(--soft); color: var(--accent); font-weight: 650; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card-row { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: stretch; gap: 14px; }
.card-row > .card { width: 260px; flex: none; }

.card {
  background: var(--card); border: 0; border-radius: 18px; padding: 18px;
  box-shadow: none; display: flex; flex-direction: column; gap: 8px; min-height: 148px;
}
.card-top { display: flex; gap: 10px; align-items: flex-start; }
.xls { width: 32px; height: 36px; flex: none; }
.card h3 { margin: 0; font-size: 15px; font-weight: 650; }
.meta { color: var(--muted); font-size: 12px; margin: 0; }
.card-actions { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.empty {
  border: 1px dashed #d5deea; border-radius: 12px; padding: 36px 20px; text-align: center; color: var(--muted); background: rgba(255,255,255,0.7);
}
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.studio { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.studio-bar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 4;
}
.studio-bar select {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; color: #4e5969;
}
.bar-left, .bar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-state { color: var(--faint); font-size: 12px; min-width: 42px; }
.studio-body { display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; min-height: 0; }
.field-pane, .inspector {
  background: #fff; padding: 14px; overflow: auto; max-height: calc(100vh - 53px);
}
.field-pane {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  height: calc(100vh - 53px); padding: 12px;
}
.pane-fixed { flex: none; }
.pane-fixed .pane-label { margin-top: 0; }
.fields-scroll { flex: 1; min-height: 72px; overflow: auto; margin-top: 8px; }
.pane-dock {
  flex: 1.15; min-height: 220px; display: flex; flex-direction: column; overflow: hidden;
  border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px;
}
.inspector { border-left: 1px solid var(--line); }
.pane-label { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.field-pane select, .inspector select, .inspector input:not([type="checkbox"]):not([type="radio"]), .modal select, .modal input:not([type="checkbox"]):not([type="radio"]), .modal textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff;
}
.fields { display: flex; flex-direction: column; gap: 6px; }
.field {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 8px; color: var(--ink);
  overflow: hidden;
}
.field-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field:hover { border-color: #c5d4f5; background: #f8faff; }
.field:active { cursor: grabbing; }
.badge { font-size: 11px; border-radius: 4px; padding: 1px 4px; background: #f2f4f7; color: var(--muted); }
.badge.num { background: #e8f0ff; color: var(--accent); }
.badge.date { background: #fff6e8; color: #c47d12; }
.badge.link { background: #e8f0ff; color: var(--accent); }
.desk { position: relative; overflow: auto; padding: 16px 18px 28px; background: var(--bg); max-height: calc(100vh - 53px); }
.sheet {
  width: 100%; margin: 0 auto; background: transparent;
  border: 0; box-shadow: none; padding: 4px 0 8px; min-height: 0;
}
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.sheet-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; }
.sheet-title-row .sheet-title { flex: 1; min-width: 0; }
.grain-line { display: flex; align-items: center; gap: 6px; flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.grain-line select { font-size: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 4px 8px; max-width: 220px; }
.sheet-title {
  width: 100%; border: 0; background: transparent; font-size: 28px; font-weight: 600; padding: 0; letter-spacing: -0.03em;
}
.sheet-desc { width: 100%; border: 0; resize: none; background: transparent; color: var(--muted); padding: 2px 0 0; }
.sheet-title:focus, .sheet-desc:focus { outline: none; background: #fff; border-radius: 6px; }
.sheet { position: relative; }

.metric-band { display: flex; flex-direction: column; gap: 16px; margin: 0 0 16px; }
.metric-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 16px; }
.metric-band .widget.is-metric { min-height: 148px; height: auto; }
.metric-band .widget.is-metric h3 { padding-left: 2px; }
.metric-band .widget.is-metric .metric { padding-left: 2px; }
.metric-band .metric b { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.sheet.is-present .metric-band .widget.is-metric { min-height: 148px; height: auto; }
.sheet.is-present .metric-band .metric b { font-size: 26px; }
.sheet-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 72px; gap: 16px; position: relative; min-width: 0; width: 100%; }
.sheet-foot { margin-top: 14px; color: var(--faint); font-size: 12px; text-align: right; }
.widget {
  --head-inset: 30px;
  background: #fff; border: 0; border-radius: 18px; padding: 14px 16px 12px; position: relative;
  min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: none;
}
.widget.is-selected { box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.22); }
.widget:has(.hint:hover), .widget:has(.hint:focus-within) { overflow: visible; z-index: 5; }
.widget h3 { margin: 0 0 8px; padding: 1px 52px 0 var(--head-inset); font-size: 13px; font-weight: 600; color: var(--ink); line-height: 18px; }
.widget.is-metric { padding: 16px 18px 14px 12px; }
.widget.is-metric h3 { margin: 0; padding: 1px 52px 0 26px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--muted); }
.widget-move, .resize { position: absolute; border: 0; background: transparent; color: var(--faint); }
.widget-delete, .hint i {
  width: 22px; height: 22px; border: 0; border-radius: 6px; background: #f3f5f8; color: #86909c;
  display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 650; line-height: 1; padding: 0;
}
.widget-delete {
  position: absolute; top: 8px; right: 8px; z-index: 4; cursor: pointer; font-size: 14px;
}
.widget-delete:hover { background: #ffece8; color: #d14343; }
.widget-swap {
  position: absolute; top: 8px; right: 34px; z-index: 6; width: 22px; height: 22px; border: 0; border-radius: 6px;
  background: #f3f5f8; color: #86909c; display: grid; place-items: center; padding: 0; cursor: pointer;
}
.widget-swap svg { pointer-events: none; }
.widget-swap:hover { background: #eef3ff; color: var(--accent); }
.widget-swap svg { width: 14px; height: 14px; display: block; }
.widget:has(.widget-swap) .hint { right: 60px; }
.widget:has(.widget-swap) h3 { padding-right: 88px; }
.hint { position: absolute; top: 8px; right: 34px; z-index: 4; width: 22px; height: 22px; }
.hint.solo { right: 8px; }
.hint i { cursor: default; }
.hint-pop {
  display: none; position: absolute; top: 24px; right: 0; width: 220px; padding: 8px 10px;
  background: #1d2129; color: #fff; border-radius: 8px; font-size: 12px; line-height: 1.5; z-index: 6;
}
.hint:hover .hint-pop, .hint:focus .hint-pop, .hint:focus-within .hint-pop { display: block; }
.modal { position: relative; }
.modal.wide { width: min(920px, 100%); }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: #f4f6f8; color: #4e5969; cursor: pointer; font-size: 16px; line-height: 1;
}
.modal-x:hover { background: #eef2f6; }
.table-wrap.tall { max-height: min(60vh, 520px); }
.filter-chip {
  border: 1px solid #d6e2ff; background: #f4f7ff; color: var(--accent); border-radius: 999px;
  padding: 6px 12px; white-space: nowrap;
}
.more-wrap { position: relative; }
.more-pop { right: 0; left: auto; display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.more-pop .btn { justify-content: flex-start; }
.download-wrap { position: relative; }
.download-pop {
  top: auto; right: auto; left: 0; bottom: 24px; width: auto; min-width: 88px;
  padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 6;
}
.download-pop button {
  border: 0; background: transparent; text-align: left; border-radius: 6px;
  padding: 6px 8px; color: var(--ink); font-size: 13px;
}
.download-pop button:hover { background: #f2f5f9; }
.modal input[type="checkbox"] { width: auto; flex: none; }
.join-sample { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 4px 0; }
.join-picks { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.join-pick {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer;
}
.join-pick.on { border-color: #c9d8ff; background: var(--soft); }
.join-pick input {
  width: 16px; height: 16px; flex: none; margin: 0; padding: 0; border: 0;
  accent-color: var(--accent); background: transparent;
}
.join-pick .pair { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.join-pick .meta { margin: 0 0 0 auto; flex: none; white-space: nowrap; }
.warn { color: var(--danger); }


.widget-move { left: 8px; top: 10px; width: 20px; height: 20px; cursor: grab; padding: 0; z-index: 3; touch-action: none; font-size: 14px; }
.resize { right: 4px; bottom: 4px; width: 12px; height: 12px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #d5deea 50%); border-radius: 2px; }
.chart { flex: 1; min-height: 0; min-width: 0; width: 100%; position: relative; overflow: hidden; }
.caption { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.3; }
.metric { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 0 2px; }
.widget.is-metric .metric { flex: 1; min-height: 0; justify-content: flex-start; align-items: flex-start; padding: 8px 0 0 26px; }
.metric b {
  font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.1;
  white-space: nowrap; color: var(--ink);
}
.metric span { color: var(--faint); font-size: 12px; }
.widget textarea.plain {
  flex: 1; width: 100%; border: 0; resize: none; background: transparent; line-height: 1.7; color: #4e5969;
}
.sheet-empty {
  min-height: 280px; display: grid; place-items: center; text-align: center; color: var(--muted);
  background: #fff; border: 1px dashed #d5deea; border-radius: 12px; margin-top: 8px;
}
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--accent); }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 6px; color: var(--muted); }
.seg button.on { background: var(--soft); color: var(--accent); font-weight: 650; }
.modal-back { position: fixed; inset: 0; background: rgba(29, 33, 41, 0.36); display: grid; place-items: center; z-index: 20; padding: 20px; }
.modal { width: min(520px, 100%); max-height: min(86vh, 760px); overflow: auto; background: var(--card); border-radius: 12px; padding: 18px; box-shadow: 0 18px 48px rgba(31, 56, 88, 0.16); }
.modal h3 { margin: 0 0 8px; font-size: 20px; font-weight: 650; }
.modal p { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.slots { display: flex; flex-direction: column; gap: 8px; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2129; color: white;
  border-radius: 999px; padding: 8px 14px; z-index: 30; font-size: 13px;
}
.feedback-list { max-height: 160px; overflow: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.feedback-list div { background: #f4f7fb; border-radius: 8px; padding: 8px; font-size: 13px; }

.nav-btn em { font-style: normal; }
.studio { height: 100vh; }
.plain { white-space: pre-wrap; color: #4e5969; line-height: 1.7; }
.studio > .desk { max-height: calc(100vh - 53px); }

.btn { white-space: nowrap; flex: none; }
.page-head .btn { align-self: flex-start; }
.range { display: flex; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.range button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; color: var(--muted); }
.range button.on { background: var(--soft); color: var(--accent); border-color: transparent; font-weight: 650; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; overflow: auto; min-height: 0; flex: 1; align-content: start; padding-bottom: 8px; }
.type-chip {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 6px; text-align: left; color: var(--ink); font-size: 12px; min-width: 0;
  height: 32px; overflow: hidden; white-space: nowrap;
}
.type-chip .chip-long { font-size: 11px; letter-spacing: -0.04em; }
.type-chip:hover { border-color: #c5d4f5; background: #f8faff; }
.glyph { width: 16px; height: 16px; flex: none; border-radius: 3px; background: var(--soft); position: relative; }
.glyph.bar { background: linear-gradient(to top, var(--accent) 70%, transparent 70%) left bottom / 3px 100% no-repeat, linear-gradient(to top, var(--accent) 45%, transparent 45%) center bottom / 3px 100% no-repeat, linear-gradient(to top, var(--accent) 85%, transparent 85%) right bottom / 3px 100% no-repeat, var(--soft); }
.glyph.cluster { background: linear-gradient(to top, var(--accent) 78%, transparent 78%) left 1px bottom / 3px 100% no-repeat, linear-gradient(to top, #8b9cb3 48%, transparent 48%) left 5px bottom / 3px 100% no-repeat, linear-gradient(to top, var(--accent) 42%, transparent 42%) right 5px bottom / 3px 100% no-repeat, linear-gradient(to top, #8b9cb3 70%, transparent 70%) right 1px bottom / 3px 100% no-repeat, var(--soft); }
.glyph.line { background: linear-gradient(135deg, transparent 46%, var(--accent) 46% 54%, transparent 54%); }
.glyph.pie { border-radius: 50%; background: conic-gradient(var(--accent) 0 62%, #dbe4f5 0 100%); }
.glyph.donut { border-radius: 50%; background: conic-gradient(var(--accent) 0 62%, #dbe4f5 0 100%); -webkit-mask: radial-gradient(circle, transparent 38%, #000 42%); mask: radial-gradient(circle, transparent 38%, #000 42%); }
.glyph.metric { background: var(--accent); height: 3px; align-self: center; }
.glyph.scatter { background: radial-gradient(circle at 30% 70%, var(--accent) 2px, transparent 2.5px), radial-gradient(circle at 60% 40%, var(--accent) 2px, transparent 2.5px), radial-gradient(circle at 75% 65%, var(--accent) 2px, transparent 2.5px), var(--soft); }
.glyph.text { background: repeating-linear-gradient(var(--muted) 0 1px, transparent 1px 4px); }
.glyph.histogram { background: linear-gradient(to top, var(--accent) 80%, transparent 80%) left bottom / 3px 100% no-repeat, linear-gradient(to top, var(--accent) 50%, transparent 50%) center bottom / 3px 100% no-repeat, linear-gradient(to top, var(--accent) 68%, transparent 68%) right bottom / 3px 100% no-repeat, var(--soft); }
.glyph.area { background: linear-gradient(160deg, transparent 46%, var(--accent) 46%), var(--soft); }
.glyph.stack { background: linear-gradient(to top, #8b9cb3 0 38%, transparent 38%), linear-gradient(to top, var(--accent) 0 68%, transparent 68%), var(--soft); }
.glyph.funnel { background: var(--accent); clip-path: polygon(12% 8%, 88% 8%, 68% 92%, 32% 92%); }
.glyph.radar { border-radius: 50%; background: linear-gradient(var(--accent), var(--accent)) center / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) center / 1px 10px no-repeat, var(--soft); }
.glyph.treemap { background: linear-gradient(var(--accent), var(--accent)) left top / 9px 9px no-repeat, linear-gradient(#8b9cb3, #8b9cb3) right top / 5px 9px no-repeat, linear-gradient(#14b8a6, #14b8a6) left bottom / 6px 5px no-repeat, linear-gradient(#f5a524, #f5a524) right bottom / 8px 5px no-repeat, var(--soft); }
.glyph.progress { background: linear-gradient(#d5deea, #d5deea) left center / 100% 4px no-repeat, linear-gradient(var(--accent), var(--accent)) left center / 68% 4px no-repeat, var(--soft); }
.glyph.gauge { border-radius: 50%; background: radial-gradient(circle at 50% 62%, #fff 1.5px, var(--accent) 2px 3px, transparent 3.5px), conic-gradient(from 214deg, var(--accent) 0 168deg, #e8eef5 168deg 236deg, transparent 236deg); }
.glyph.liquid { border-radius: 50%; background: linear-gradient(to top, var(--accent) 54%, #dbe4f5 54%); }
.widget.is-dragging {
  z-index: 8; box-shadow: 0 16px 36px rgba(31, 56, 88, 0.16); transition: none;
  cursor: grabbing;
}
.move-ghost {
  border: 1px dashed #9bb6f5; border-radius: 12px; background: rgba(47, 107, 255, 0.06);
  pointer-events: none; min-height: 0;
}
.move-ghost.is-join { border-style: solid; border-color: var(--accent); background: rgba(47, 107, 255, 0.1); }
.move-dir {
  position: fixed; z-index: 40; display: none; align-items: center; gap: 4px; height: 24px;
  padding: 0 8px 0 6px; border-radius: 999px; background: #fff; border: 1px solid #d6e2ff;
  box-shadow: 0 6px 16px rgba(31, 56, 88, 0.12); color: var(--accent); font-size: 12px; font-weight: 650;
  pointer-events: none; transform: translate(-50%, -50%);
}
.move-dir.is-on { display: flex; }
.move-dir i { width: 14px; height: 14px; display: grid; place-items: center; }
.move-dir i::before {
  content: ""; width: 6px; height: 6px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
}
.move-dir.is-up i::before { transform: translateY(1px) rotate(-45deg); }
.move-dir.is-right i::before { transform: translateX(-1px) rotate(45deg); }
.move-dir.is-down i::before { transform: translateY(-1px) rotate(135deg); }
.move-dir.is-left i::before { transform: translateX(1px) rotate(-135deg); }
body.is-moving-widget, body.is-moving-widget * { cursor: grabbing !important; }
body.dragging-type .widget { outline: 1px dashed transparent; }
body.dragging-type .widget:hover { outline-color: var(--accent); }
body.dragging-type .sheet-grid { outline: 1px dashed #c5d4f5; outline-offset: 4px; }
.modal.wide { width: min(860px, 100%); }
.table-wrap { overflow: auto; max-height: 280px; border: 1px solid var(--line); border-radius: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th, table.data td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { background: #f7f9fc; color: var(--muted); font-weight: 500; position: sticky; top: 0; }
.inspector textarea, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; resize: vertical; }
@media (max-width: 1440px) {
  .studio-body { grid-template-columns: 232px minmax(0, 1fr) 232px; }
  .desk { padding: 12px 14px 22px; }
}
@media (max-width: 1280px) {
  .studio-body { grid-template-columns: 210px minmax(0, 1fr) 210px; }
  .main { padding: 18px 16px 32px; }
  .sheet-grid { gap: 8px; }
}
@media (max-width: 980px) {
  .studio-body { grid-template-columns: 168px minmax(0, 1fr); }
  .inspector { display: none; }
  .studio.show-inspector .inspector {
    display: block; position: fixed; right: 12px; top: 64px; width: min(300px, calc(100vw - 24px));
    max-height: calc(100vh - 80px); border: 1px solid var(--line); border-radius: 12px; z-index: 6;
    box-shadow: var(--shadow); background: #fff;
  }
}

.card-foot { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 4px; }
.text-btn { border: 0; background: none; padding: 0; color: #4e5969; font-size: 13px; white-space: nowrap; }
.text-btn.main { color: var(--accent); font-weight: 650; }
.text-btn.faint { margin-left: auto; color: var(--faint); }
.card:hover .text-btn.faint { color: var(--danger); }
.axis-wells { display: flex; gap: 8px; }
.axis-wells.waiting { flex: 1; min-height: 84px; }
.axis-wells.compact { flex: none; margin: 0 0 6px; }
.axis-well {
  flex: 1; min-width: 0; border: 1px dashed #c5d4f5; border-radius: 8px; background: #f8faff;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
  padding: 10px 12px; text-align: left;
}
.axis-well span { font-size: 11px; color: var(--muted); }
.axis-well b { font-size: 13px; font-weight: 650; color: #98a2b3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.axis-well.filled { border-style: solid; background: #fff; }
.axis-well.filled b { color: var(--ink); }
.axis-wells.compact .axis-well { flex-direction: row; align-items: center; padding: 4px 8px; gap: 6px; }
body.dragging-field .axis-well { border-color: var(--accent); background: #eef3ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12); cursor: copy; }
body.dragging-field .axis-wells.compact .axis-well { min-height: 44px; padding: 8px 10px; }
body.dragging-field .axis-well.is-over { background: #dce7ff; border-style: solid; }

.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.layout-card {
  text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; color: var(--ink);
}
.layout-card.rec { border-color: #c5d4f5; background: #fbfcff; }
.layout-card:hover { border-color: var(--accent); }
.lay-top { display: flex; align-items: center; gap: 8px; }
.lay-top em { font-style: normal; font-size: 11px; color: var(--accent); background: var(--soft); border-radius: 999px; padding: 1px 6px; }
.lay-top strong { font-size: 14px; }
.lay { height: 88px; background: #f4f7fb; border-radius: 8px; padding: 6px; display: grid; gap: 4px; }
.lay i { display: block; background: #fff; border: 1px solid #e6ebf2; border-radius: 4px; min-height: 8px; }
.lay i:first-child { background: #e8f0ff; }
.lay.tiny { width: 72px; height: 40px; padding: 3px; gap: 2px; flex: none; }
.lay-kpi-split { grid-template-columns: 1.2fr 1.2fr 0.8fr; grid-template-rows: 18px 1fr 16px; }
.lay-kpi-split i:nth-child(4) { grid-column: 1 / 3; }
.lay-kpi-split i:nth-child(5) { grid-column: 3; grid-row: 2; }
.lay-kpi-split i:nth-child(6) { grid-column: 1 / -1; }
.lay-kpi-trend { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 16px 1.4fr 0.8fr; }
.lay-kpi-trend i:nth-child(4), .lay-kpi-trend i:nth-child(5) { grid-column: 1 / -1; }
.lay-side-main { grid-template-columns: 0.7fr 1.6fr; grid-template-rows: 1fr 1fr 1fr; }
.lay-side-main i:nth-child(4) { grid-column: 2; grid-row: 1 / span 3; }
.lay-compare { grid-template-rows: 1.4fr 1fr; }
.lay-split { grid-template-columns: 1fr 1fr; grid-template-rows: 1.3fr 0.7fr; }
.lay-split i:nth-child(3) { grid-column: 1 / -1; }
.lay-hero-line { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1.6fr 18px; }
.lay-hero-line i:first-child { grid-column: 1 / -1; }
.lay-kpi-quad { grid-template-columns: repeat(4, 1fr); grid-template-rows: 18px 1fr; }
.lay-kpi-quad i:nth-child(5) { grid-column: 1 / 3; }
.lay-kpi-quad i:nth-child(6) { grid-column: 3 / 5; }
.lay.tiny.lay-kpi-split, .lay.tiny.lay-kpi-trend, .lay.tiny.lay-kpi-quad, .lay.tiny.lay-hero-line { grid-template-rows: 8px 1fr 6px; }
.modal.wide .layout-grid { max-height: min(62vh, 560px); overflow: auto; padding-right: 2px; }

.sheet.is-present .sheet-head { margin-bottom: 8px; }
.sheet.is-present .sheet-title { font-size: 28px; letter-spacing: -0.03em; }
.sheet.is-present .sheet-desc { font-size: 13px; }
.sheet.is-present .sheet-grid { grid-auto-rows: 68px; gap: 16px; }
.sheet.is-present .sheet-foot { display: none; }
.sheet.is-present .widget { padding: 16px 16px 12px; border-radius: 18px; }
.sheet.is-present .widget h3 { margin: 0 0 8px; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.sheet.is-present .widget.is-metric { padding: 18px 20px 16px; }
.sheet.is-present .widget.is-metric h3 { margin: 0; padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.sheet.is-present .widget.is-metric .metric { padding: 8px 0 0; }
.sheet.is-present .metric { justify-content: flex-start; gap: 4px; }
.sheet.is-present .metric b { font-size: 26px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
.studio.is-present .desk { padding: 18px 28px 28px; }
.sheet.is-present { max-width: 1420px; }
.sheet.is-present .sheet-head { align-items: flex-end; margin-bottom: 14px; }
.sheet.is-present .meta-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.meta-chip { display: inline-flex; align-items: center; border: 1px solid #e7ebf2; border-radius: 999px; background: #fff; color: #4e5969; font-size: 12px; padding: 6px 10px; white-space: nowrap; }
.sheet.is-present .widget { border: 1px solid #e7ebf2; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.sheet.is-present .widget.is-metric { position: relative; padding: 14px 16px 12px; overflow: hidden; }
.sheet.is-present .widget.is-metric::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #4f46e5; }
.sheet.is-present .metric-band .widget.is-metric { min-height: 148px; height: auto; }
.sheet.is-present .metric b { font-size: 26px; }
.metric-foot { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.chart-note { margin: -4px 0 8px; padding: 0 52px 0 var(--head-inset); color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.sheet.is-present .chart-note { margin: 2px 0 8px; padding: 0; }
.metric b small, .metric b .unit { margin-left: 6px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.sheet.is-present .widget.is-metric h3 { font-size: 12px; }
@media (max-width: 900px) {
  .sheet.is-present .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.drop-new {
  min-height: 46px;
  margin-top: 10px;
  border: 1px dashed #d5deea;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255,255,255,0.7);
}
body.dragging-type .drop-new {
  min-height: 84px;
  border-color: var(--accent);
  color: var(--accent);
  background: #eef3ff;
}

.desk.is-panning { overflow: hidden; }
.widget h3 { cursor: grab; touch-action: none; }
.widget.is-dragging, .widget.is-dragging * { touch-action: none; }

.widget.is-table { overflow: hidden; }
.widget-table { flex: 1; min-height: 0; overflow: auto; }
.widget-table table.data { font-size: 12px; }

.studio.is-cockpit { background: #0b1220; color: #e8eef8; }

.adjust-tray {
  position: absolute;
  z-index: 6;
  top: 8px;
  left: 8px;
  width: 220px;
  max-height: min(440px, calc(100% - 16px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(29, 33, 41, 0.08);
  padding: 10px;
}
.adjust-tray .fields { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.adjust-tray select { width: 100%; margin-top: 6px; }
.sheet.is-adjust .widget { position: relative; }
.sheet.is-adjust .axis-wells {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 28px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.96);
}
.studio.is-cockpit .studio-bar { background: #10192b; border-bottom-color: #24344d; }
.studio.is-cockpit .studio-bar strong, .studio.is-cockpit .sheet-title { color: #f4f7fb; }
.studio.is-cockpit .sheet-desc, .studio.is-cockpit .meta { color: #8ea0b8; }
.studio.is-cockpit .desk { background: #0b1220; }
.studio.is-cockpit .widget { background: #152033; border: 1px solid #24344d; box-shadow: none; }
.studio.is-cockpit .widget.is-metric h3 { color: #8ea0b8; }
.studio.is-cockpit .widget.is-selected { box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.55); }
.studio.is-cockpit .widget h3, .studio.is-cockpit .metric b { color: #f4f7fb; }
.studio.is-cockpit .axis-well { background: #10192b; border-color: #2a3b55; }
.studio.is-cockpit .axis-well.filled { background: #1b2940; }
.studio.is-cockpit .axis-well span, .studio.is-cockpit .caption { color: #8ea0b8; }
.studio.is-cockpit .btn { background: #152033; border-color: #2a3b55; color: #d7e2f0; }
.studio.is-cockpit .seg { border-color: #2a3b55; }
.studio.is-cockpit .seg button { background: #10192b; color: #8ea0b8; }
.studio.is-cockpit .seg button.on { background: #1d4ed8; color: #fff; }
.theme-seg { min-width: 132px; }

.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.doc-bar .seg-tabs, .doc-bar .card-actions { margin: 0; flex: none; }
.seg-tabs { display: inline-flex; background: #f2f4f7; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 14px; }
.seg-tabs .tab { border-radius: 8px; padding: 6px 14px; color: #4e5969; }
.seg-tabs .tab.active { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06); }
.studio.is-cockpit .grain-line, .studio.is-cockpit .grain-line select { color: #d7e2f0; background: #152033; border-color: #2a3b55; }
.studio.is-cockpit .adjust-tray { background: #152033; border-color: #2a3b55; color: #d7e2f0; }
.studio.is-cockpit .sheet.is-adjust .axis-wells { background: rgba(21, 32, 51, 0.96); }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px 22px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; text-align: left; }
.auth-card .lead { margin: 0 0 18px; color: var(--muted); text-align: left; }
.auth-card .field { display: block; margin: 0 0 6px; font-size: 13px; text-align: left; }
.auth-card input[type="email"], .auth-card input[type="password"] { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; margin: 0 0 14px; }
.auth-card input:focus { outline: none; border-color: #c5d4f5; }
.auth-card .check { margin: -2px 0 14px; justify-content: flex-start; }
.auth-submit { width: 100%; }
.auth-error { margin: 0 0 10px; color: var(--danger); font-size: 13px; text-align: left; }
.auth-switch { margin: 14px 0 0; text-align: center; color: var(--muted); }
.auth-switch button { border: 0; background: none; color: var(--accent); padding: 0; }
.auth-note { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: left; }
