

:root {
  
  --primary: #3E63DD;            
  --primary-hover: #3556C4;
  --primary-weak: #EDF2FE;       
  --primary-border: #C6D3F7;
  --ai: #6E4BD8;
  --ai-weak: #EFEAFC;
  --bg-page: #F3F4F7;            
  --bg-surface: #F7F8FA;         
  --bg-elevated: #FFFFFF;        
  --bg-sunken: #EEF0F4;          
  --text-primary: #171B26;       
  --text-secondary: #4A5568;
  --text-muted: #7A8595;
  --border: #E4E7ED;
  --border-strong: #CBD2DC;
  --success: #17A673;  --success-bg: #E2F6ED;
  --warning: #B97A17;  --warning-bg: #FBF1DF;
  --danger:  #E5484D;  --danger-bg:  #FCE9EA;   
  
  --panel-deep: #171C29;
  --panel-deep-text: #FFFFFF;
  --panel-deep-sub: rgba(255, 255, 255, 0.65);
  
  --radius-card: 14px;
  --radius-control: 10px;
  --radius-chip: 999px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-popover: 0 8px 24px rgba(15, 27, 38, 0.10);
  --shadow-modal: 0 16px 48px rgba(15, 27, 38, 0.16);
  
  --font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: Menlo, ui-monospace, 'Roboto Mono', monospace;
  
  
  --comp-opt-h: 40px;          
  --comp-card-h: 72px;         
  --comp-card-media-h: 140px;  
  --comp-media: 64px;          
  --comp-touch: 40px;          
  --comp-touch-sm: 28px;       
  --font-hero: 20px;
  --font-title: 15px;
  --font-base: 13px;
  --font-small: 12px;
  --font-caption: 11px;
  
  --space: 8px;
  --card-pad: 16px;
  --gap: 12px;
  --dur-fast: 120ms;
  --dur-base: 220ms;
  
  --chart-grid: #E8ECEF;
  --chart-axis: #C7D0D8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

:root { --side-w: 212px; }
.sidenav {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); z-index: 50;
  background: var(--bg-elevated); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 6px; overflow-y: auto;
}
.sidenav .logo {
  font-weight: 700; font-size: var(--font-title); color: var(--text-primary);
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 12px; white-space: nowrap;
}
.sidenav .logo .logo-mark { display: inline-flex; flex: none; }
.sidenav .nav-group { display: flex; flex-direction: column; gap: 2px; }
.sidenav .nav-group + .nav-group { margin-top: 10px; }
.sidenav .nav-title { font-size: var(--font-caption); color: var(--text-muted); letter-spacing: 0.6px; padding: 4px 10px 4px; }
.sidenav a.navlink {
  display: flex; align-items: center; gap: 9px; color: var(--text-secondary);
  padding: 7px 12px; border-radius: 999px; font-size: var(--font-base);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.sidenav a.navlink .ico { color: var(--text-muted); transition: color var(--dur-fast); }
.sidenav a.navlink:hover { background: var(--bg-elevated); color: var(--text-primary); }
.sidenav a.navlink:hover .ico { color: var(--text-secondary); }

.sidenav a.navlink { position: relative; }
.sidenav a.navlink.active { color: var(--primary); background: var(--primary-weak); font-weight: 600; }
.sidenav a.navlink.active .ico { color: var(--primary); }
.sidenav a.navlink.active::before { content: ""; position: absolute; left: -1px; top: 22%; bottom: 22%;
  width: 3px; border-radius: 3px; background: var(--primary); }
.sidenav .nav-foot { margin-top: auto; padding: 8px 2px 0; }
.sidenav .nav-foot select { font-size: var(--font-small); padding: 5px 8px; color: var(--text-secondary); }

.nav-account {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-top: 1px solid var(--border); border-radius: 14px; cursor: default;
}
.nav-account:hover { background: var(--bg-elevated); }
.acc-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--font-base); font-weight: 600; flex: none;
}
.acc-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.acc-name { font-size: var(--font-base); font-weight: 600; color: var(--text-primary); }
.acc-role { font-size: var(--font-caption); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .acc-info { display: none; } .nav-account { justify-content: center; padding: 8px 0; } }

.tc-msgs { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.tc-u { display: flex; justify-content: flex-end; }
.tc-u span { background: var(--panel-deep); color: #fff; padding: 7px 12px; border-radius: 14px 14px 4px 14px; font-size: var(--font-base); max-width: 78%; word-break: break-word; }
.tc-b { display: flex; gap: 8px; align-items: flex-start; }
.tc-b .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-deep); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
.tc-b .bubble { flex: 1; min-width: 0; font-size: var(--font-base); }
.tc-composer {
  display: flex; align-items: center; gap: 6px; flex: 1;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 4px 4px 6px;
}
.tc-composer .model-pick { width: auto; max-width: 130px; border: none; box-shadow: none; background: transparent; color: var(--text-muted); font-size: var(--font-small); padding: 4px 0 4px 8px; flex: none; cursor: pointer; }
.tc-composer .model-pick:focus { box-shadow: none; }
.tc-composer input[type=text] { border: none; box-shadow: none; background: transparent; padding: 5px 4px; font-size: var(--font-base); }
.tc-composer input[type=text]:focus { box-shadow: none; }
.tc-send { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tc-send:hover { background: var(--primary-hover); }
.tc-send.stop { background: var(--danger); }
.reason-panel { border: 1px dashed var(--border); border-radius: var(--radius-control); padding: 8px 12px; margin: 4px 0 8px; background: var(--bg-surface); }
.reason-step { display: flex; gap: 8px; padding: 2px 0; font-size: var(--font-small); color: var(--text-secondary); }
.reason-step .dot { color: var(--primary); }

.drawer-mask { position: fixed; inset: 0; background: rgba(15, 27, 38, 0.32); z-index: 100; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw;
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform 180ms ease;
  box-shadow: var(--shadow-modal);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px 16px; }
.drawer-foot { padding: 12px 20px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
body.has-side { padding-left: var(--side-w); }
body.has-side .inputbar { left: var(--side-w); }
@media (max-width: 900px) {
  :root { --side-w: 56px; }
  .sidenav .logo span:not(.logo-mark), .sidenav .nav-title, .sidenav a.navlink span:not(.ico):not(.logo-mark), .sidenav .nav-foot { display: none; }
  .sidenav { padding: 14px 8px; }
  .sidenav a.navlink { justify-content: center; padding: 9px; }
}
.help { display: inline-flex; color: var(--text-muted); cursor: help; vertical-align: -2px; margin-left: 4px; }
.help:hover { color: var(--primary); }
.help-tip { position: fixed; z-index: 1200; background: #24313C; color: #fff; padding: 8px 12px;
  border-radius: 8px; font-size: var(--font-caption); line-height: 1.65; max-width: 300px;
  box-shadow: 0 6px 20px rgba(16, 42, 67, 0.28); pointer-events: none; }

.page { max-width: 1200px; margin: 0 auto; padding: 22px 26px; }
.page-narrow { max-width: 920px; }
.page-head { margin-bottom: 18px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.page-head .page-sub { color: var(--text-muted); font-size: var(--font-small); margin-top: 2px; }

.card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--card-pad);
  box-shadow: var(--shadow-card);
}
.card.flat { box-shadow: none; }
.section-title { font-size: var(--font-title); font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--text-muted); font-size: var(--font-small); }
.secondary { color: var(--text-secondary); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

input[type=number] { text-align: right; }
input[type=text], input[type=search], input[type=date], input[type=datetime-local], textarea, select { text-align: left; }

.deep-panel {
  background: var(--panel-deep); color: var(--panel-deep-text);
  border-radius: var(--radius-card); padding: 18px 20px;
}
.deep-panel .sub { color: var(--panel-deep-sub); font-size: var(--font-small); }

.btn {
  white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--bg-elevated);
  border-radius: 10px; padding: 6px 14px; color: var(--text-primary); font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.btn:hover { background: var(--bg-surface); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }

.comp .btn.primary, .brand-scope .btn.primary { color: var(--on-primary, #fff); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: none; }
.btn.ai { background: var(--ai-weak); border-color: transparent; color: var(--ai); font-weight: 600; }
.btn.ai:hover { background: #E4DCF9; }
.btn.danger { color: var(--danger); border-color: var(--danger-bg); background: var(--bg-surface); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.small { padding: 3px 12px; font-size: var(--font-small); }
.btn.ghost {
  border: none; background: none; color: var(--text-secondary);
  padding: 2px 6px; font-size: var(--font-small); box-shadow: none;
}
.btn.ghost:hover { background: none; color: var(--primary); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.primary:disabled { background: var(--bg-sunken); border-color: var(--bg-sunken); color: var(--text-muted); opacity: 1; }

.chip {
  display: inline-block; padding: 1px 10px; border-radius: var(--radius-chip);
  font-size: var(--font-small); border: 1px solid var(--border); color: var(--text-secondary);
  background: var(--bg-elevated); line-height: 1.7; white-space: nowrap;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;
}
.chip.blue { background: var(--primary-weak); color: #1873AE; border-color: transparent; }
.chip.green { background: var(--success-bg); color: #1E8A61; border-color: transparent; }
.chip.yellow { background: var(--warning-bg); color: #8A6100; border-color: transparent; }
.chip.red { background: var(--danger-bg); color: #C4423A; border-color: transparent; }
.chip.gray { background: var(--bg-sunken); border-color: transparent; }
.chip.ai { background: var(--ai-weak); color: var(--ai); border-color: transparent; font-weight: 600; }
.chip.coral { background: #F9ECE7; color: #B05C44; border-color: transparent; }

input[type=text], input[type=number], input[type=url], textarea, select {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-control);
  padding: 7px 12px; font-family: inherit; font-size: var(--font-base);
  background: var(--bg-elevated); color: var(--text-primary);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
input:focus, textarea:focus, select:focus {
  
  outline: none; border-color: var(--brand-ring, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-ring, var(--primary)) 18%, transparent);
}
input:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled), select:hover:not(:disabled) { border-color: var(--border-strong); }
input::placeholder, textarea::placeholder { color: #AAB1BE; }
textarea { resize: none; }
label.field { display: block; margin-bottom: 12px; }
label.field .label-text { display: block; font-size: var(--font-small); color: var(--text-secondary); margin-bottom: 4px; }
.field .label-text.req::after { content: " *"; color: var(--danger); }
.field .label-text .req::after { content: " *"; color: var(--danger); }
.field-error { color: var(--danger); font-size: var(--font-small); margin-top: 2px; }
.field-error:empty { display: none; }
label.field.has-error input, label.field.has-error textarea, label.field.has-error select { border-color: var(--danger); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-page); color: var(--text-muted); cursor: not-allowed; }

.menu-pop {
  position: absolute; z-index: 120; min-width: 168px; padding: 4px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-popover);
  animation: popIn 0.1s ease-out;
}
.menu-pop .menu-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 10px; border-radius: 6px; color: var(--text-primary); font-size: var(--font-small);
}
.menu-pop .menu-item:hover { background: var(--primary-weak); }
.menu-pop .menu-item.danger { color: var(--danger); }
.menu-pop .menu-item.danger:hover { background: var(--danger-bg); }

.editor-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.editor-split .editor-preview { position: sticky; top: 0; background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px; }
@media (max-width: 900px) { .editor-split { grid-template-columns: 1fr; } .editor-split .editor-preview { position: static; } }

.toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.toggle {
  position: relative; width: 34px; height: 19px; border-radius: 999px;
  background: var(--bg-sunken); border: none; padding: 0; transition: background var(--dur-fast); flex: none;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.25); transition: left var(--dur-fast);
}
.toggle.on { background: var(--primary); }
.toggle.on::after { left: 17px; }
.toggle:disabled { opacity: 0.55; cursor: not-allowed; }

.toggle.on:disabled { opacity: 1; background: var(--primary-border); }

.ico { display: inline-flex; align-items: center; vertical-align: -2px; line-height: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 1px solid transparent; background: transparent; border-radius: 6px; color: var(--text-muted);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--text-primary); }
.icon-btn.ai { color: var(--ai); background: var(--ai-weak); }
.icon-btn.ai:hover { background: #E4DCF9; }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn.frame {
  width: 30px; height: 30px; border: 1px solid var(--border-strong); background: var(--bg-elevated);
  border-radius: 999px; color: var(--text-secondary);
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.icon-btn.frame:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-elevated); box-shadow: 0 2px 8px rgba(29, 161, 242, 0.18); }
.icon-btn.busy svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.input-wrap { position: relative; }
.input-wrap textarea, .input-wrap input[type=text] { padding-right: 40px; }
.input-wrap .input-action { position: absolute; right: 6px; bottom: 8px; }
.input-wrap.single .input-action { top: 50%; bottom: auto; transform: translateY(-50%); }
.btn .ico { margin-right: 4px; }

.id-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; height: 20px;
  border: 1px dashed var(--border-strong); border-radius: 5px; background: transparent;
  color: var(--text-muted); font-size: var(--font-caption); letter-spacing: 0.2px; cursor: copy;
}
.id-chip:hover { color: var(--primary); border-color: var(--primary-border); background: var(--primary-weak); }

.key-field {
  display: inline-flex; align-items: center; gap: 0; max-width: 100%;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); overflow: hidden;
}
.key-field .key-label { padding: 0 8px; font-size: var(--font-caption); color: var(--text-muted); border-right: 1px solid var(--border); height: 28px; display: inline-flex; align-items: center; white-space: nowrap; }
.key-field code { font-family: var(--font-mono); font-size: var(--font-small); color: var(--text-primary); padding: 0 10px; height: 28px; display: inline-flex; align-items: center; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-field .icon-btn { width: 28px; height: 28px; border-radius: 0; border-left: 1px solid var(--border); }
.key-field.block { display: flex; }
.key-field.block code { flex: 1; }

.chat-mock { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-mock .m-user { display: flex; justify-content: flex-end; }

.chat-mock .m-user span { background: var(--panel-deep); color: #fff; padding: 7px 12px; border-radius: 12px 12px 4px 12px; font-size: var(--font-base); max-width: 78%; }
.chat-mock .m-bot { display: flex; gap: 8px; align-items: flex-start; }
.chat-mock .m-bot .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-deep); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chat-mock .m-bot .bubble { background: var(--bg-surface); border: none; border-radius: 4px 12px 12px 12px; padding: 8px 12px; flex: 1; min-width: 0; }
.chat-mock .m-bot .bubble .comp-meta { margin-top: 6px; }

.tag-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 38px;
  border: 1px solid var(--border); border-radius: var(--radius-control); padding: 5px 8px; background: var(--bg-elevated); cursor: text;
}
.tag-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.tag-input input { flex: 1; min-width: 140px; border: none; padding: 3px 2px; font-size: var(--font-small); box-shadow: none; }
.tag-input input:focus { box-shadow: none; }
.tag-input .tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px 1px 9px; border-radius: var(--radius-chip);
  background: var(--primary-weak); color: #1873AE; font-size: var(--font-small); max-width: 100%;
}
.tag-input .tag > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-input .tag-x { border: none; background: none; color: inherit; display: inline-flex; padding: 2px; border-radius: 50%; opacity: 0.7; }
.tag-input .tag-x:hover { opacity: 1; background: rgba(59,95,206,0.15); }

.toggle-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.toggle-row .toggle { margin-top: 2px; }
.toggle-row .toggle-label { font-size: var(--font-base); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }
.step-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: var(--font-caption); font-weight: 600; flex: none;
}
.editor-section { padding: 0; border: none; background: transparent; }
.editor-section + .editor-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.meta-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: var(--bg-page); border-radius: var(--radius-control); margin-bottom: 12px; font-size: var(--font-small); color: var(--text-secondary); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 4px 10px; font-size: var(--font-small); }
.kv dt { color: var(--text-muted); }
.kv dd { color: var(--text-primary); margin: 0; word-break: break-all; }

.comp-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: var(--font-caption); color: var(--text-muted); }

.comp {
  
  color: var(--text-primary);
  --comp-amount: 16px;
  
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card, 12px);
  padding: var(--card-pad, 14px);
  margin-top: 10px; max-width: 480px;
  font-size: var(--font-base, var(--font-small));
  box-shadow: var(--brand-shadow, 0 1px 2px rgba(15, 27, 38, .05));
  transition: box-shadow var(--dur-base, .18s);
}
.comp > * + * { margin-top: 10px; }
.comp .comp-title { font-size: var(--font-base); font-weight: 600; margin: 0; color: var(--text-primary); line-height: 1.5; }
.comp .opt-row { display: flex; gap: var(--cand-gap, 10px); flex-wrap: wrap; }
.comp .btn.opt {
  border-radius: 999px; font-size: var(--font-base); padding: 5px 14px;
  border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text-primary); font-weight: 400;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.comp .btn.opt:hover { border-color: var(--brand-accent, var(--primary)); color: var(--brand-accent, var(--primary)); background: var(--bg-elevated); }
.comp .btn.opt.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600;
  min-height: var(--control-height, 36px); padding: 0 18px; border-radius: var(--radius-control, 10px);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 40%, transparent);
  transition: filter var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast); }
.comp .btn.opt.primary:hover { filter: brightness(1.06); box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 45%, transparent); }
.comp .btn.opt.primary:active { transform: translateY(1px); filter: brightness(.97); }

.comp.confirm-risk { border-left: none; }
.comp.confirm-risk .btn.primary { background: var(--danger); border-color: var(--danger);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--danger) 40%, transparent); }
.comp.confirm-risk .btn.primary:hover { filter: brightness(1.05); }
.comp .btn.opt.likert { min-width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.comp .likert-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.comp .likert-row > .muted { font-size: var(--font-caption); }
.comp .submit-bar { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.comp .submit-bar .btn.primary { padding: 4px 16px; font-size: var(--font-small); box-shadow: none; }
.comp .opt-card { background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--opt-radius, 10px); padding: 9px 12px; cursor: pointer; flex: 1; min-width: 140px; height: var(--control-height, var(--comp-card-h)); overflow: hidden; display: flex; flex-direction: column; transition: border-color var(--dur-fast), background var(--dur-fast); }
.comp .opt-card.media { height: var(--comp-card-media-h); }
.comp .opt-card .oc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp .opt-card .oc-desc { color: var(--text-muted); font-size: var(--font-small); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.comp .opt-card:hover { border-color: var(--brand-accent, var(--primary)); }
.comp .opt-card.on { border-color: var(--primary); background: var(--primary-weak); }
.comp label.field { margin-bottom: 10px; }
.comp label.field .label-text { font-size: var(--font-small); margin-bottom: 3px; }
.comp input[type=text], .comp input[type=number], .comp textarea { padding: 5px 10px; font-size: var(--font-small); background: var(--bg-page); }
.comp table.data { font-size: var(--font-small); }
.comp table.data th, .comp table.data td { padding: 5px 8px; }
.comp .comp-meta { border-top: none; padding-top: 0; opacity: 0; transition: opacity var(--dur-fast); }
.comp:hover .comp-meta { opacity: 0.75; }

.chat-mock .m-bot .bubble > .comp { margin-top: 8px !important; max-width: 100%; }
.comp.comp-degraded { border-style: dashed; }

.comp .opt-list { display: flex; flex-direction: column; gap: 6px; }
.comp .opt-item {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-control, 10px);
  padding: 0 14px; min-height: var(--control-height, var(--comp-opt-h, 40px));
  cursor: pointer; background: var(--bg-elevated); width: 100%; text-align: left;
  font-size: inherit; color: var(--text-primary);
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.comp .opt-item:hover { border-color: var(--brand-accent, var(--primary)); background: color-mix(in srgb, var(--brand-accent, var(--primary)) 4%, var(--bg-elevated)); }
.comp .opt-item:active { transform: scale(.995); }
.comp .opt-item.on { border-color: var(--primary); background: var(--primary-weak); box-shadow: inset 0 0 0 .5px var(--primary); }
.comp .opt-item .opt-text { flex: 1; min-width: 0; word-break: break-word; }
.comp .sel-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff;
  background: var(--bg-elevated); transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.comp .sel-dot.sq { border-radius: 6px; }
.comp .sel-dot.on { background: var(--primary); border-color: var(--primary); animation: dot-pop .18s ease-out; }
@keyframes dot-pop { 0% { transform: scale(.7); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.comp .opt-item:hover .sel-dot:not(.on) { border-color: var(--brand-accent, var(--primary)); }
.comp .rank-no { width: 18px; text-align: center; color: var(--text-muted); flex: none; }

.comp .quick-float { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; background: var(--bg-surface); border: none; border-radius: 12px; }
.comp .quick-float .btn.opt { background: var(--bg-elevated); }

.comp .likert-bar { display: flex; width: 100%; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.comp .likert-bar button { flex: 1; border: none; background: var(--bg-elevated); padding: 7px 0; font-size: var(--font-base); border-right: 1px solid var(--border); font-variant-numeric: tabular-nums; cursor: pointer;
  color: var(--text-ink, var(--ink-panel, var(--text-primary))); }
.comp .likert-bar button:last-child { border-right: none; }
.comp .likert-bar button.primary { background: var(--primary); color: var(--on-primary, #fff); }

.comp .stepper { display: flex; align-items: center; gap: 10px; }
.comp .stepper .btn { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.comp .stepper .val { font-family: var(--font-mono); font-size: var(--comp-amount); font-weight: 700; min-width: 72px; text-align: center; }

.comp .opt-card img { width: 100%; height: 72px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.comp .opt-card .img-ph { width: 100%; height: 56px; border-radius: 8px; margin-bottom: 6px; background: var(--primary-weak); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--font-hero); }

.ai-suggest {
  border: 1px solid var(--ai); border-radius: 16px; background: #FBFAFE;
  padding: 12px 14px; margin: 8px 0 12px; overflow: hidden;
}
.ai-suggest .sug-text { word-break: break-word; overflow-wrap: anywhere; max-height: 132px; overflow-y: auto; font-size: var(--font-base); }
.ai-suggest .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.row-item { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.row-item:hover { background: var(--bg-surface); }
.row-item.active { background: var(--primary-weak); box-shadow: inset 3px 0 0 var(--primary); }
.row-item:last-child { border-bottom: none; }

table.data { width: 100%; border-collapse: collapse; font-size: var(--font-base); }
table.data th {
  text-align: left; font-weight: 600; color: var(--text-muted); font-size: var(--font-small);
  padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: transparent;
}
table.data th:first-child { border-radius: 6px 0 0 0; }
table.data th:last-child { border-radius: 0 6px 0 0; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; vertical-align: middle; }
table.data td .chip + .chip { margin-left: 4px; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.clickable:hover { background: var(--primary-weak); cursor: pointer; }

.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } .grid.cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.stat-tile {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 14px 16px;
}
.stat-tile .stat-label { font-size: var(--font-small); color: var(--text-muted); }
.stat-tile .stat-value {
  color: var(--text-primary);
  font-size: var(--font-hero); font-weight: 600; line-height: 1.35;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.stat-tile .stat-sub { font-size: var(--font-small); color: var(--text-secondary); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .empty-title { font-size: var(--font-title); color: var(--text-secondary); margin-bottom: 6px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 25, 40, 0.42);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--bg-elevated); border-radius: 20px;
  max-width: 760px; width: 92%; max-height: 86vh; overflow: auto; padding: 20px;
  box-shadow: var(--shadow-modal);
}
.modal.wide { max-width: 1120px; width: 94%; }

.modal .modal-foot { position: sticky; bottom: -20px; background: var(--bg-surface); margin: 8px -20px -20px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.modal .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal .modal-title { font-size: var(--font-title); font-weight: 600; }
.close-btn { border: none; background: none; font-size: 18px; line-height: 1; color: var(--text-muted);
  width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); flex: none; }
.close-btn:hover { color: var(--text-primary); background: var(--bg-surface); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #15202B; color: #fff; padding: 8px 18px;
  border-radius: var(--radius-control); font-size: var(--font-base); z-index: 200;
  max-width: 80%; box-shadow: var(--shadow-popover);
}
.toast.error { background: var(--danger); }

.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabbar .tab {
  padding: 8px 16px; border: none; background: none; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabbar .tab:hover { color: var(--text-primary); }
.tabbar .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.progress-track { height: 8px; background: var(--bg-sunken); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width var(--dur-base); }

pre.code {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-control);
  padding: 10px; font-size: var(--font-small); overflow: auto; font-family: var(--font-mono);
  white-space: pre-wrap; word-break: break-all; color: #333B4E;
}

.segmented {
  display: inline-flex; background: var(--bg-sunken); border-radius: var(--radius-control);
  padding: 2px; gap: 2px;
}
.segmented .seg {
  border: none; background: none; padding: 4px 12px; border-radius: 6px;
  color: var(--text-secondary); font-size: var(--font-small); white-space: nowrap; font-weight: 600;
}
.segmented .seg.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-card); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9CEDA; border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #AEB5C4; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: var(--primary-weak); }

.echo-panel .echo-head { font-size: var(--font-small); font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.echo-panel .echo-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: var(--font-caption); color: var(--text-secondary); }
.echo-panel .echo-row .echo-name { flex: 0 0 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.echo-panel .echo-row.own .echo-name { color: var(--primary); font-weight: 600; }
.echo-panel .echo-track { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.echo-panel .echo-fill { display: block; height: 100%; border-radius: 999px; background: var(--border-strong); }
.echo-panel .echo-row.own .echo-fill { background: var(--primary); }
.echo-panel .echo-pct { flex: 0 0 34px; text-align: right; font-size: var(--font-caption); }
.echo-panel .echo-row.own .echo-pct { color: var(--primary); font-weight: 600; }
.echo-panel .echo-quote { font-size: var(--font-small); color: var(--text-secondary); padding: 3px 0 3px 10px; border-left: 2px solid var(--border-strong); margin: 4px 0; }

.sec-head { font-size: var(--font-title); font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
label.field .muted, .field .muted { font-size: var(--font-caption); }
.comp-pick { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); margin-bottom: 12px; }
.comp-pick .cp-name { font-weight: 700; font-size: var(--font-base); }
.comp-pick .cp-desc { font-size: var(--font-small); color: var(--text-muted); margin-top: 2px; }
.comp-pick .cp-hint { font-size: var(--font-caption); color: var(--text-muted); flex: none; }
.validity-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; max-width: 380px; }
.act-panel { margin: 6px 0 4px; padding: 10px 12px; border: 1px dashed var(--ai); border-radius: 10px; background: #FBFAFE; }
.contract-box .code { max-height: 300px; overflow: auto; }

.opt-edit-card { padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.opt-edit-card + .opt-edit-card { margin-top: 2px; }

input[type=date], input[type=time], input[type=datetime-local], input[type=month] {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-control);
  padding: 6px 12px; min-height: 36px; font-family: inherit; font-size: var(--font-base); line-height: 20px;
  background: var(--bg-elevated); color: var(--text-primary); -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
input[type=date]::-webkit-datetime-edit, input[type=time]::-webkit-datetime-edit, input[type=datetime-local]::-webkit-datetime-edit { padding: 0; }
input[type=date]::-webkit-datetime-edit-fields-wrapper, input[type=time]::-webkit-datetime-edit-fields-wrapper, input[type=datetime-local]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator {
  opacity: 0.45; cursor: pointer; width: 16px; height: 16px; margin-left: 4px;
}
input[type=date]:hover::-webkit-calendar-picker-indicator, input[type=time]:hover::-webkit-calendar-picker-indicator, input[type=datetime-local]:hover::-webkit-calendar-picker-indicator { opacity: 0.85; }
input[type=date]:invalid, input[type=time]:invalid, input[type=datetime-local]:invalid { color: var(--text-muted); }
.comp input[type=date], .comp input[type=time], .comp input[type=datetime-local] { padding: 5px 10px; min-height: 32px; font-size: var(--font-small); background: var(--bg-page); }
.comp .range-row { display: flex; align-items: center; gap: 8px; }
.comp .range-row input { flex: 1; min-width: 0; max-width: none; }
.validity-row input { flex: 1; min-width: 0; }

.modal.editor { width: 1140px; max-width: 96vw; height: 720px; max-height: 90vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal.editor .modal-head { flex: none; margin: 0; padding: 18px 24px 0; }
.modal.editor .ed-steps { flex: none; display: flex; align-items: center; gap: 4px; padding: 12px 24px; border-bottom: 1px solid var(--border); font-size: var(--font-small); }
.modal.editor .ed-steps .st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; color: var(--text-muted); border: 1px solid transparent; }
.modal.editor .ed-steps .st.done { color: var(--text-secondary); }
.modal.editor .ed-steps .st.active { color: var(--primary); background: var(--primary-weak); font-weight: 600; }
.modal.editor .ed-steps .st.click { cursor: pointer; }
.modal.editor .ed-steps .st.click:hover { border-color: var(--primary-border); color: var(--text-primary); }
.modal.editor .ed-steps .sep { color: var(--border-strong); display: inline-flex; }
.modal.editor .ed-steps .meta { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.modal.editor .ed-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 0; }
.modal.editor .ed-form { min-height: 0; overflow: auto; padding: 18px 24px 24px; }
.modal.editor .ed-preview { min-height: 0; overflow: auto; margin: 16px 24px 16px 0; padding: 14px; background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius-card); }
.modal.editor .ed-preview .chat-mock { min-height: 300px; }
.modal.editor .modal-foot { position: static; flex: none; margin: 0; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--bg-elevated); }

.modal.editor .ed-form .editor-section + .editor-section { margin-top: 20px; padding-top: 18px; }

.q-input { font-size: var(--font-title); font-weight: 600; padding: 10px 14px; background: var(--bg-surface); border-color: var(--border-strong); }
.q-input::placeholder { font-weight: 400; }

.opt-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 92px 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.opt-row input { min-width: 0; }
.opt-row .ghost-ai { white-space: nowrap; width: 92px; justify-content: center; }
.opt-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 92px 32px; gap: 6px; font-size: var(--font-caption); color: var(--text-muted); margin-bottom: 4px; }

.done-hero { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-control); background: var(--success-bg, #EAF7EE); color: #1E7A3C; margin-bottom: 16px; }
.done-hero .ico { width: 32px; height: 32px; border-radius: 50%; background: #2E9E55; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.done-hero.draft { background: var(--bg-surface); color: var(--text-secondary); }
.done-hero.draft .ico { background: var(--text-muted); }

.comp .rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); margin-bottom: 6px; }
.comp .rank-item:last-child { margin-bottom: 0; }
.comp .rank-item .opt-text { flex: 1; min-width: 0; }
.comp .rank-item .rank-no { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-sunken); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; font-size: var(--font-small); flex: none; }
.comp .rank-item .rank-no.top { background: var(--primary); color: #fff; }
.comp .rank-ctl { display: inline-flex; gap: 2px; flex: none; }
.comp .rank-ctl .icon-btn:disabled { opacity: 0.25; }

.input-wrap.ta textarea { padding-right: 12px; padding-bottom: 40px; }
.input-wrap.ta .input-action { right: 8px; bottom: 8px; }

.ed-preview .chat-mock .m-bot .bubble { flex: 1; }
.ed-preview .comp { max-width: none; }

input[type=range], .comp input[type=range] {
  -webkit-appearance: none; appearance: none;
  border: none; background: transparent; padding: 0; height: 28px;
  accent-color: var(--primary);
}
input[type=range]:focus, input[type=range]:hover { border: none; box-shadow: none; outline: none; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--primary) var(--fill, 50%), var(--bg-sunken) var(--fill, 50%)); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(15, 27, 38, 0.25); margin-top: -5px;
}
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--primary-weak); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--bg-sunken); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--primary); }

select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23657786' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
}
select:disabled { background-color: var(--bg-page); }

details > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 6px 0; border-radius: var(--radius-control); user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23657786' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") no-repeat center;
  transition: transform var(--dur-fast);
}
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--text-primary); }

input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: auto; }

.comp .loc-list { }
.comp .loc-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); margin-bottom: 6px; cursor: pointer; }
.comp .loc-row:last-child { margin-bottom: 0; }
.comp .loc-row:hover { border-color: var(--primary-border); }
.comp .loc-main { min-width: 0; flex: 1; }
.comp .loc-name { font-weight: 600; font-size: var(--font-small); display: flex; align-items: center; }
.comp .loc-addr { font-size: var(--font-caption); color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp .loc-selected { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--primary); border-radius: 10px; background: var(--primary-weak); }
.comp .loc-map { width: 100%; height: 170px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; display: block; }

.comp .img-thumb img { max-width: 100%; max-height: 160px; border-radius: 10px; border: 1px solid var(--border); display: block; margin-bottom: 8px; }

.fun-row { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; }
.fun-label { font-size: var(--font-small); color: var(--text-secondary); text-align: right; }
.fun-track { display: flex; justify-content: flex-start; }
.fun-bar { height: 22px; border-radius: 0 4px 4px 0; min-width: 22px; transition: width var(--dur-base); background: var(--primary); }
.fun-val { font-size: var(--font-small); color: var(--text-primary); }
.fun-conv { text-align: left; font-size: var(--font-caption); color: var(--text-muted); padding: 3px 0 3px 74px; }
.meter-row { display: grid; grid-template-columns: 76px 1fr 56px; gap: 10px; align-items: center; margin-top: 12px; }
.meter-label { font-size: var(--font-small); color: var(--text-secondary); }
.meter-track { position: relative; height: 8px; border-radius: 999px; background: var(--bg-sunken); }
.meter-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.meter-fill.warn { background: var(--danger); }
.meter-th { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text-muted); border-radius: 1px; }
.meter-val { font-size: var(--font-small); text-align: right; }
.meter-val.warn { color: var(--danger); }
.mini-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.mini-metrics:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.mini-metric { background: var(--bg-surface); border-radius: 10px; padding: 8px 10px; }
.mini-metric .mm-label { font-size: var(--font-caption); color: var(--text-muted); }
.mini-metric .mm-value { font-size: var(--font-title); font-weight: 700; margin-top: 2px; }
.mini-metric .mm-value.warn { color: var(--danger); }
.card-foot-meta { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.stack-bar { display: flex; gap: 2px; height: 26px; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.stack-bar .seg { height: 100%; }
.stack-legend { display: flex; gap: 16px; margin-top: 8px; font-size: var(--font-small); color: var(--text-secondary); }
.stack-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

.comp .fu-list { display: flex; flex-direction: column; gap: 6px; }
.comp .fu-item { display: flex; align-items: center; gap: 8px; text-align: left; width: 100%;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated);
  font-size: var(--font-small); color: var(--text-primary); cursor: pointer; transition: border-color var(--dur-fast); }
.comp .fu-item:hover { border-color: var(--primary-border); }
.comp .fu-item.on { border-color: var(--primary); background: var(--primary-weak); }
.comp .fu-item:disabled { opacity: 0.45; cursor: default; }
.comp .fu-item .fu-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp .fu-item .fu-ico { color: var(--text-muted); display: inline-flex; flex: none; }

.comp .cm-item { display: flex; gap: 10px; padding: 10px; border: none; border-radius: 12px; background: var(--bg-elevated); margin-bottom: 8px; transition: box-shadow var(--dur-fast); }
.comp .cm-item:last-child { margin-bottom: 0; }
.comp .cm-item.on { box-shadow: inset 0 0 0 1.5px var(--primary); }
.comp .cm-img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; }
.comp .cm-img.ph { background: linear-gradient(135deg, var(--primary-weak), #EAF4FE 60%, #F5FAFF); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; opacity: 0.9; }
.comp .cm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.comp .cm-name { font-weight: 700; font-size: var(--font-small); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.comp .cm-desc { font-size: var(--font-small); color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp .cm-meta { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden; margin-top: 2px; min-height: 0; }
.comp .cm-tag { font-size: var(--font-caption); color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; }
.comp .cm-sales { font-size: var(--font-caption); color: var(--text-muted); }
.comp .cm-price-row { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 2px; white-space: nowrap; }
.comp .cm-price { font-size: var(--comp-amount); font-weight: 700; color: var(--text-primary); line-height: 1; letter-spacing: -0.2px; }
.comp .cm-price .cm-yen { font-size: var(--font-caption); font-weight: 700; margin-right: 1px; }
.comp .cm-orig { font-size: var(--font-small); color: var(--text-muted); text-decoration: line-through; }
.comp .cm-discount { flex: none; font-size: var(--font-caption); color: var(--primary); background: var(--primary-weak); border-radius: 6px; padding: 2px 6px; font-weight: 600; }
.comp .cm-order { flex: none; align-self: center; border: none; cursor: pointer; background: var(--primary); color: #fff;
  border-radius: 999px; padding: 5px 14px; font-size: var(--font-small); font-weight: 600; min-height: 30px;
  transition: filter var(--dur-fast); }
.comp .cm-order:hover { filter: brightness(0.94); }
.comp .cm-qty { display: inline-flex; align-items: center; gap: 8px; align-self: center; }
.comp .cm-step { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--primary); background: var(--bg-elevated); color: var(--primary); font-size: var(--font-small); font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.comp .cm-step:hover:not(:disabled) { background: var(--primary-weak); }
.comp .cm-step:disabled { opacity: 0.35; }
.comp .cm-qty-n { min-width: 18px; text-align: center; font-weight: 700; font-size: var(--font-small); }
.comp .cm-total { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 4px; }
.comp .cm-submit { border: none; cursor: pointer; background: var(--primary); color: #fff; border-radius: 999px;
  padding: 6px 16px; font-size: var(--font-small); font-weight: 600; }
.comp .cm-submit:hover:not(:disabled) { filter: brightness(0.94); }
.comp .cm-submit:disabled { opacity: 0.6; cursor: default; }
.comp .cm-total:empty { display: none; margin: 0; }
.comp .cm-total-val { font-weight: 700; font-size: var(--font-small); color: var(--text-primary); }

.comp .el-list { display: flex; flex-direction: column; gap: 8px; }
.comp .el-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border: none; border-radius: 12px; background: var(--primary-weak);
  cursor: pointer; transition: filter var(--dur-fast); }
.comp .el-item:hover { filter: brightness(0.97); }
.comp .el-item.on { outline: 2px solid var(--primary); }
.comp .el-item:disabled { opacity: 0.45; cursor: default; }
.comp .el-ico { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.comp .el-ico.ph { background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--font-small); }
.comp .el-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comp .el-name { font-weight: 600; font-size: var(--font-base); color: var(--text-primary); }
.comp .el-sub { font-size: var(--font-caption); color: var(--text-secondary); }
.comp .el-arrow { color: var(--text-muted); display: inline-flex; flex: none; }

.comp .trk-cur { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.comp .trk-upd { font-size: var(--font-caption); color: var(--text-muted); flex: none; }
.comp .trk-list { margin-left: 5px; }
.comp .trk-node { position: relative; display: flex; gap: 10px; padding: 0 0 14px 0; }
.comp .trk-node:last-child { padding-bottom: 0; }
.comp .trk-node::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: 0; width: 2px; background: var(--border); }
.comp .trk-node:last-child::before { display: none; }
.comp .trk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex: none; margin-top: 3px; z-index: 1; }
.comp .trk-node.done .trk-dot { background: var(--primary); opacity: 0.45; }
.comp .trk-node.current .trk-dot { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.comp .trk-node.current .trk-text { font-weight: 600; color: var(--text-primary); }
.comp .trk-text { font-size: var(--font-small); color: var(--text-secondary); }
.comp .trk-time { font-size: var(--font-caption); color: var(--text-muted); margin-top: 1px; }

.comp .quick-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.comp .quick-chip { border: 1px solid var(--border); background: var(--bg-elevated); border-radius: 999px;
  padding: 3px 11px; font-size: var(--font-caption); color: var(--text-secondary); cursor: pointer; }
.comp .quick-chip:hover { border-color: var(--primary-border); color: var(--text-primary); }
.comp .quick-chip.on { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); }

.comp .opt-item { min-height: var(--control-height, var(--comp-opt-h)); }
.comp .loc-row { min-height: var(--control-height, var(--comp-opt-h)); }
.comp .fu-item { min-height: var(--control-height, var(--comp-opt-h)); }
.comp .el-item { min-height: 46px; }
.comp .rank-item { min-height: var(--control-height, var(--comp-opt-h)); }
.comp .quick-chip { min-height: 26px; }

.comp { position: relative; }
.comp .comp-reset { position: absolute; top: 10px; right: 12px; z-index: 2; display: none;
  border: none; background: none; color: var(--text-muted); font-size: var(--font-small); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.comp.dirty .comp-reset { display: inline-flex; }
.comp .comp-reset.inbar { position: static; margin-left: auto; }
.comp .cm-total .comp-reset.inbar { margin-left: 0; }
.comp .comp-reset:hover:not(:disabled) { color: var(--primary); background: var(--primary-weak); }
.comp .comp-reset:disabled { display: none; }
.comp .comp-title { padding-right: 44px; }
.comp.clamped { max-height: 340px; overflow: hidden; }
.comp .comp-expand { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; border: none; cursor: pointer;
  padding: 26px 0 10px; font-size: var(--font-small); color: var(--primary); text-align: center;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg-elevated) 55%); }

.recv-row { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-control); padding: 12px 14px; margin-bottom: 10px; background: var(--bg-elevated); }
.recv-row .recv-main { flex: 1; min-width: 0; }
.recv-row .recv-t { font-weight: 600; margin-bottom: 3px; }
.recv-row .toggle { margin-top: 2px; }
.recv-row input { margin-top: 6px; }

.info-card { border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--bg-elevated); padding: 12px 14px; margin-bottom: 10px; }
.info-card .ic-head { display: flex; align-items: center; margin-bottom: 8px; }
.info-card .ic-title { font-weight: 600; }
.info-card .sum-rows { display: grid; grid-template-columns: 76px 1fr; row-gap: 8px; column-gap: 12px; align-items: start; }
.info-card .sum-rows .k { color: var(--text-muted); font-size: var(--font-small); padding-top: 1px; }
.info-card .sum-rows .v { min-width: 0; word-break: break-word; }
.info-card .sum-rows .chips { display: flex; gap: 4px; flex-wrap: wrap; }

.warn-banner { border: 1px solid #E8C46B; background: var(--warning-bg, #FBF3DF); color: #8A6116; border-radius: var(--radius-control); padding: 10px 14px; margin-bottom: 14px; font-size: var(--font-base); }

.src-row { display: flex; align-items: center; gap: 14px; padding: 11px 2px; border-top: 1px solid var(--border); }
.src-row:first-child { border-top: none; }
.src-row .src-main { flex: 1; min-width: 0; }
.src-row .src-t { font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.src-row .src-n { color: var(--text-secondary); flex: none; min-width: 52px; text-align: right; }

.tab-bar { display: flex; gap: 22px; }
.tab-bar .tab { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer;
  padding: 13px 2px 11px; font-size: var(--font-base); font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-bar .tab:hover { color: var(--text-secondary); }
.tab-bar .tab.active { color: var(--text-primary); border-bottom-color: var(--primary); }
.tab-bar .tab-count { font-size: var(--font-caption); background: var(--bg-sunken); border-radius: 999px; padding: 0 7px; line-height: 17px; color: var(--text-secondary); }
.tab-bar .tab.active .tab-count { background: var(--primary-weak); color: var(--primary); }

.comp.comp-bare { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; }
.comp.comp-bare .comp-title { padding-right: 0; margin-bottom: 6px; }

.fsel { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--bg-elevated); padding: 7px 10px 7px 12px; font-size: var(--font-base); color: var(--text-primary); cursor: pointer;
  transition: border-color var(--dur-fast); }
.fsel:hover { border-color: var(--border-strong); }

.fsel-pop .menu-item.on { color: var(--primary); font-weight: 600; background: var(--primary-weak); }

.opt-row.sug, .opt-head.sug { grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr) 32px; }

@media (max-width: 1100px) {
  .modal.editor .ed-split { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 900px) {
  .modal.editor { height: 94vh; }
  .modal.editor .ed-split { display: block; overflow: auto; }
  .modal.editor .ed-form { overflow: visible; padding-bottom: 8px; }
  .modal.editor .ed-preview { margin: 0 24px 16px; }
}

.tab-bar { overflow-x: auto; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
@media (max-width: 680px) {
  .mini-metrics { grid-template-columns: repeat(2, 1fr); }
  .card-row .cr-line2 { max-width: none; }
}

@media (max-width: 760px) {
  .card-row { flex-wrap: wrap; }
  .card-row .cr-actions { width: 100%; justify-content: flex-end; margin-top: 8px; align-self: auto; }
}

.comp .loc-result:empty { display: none; margin: 0; }

.echo-panel { background: var(--bg-surface); border-radius: 10px; padding: 12px; }

.scene-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.scene-tag { border: 1px solid var(--border); background: var(--bg-elevated); border-radius: 999px;
  padding: 5px 14px; font-size: var(--font-small); color: var(--text-secondary); cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast); }
.scene-tag:hover { border-color: var(--primary-border); color: var(--text-primary); }
.scene-tag.on { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); }

.input-wrap.ta.ta-mid .input-action { bottom: 38px; }
.input-wrap.ta.ta-mid textarea { padding-bottom: 12px; padding-right: 96px; }

.tpl-scroll { max-height: 336px; overflow-y: auto; padding-right: 6px; margin-right: -6px; }
.tpl-scroll::-webkit-scrollbar { width: 6px; }
.tpl-scroll::-webkit-scrollbar-thumb { background: var(--bg-sunken); border-radius: 999px; }
.tpl-scroll::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.comp .rank-drag { color: var(--text-muted); cursor: grab; display: inline-flex; padding: 4px; flex: none; }
.comp .rank-item.dragging { opacity: 0.5; border-style: dashed; }
.comp .rank-item { user-select: none; }

.comp .ts-wrap { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; height: 208px; }
.comp .ts-days { display: flex; flex-direction: column; background: var(--bg-surface); flex: none; width: 86px; overflow-y: auto; }
.comp .ts-day { border: none; background: none; padding: 11px 10px; text-align: left; font-size: var(--font-small); color: var(--text-secondary); cursor: pointer; position: relative; }
.comp .ts-day.on { background: var(--bg-elevated); color: var(--primary); font-weight: 600; }
.comp .ts-day.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.comp .ts-slots { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.comp .ts-slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: none; background: none; padding: 11px 14px; font-size: var(--font-small); color: var(--text-primary); cursor: pointer; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.comp .ts-slot:last-child { border-bottom: none; }
.comp .ts-slot:hover:not(:disabled) { background: var(--bg-surface); }
.comp .ts-slot.on { color: var(--primary); font-weight: 600; background: var(--primary-weak); }
.comp .ts-slot:disabled { color: var(--text-muted); cursor: default; }
.comp .ts-slot .ts-dead { font-size: var(--font-caption); color: var(--text-muted); }

.comp .addr-list { display: flex; flex-direction: column; gap: 6px; }
.comp .addr-card { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-elevated); cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast); }
.comp .addr-card:hover { border-color: var(--primary); }
.comp .addr-card.on { border-color: var(--primary); background: var(--primary-weak); }

.comp .mx-table { table-layout: fixed; width: 100%; font-size: var(--tbl-font, 0.86em); }
.comp .mx-table th { font-size: inherit; padding: 6px 6px; }
.comp .mx-table td { padding: 7px 6px; }
.comp .mx-table th.mx-v, .comp .mx-table td.mx-v { width: 44px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp .mx-table th.mx-sum, .comp .mx-table td.mx-sum { width: 48px; text-align: right; }
.comp .mx-table td.mx-sum.best { color: var(--accent-ink, var(--primary)); font-weight: 700; }
.comp .mx-table td.mx-name { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.comp .mx-table .mx-opt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.comp .mx-row.pick { cursor: pointer; }
.comp .mx-row.pick:hover td { background: var(--bg-surface); }
.comp .mx-row.on td { background: var(--primary-weak); }

.card-row .cr-id { font-size: var(--font-caption); color: var(--text-muted); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; flex: none; }
.icon-btn.dim { opacity: 0.4; }
.btn.dim { opacity: 0.5; }

.modal.editor .modal-title { font-size: 16px; }
.modal.editor .ed-steps { padding: 14px 24px; gap: 8px; }
.modal.editor .ed-steps .st { padding: 6px 14px; }
.modal.editor .ed-steps .sep { margin: 0 8px; }
.modal.editor .ed-form { padding: 20px 24px 24px; }
.modal.editor .ed-form label.field, .modal.editor .ed-form .field { margin-bottom: 16px; }
.modal.editor .ed-form .label-text { margin-bottom: 6px; }
.modal.editor .ed-form .field .muted { margin-top: 6px; font-size: var(--font-small); }
.modal.editor .ed-form .editor-section + .editor-section { margin-top: 28px; padding-top: 24px; }
.modal.editor .ed-form .sec-head { margin-bottom: 14px; }
.modal.editor .ed-form input[type=text], .modal.editor .ed-form input[type=number], .modal.editor .ed-form input[type=url],
.modal.editor .ed-form select, .modal.editor .ed-form input[type=date] { min-height: 36px; }
.modal.editor .ed-form .form-grid { gap: 0 16px; }
.modal.editor .ed-form .segmented .seg { padding: 5px 14px; }

.opt-block { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.opt-block > * + * { margin-top: 8px; }
.opt-block input { background: var(--bg-elevated); }
.opt-block .ob-row { display: flex; gap: 8px; align-items: center; }
.opt-block .ob-toggle { display: flex; gap: 8px; align-items: center; font-size: var(--font-small); color: var(--text-secondary); }
.opt-add { width: 100%; border: 1px dashed var(--border-strong); background: none; border-radius: 10px; min-height: 40px;
  color: var(--text-secondary); font-size: var(--font-small); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.opt-add:hover { border-color: var(--primary); color: var(--primary); }

.chat-mock .bubble-prompt { font-weight: 600; margin-top: 4px; }
.tc-b .bubble-prompt { font-weight: 600; margin-top: 4px; }

.blt-row { display: grid; grid-template-columns: 88px 1fr 44px 42px; gap: 8px; align-items: center; margin: 5px 0; }
.blt-label { font-size: var(--font-small); color: var(--text-secondary); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blt-track { position: relative; height: 14px; }
.blt-base { position: absolute; inset: 0 auto 0 0; background: var(--primary-weak); border-radius: 0 3px 3px 0; }
.blt-fill { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 0 3px 3px 0; }
.blt-val { font-size: var(--font-caption); color: var(--text-muted); text-align: right; }
.blt-rate { font-size: var(--font-small); font-weight: 600; text-align: right; }
.blt-rate.warn { color: var(--danger); }

.alpha-ticks { display: flex; justify-content: space-between; font-size: var(--font-caption); color: var(--text-muted); padding: 0 2px; }

.bf-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.bf-row + .bf-row { border-top: 1px solid var(--border); }
.bf-row .bf-main { min-width: 200px; }
.bf-row .bf-prog { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.route-cot { margin-top: 8px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: var(--font-small); }
.route-cot .rc-title { font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; font-size: var(--font-caption); }
.route-cot .rc-row { display: flex; gap: 8px; padding: 2px 0; align-items: baseline; }
.route-cot .rc-k { flex: none; width: 32px; color: var(--text-muted); font-size: var(--font-caption); }
.route-cot .rc-v { color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; }

.dr-pop { padding: 12px; width: 260px; }
.dr-pop .dr-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dr-pop .dr-row .muted { flex: none; width: 28px; font-size: var(--font-caption); }
.dr-pop .dr-chips { display: flex; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.dr-pop .dr-chips .btn { flex: 1; }

.editor-inline .modal.editor {
  width: 100%; max-width: none; height: auto; min-height: calc(100vh - 120px); max-height: none;
  box-shadow: none; border: 1px solid var(--border); border-radius: var(--radius-card);
  overflow: visible; 
}
.editor-inline .modal.editor .ed-form { overflow: visible; }
.editor-inline .modal.editor .ed-preview { overflow: visible; position: sticky; top: 112px; align-self: start; }
.editor-inline .modal.editor .modal-foot { position: sticky; bottom: 0; z-index: 5; border-radius: 0 0 var(--radius-card) var(--radius-card); }

.v-sep { width: 1px; height: 18px; background: var(--border); flex: none; }

.scene-expand td { background: var(--bg-surface); }
.scene-expand textarea { flex: 1; }

.tc-pick { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop .pop-group { font-size: var(--font-caption); color: var(--text-muted); padding: 8px 12px 3px; font-weight: 600; }
.agg-badge { margin-top: 8px; }
.agg-badge details { margin-top: 6px; }
.agg-cand { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-top: 6px; font-size: var(--font-small); }
.agg-cand .muted { margin-bottom: 3px; }

.fsel .fsel-caret { color: var(--text-muted); display: inline-flex; margin-left: 2px; flex: none; }

.tc-pick { max-width: 230px; }

@keyframes popIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.scene-del { opacity: 0; transition: opacity var(--dur-fast); width: 22px; height: 22px; }
tr:hover .scene-del { opacity: 1; }

.tc-page { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 420px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.tc-pagebody { flex: 1; overflow-y: auto; padding: 20px 22px; }
.tc-pagefoot { border-top: 1px solid var(--border); padding: 12px 16px; background: var(--bg-elevated); }
.tc-pagefoot .tc-composer { margin: 0; }

.card-flash { animation: cardFlash 2.6s ease-out; }
@keyframes cardFlash { 0%, 55% { box-shadow: 0 0 0 2px var(--primary), var(--shadow-popover); } 100% { box-shadow: none; } }

.comp .gs-body { min-height: 110px; }
.comp .gs-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.2px; }
.comp .gs-text { font-size: var(--font-base); color: var(--text-secondary); line-height: 1.9; }
.comp .gs-foot { display: flex; align-items: center; gap: 7px; margin-top: 16px; }
.comp .gs-dot { width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--bg-surface);
  color: var(--text-secondary); font-size: var(--font-small); font-weight: 600; cursor: pointer; flex: none;
  transition: background var(--dur-fast); }
.comp .gs-dot:hover:not(:disabled) { background: var(--bg-sunken); }
.comp .gs-dot.on { background: var(--primary-weak); color: var(--primary); }
.comp .gs-foot .btn.small { height: 32px; padding: 0 16px; }

.modal.editor .ed-form .field-row, .modal.editor .ed-form .seg-row { margin-bottom: 16px; }
.modal.editor .ed-form select + .muted { margin-top: 6px; }

.opt-block > .ob-row:first-child input { font-weight: 600; }
.opt-block input::placeholder, .opt-block textarea::placeholder { color: var(--text-muted); opacity: 0.8; }

.policy-card { transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.policy-card.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.wl-box { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 12px; background: var(--bg-surface); border-radius: 12px; }
.wl-item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-base); cursor: pointer; }

.tc-guide { max-width: 560px; margin: 28px auto 0; text-align: center; }
.tc-guide .tg-title { font-weight: 700; font-size: var(--font-title); margin-bottom: 6px; }
.tc-guide .tg-sub { font-size: var(--font-small); color: var(--text-muted); margin-bottom: 18px; line-height: 1.7; }
.tc-guide .tg-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
@media (max-width: 720px) { .tc-guide .tg-chips { grid-template-columns: 1fr; } }
.tc-guide .tg-chip { border: 1px solid transparent; background: var(--primary-weak); border-radius: 14px;
  border-bottom-right-radius: 4px; padding: 11px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast); text-align: left; }
.tc-guide .tg-chip:hover { border-color: var(--primary-border); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.tc-guide .tg-q { font-size: var(--font-base); font-weight: 600; color: var(--text-primary); }
.tc-guide .tg-l { font-size: var(--font-caption); color: var(--text-secondary); }

.rs-bars { margin: 4px 0 6px 18px; display: flex; flex-direction: column; gap: 3px; }
.rs-row { display: flex; align-items: center; gap: 8px; }
.rs-m { flex: none; width: 88px; font-size: var(--font-caption); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-track { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; position: relative; }
.rs-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--border-strong); }
.rs-fill.on { background: var(--primary); }
.rs-v { flex: none; width: 34px; text-align: right; font-size: var(--font-caption); color: var(--text-secondary); }

.brand-card.draft-card { border-style: dashed; opacity: 0.85; }

.judge-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: 12px; color: var(--text-primary); }
.judge-bar > .ico { color: var(--primary); flex: none; }
.judge-bar.missing { background: var(--bg-elevated); border-left-color: var(--danger); }
.judge-bar.missing > .ico { color: var(--danger); }
.policy-card.grayed { opacity: 0.55; }

table.data thead th { position: sticky; top: 0; background: var(--bg-elevated); z-index: 5; }

details.explain > summary { padding: 2px 0; }
details.explain .explain-body { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
details.explain .explain-body p { margin: 0 0 8px; font-size: var(--font-base); color: var(--text-secondary); line-height: 1.8; }

.tc-modebar { display: flex; align-items: center; gap: 10px; padding: 0 2px 10px; }
.tc-modebar .segmented { flex-wrap: nowrap; }

.echo-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.echo-item:hover { background: var(--bg-surface); }
.echo-item:last-child { border-bottom: none; }

.directions-panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 16px 18px; margin-top: 2px; }
.directions-panel .directions-table { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 4px 8px; }

.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); text-decoration: none;
  font-size: var(--font-base); font-weight: 600; padding: 4px 8px 4px 4px; border-radius: 8px; }
.back-link:hover { color: var(--primary); background: var(--bg-sunken); }
.back-link .ico { transform: rotate(180deg); }

.policy-form .field { margin-bottom: 24px; }
.policy-form .drawer-meta { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 24px;
  background: var(--bg-sunken); border-radius: 10px; font-size: var(--font-caption); color: var(--text-secondary); }

.tagsel-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tagsel-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 8px;
  background: var(--primary-weak); color: var(--primary); font-size: var(--font-caption); font-weight: 600; }
.tagsel-tag button { border: 0; background: none; cursor: pointer; color: inherit; opacity: .7; padding: 0 2px; font-size: 14px; line-height: 1; }
.tagsel-tag button:hover { opacity: 1; }

.btn.iconic { padding: 6px 8px; }

.dr-chips { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; display: flex; gap: 4px; }
.dr-quick { border: 0; background: none; cursor: pointer; color: var(--text-secondary); font-size: var(--font-small);
  font-weight: 600; padding: 4px 8px; border-radius: 8px; }
.dr-quick:hover { color: var(--primary); background: var(--bg-sunken); }
.link-hover:hover { color: var(--primary) !important; }

.btn.danger-text { color: var(--text-secondary); }
.btn.danger-text:hover { color: var(--danger); border-color: var(--danger); }

.judge-bar { background: var(--primary-weak); border: 1px solid var(--primary-border); border-left: 3px solid var(--primary); }
.judge-bar.missing { background: var(--danger-bg); border-color: var(--danger); border-left-color: var(--danger); }

.duo-sel { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--bg-elevated); overflow: hidden; }
.duo-sel .fsel { border: none; border-radius: 0; background: none; box-shadow: none; }
.duo-sel .duo-div { width: 1px; background: var(--border); }
.duo-sel .duo-static { display: inline-flex; align-items: center; padding: 0 14px; color: var(--text-secondary); font-size: var(--font-small); font-weight: 600; }

.brand-card.add-card { border-style: dashed; color: var(--text-secondary); background: none; }
.brand-card.add-card .bname { color: var(--text-secondary); }
.brand-card.add-card:hover { border-color: var(--primary); color: var(--primary); }
.brand-card.add-card:hover .bname { color: var(--primary); }

.mini-metrics.duo { grid-template-columns: repeat(2, 1fr); margin: 0; }
.mini-metric .mm-sub { font-size: var(--font-caption); color: var(--text-muted); margin-top: 2px; }
.mini-metric .mm-label .help { margin-left: 2px; }

.prod-group-head { display: flex; align-items: center; gap: 10px; padding: 14px 4px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.prod-group-head:first-child { padding-top: 4px; }
.prod-group-head .pg-name { font-weight: 700; font-size: var(--font-base); }
.prod-group-head .pg-name.muted-name { color: var(--text-secondary); }

.cross-link { display: inline-block; margin-top: 22px; color: var(--text-muted); text-decoration: none; font-size: var(--font-small); }
.cross-link:hover { color: var(--primary); }

.tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 5px 10px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-control); cursor: text; }
.tagbox:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.tagbox .tagbox-in { flex: 1; min-width: 90px; border: none; outline: none; background: none; padding: 4px 2px;
  font-size: var(--font-base); color: var(--text-primary); box-shadow: none; }

.pp-card { margin-bottom: 8px; padding: 12px 16px; }
.pp-head { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-wrap: wrap; }
.pp-name { font-weight: 700; font-size: var(--font-base); width: 150px; flex: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-chev { color: var(--text-muted); display: inline-flex; transition: transform var(--dur-fast, .15s); }
.pp-chev.open { transform: rotate(180deg); }
.pp-prog { width: 140px; height: 5px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.pp-prog-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width .4s; }
.pp-body { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }

.sw-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.sw.on { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--bg-elevated), inset 0 0 0 1px rgba(0,0,0,.06); }
.style-ed .label-text { display: block; margin-bottom: 6px; }
.style-ed .field { margin-bottom: 16px; }

.key-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-sunken); color: var(--text-secondary);
  font-size: var(--font-caption); cursor: pointer; }
.key-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }

table.data thead th { text-align: left; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
table.data td { vertical-align: middle; }
table.data th.w-main, table.data td.w-main { width: 99%; }
table.data td { white-space: nowrap; }
table.data td.w-main { white-space: normal; }

.pp-head .btn.ghost.active .ico { transform: rotate(180deg); }
.pp-head .btn.ghost .ico { transition: transform var(--dur-fast, .15s); }

.btn.iconic.round { width: 32px; height: 32px; border-radius: 999px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; }

.form-sec { font-size: var(--font-caption); font-weight: 700; letter-spacing: 1.5px; color: var(--text-muted);
  margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.form-sec:first-of-type { margin-top: 4px; border-top: none; padding-top: 0; }

.brand-scope { font-weight: var(--font-weight-base, 400); }

.pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pal-card { border: 2px solid var(--border); border-radius: 12px; padding: 8px 10px; cursor: pointer; background: var(--bg-elevated); text-align: left; }
.pal-card:hover { border-color: var(--primary-border); }
.pal-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.pal-card .pal-name { font-size: var(--font-caption); font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.pal-card .pal-row { display: flex; gap: 4px; }
.pal-card .pal-row i { flex: 1; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }

.rad-row { display: flex; align-items: center; gap: 10px; }
.rad-row input[type=range] { flex: 1; }
.rad-row .rad-lab { flex: none; min-width: 44px; text-align: right; font-weight: 600; font-size: var(--font-small); }

details.route-cot > summary.rc-title { cursor: pointer; list-style: none; }
details.route-cot > summary.rc-title::before { content: ""; display: inline-block; width: 0; height: 0;
  border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  margin-right: 6px; transition: transform var(--dur-fast, .15s); vertical-align: 1px; }
details.route-cot[open] > summary.rc-title::before { transform: rotate(90deg); }
.ans-tags { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.pal-card.dark { background: #19222E; border-color: #2B3948; }
.pal-card.dark .pal-name { color: #F2F6FA; }
.pal-card.dark.on { border-color: var(--primary); }

.rad-track-wrap { position: relative; flex: 1; }
.rad-ticks { position: absolute; left: 8px; right: 8px; top: 100%; margin-top: 2px; display: flex; justify-content: space-between; pointer-events: none; }
.rad-ticks span { width: 2px; height: 5px; border-radius: 1px; background: var(--border-strong, #C7D3DC); }

.fs-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.fs-card { width: 56px; border: 2px solid var(--border); border-radius: 10px; background: var(--bg-elevated);
  padding: 7px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; overflow: hidden; }
.fs-card:hover { border-color: var(--primary-border); }
.fs-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.fs-card .fs-demo { color: var(--text-primary); line-height: 1.2; font-size: 15px; white-space: nowrap; }
.fs-card .fs-name { font-size: var(--font-caption); color: var(--text-muted); white-space: nowrap; }

[hidden] { display: none !important; }

.form-loose label.field, .form-loose .field { margin-bottom: 18px; }

.sty-section { margin-bottom: 18px; }
.sty-label { font-size: var(--font-small); color: var(--text-secondary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.sty-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sty-swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0; position: relative; }
.sty-swatch.on { border-color: var(--text-primary); box-shadow: 0 0 0 2px #fff inset; }
.sty-swatch.brand { background: repeating-conic-gradient(var(--border) 0 25%, #fff 0 50%) 50%/10px 10px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text-secondary); }
.sty-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.sty-card { border: 1.5px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; padding: 10px 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 74px; }
.sty-card:hover { border-color: var(--text-secondary); }
.sty-card.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-weak); }
.sty-card .demo { display: flex; align-items: center; justify-content: center; height: 34px; }
.sty-card .nm { font-size: var(--font-caption); color: var(--text-secondary); }
.sty-card.on .nm { color: var(--primary); font-weight: 600; }
.sty-radius-demo { width: 30px; height: 22px; border: 2px solid var(--text-secondary); border-bottom: none; border-right: none; }
.sty-h-demo { background: var(--primary); border-radius: 6px; width: 40px; }
.sty-shadow-demo { width: 36px; height: 24px; border-radius: 6px; background: #fff; border: 1px solid var(--border); }
.sty-density-demo { display: flex; flex-direction: column; gap: var(--sd-gap, 3px); width: 36px; }
.sty-density-demo i { display: block; height: 4px; border-radius: 2px; background: var(--border); }
.sty-inherit { display: flex; align-items: center; gap: 8px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: var(--font-small); color: var(--text-secondary); }

.np-btn { display: flex; align-items: center; gap: 9px; width: 100%; margin: 0 0 2px;
  padding: 7px 10px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; transition: background var(--dur-fast); text-align: left; }
.np-btn:hover { background: var(--bg-elevated); }
.np-btn .fsel-caret { color: var(--text-muted); }
.np-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px;
  width: 34px; height: 34px; color: #fff; font-weight: 700; font-size: 13px; flex: none; }

.np-pop .np-card.np-new { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.np-pop .np-card.np-new .np-avatar { background: var(--primary-weak); color: var(--primary);
  border: 1px dashed var(--primary-border, var(--primary)); }
.np-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.np-name { font-weight: 700; font-size: var(--font-base); color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-sub { font-size: 11px; color: var(--text-muted); }
.np-pop { padding: 6px; border-radius: 12px; }
.np-item { display: flex; align-items: center; gap: 10px; border-radius: 9px; padding: 8px 10px; }
.np-item.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }

.comp .fb-pair, .brand-scope .fb-pair { display: inline-flex; gap: 6px; }
.fb-btn { border: 1.5px solid var(--border); background: var(--bg-elevated); border-radius: 999px;
  padding: 5px 16px; font-size: var(--font-small); cursor: pointer; color: var(--text-secondary);
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast); }
.fb-btn:hover { border-color: var(--primary); color: var(--primary); }
.fb-btn.down:hover { border-color: var(--danger); color: var(--danger); }
.fb-btn:active { transform: scale(.96); }
.fb-btn.on { background: var(--primary-weak); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.fb-btn.down.on { background: color-mix(in srgb, var(--danger) 10%, #fff); border-color: var(--danger); color: var(--danger); }
.fb-btn:disabled:not(.on) { opacity: .45; cursor: default; }

.comp table.data tbody tr:nth-child(even) { background: var(--bg-surface); }
.comp table.data tbody tr:hover { background: var(--primary-weak); }
.comp table.data td:first-child { font-weight: 600; }

.np-pop { padding: 8px; border-radius: 14px; min-width: 240px; box-shadow: 0 12px 32px rgba(15, 27, 38, .16), 0 2px 8px rgba(15, 27, 38, .08); }
.np-pop-head { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .06em;
  color: var(--text-muted); padding: 4px 8px 8px; }
.np-pop-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.np-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; background: transparent;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast); }
.np-card:hover { background: var(--bg-surface); transform: translateX(2px); }
.np-card.on { border-color: var(--primary); background: var(--primary-weak); }
.np-card-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.np-card-name { font-weight: 700; font-size: var(--font-base); color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-card-sub { font-size: 11px; color: var(--text-muted); }
.np-card-check { color: var(--primary); display: inline-flex; }

.schema-pre { background: var(--bg-sunken, var(--bg-surface)); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin: 0; font-size: 12px; line-height: 1.55;
  overflow-x: auto; max-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.comp .steps-row { display: flex; margin-top: 4px; }
.comp .step-cell { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.comp .step-track { display: flex; align-items: center; width: 100%; }
.comp .step-line { flex: 1; height: 2px; background: var(--border); }
.comp .step-line.fill { background: var(--primary); }
.comp .step-line.ghost { visibility: hidden; }
.comp .step-node {
  width: 26px; height: 26px; border-radius: 50%; flex: none; margin: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--border-strong); color: var(--text-muted); background: var(--bg-elevated);
}
.comp .step-node.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.comp .step-node.cur {
  border-color: var(--primary); color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-weak);
}
.comp .step-label { font-size: var(--font-caption); color: var(--text-muted); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.comp .step-label.cur { color: var(--text-primary); font-weight: 600; }
.comp .step-label.done { color: var(--text-secondary); }

.comp .tl-list { margin-top: 2px; }
.comp .tl-row { display: flex; gap: 10px; }
.comp .tl-ts { min-width: 44px; text-align: right; color: var(--text-muted);
  font-size: var(--font-caption); font-variant-numeric: tabular-nums; padding-top: 2px; }
.comp .tl-rail { display: flex; flex-direction: column; align-items: center; width: 14px; flex: none; }
.comp .tl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px;
  border: 2px solid var(--primary); background: var(--bg-elevated); }
.comp .tl-dot.now { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.comp .tl-line { width: 2px; flex: 1; background: var(--border); margin: 3px 0; min-height: 10px; }
.comp .tl-body { flex: 1; min-width: 0; padding-bottom: 12px; }
.comp .tl-row:last-child .tl-body { padding-bottom: 2px; }
.comp .tl-title { font-weight: 600; line-height: 1.45; }
.comp .tl-title.now { color: var(--accent-ink, var(--primary)); }

.comp .metric-value { font-size: 30px; font-weight: 700; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; line-height: 1.15; }
.comp .delta-chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px;
  font-size: var(--font-caption); font-weight: 600; font-variant-numeric: tabular-nums;
}
.comp .delta-chip.up { color: var(--success); background: color-mix(in srgb, var(--success) 11%, transparent); }
.comp .delta-chip.down { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

.comp .fb-cands, .fb-cands { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.fb-cand {
  border: 1.5px solid var(--border); border-radius: var(--radius-control, 10px);
  padding: 10px 12px; cursor: pointer; background: var(--bg-elevated);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.fb-cand:hover { border-color: var(--primary); box-shadow: 0 1px 6px color-mix(in srgb, var(--primary) 14%, transparent); }
.fb-cand.on { border-color: var(--primary); background: var(--primary-weak); }
.fb-cand.settled:not(.on) { opacity: .55; }
.fb-cand-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fb-cand-check { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; background: var(--primary);
  opacity: 0; transform: scale(.6); transition: opacity var(--dur-fast), transform var(--dur-fast); }
.fb-cand.on .fb-cand-check { opacity: 1; transform: scale(1); }
.fb-cand-body { font-size: var(--font-small); color: var(--text-secondary); line-height: 1.6; }

.comp table.data th.num-col, .comp table.data td.num-col { text-align: right; }
.comp table.data td.num-col { font-variant-numeric: tabular-nums; }

.comp input[type=text], .comp input[type=number], .comp textarea, .comp select {
  background: var(--bg-elevated); border: 1.5px solid var(--border);
}
.comp input:focus, .comp textarea:focus, .comp select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.fb-btn svg { display: block; }
.fb-btn { display: inline-flex; align-items: center; gap: 5px; }
.fb-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.fb-btn.down:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.fb-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fb-btn.down.on { background: var(--danger); border-color: var(--danger); }

.tok-group summary { display: flex; align-items: center; gap: 8px; }
.tok-group summary::-webkit-details-marker { display: none; }
.tok-group summary::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; flex: none;
  transition: transform var(--dur-fast, .15s); }
.tok-group[open] summary::before { transform: rotate(90deg); }
.tok-sum-sw { display: inline-flex; gap: 4px; margin-left: auto; }
.tok-sum-sw i { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }

.fs-card .rad-demo { width: 26px; height: 22px; border: 2px solid var(--text-secondary); border-bottom: none;
  border-right: none; background: transparent; display: block; margin: 2px 0 1px;
  border-top-left-radius: inherit; }

.np-btn .np-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--font-base); }

.sdk-sec { margin-bottom: 10px; }
.sdk-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sdk-sec-title { font-weight: 600; font-size: var(--font-small); white-space: nowrap; flex: none; }
.sdk-code { margin: 0; background: var(--bg-sunken, var(--bg-surface)); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; font-size: 12px; line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }

.sl-row { display: flex; align-items: center; gap: 10px; }
.sl-wrap { position: relative; flex: 1; padding: 4px 0 10px; }
.sl-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--fill, 0%), var(--border) var(--fill, 0%), var(--border) 100%);
  outline: none; margin: 0; display: block; }
.sl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary); box-shadow: 0 1px 4px rgba(15,27,38,.18); cursor: grab; }
.sl-range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.08); }
.sl-stops { position: absolute; left: 9px; right: 9px; top: 100%; margin-top: -8px; height: 10px; pointer-events: none; }
.sl-stop { position: absolute; transform: translateX(-50%); width: 10px; height: 10px; padding: 0; border: none;
  border-radius: 50%; background: transparent; cursor: pointer; pointer-events: auto; }
.sl-stop::after { content: ""; display: block; width: 3px; height: 6px; border-radius: 2px;
  background: var(--border-strong, #C7D3DC); margin: 2px auto 0; }
.sl-stop:hover::after { background: var(--primary); }
.sl-lab { flex: none; min-width: 40px; text-align: right; font-weight: 600; font-size: var(--font-small); }
.sl-row input.sl-num[type=number] { width: 60px; flex: none; text-align: right; padding: 4px 8px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); }
::-webkit-scrollbar-track { background: transparent; }

.sl-range.unset { opacity: .45; }
.sl-range.unset::-webkit-slider-thumb { border-color: var(--border-strong); }

.card-row .cr-check { display: flex; align-items: center; padding: 0 2px 0 0; cursor: pointer;
  align-self: flex-start; margin-top: 3px; }
.card-row .cr-check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.batch-bar { position: fixed; left: calc(50% + var(--side-w) / 2); transform: translateX(-50%); bottom: 26px; z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, .16); }

.key-chip.static { cursor: default; }
.key-chip.static:hover { border-color: var(--border); background: var(--bg-elevated); color: inherit; }

.ed-note { margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: var(--font-small); line-height: 1.7; }

input.invalid, textarea.invalid { border-color: var(--danger); }
input.invalid:focus, textarea.invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }

.sty-inherit-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-caption); }
.sty-inherit-tag .toggle { margin-left: 2px; }
.sty-section:has(.sty-inherit-tag:not(.is-custom)) .sty-swatches { opacity: .62; }

.comp [data-opt].has-echo { position: relative; }
.comp .opt-item.has-echo { flex-wrap: wrap; padding-bottom: 8px; }
.comp .opt-echo { display: flex; align-items: center; gap: 8px; width: 100%;
  margin-top: 6px; flex: 0 0 100%; }
.comp .opt-card .opt-echo { margin-top: auto; padding-top: 6px; }
.comp .oe-track { flex: 1; height: 4px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.comp .oe-fill { display: block; height: 100%; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 40%, var(--bg-sunken)); }
.comp .echo-own .oe-fill { background: var(--primary); }
.comp .oe-pct { flex: none; font-size: var(--font-caption); color: var(--text-muted);
  min-width: 34px; text-align: right; }
.comp .echo-own .oe-pct { color: var(--primary); font-weight: 600; }
.comp .btn.opt.has-echo { display: inline-flex; flex-direction: column; align-items: stretch; gap: 2px; }

.comp .fb-btn.has-echo { flex-direction: column; height: auto; padding: 5px 12px; gap: 1px; }
.comp .fb-btn .opt-echo { margin-top: 0; width: auto; }
.comp .fb-btn .oe-track { display: none; }
.comp .fb-btn .oe-pct { min-width: 0; font-size: 11px; }

.comp table.mx-table.mx-striped tbody tr:nth-child(even) { background: var(--bg-surface); }

.demo-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  grid-auto-rows: minmax(300px, auto); align-items: start; }
.demo-grid2 > .demo-cell { align-self: start; }

.dark-map { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
  margin-top: 4px; padding: 10px 12px; border: 1px dashed var(--border);
  border-radius: 10px; background: var(--bg-surface); }
.dark-map-txt { flex: 1; min-width: 0; }
.dark-map-t { font-size: var(--font-small); font-weight: 600; color: var(--text-primary); }
.dark-map-d { font-size: var(--font-caption); color: var(--text-muted); margin-top: 2px; }

.sh-custom { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.sh-custom summary { cursor: pointer; padding: 8px 12px; font-size: var(--font-small); color: var(--text-secondary); font-weight: 600; user-select: none; }
.sh-custom[open] summary { border-bottom: 1px solid var(--border); }
.sh-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 12px; align-items: end; }
.sh-field { display: flex; flex-direction: column; gap: 5px; font-size: var(--font-caption); color: var(--text-muted); min-width: 0; }
.sh-field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-field input.sh-num[type=number] { width: 100%; padding: 5px 8px; text-align: left; }
@media (max-width: 1100px) { .sh-grid { grid-template-columns: repeat(3, 1fr); } }

.comp .confirm-ico { width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger);
  display: inline-flex; align-items: center; justify-content: center; }
.comp .confirm-title { font-weight: 600; font-size: var(--font-base); line-height: 1.5; }
.comp .confirm-note { margin-top: 8px; background: var(--bg-surface); border-radius: 8px;
  padding: 8px 12px; font-size: var(--font-small); color: var(--text-secondary); line-height: 1.6; }
.comp .btn.confirm-danger { background: var(--danger); border-color: var(--danger);
  color: var(--on-danger, #fff); }
.comp .btn.confirm-danger:hover:not(:disabled) { filter: brightness(.93); background: var(--danger); }

.comp .opt-item { border-width: 1px; }
.comp .opt-item.on { border-width: 1.5px; }

.sidenav .np-context { margin: 2px 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--border); }

.sty-group { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: var(--font-base);
  margin: 22px 0 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.sty-group:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.sty-bool { display: flex; align-items: center; gap: 8px; font-size: var(--font-base); cursor: pointer; margin: 8px 0; }
.sty-bool input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

.comp.sel-outline .opt-item.on { background: transparent; box-shadow: inset 0 0 0 1px var(--primary); }
.comp.sel-outline .fb-cand.on { background: transparent; box-shadow: inset 0 0 0 1px var(--primary); }

.comp.no-rec .rec-chip { display: none; }

.comp table.no-striped tbody tr { background: transparent !important; }
.comp table.hdr-normal th { font-weight: 400; background: transparent; }
.comp table.tbl-outline { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }

.comp .btn.primary.submitting { opacity: .75; }
.comp .btn.primary.submitted { background: var(--success); border-color: var(--success); color: #fff; }

.comp .btn.primary.submitted:disabled { opacity: 1; }
.comp .btn.primary.submit-fail { background: var(--danger); border-color: var(--danger); }

.lib-group { font-weight: 700; font-size: var(--font-base); margin: 20px 0 10px; }
.lib-group:first-of-type { margin-top: 4px; }

.quick-colors { display: flex; gap: 14px; flex-wrap: wrap; }
.quick-color { display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: var(--font-caption); color: var(--text-secondary); cursor: pointer; }
.quick-color .tok-chip { width: 40px; height: 40px; border-radius: 10px; }
.tok-desc { flex: 1; font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.comp .opt-list { display: flex; flex-direction: column; gap: var(--opt-gap, 8px); }
.comp .fb-cands, .fb-cands { gap: var(--cand-gap, 8px); }
.comp .ol-list { display: flex; flex-direction: column; gap: var(--list-gap, 8px); margin-top: 2px; }
.comp .ol-row { display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; }
.comp .ol-marker { width: 20px; height: 20px; border-radius: 50%; flex: none; font-size: 11px;
  background: color-mix(in srgb, var(--mk-color, var(--accent-ink, var(--primary))) 10%, transparent);
  color: var(--mk-color, var(--accent-ink, var(--primary))); display: inline-flex; align-items: center; justify-content: center; }
.comp .ol-dotmark { display: none; width: 6px; height: 6px; border-radius: 50%; flex: none; margin-top: 7px;
  background: var(--mk-color, var(--primary)); }
.comp.mk-dot .ol-marker { display: none; }
.comp.mk-dot .ol-dotmark { display: inline-block; }
.comp.mk-none .ol-marker, .comp.mk-none .ol-dotmark { display: none; }

.comp.no-optborder .opt-item { border-color: transparent; background: var(--bg-surface); }
.comp.no-optborder .opt-item.on { border-color: var(--primary); }

.comp.fb-square .fb-btn { border-radius: var(--radius-control, 10px); }

.comp.no-cicon .confirm-ico { display: none; }
.comp.btn-stretch .btn.confirm-danger, .comp.btn-stretch .btn.confirm-danger + .btn,
.comp.btn-stretch [class*="confirm"] ~ div .btn { flex: 1; }
.comp.btn-stretch > div:last-child { display: flex; }
.comp.btn-stretch > div:last-child .btn { flex: 1; }

.comp .step-node { width: var(--stp-node, 26px); height: var(--stp-node, 26px); }
.comp .step-node.cur { background: var(--primary); color: var(--on-primary, #fff); border-color: var(--primary); }
.comp .step-node.done { background: var(--stp-done, var(--primary)); border-color: var(--stp-done, var(--primary));
  color: var(--on-stp-done, var(--on-primary, #fff)); }
.comp .step-line { height: var(--stp-line, 2px); }
.comp .step-line.fill { background: var(--stp-done, var(--primary)); }
.comp.no-halo .step-node.cur { box-shadow: none; }

.comp .tl-dot { border-color: var(--tl-dot, var(--primary)); }
.comp .tl-dot.now { background: var(--tl-dot, var(--primary)); }
.comp.tl-square .tl-dot { border-radius: 3px; }
.comp.tl-dashed .tl-line { background: none; border-left: 2px dashed var(--border); width: 0; }
.comp.no-ts .tl-ts { display: none; }
.comp.no-desc .tl-body .muted { display: none; }

.comp.no-delta .delta-chip { display: none; }
.comp.no-baseline .metric-baseline { display: none; }
.comp.no-caption .hl-caption { display: none; }
.comp.no-tone .hl-value { color: var(--text-primary) !important; }

.comp table.data th { background: var(--th-bg, transparent); }
.comp.div-none table.data td { border-bottom: none; }
.comp.div-all table.data td { border: 1px solid var(--border); }
.comp.div-all table.data th { border: 1px solid var(--border); }

.comp.no-sum .mx-sum { display: none; }
.comp.no-best .mx-sum.best { color: inherit; font-weight: inherit; }

.comp .pie-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px;
  justify-content: var(--chart-align, flex-start); }

.comp[style*="--chart-title-align"] > .comp-title { text-align: var(--chart-title-align, inherit); }
.comp .pie-lg { display: inline-flex; align-items: center; gap: 5px; font-size: var(--font-small); }
.comp .pie-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.comp .pie-lb { color: var(--text-secondary); }

.comp .pie-pct { color: var(--text-primary); font-weight: 600; margin-left: 2px; }
.comp.no-legend .pie-legend { display: none; }
.comp.no-legendpct .pie-pct { display: none; }

.comp .chart-frame, .comp svg { display: block; margin-left: var(--chart-ml, 0); }

.comp.no-quick .dt-quick { display: none; }

.comp.rank-square .rank-no, .comp.rank-square .ol-marker { border-radius: 5px; }
.comp.no-handle .rank-handle, .comp.no-handle [class*="drag"] { display: none; }

.comp input[type=range] { height: var(--track-h, 6px); }
.comp input[type=range]::-webkit-slider-thumb { width: var(--thumb-s, 18px); height: var(--thumb-s, 18px); }
.comp .likert-dots button, .comp .lk-dot,
.comp .btn.opt.likert { width: var(--lk-size, 34px); height: var(--lk-size, 34px); min-width: var(--lk-size, 34px); }
.comp .likert-dots, .comp .likert-row { gap: var(--lk-gap, 6px); }

.comp input[type=text], .comp input[type=number], .comp textarea { background: var(--input-bg, var(--bg-elevated)); }

.fx-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.echo-demo { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.echo-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: var(--font-small); }
.echo-name { width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.echo-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-surface); overflow: hidden; }
.echo-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.echo-pct { width: 40px; text-align: right; color: var(--text-muted); font-size: var(--font-caption); }

.comp .opt-item { border-radius: var(--opt-radius, var(--radius-control, 10px)); gap: 10px; }
.comp.no-radio .sel-dot { display: none; }
.comp.metric-center { text-align: center; }
.comp.metric-center > div { justify-content: center; }
.comp.delta-invert .delta-chip.up { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.comp.delta-invert .delta-chip.down { color: var(--success); background: color-mix(in srgb, var(--success) 11%, transparent); }
.comp table.data { font-size: var(--tbl-font, 0.93em); }
.comp.col-left table.data th.num-col, .comp.col-left table.data td.num-col { text-align: left; font-variant-numeric: normal; }
.comp .tl-line { background: var(--tl-line-c, var(--border)); }
.comp.tl-dashed .tl-line { border-left-color: var(--tl-line-c, var(--border)); }
.comp.no-stepnum .step-node { color: transparent; }
.comp.no-stepnum .step-node.done { color: #fff; }
.comp .step-label { font-size: var(--stp-label, var(--font-caption)); }
.comp.txt-center { text-align: center; }
.comp.txt-center .ol-row { justify-content: center; }
.comp .confirm-ico { color: var(--cicon-c, var(--danger)); background: color-mix(in srgb, var(--cicon-c, var(--danger)) 11%, transparent); }

.adv-colors { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); }
.adv-colors > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: var(--font-small);
  color: var(--text-secondary); user-select: none; display: flex; align-items: center; gap: 8px; }
.adv-colors > summary::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform var(--dur-fast); }
.adv-colors[open] > summary::before { transform: rotate(90deg); }
.adv-colors[open] > summary { border-bottom: 1px solid var(--border); }
.adv-colors > div { padding: 10px 12px 12px; }

.sty-adv { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); margin-top: 8px; }
.sty-adv > summary { cursor: pointer; padding: 9px 12px; font-size: var(--font-small); font-weight: 600;
  color: var(--text-secondary); user-select: none; }
.sty-adv[open] > summary { border-bottom: 1px solid var(--border); }
.sty-adv > div { padding: 4px 12px 10px; }

.cm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cm-card { border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg-elevated);
  padding: 12px 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.cm-card:hover { border-color: var(--primary-border); }
.cm-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.cm-card .cm-name { font-weight: 600; font-size: var(--font-base); color: var(--text-primary); }
.cm-card .cm-sub { font-size: var(--font-caption); color: var(--text-muted); line-height: 1.5; }

.cp-pop { width: 232px; padding: 12px; border-radius: 12px; }
.cp-sv { position: relative; width: 100%; height: 140px; border-radius: 8px; cursor: crosshair; margin-bottom: 10px; }
.cp-cursor { position: absolute; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35); transform: translate(-6px, -6px); pointer-events: none; }
.cp-slider { position: relative; height: 12px; border-radius: 999px; cursor: pointer; margin-bottom: 8px; }
.cp-hue { background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-alpha { background: linear-gradient(to right, transparent, var(--cp-c, #3E63DD)),
  repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.cp-knob { position: absolute; top: -2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(0,0,0,.2); box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transform: translateX(-8px); pointer-events: none; }
.cp-inputs { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cp-hex { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12px; text-transform: uppercase; }
.cp-a { width: 52px; padding: 5px 6px; font-size: 12px; text-align: right; }

.ed-split .ed-preview { position: sticky; top: 0; align-self: flex-start; }

.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpl-pick { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; min-height: 76px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg-elevated); cursor: pointer;
  position: relative; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); }
.tpl-pick:hover { border-color: var(--primary-border); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.tpl-pick.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }

.tpl-ico { display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 9px; background: var(--primary-weak); color: var(--primary); }
.tpl-pick .tpl-ico { width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--primary-weak); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.tpl-pick .tpl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tpl-pick .t { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tpl-pick .d { color: var(--text-muted); font-size: var(--font-caption); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sty-group { margin: 26px 0 14px; padding-top: 16px; }
.sty-section { margin-bottom: 18px; }
.sty-label { margin-bottom: 9px; }

.sty-swatches { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.sty-swatch { width: 30px; height: 30px; border-radius: 9px; border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); transition: transform var(--dur-fast), border-color var(--dur-fast); }
.sty-swatch:hover { transform: scale(1.1); }
.sty-swatch.on { border-color: var(--text-primary); box-shadow: inset 0 0 0 2px #fff; }

.sty-swatch.brand { background: transparent; color: var(--text-primary); font-size: 10px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border); display: inline-flex; align-items: center; justify-content: center; }
.sty-swatch.brand.on { box-shadow: inset 0 0 0 1.5px var(--text-primary); }

.sty-swatch.cp-open { background: var(--bg-elevated); color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border);
  display: inline-flex; align-items: center; justify-content: center; }
.sty-swatch.cp-open:hover { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-border); }
.sty-swatch.cp-open::after { display: none; }

.fx-panel { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface);
  padding: 14px 16px 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.fx-panel .field { margin-bottom: 10px; }
.fx-sec { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.fx-sec-t { font-weight: 600; font-size: var(--font-base); }
.fx-sec-d { font-size: var(--font-caption); color: var(--text-muted); }
.fx-echo { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-elevated); padding: 10px 12px; cursor: pointer; margin-top: 2px; }
.fx-echo input { margin-top: 3px; flex: none; }
.fx-echo-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx-echo-t { font-weight: 600; }
.fx-echo-d { font-size: var(--font-caption); color: var(--text-muted); line-height: 1.6; }
.fx-echo:hover { border-color: var(--primary-border); }

.wb-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wb-toolbar .tab-bar { border-bottom: none; }

.ed-preview .pv-narrow .chat-mock { max-width: 320px; margin: 0 auto; }

.comp .rank-arrows { display: inline-flex; gap: 2px; margin-left: auto; }
.comp .rank-arrows .icon-btn { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-elevated); color: var(--text-secondary); padding: 0; }
.comp .rank-arrows .icon-btn:first-child svg { transform: rotate(180deg); }
.comp .rank-arrows .icon-btn:hover:not(:disabled) { color: var(--primary); border-color: var(--primary-border); }
.comp.no-arrows .rank-arrows { display: none; }
.comp .rank-item .rank-drag { margin-left: 6px; }

.comp.steps-vert .steps-row { flex-direction: column; align-items: stretch; gap: 0; }
.comp.steps-vert .step-cell { display: flex; align-items: flex-start; gap: 10px; }
.comp.steps-vert .step-track { flex-direction: column; width: auto; min-width: 24px; }
.comp.steps-vert .step-line { width: 2px; height: 14px; min-width: 0; flex: none; }
.comp.steps-vert .step-label { text-align: left; padding: 3px 0 12px; }

.comp .rec-chip { font-size: 11px; padding: 1px 8px; margin-left: 6px; flex: none; }
.comp.no-rec .rec-chip { display: none; }

.pv-tag { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 11px; color: var(--text-muted);
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.card > .pv-tag { top: 14px; right: 14px; }
.lib-detail-grid .card:first-child { position: relative; }

.pv-demo-note { background: var(--warning-weak, #FCF4E3); border: 1px solid rgba(214, 151, 10, .35);
  color: #8A6104; font-size: var(--font-caption); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; line-height: 1.6; }

.pick-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pick-cat { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border);
  background: var(--bg-elevated); border-radius: 999px; padding: 4px 12px; font-size: var(--font-small);
  color: var(--text-secondary); cursor: pointer; transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast); }
.pick-cat .num { font-size: 11px; color: var(--text-muted); }
.pick-cat:hover { border-color: var(--primary-border); color: var(--text-primary); }
.pick-cat.on { background: var(--primary-weak); border-color: var(--primary-border); color: var(--primary); font-weight: 600; }
.pick-cat.on .num { color: var(--primary); }

.page-head { position: sticky; top: 0; z-index: 40; background: var(--bg-page); padding: 10px 0 12px; margin-top: -10px; }

.ed-sticky-head { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated); box-shadow: 0 1px 0 var(--border);
  
  margin: 0 calc(var(--card-pad) * -1) 16px;
  padding: 14px var(--card-pad); border-bottom: 1px solid var(--border);
  border-radius: var(--radius-card) var(--radius-card) 0 0; }

.ed-steps { position: sticky; top: 54px; z-index: 30; background: var(--bg-elevated); }

.lib-split { display: flex; gap: 18px; align-items: flex-start; }
.lib-cats { width: 132px; flex: none; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 120px; }
.lib-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: none; background: none; text-align: left; padding: 8px 12px; border-radius: 9px;
  font-size: var(--font-base); color: var(--text-secondary); cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast); }
.lib-cat:hover { background: var(--bg-elevated); color: var(--text-primary); }
.lib-cat.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }

.wb-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-self: start; }
@media (max-width: 1200px) { .wb-grid { grid-template-columns: 1fr; } }
.wb-card { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated);
  padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px;
  height: 318px;                       
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.wb-card:hover { border-color: var(--primary-border); box-shadow: 0 2px 10px rgba(16, 24, 40, .06); }
.wb-head { display: flex; align-items: center; gap: 10px; flex: none; min-height: 34px; }
.wb-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }

.wb-name { font-weight: 600; font-size: var(--font-title); line-height: 1.4;
  flex: 0 1 auto; min-width: 0; max-width: 8.6em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-chips { display: flex; gap: 6px; flex: none; flex-wrap: nowrap; }
.wb-chips > * { flex: none; }

.wb-head > .tpl-ico { align-self: center; }
.wb-summary { display: flex; align-items: center; gap: 6px; min-height: 22px;
  color: var(--text-muted); font-size: var(--font-caption); overflow: hidden; }
.wb-summary .wb-sm-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-summary .chip { flex: none; }
.wb-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; flex: none;
  border-top: 1px solid var(--border); }
.wb-summary { flex: none; }

.sty-group { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; }
.sty-group .muted { font-weight: 400; }
.sty-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.sty-bool { font-size: 13px; color: var(--text-secondary); }
.sl-lab { font-size: 12px; color: var(--text-secondary); }
.label-text { font-weight: 600; }

:root { --ctx-p: #3E63DD; --ctx-a: #8E4EC6; }
.sidenav::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 148px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ctx-p) 12%, transparent), transparent);
  pointer-events: none; transition: background .4s; }
.sidenav > * { position: relative; }

.wb-preview { background: var(--bg-sunken); border-radius: 10px; padding: 12px;
  flex: 1; min-height: 0;
  overflow: hidden; position: relative; pointer-events: none; }
.wb-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(transparent, var(--bg-sunken) 72%); }
.wb-preview .comp { margin-top: 0; max-width: 100%; }

.tpl-pick { position: relative; }
.tpl-pick .sel-ico { position: absolute; top: 9px; right: 11px; color: var(--primary); }
.tpl-pick.recommended { border-color: var(--ai); animation: aiPulse 1.8s ease-in-out infinite; }
@keyframes aiPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(110, 75, 216, .3); } 50% { box-shadow: 0 0 0 7px rgba(110, 75, 216, 0); } }
.tpl-pick.locked { cursor: not-allowed; opacity: .45; }
.tpl-pick.locked.selected { opacity: 1; }

.comp input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]) { min-height: var(--control-height, 36px); }

.comp { border-color: var(--panel-bc, var(--border)); }
.comp .opt-item, .comp .btn.opt, .comp .opt-card, .comp .rank-item, .comp .fb-cand {
  background: var(--opt-bg, var(--bg-elevated)); border-color: var(--opt-bc, var(--border));
  color: var(--ink-opt, var(--ink-panel, var(--text-primary))); }
.comp .opt-item .opt-text, .comp .opt-card .oc-name, .comp .rank-item > span { color: inherit; }
.comp .opt-card .oc-desc, .comp .fb-cand-body {
  color: var(--ink-opt, var(--ink-panel, var(--text-muted))); }
.comp[style*="--ink-opt"] .oc-desc, .comp[style*="--ink-panel"] .oc-desc { opacity: .82; }

.comp { color: var(--text-ink, var(--ink-panel, var(--text-primary))); font-weight: var(--text-weight, 400); }
.comp .comp-title { color: var(--text-ink, var(--ink-panel, var(--text-primary))); }
.comp .fb-cand { border-radius: var(--opt-radius, 10px); }
.comp .submit-bar .btn.primary:not(.submitted) {
  background: var(--btn-bg, var(--primary)); border-color: var(--btn-bc, var(--btn-bg, var(--primary)));
  color: var(--btn-fg, var(--on-primary, #fff)); }
.comp .btn.confirm-danger {
  background: var(--btn-bg, var(--danger)); border-color: var(--btn-bc, var(--btn-bg, var(--danger)));
  color: var(--btn-fg, #fff); }

.fx-panel .fx-sec { margin-bottom: 10px; }

.editor-inline .modal.editor .ed-preview { min-height: calc(100vh - 214px); }

.sty-acc { border-bottom: 1px solid var(--border); }
.sty-acc summary { list-style: none; list-style-type: none; display: block; cursor: pointer; user-select: none; }
.sty-acc summary::-webkit-details-marker { display: none; }
.sty-acc summary .sty-group { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 0; }
.sty-acc summary .sty-group::after { content: ""; width: 8px; height: 8px; margin-left: auto; flex: none;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg); transition: transform var(--dur-fast); }
.sty-acc[open] summary .sty-group::after { transform: rotate(45deg); }
.sty-acc-n { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.sty-acc > .sty-section, .sty-acc > .field { margin-left: 2px; }
.sty-acc[open] { padding-bottom: 10px; }

.wb-foot { margin-top: auto; }

.sty-acc summary::marker { content: ""; }

.comp .delta-chip.neutral { background: var(--bg-sunken); color: var(--text-secondary); }

.comp.auto-submit .submit-bar .btn.primary { display: none; }

.modal.editor .ed-split.pick-mode { grid-template-columns: 1fr; }
.tpl-rich { border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg-elevated);
  padding: 12px 14px 10px; cursor: pointer; position: relative;
  height: 300px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.tpl-rich .tpl-head { flex: none; }
.tpl-rich .tpl-desc { flex: none; }
.tpl-rich:hover { border-color: var(--primary-border); box-shadow: 0 2px 8px rgba(16, 24, 40, .06); }
.tpl-rich.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.tpl-rich .tpl-preview.pick-pv { flex: 1; min-height: 0; height: auto; pointer-events: none; }

body:has(.batch-bar:not([hidden])) #cardList { padding-bottom: 64px; }

.prod-cover { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--bg-elevated); border-radius: var(--radius-card); }
.prod-cover .pc-id { width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--ctx-p, var(--primary)), var(--ctx-a, var(--primary))); }
.prod-cover .pc-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prod-cover .pc-name { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  border: none; background: none; padding: 2px 6px 2px 0; margin-left: -2px; border-radius: 8px;
  font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  color: var(--text-primary); cursor: pointer; transition: color var(--dur-fast); }
.prod-cover .pc-name:hover { color: var(--primary); }
.prod-cover .pc-name .pc-caret { color: var(--text-muted); display: inline-flex; }
.prod-cover .pc-name:hover .pc-caret { color: var(--primary); }
.prod-cover .pc-meta { display: flex; align-items: center; gap: 7px;
  font-size: var(--font-caption); color: var(--text-muted); }
.prod-cover .pc-dot { color: var(--border-strong); }
.prod-cover .pc-on { color: var(--success); }
.prod-cover .pc-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.prod-cover .pc-field { display: inline-flex; align-items: center; gap: 8px; }
.prod-cover .pc-field-label { font-size: var(--font-caption); color: var(--text-muted); white-space: nowrap; }
.prod-cover .fsel { background: var(--bg-surface); border-color: transparent; }
.prod-cover .fsel:hover { border-color: var(--border); background: var(--bg-elevated); }
.prod-cover .fsel-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-cover.unbound .pc-id { background: var(--bg-sunken); color: var(--text-muted); }
@media (max-width: 900px) { .prod-cover { flex-wrap: wrap; } .prod-cover .pc-actions { margin-left: 0; width: 100%; } }

.dt-page { display: flex; flex-direction: column; gap: 14px; }
.dt-head { display: flex; align-items: center; gap: 10px; }
.dt-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.dt-split { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .dt-split { grid-template-columns: 1fr; } }
.dt-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dt-sec { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 5px; }
.dt-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.dt-row:first-of-type { border-top: none; }
.dt-k { width: 92px; flex: none; font-size: var(--font-small); color: var(--text-muted); }
.dt-v { font-size: var(--font-small); color: var(--text-primary); min-width: 0; }
.dt-code { display: flex; flex-direction: column; gap: 12px; }
.dt-block-t { font-size: var(--font-caption); color: var(--text-muted); margin-bottom: 5px; }
.dt-code pre { margin: 0; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; font-size: 12px; line-height: 1.6; overflow-x: auto;
  font-family: var(--font-mono); color: var(--text-secondary); max-height: 320px; overflow-y: auto; }
.dt-preview-card { position: sticky; top: 14px; }
.dt-sec { display: flex; align-items: center; }
.dt-preview { background: var(--bg-sunken); border-radius: 10px; padding: 16px; }

.comp .hl-caption { font-size: var(--cap-size, var(--font-small)); font-weight: var(--cap-weight, 400);
  color: var(--cap-color, var(--ink-panel, var(--text-muted))); }

.fx-add { display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 8px; padding: 9px 12px; cursor: pointer;
  background: transparent; border: 1px dashed var(--border-strong, var(--border));
  border-radius: 9px; color: var(--text-secondary); font-size: var(--font-small);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast); }
.fx-add:hover:not(:disabled) { border-color: var(--primary); color: var(--primary);
  background: var(--primary-weak); }
.fx-add:disabled { opacity: .5; cursor: default; }

.preset-onboard { background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px; }
.po-head { margin-bottom: 14px; }
.po-t { font-size: 16px; font-weight: 700; }
.po-d { font-size: var(--font-small); color: var(--text-muted); margin-top: 4px; line-height: 1.6; }
.po-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.po-cell { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg-surface); min-width: 0; }
.po-name { font-size: var(--font-small); font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-cell .chip { flex: none; margin-left: auto; }
.po-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid var(--border); }

.prod-actions .btn.small { height: 32px; display: inline-flex; align-items: center; }
.prod-actions .btn.iconic.round { width: 32px; height: 32px; }

.ds-head { display: flex; align-items: center; gap: 10px; }
.ds-head .ds-back { flex: none; }
.ds-head #brandCount { flex: none; }

.design-page { display: flex; flex-direction: column; height: calc(100vh - 44px); min-height: 0; }
.design-page > .page-head { flex: none; }
.design-page > .style-split { flex: 1; min-height: 0; }
.style-split > .ds-left { align-self: stretch; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.ds-left > .ds-editor { flex: 1; min-height: 0; overflow-y: auto; position: relative; padding-top: 0; }
.ds-editor .sty-swatches, .ds-editor .quick-color { position: relative; z-index: 1; }
.ds-preview { align-self: stretch; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ds-preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex: none; }
.ds-preview > .demo-one { flex: 1; min-height: 0; overflow-y: auto; }

.wb-layout { display: flex; flex-direction: column; height: calc(100vh - 44px); min-height: 0; }
.wb-layout > .page-head, .wb-layout > .card, .wb-layout > .wb-toolbar { flex: none; }
.wb-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 0;
  background: var(--bg-page); padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.wb-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding-top: 14px; padding-right: 2px; }

.wb-scroll .lib-cats { position: sticky; top: 0; align-self: flex-start; }
.wb-search { position: relative; display: inline-flex; align-items: center; }
.wb-search input { width: 220px; height: 32px; padding: 4px 12px 4px 30px; border-radius: 999px;
  background: var(--bg-elevated); }
.wb-search input:focus { width: 260px; }
.wb-search .wb-search-ico { position: absolute; left: 11px; width: 12px; height: 12px; pointer-events: none;
  border: 1.6px solid var(--text-muted); border-radius: 50%; }
.wb-search .wb-search-ico::after { content: ""; position: absolute; right: -4px; bottom: -3px; width: 5px; height: 1.6px;
  background: var(--text-muted); transform: rotate(45deg); border-radius: 2px; }

.wb-switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; flex: none; }
.wb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.wb-switch .sw-track { width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong, #C7D3DC);
  position: relative; flex: none; transition: background var(--dur-fast); }
.wb-switch .sw-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.25); transition: transform var(--dur-fast); }
.wb-switch.on .sw-track { background: var(--primary); }
.wb-switch.on .sw-knob { transform: translateX(14px); }
.wb-switch .sw-text { font-size: var(--font-caption); color: var(--text-secondary); white-space: nowrap; }
.wb-switch.on .sw-text { color: var(--primary); font-weight: 600; }
.wb-switch input:focus-visible + .sw-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.wb-switch input:disabled ~ .sw-track { opacity: .55; }

.tpl-preview { background: var(--bg-sunken); border-radius: 10px; padding: 14px;
  overflow: hidden; position: relative; }
.tpl-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px;
  background: linear-gradient(transparent, var(--bg-sunken)); pointer-events: none; }

.modal.editor .tpl-grid { align-items: stretch; }
.tpl-rich { display: flex; flex-direction: column; }
.tpl-rich .tpl-preview.pick-pv { flex: 1; min-height: 150px; max-height: 180px; }

.editor-inline .modal.editor .modal-head { position: sticky; top: 0; z-index: 31;
  height: 56px; box-sizing: border-box; padding: 0 24px; display: flex; align-items: center;
  background: var(--bg-elevated); border-radius: var(--radius-card) var(--radius-card) 0 0; }
.editor-inline .modal.editor .ed-steps { position: sticky; top: 56px; z-index: 30;
  background: var(--bg-elevated); }

.tpl-rich.selected { background: color-mix(in srgb, var(--primary) 4%, var(--bg-elevated)); }

.sl-num.inherited { color: var(--text-muted); }

.sty-bool .bool-demo { display: inline-flex; align-items: center; margin-left: 2px;
  color: var(--text-muted); background: var(--bg-surface); border-radius: 5px; padding: 2px 5px; }
.sty-bool input:checked ~ .bool-demo { color: var(--primary); background: var(--primary-weak); }

.comp.no-inputborder input, .comp.no-inputborder textarea {
  border-color: transparent; background: var(--bg-surface); }
.comp.no-inputborder input:focus, .comp.no-inputborder textarea:focus {
  border-color: var(--brand-ring, var(--primary)); background: var(--bg-elevated); }
.comp.label-left .field { display: grid; grid-template-columns: 84px minmax(0, 1fr);
  align-items: center; gap: 6px 10px; }
.comp.label-left .field .label-text { margin-bottom: 0; }
.comp.label-left .field .field-error { grid-column: 2; }
@media (max-width: 520px) { .comp.label-left .field { grid-template-columns: 1fr; } }
.comp table.data td { height: var(--row-h, auto); }

.tpl-rich .tpl-head { display: flex; align-items: center; gap: 9px; min-height: 30px; margin-bottom: 2px; }
.tpl-rich .tpl-head .tpl-ico { width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--primary-weak); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.tpl-rich .tpl-head > span[style*="font-weight"] { font-size: 15px; letter-spacing: -.01em; }
.tpl-rich .tpl-head .chip { flex: none; }
.tpl-rich .tpl-head .sel-ico { position: static; flex: none; display: inline-flex; color: var(--primary); }

.tpl-rich .tpl-preview.pick-pv { flex: 1; min-height: 196px; max-height: 232px;
  display: flex; align-items: center; justify-content: center; padding: 12px; }
.tpl-rich .tpl-preview.pick-pv .brand-scope { width: 100%; }
.tpl-rich .tpl-preview.pick-pv .comp { margin-top: 0; max-width: 100%; }

.wb-card .cr-check { flex: none; }

.schema-card { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated);
  padding: 14px 16px; margin-bottom: 12px; }
.schema-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.schema-name { font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 13px; font-weight: 600;
  background: var(--bg-surface); border-radius: 6px; padding: 2px 8px; }
.schema-hint { font-size: var(--font-caption); color: var(--text-muted); }
.schema-table { width: 100%; font-size: var(--font-small); }
.schema-table th { font-weight: 600; color: var(--text-muted); font-size: var(--font-caption); }
.schema-table td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.schema-key { font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 12px; color: var(--text-primary); }
.schema-raw { margin-top: 10px; }
.schema-raw summary { cursor: pointer; font-size: var(--font-caption); color: var(--text-muted); }
.schema-raw summary:hover { color: var(--primary); }

.sty-inherit-tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--font-caption); }
.sty-inherit-tag .sw-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sty-inherit-tag .btn.small { padding: 1px 8px; font-size: 11px; }

.ff-card { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated);
  padding: 9px 10px; margin-bottom: 8px; }
.ff-line { display: flex; align-items: center; gap: 8px; }
.ff-line + .ff-line { margin-top: 7px; }
.ff-no { width: 16px; flex: none; text-align: center; font-size: 11px; color: var(--text-muted); }
.ff-grow { flex: 1; min-width: 0; }
.ff-grow input { width: 100%; }
.ff-key { width: 116px; flex: none; }
.ff-key input { width: 100%; font-size: 12px; }
.ff-req { margin: 0 !important; flex: none; white-space: nowrap; }
.ff-sub input { background: var(--bg-surface); }

.comp .fb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comp .fb-row .comp-reset.inbar { margin-left: 8px; }

.nr-line .sty-label { margin-bottom: 6px; }
.nr-line .sl-num { width: 150px; }
