.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; transition: var(--transition); }
.button:focus-visible, .icon-button:focus-visible, .resource-tab:focus-visible, .cell-input:focus-visible, .sheet-header-input:focus-visible, .sheet-column-label:focus-visible, .sheet-group-heading:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 8px color-mix(in srgb, var(--primary) 22%, transparent); }
.button-primary:hover { background: var(--primary-strong); transform: translateY(-1px); }
.button-secondary { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 15%, var(--border)); }
.button-secondary:hover { background: color-mix(in srgb, var(--primary) 22%, var(--panel-bg)); }
.button-ghost { color: var(--text-muted); background: transparent; border-color: transparent; }
.button-ghost:hover { color: var(--text); background: var(--panel-soft); border-color: var(--border); }
.button-danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 18%, var(--border)); }
.button-danger:hover { background: color-mix(in srgb, var(--danger) 16%, var(--panel-bg)); }
.button-small { height: 27px; font-size: 11px; padding: 0 8px; }
.full-width { width: 100%; }
.icon-button { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-muted); font-size: 17px; line-height: 1; transition: var(--transition); }
.icon-button:hover { color: var(--text); background: var(--panel-soft); border-color: var(--border); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.resource-card { position: relative; display: flex; gap: 9px; align-items: center; padding: 10px 9px; margin-bottom: 5px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; transition: var(--transition); }
.resource-card:hover { background: var(--panel-soft); border-color: var(--border); }
.resource-card.is-selected { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 20%, var(--border)); }
.resource-icon { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-muted); color: var(--text-muted); font-size: 14px; }
.resource-card.is-selected .resource-icon { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.resource-main { min-width: 0; flex: 1; }
.resource-name { color: var(--text-strong); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-meta { color: var(--text-faint); font-size: 10px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-actions { display: none; align-items: center; gap: 2px; }
.resource-card:hover .resource-actions, .resource-card.is-selected .resource-actions { display: flex; }
.resource-action { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; color: var(--text-faint); background: transparent; }
.resource-action:hover { color: var(--text); background: var(--panel-muted); }
.section-label { display: flex; align-items: center; justify-content: space-between; margin: 3px 4px 9px; color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.empty-sidebar { padding: 28px 10px; text-align: center; color: var(--text-faint); font-size: 12px; line-height: 1.6; }
.empty-sidebar .empty-icon { margin: 0 auto 9px; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 19px; }
.welcome { max-width: 960px; margin: 0 auto; }
.welcome-hero { position: relative; overflow: hidden; padding: 36px 40px 39px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--panel-bg), color-mix(in srgb, var(--primary-soft) 43%, var(--panel-bg))); box-shadow: var(--shadow-sm); }
.welcome-hero::after { content: ''; position: absolute; width: 230px; height: 230px; right: -70px; top: -90px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); box-shadow: 0 0 0 22px color-mix(in srgb, var(--primary) 5%, transparent), 0 0 0 44px color-mix(in srgb, var(--primary) 3%, transparent); }
.welcome-kicker { color: var(--primary); font-size: 11px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; }
.welcome h1 { max-width: 600px; color: var(--text-strong); font-size: clamp(28px, 3.5vw, 44px); line-height: 1.12; letter-spacing: -.045em; margin: 10px 0 13px; }
.welcome-copy { max-width: 540px; color: var(--text-muted); font-size: 14px; line-height: 1.8; }
.welcome-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 25px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 17px; }
.quick-card { padding: 17px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-bg); transition: var(--transition); }
.quick-card:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-card-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); margin-bottom: 11px; }
.quick-card h3 { color: var(--text-strong); font-size: 12px; margin-bottom: 5px; }
.quick-card p { color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.page-title { color: var(--text-strong); font-size: 24px; letter-spacing: -.035em; }
.page-subtitle { color: var(--text-muted); font-size: 12px; margin-top: 6px; line-height: 1.6; }
.toolbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.data-card, .analysis-card, .chart-card, .result-card, .panel-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-bg); box-shadow: var(--shadow-sm); }
.data-card { overflow: hidden; }
.data-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.data-card-head h3 { color: var(--text-strong); font-size: 14px; }
.data-card-head p { color: var(--text-faint); font-size: 11px; margin-top: 4px; }
.sheet-wrap { overflow: auto; max-height: min(62vh, 610px); }
.sheet-table { min-width: 620px; width: 100%; table-layout: fixed; }
.sheet-table th, .sheet-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sheet-table th:last-child, .sheet-table td:last-child { border-right: 0; }
.sheet-table thead th { position: sticky; top: 0; z-index: 2; height: 34px; background: var(--panel-muted); color: var(--text-muted); font-size: 10px; font-weight: 700; }
.sheet-table thead tr.sheet-column-row th { top: 0; }
.sheet-table.has-structure-header thead tr.sheet-column-row th { top: 28px; }
.sheet-table thead tr.sheet-group-row th { top: 0; z-index: 4; height: 28px; overflow: hidden; padding: 0 8px; border-bottom-color: var(--border-strong); color: var(--text-muted); background: color-mix(in srgb, var(--panel-muted) 76%, var(--panel-bg)); font-size: 10px; font-weight: 800; letter-spacing: .015em; text-align: center; cursor: pointer; }
.sheet-table thead tr.sheet-group-row th:hover { color: var(--primary); background: var(--primary-soft); }
.sheet-table thead tr.sheet-group-row th.is-x { color: color-mix(in srgb, var(--primary) 82%, var(--text)); background: color-mix(in srgb, var(--primary-soft) 72%, var(--panel-bg)); }
.sheet-table thead tr.sheet-group-row th.is-y, .sheet-table thead tr.sheet-group-row th.is-group { color: color-mix(in srgb, #7c3aed 70%, var(--text)); background: color-mix(in srgb, #ede9fe 64%, var(--panel-bg)); }
[data-theme="dark"] .sheet-table thead tr.sheet-group-row th.is-y, [data-theme="dark"] .sheet-table thead tr.sheet-group-row th.is-group { background: color-mix(in srgb, #6d28d9 22%, var(--panel-bg)); }
.sheet-table thead tr.sheet-group-row th.is-dimension { color: var(--text-faint); background: var(--panel-soft); }
.sheet-table thead tr.sheet-group-row th.is-plain { color: transparent; background: var(--panel-soft); cursor: default; }
.sheet-table thead tr.sheet-group-row th.sheet-group-corner { position: sticky; left: 0; z-index: 5; width: 44px; height: 62px; padding: 0; color: var(--text-faint); vertical-align: middle; }
.sheet-group-label { display: block; overflow: hidden; padding: 0 18px; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.sheet-group-heading.is-editable { cursor: text; }
.sheet-group-heading.is-editing { padding: 2px 4px !important; }
.sheet-group-edit { position: absolute; z-index: 1; right: 4px; top: 50%; width: 18px; height: 18px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; color: currentColor; background: color-mix(in srgb, var(--panel-bg) 72%, transparent); font-size: 9px; opacity: 0; pointer-events: auto; transform: translateY(-50%); transition: opacity .15s ease, background .15s ease; }
.sheet-group-heading:hover .sheet-group-edit, .sheet-group-heading:focus-within .sheet-group-edit { opacity: 1; pointer-events: auto; }
.sheet-group-edit:hover { background: var(--panel-bg); }
.sheet-group-edit[hidden] { display: none; }
.sheet-group-input { display: block; width: 100%; height: 22px; border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border)); border-radius: 5px; padding: 0 6px; color: var(--text-strong); background: var(--panel-bg); font-size: 10px; font-weight: 700; text-align: center; outline: none; }
.sheet-group-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 14%, transparent); }
@media (hover: none), (pointer: coarse) { .sheet-group-edit { opacity: 1; pointer-events: auto; } }
.sheet-table.has-structure-header thead { box-shadow: 0 2px 0 color-mix(in srgb, var(--border-strong) 72%, transparent); }
.sheet-table thead th.corner { position: sticky; left: 0; z-index: 5; width: 44px; }
.sheet-table thead th.sheet-column-heading { padding: 2px 4px 3px; }
.sheet-table thead th .col-letter { display: block; color: var(--text-faint); font-size: 9px; }
.sheet-table thead th .col-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 5px; }
.sheet-column-label { min-height: 18px; border-radius: 4px; color: var(--text-muted); font-size: 11px; line-height: 18px; cursor: text; }
.sheet-column-label:hover { color: var(--text-strong); background: color-mix(in srgb, var(--primary-soft) 56%, transparent); }
.sheet-header-input { width: 100%; height: 18px; padding: 0 4px; border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border)); border-radius: 4px; color: var(--text-strong); background: var(--panel-bg); font-size: 11px; text-align: center; outline: none; }
.sheet-header-input[hidden] { display: none; }
.sheet-table tbody th { position: sticky; left: 0; z-index: 1; width: 44px; background: var(--panel-muted); color: var(--text-faint); font-size: 10px; font-weight: 600; text-align: center; }
.sheet-table td { height: 34px; min-width: 120px; padding: 0; background: var(--panel-bg); }
.sheet-table td.is-selected { background: color-mix(in srgb, var(--primary-soft) 72%, var(--panel-bg)); }
.sheet-table td.is-active { position: relative; box-shadow: inset 0 0 0 2px var(--primary); }
.cell-input { width: 100%; height: 33px; border: 0; padding: 0 8px; color: var(--text); background: transparent; outline: none; font-size: 12px; }
.cell-input:focus { background: color-mix(in srgb, var(--primary-soft) 44%, transparent); }
.cell-input.is-invalid, .sheet-table td.is-invalid .cell-input { background: var(--warning-soft); color: var(--warning); }
.sheet-table td.is-empty .cell-input { color: var(--text-faint); }
.sheet-tools { display: flex; align-items: center; gap: 6px; padding: 10px 13px; border-top: 1px solid var(--border); background: var(--panel-soft); }
.sheet-tools .spacer { flex: 1; }
.table-hint { color: var(--text-faint); font-size: 11px; }
.sheet-context-menu { position: fixed; z-index: 95; width: 205px; display: grid; gap: 3px; padding: 7px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--panel-bg); box-shadow: var(--shadow-md); backdrop-filter: blur(18px); }
.sheet-context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 7px 9px; border: 0; border-radius: 8px; color: inherit; background: transparent; text-align: left; font-size: 11px; }
.sheet-context-menu button:hover { color: var(--primary); background: var(--primary-soft); }
.sheet-context-menu button i { width: 16px; text-align: center; }
.sheet-menu-divider { height: 1px; margin: 3px 4px; background: var(--border); }
.analysis-layout { display: grid; grid-template-columns: minmax(290px, .8fr) minmax(0, 1.4fr); gap: 15px; align-items: start; }
.panel-card { padding: 17px; }
.panel-card h3 { color: var(--text-strong); font-size: 13px; margin-bottom: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.field input, .field select, .field textarea, .form-input { width: 100%; min-height: 33px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: var(--panel-bg); padding: 7px 9px; outline: none; font-size: 12px; transition: var(--transition); }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.checkbox-field { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 11px; }
.checkbox-field input { accent-color: var(--primary); }
.analysis-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.analysis-result-head h3 { margin-bottom: 4px; }
.result-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.result-table { width: 100%; min-width: 450px; }
.result-table th, .result-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 11px; }
.result-table th { color: var(--text-muted); background: var(--panel-muted); font-weight: 700; }
.result-table td { color: var(--text); }
.result-table tr:last-child td { border-bottom: 0; }
.result-note { margin-top: 13px; padding: 11px 12px; border-radius: 8px; background: var(--panel-soft); color: var(--text-muted); font-size: 11px; line-height: 1.65; }
.disclaimer { color: var(--text-faint); font-size: 10px; line-height: 1.65; margin-top: 13px; }
.stale-badge, .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.stale-badge { color: var(--warning); background: var(--warning-soft); }
.badge-blue { color: var(--primary); background: var(--primary-soft); }
.badge-green { color: var(--success); background: var(--success-soft); }
.chart-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; }
.chart-canvas-card { min-height: 520px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-bg); box-shadow: var(--shadow-sm); overflow: hidden; }
.chart-canvas-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--border); background: var(--panel-soft); }
.chart-canvas-head .chart-title-mini { color: var(--text-strong); font-size: 12px; font-weight: 600; }
.chart-canvas { flex: 1; min-height: 475px; padding: 17px; display: flex; align-items: flex-start; justify-content: center; background: var(--panel-bg); }
.chart-canvas > div { width: 100%; height: 100%; min-height: 438px; }
.chart-canvas > .chart-preview-host { width: 100%; height: auto; min-height: 0; aspect-ratio: var(--chart-aspect-ratio, 3 / 2); }
.chart-preview-host > .chart-host { width: 100%; height: 100%; min-height: 0; }
.chart-loading { display: grid; place-items: center; height: 100%; min-height: 438px; color: var(--text-muted); font-size: 12px; }
.chart-error { display: grid; place-items: center; height: 100%; min-height: 438px; padding: 30px; text-align: center; color: var(--danger); font-size: 12px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.chart-card { overflow: hidden; cursor: pointer; transition: var(--transition); }
.chart-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.chart-thumb { height: 150px; padding: 9px; background: var(--panel-soft); pointer-events: none; }
.chart-thumb > div { width: 100%; height: 100%; }
.chart-card-body { padding: 12px 13px 13px; }
.chart-card-title { color: var(--text-strong); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-card-meta { color: var(--text-faint); font-size: 10px; margin-top: 5px; }
.inspector-section { border-bottom: 1px solid var(--border); padding: 4px 0 13px; margin-bottom: 10px; }
.inspector-section:last-child { border-bottom: 0; }
.inspector-section summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; color: var(--text-strong); font-size: 12px; font-weight: 700; padding: 8px 3px; }
.inspector-section summary::-webkit-details-marker { display: none; }
.inspector-section summary::after { content: '⌄'; color: var(--text-faint); transition: var(--transition); }
.inspector-section[open] summary::after { transform: rotate(180deg); }
.inspector-section-content { padding: 4px 3px 0; }
.inspector .field-grid { gap: 9px; }
.inspector .field input, .inspector .field select { min-height: 30px; padding: 5px 7px; font-size: 11px; }
.palette-row { display: flex; gap: 5px; flex-wrap: wrap; }
.palette-swatch { width: 27px; height: 22px; border-radius: 5px; border: 2px solid transparent; cursor: pointer; }
.palette-swatch.is-active { border-color: var(--text-strong); box-shadow: 0 0 0 2px var(--panel-bg); }
.significance-list { display: grid; gap: 6px; margin-top: 9px; }
.significance-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-soft); }
.significance-item > div { min-width: 0; display: grid; gap: 2px; }
.significance-item strong { color: var(--text-strong); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.significance-item span { color: var(--text-faint); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.significance-item .resource-action { display: inline-grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; }
.inspector-mini-empty { margin-top: 8px; padding: 10px; border: 1px dashed var(--border); border-radius: 9px; color: var(--text-faint); text-align: center; font-size: 10px; }
.color-input { width: 34px !important; min-height: 28px !important; padding: 2px !important; }
.color-control { min-width: 0; width: 100%; }
.color-control-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 33px; padding: 4px 9px 4px 4px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--panel-bg); text-align: left; transition: var(--transition); }
.color-control-trigger:hover, .color-control-trigger.is-active { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); }
.checkerboard { background-color: #fff; background-image: linear-gradient(45deg, #d9dee7 25%, transparent 25%), linear-gradient(-45deg, #d9dee7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d9dee7 75%), linear-gradient(-45deg, transparent 75%, #d9dee7 75%); background-position: 0 0, 0 6px, 6px -6px, -6px 0; background-size: 12px 12px; }
.color-control-swatch { position: relative; flex: 0 0 26px; width: 26px; height: 26px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--text) 18%, var(--border)); border-radius: 7px; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.color-control-swatch > span { position: absolute; inset: 0; }
.color-control-code { flex: 1; min-width: 0; overflow: hidden; color: var(--text-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.color-control-trigger > i { color: var(--text-faint); font-size: 10px; }
.color-control.is-compact { flex: 0 0 auto; width: auto; }
.color-control.is-compact .color-control-trigger { position: relative; width: 34px; min-height: 30px; padding: 2px; border-radius: 8px; }
.color-control.is-compact .color-control-swatch { flex-basis: 28px; width: 28px; height: 26px; }
.color-control-kind { position: absolute; right: 2px; bottom: 1px; min-width: 12px; padding: 0 2px; border-radius: 4px; color: #fff; background: rgba(15, 23, 42, .68); font-size: 7px; font-weight: 800; line-height: 12px; text-align: center; }
.color-picker-portal { position: fixed; z-index: 180; max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border)); border-radius: 18px; background: color-mix(in srgb, var(--panel-bg) 96%, transparent); box-shadow: 0 28px 75px rgba(15, 23, 42, .25); backdrop-filter: blur(24px) saturate(145%); }
.color-picker-portal[hidden] { display: none; }
.color-editor { padding: 13px; }
.color-editor-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 34px; gap: 9px; align-items: center; }
.color-editor-head-swatch { position: relative; width: 52px; height: 52px; overflow: hidden; border: 2px solid var(--panel-bg); border-radius: 13px; box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(15, 23, 42, .14); }
.color-editor-head-swatch > span, .color-editor-preview > span { position: absolute; inset: 0; }
.color-editor-hex { position: relative; display: block; }
.color-editor-hex > span { position: absolute; z-index: 1; left: 12px; top: 50%; color: var(--text-faint); font-size: 9px; font-weight: 800; transform: translateY(-50%); }
.color-editor-hex input { width: 100%; min-height: 43px; padding: 8px 12px 8px 45px; border: 1px solid var(--border); border-radius: 12px; color: var(--text-strong); background: var(--panel-bg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; letter-spacing: .02em; outline: none; }
.color-editor-hex input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.color-editor-hex input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 10%, transparent); }
.color-editor-transparent { min-height: 43px; }
.color-editor-body { display: grid; grid-template-columns: 142px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 13px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-soft); }
.color-editor-preview { position: relative; width: 126px; height: 126px; overflow: hidden; border: 5px solid var(--panel-bg); border-radius: 20px; box-shadow: 0 0 0 1px var(--border), 0 14px 28px rgba(15, 23, 42, .14); }
.color-editor-sliders { display: grid; gap: 12px; }
.color-channel { display: grid; gap: 6px; }
.color-channel > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: 10px; }
.color-channel b { color: var(--text-muted); font-size: 10px; }
.color-channel output { color: var(--text-faint); font-size: 10px; font-weight: 800; }
.color-range { width: 100%; height: 15px; margin: 0; border: 0; border-radius: 99px; appearance: none; -webkit-appearance: none; background: var(--color-range-bg, linear-gradient(90deg, #94a3b8, #4f8fd6)); cursor: pointer; outline: none; }
.color-range.hue-range { background: linear-gradient(90deg, #ef2f24, #f59e0b, #f5f336, #55e86f, #57e5e5, #3568ef, #8037ef, #ef3ac5, #ef2f24); }
.color-range.alpha-range { background-color: #fff; background-image: var(--color-range-bg), linear-gradient(45deg, #cfd6df 25%, transparent 25%), linear-gradient(-45deg, #cfd6df 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #cfd6df 75%), linear-gradient(-45deg, transparent 75%, #cfd6df 75%); background-position: 0 0, 0 0, 0 6px, 6px -6px, -6px 0; background-size: auto, 12px 12px, 12px 12px, 12px 12px, 12px 12px; }
.color-range::-webkit-slider-thumb { width: 22px; height: 22px; border: 3px solid var(--panel-bg); border-radius: 50%; appearance: none; -webkit-appearance: none; background: var(--text-strong); box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-strong) 75%, transparent), 0 3px 8px rgba(15, 23, 42, .25); }
.color-range::-moz-range-thumb { width: 17px; height: 17px; border: 3px solid var(--panel-bg); border-radius: 50%; background: var(--text-strong); box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-strong) 75%, transparent), 0 3px 8px rgba(15, 23, 42, .25); }
.color-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; color: var(--text-faint); font-size: 9px; line-height: 1.45; }
.series-color-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 2px 5px; color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.series-color-list { display: grid; gap: 5px; max-height: 240px; overflow: auto; }
.series-color-row { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-soft); }
.series-color-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 11px; }
.decoration-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.decoration-actions.single { grid-template-columns: 1fr; }
.ncs-quality-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 12px 13px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: 13px; background: linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 78%, var(--panel-bg)), var(--panel-bg)); }
.ncs-quality-card > div { min-width: 0; display: grid; gap: 4px; }
.ncs-quality-card strong { color: var(--text-strong); font-size: 11px; }
.ncs-quality-card p { color: var(--text-muted); font-size: 9px; line-height: 1.45; }
.ncs-quality-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; color: var(--success); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.ncs-quality-badge i { font-size: 11px; }
.ncs-export-banner { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; margin-bottom: 13px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--success) 22%, var(--border)); border-radius: 10px; color: var(--text-muted); background: color-mix(in srgb, var(--success-soft) 56%, var(--panel-bg)); font-size: 10px; line-height: 1.45; }
.ncs-export-banner .ncs-quality-badge { grid-row: span 2; }
.ncs-export-banner small { grid-column: 2; color: var(--text-faint); font-size: 9px; }
.export-dpi-readout { display: inline-flex; align-items: center; min-height: 33px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); background: var(--panel-soft); font-size: 12px; }
.export-size-preview { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)); border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 11px; line-height: 1.5; }
.export-size-preview.is-warning { border-color: color-mix(in srgb, var(--warning) 28%, var(--border)); color: var(--warning); background: var(--warning-soft); }
.color-input-wide { min-height: 38px !important; padding: 4px !important; }
.modal-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.modal-root.is-open { pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(650px, 100%); max-height: min(88vh, 760px); max-height: min(88dvh, 760px); display: flex; min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--panel-bg); box-shadow: var(--shadow-md); animation: modalIn .18s ease-out; }
.modal > form { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.modal:has(.dataset-builder) { width: min(980px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.modal:has(.dataset-builder) form { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.modal:has(.dataset-builder) .dataset-builder { min-height: 0; overflow: auto; }
.modal:has(.dataset-builder) .modal-foot { flex: 0 0 auto; background: var(--panel-bg); box-shadow: 0 -5px 14px color-mix(in srgb, var(--panel-bg) 78%, transparent); }
@keyframes modalIn { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { position: relative; z-index: 1; display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 20px 14px; border-bottom: 1px solid var(--border); background: var(--panel-bg); }
.modal-head h2 { color: var(--text-strong); font-size: 17px; }
.modal-head p { color: var(--text-muted); font-size: 11px; margin-top: 5px; line-height: 1.5; }
.modal-body { min-height: 0; padding: 17px 20px; overflow-y: auto; overscroll-behavior: contain; }
.modal > .modal-body, .modal > form > .modal-body { flex: 1 1 auto; }
.modal-foot { position: relative; z-index: 1; display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 7px; padding: 13px 20px 17px; border-top: 1px solid var(--border); background: var(--panel-bg); }
.radio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.radio-card { position: relative; display: block; padding: 11px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: var(--transition); }
.radio-card:hover { border-color: var(--border-strong); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card-title { display: block; color: var(--text-strong); font-size: 12px; font-weight: 600; }
.radio-card-copy { display: block; color: var(--text-muted); font-size: 10px; line-height: 1.45; margin-top: 4px; }
.modal-help { color: var(--text-muted); background: var(--panel-soft); border-radius: 8px; padding: 10px; margin-top: 12px; font-size: 11px; line-height: 1.6; }
.dataset-format-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.dataset-format-rail { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-soft); }
.dataset-format-rail-title { color: var(--text-faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 2px 4px 9px; }
.dataset-format-cards { display: grid; gap: 6px; }
.dataset-format-card { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 7px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; transition: var(--transition); }
.dataset-format-card:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--panel-bg) 64%, transparent); }
.dataset-format-card:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.dataset-format-card input { position: absolute; opacity: 0; pointer-events: none; }
.dataset-format-card-visual { grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 34px; overflow: hidden; border-radius: 7px; background: var(--panel-bg); }
.dataset-format-card-visual svg { width: 100%; height: 100%; }
.dataset-format-card-title { align-self: end; color: var(--text-strong); font-size: 11px; font-weight: 750; }
.dataset-format-card-english { align-self: start; color: var(--text-faint); font-size: 9px; }
.dataset-builder-main { min-width: 0; }
.dataset-builder-preview { padding: 12px; border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-radius: 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 48%, var(--panel-bg)), var(--panel-bg)); }
.dataset-builder-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.dataset-builder-preview-head h3 { color: var(--text-strong); font-size: 15px; margin-top: 2px; }
.dataset-builder-preview-head p { color: var(--text-muted); font-size: 10px; line-height: 1.45; margin-top: 3px; }
.dataset-template-badge { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.dataset-template-preview { min-height: 142px; padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--panel-bg) 84%, transparent); }
.dataset-preview-layout { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(0, 1.15fr); gap: 12px; align-items: center; }
.dataset-preview-illustration { min-height: 112px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.62); }
[data-theme="dark"] .dataset-preview-illustration { background: rgba(8, 18, 32, .42); }
.dataset-preview-illustration svg { width: 100%; max-height: 120px; }
.dataset-preview-table-wrap { min-width: 0; overflow: hidden; }
.dataset-preview-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dataset-preview-table th, .dataset-preview-table td { max-width: 110px; overflow: hidden; padding: 5px 6px; border: 1px solid var(--border); color: var(--text-muted); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.dataset-preview-table th { color: var(--text-strong); background: var(--primary-soft); font-weight: 750; }
.dataset-preview-table thead .dataset-preview-group-row th { padding-block: 4px; border-bottom-color: var(--border-strong); color: var(--text-muted); background: var(--panel-muted); font-size: 8px; letter-spacing: .02em; }
.dataset-preview-table thead .dataset-preview-group-row th.is-x { color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 78%, var(--panel-bg)); }
.dataset-preview-table thead .dataset-preview-group-row th.is-y, .dataset-preview-table thead .dataset-preview-group-row th.is-group { color: color-mix(in srgb, #7c3aed 72%, var(--text)); background: color-mix(in srgb, #ede9fe 66%, var(--panel-bg)); }
[data-theme="dark"] .dataset-preview-table thead .dataset-preview-group-row th.is-y, [data-theme="dark"] .dataset-preview-table thead .dataset-preview-group-row th.is-group { background: color-mix(in srgb, #6d28d9 24%, var(--panel-bg)); }
.dataset-preview-table thead .dataset-preview-group-row th.is-dimension { color: var(--text-faint); background: var(--panel-soft); }
.dataset-preview-table td:first-child, .dataset-preview-table th:first-child { width: 25px; color: var(--text-faint); }
.dataset-preview-table-wrap small { display: block; margin-top: 6px; color: var(--text-faint); font-size: 9px; }
.dataset-builder-common { margin-top: 13px; }
.dataset-source-choice { display: flex; flex-wrap: wrap; gap: 7px; }
.dataset-source-choice .radio-inline { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-muted); background: var(--panel-bg); cursor: pointer; font-size: 11px; transition: var(--transition); }
.dataset-source-choice .radio-inline:hover { border-color: var(--border-strong); color: var(--text); }
.dataset-source-choice .radio-inline:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 48%, var(--border)); color: var(--primary); background: var(--primary-soft); }
.dataset-source-choice .radio-inline input[type="radio"] { appearance: none; flex: 0 0 14px; width: 14px !important; height: 14px; min-height: 14px; margin: 0; padding: 0; border: 1.5px solid var(--border-strong); border-radius: 50%; background: var(--panel-bg); box-shadow: none; }
.dataset-source-choice .radio-inline input[type="radio"]:checked { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 3px, transparent 3.5px); }
.radio-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; }
.radio-inline input { accent-color: var(--primary); }
.dataset-template-options { margin-top: 13px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft); }
.dataset-option-section + .dataset-option-section { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--border); }
.dataset-option-section h4 { color: var(--text-strong); font-size: 11px; margin-bottom: 8px; }
.dataset-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.dataset-option-card { position: relative; display: flex; min-height: 43px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-bg); cursor: pointer; transition: var(--transition); }
.dataset-option-card:hover { border-color: var(--border-strong); }
.dataset-option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 2px 0 0 var(--primary); }
.dataset-option-card input { position: absolute; opacity: 0; }
.dataset-option-card strong { display: block; color: var(--text); font-size: 10px; font-weight: 700; }
.dataset-option-card small { display: block; color: var(--text-faint); font-size: 9px; line-height: 1.35; margin-top: 2px; }
.template-svg-table path, .template-svg-table rect { vector-effect: non-scaling-stroke; }
.step-indicator { display: flex; gap: 6px; margin-bottom: 16px; }
.step-dot { width: 24px; height: 5px; border-radius: 4px; background: var(--panel-muted); }
.step-dot.is-active { background: var(--primary); }
.toast-root { position: fixed; right: 18px; top: 75px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; width: min(350px, calc(100vw - 36px)); padding: 11px 12px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 9px; color: var(--text); background: var(--panel-bg); box-shadow: var(--shadow-md); font-size: 12px; line-height: 1.45; animation: toastIn .2s ease-out; pointer-events: auto; }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }
.toast-icon { color: var(--primary); font-weight: 700; }
.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error .toast-icon { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.inspector-empty { display: grid; place-items: center; gap: 10px; padding: 60px 18px; text-align: center; color: var(--text-faint); font-size: 11px; line-height: 1.6; }
.form-divider { height: 1px; background: var(--border); margin: 15px 0; }
.data-type-pill { display: inline-flex; padding: 3px 6px; border-radius: 5px; color: var(--text-muted); background: var(--panel-muted); font-size: 10px; }
.inline-alert { padding: 10px 11px; border-radius: 7px; color: var(--warning); background: var(--warning-soft); font-size: 11px; line-height: 1.55; }
.inline-alert.error { color: var(--danger); background: var(--danger-soft); }
.stat-highlight { color: var(--text-strong); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 9px; margin-bottom: 14px; }
.stat-tile { padding: 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-soft); }
.stat-tile-label { color: var(--text-faint); font-size: 10px; }
.stat-tile-value { color: var(--text-strong); font-size: 15px; font-weight: 700; margin-top: 5px; }
.subtle { color: var(--text-muted); font-size: 11px; }
.muted { color: var(--text-faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.spin { animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
