* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--regular-fc);
  background: var(--page-bg);
  font-family: var(--regular-ff);
  font-size: var(--font-size-12);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--link-fc);
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-sm {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.e10-shell {
  display: grid;
  grid-template: var(--topbar-height) minmax(0, 1fr) / var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 320px;
}

.topbar {
  z-index: 30;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(280px, 1fr) auto;
  align-items: center;
  min-height: var(--topbar-height);
  background: var(--panel-bg);
  border-bottom: var(--border-solid);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 18px;
  color: var(--main-fc);
  border-right: var(--border-solid);
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--base-white);
  background: var(--primary);
  border-radius: var(--border-radius-xs);
  font-family: var(--bold-ff);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  overflow: hidden;
  color: var(--main-fc);
  font-family: var(--medium-ff);
  font-size: var(--font-size-14);
  font-weight: 600;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--secondary-fc);
  font-size: var(--font-size-10);
  line-height: 14px;
}

.global-search {
  position: relative;
  width: min(480px, calc(100% - 32px));
  margin-left: 20px;
}

.global-search .icon {
  position: absolute;
  top: 8px;
  left: 10px;
  color: var(--secondary-fc);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  height: 32px;
  padding: 4px 34px;
  color: var(--main-fc);
  background: var(--bg-base);
  border: 1px solid transparent;
  border-radius: var(--border-radius-xs);
  outline: none;
  transition: var(--transition-all);
}

.global-search input:focus {
  background: var(--base-white);
  border-color: var(--primary);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 14px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--regular-fc);
  background: transparent;
  border: 0;
  border-radius: var(--border-radius-xs);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--primary);
  background: var(--hover-bc);
  outline: none;
}

.notification-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  background: var(--danger);
  border: 1px solid var(--base-white);
  border-radius: 50%;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-left: 4px;
  padding: 0 8px;
  color: var(--regular-fc);
  background: transparent;
  border: 0;
  border-radius: var(--border-radius-xs);
  cursor: pointer;
}

.user-menu:hover {
  background: var(--bg-base);
}

.avatar {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #245979;
  background: #dceef7;
  border-radius: 50%;
  font-family: var(--medium-ff);
  font-size: var(--font-size-12);
}

.sidebar {
  z-index: 20;
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: var(--panel-bg);
  border-right: var(--border-solid);
}

.workspace-label {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  color: var(--main-fc);
  border-bottom: 1px solid var(--diviling-line-color);
  font-family: var(--medium-ff);
  font-size: var(--font-size-14);
}

.nav-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 10px 8px;
  overflow: auto;
  list-style: none;
}

.nav-section-label {
  margin: 14px 10px 6px;
  color: var(--secondary-fc);
  font-size: var(--font-size-10);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  color: var(--regular-fc);
  background: transparent;
  border: 0;
  border-radius: var(--border-radius-xs);
  cursor: pointer;
  text-align: left;
}

.nav-item::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -8px;
  width: 3px;
  content: "";
  background: transparent;
}

.nav-item:hover {
  color: var(--main-fc);
  background: var(--bg-base);
}

.nav-item:focus {
  outline: none;
}

.nav-item:focus-visible {
  box-shadow: inset 0 0 0 1px var(--primary);
}

.nav-item.active {
  color: var(--primary);
  background: var(--hover-bc);
  font-family: var(--medium-ff);
}

.nav-item.active::before {
  background: var(--primary);
}

.nav-item .nav-badge {
  min-width: 20px;
  height: 18px;
  margin-left: auto;
  padding: 0 6px;
  color: var(--secondary-fc);
  background: var(--bg-weak);
  border-radius: 9px;
  font-size: var(--font-size-10);
  line-height: 18px;
  text-align: center;
}

.nav-item.active .nav-badge {
  color: var(--primary);
  background: var(--label-bc-active);
}

.sidebar-footer {
  padding: 12px 14px;
  color: var(--secondary-fc);
  border-top: var(--border-solid);
  font-size: var(--font-size-10);
  line-height: 18px;
}

.main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--page-bg);
}

.view {
  display: none;
  min-width: 0;
  min-height: 100%;
  padding: 16px;
}

.view.active {
  display: block;
}

.page-header {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.page-heading {
  min-width: 0;
}

.page-title {
  margin: 0;
  color: var(--main-fc);
  font-family: var(--medium-ff);
  font-size: var(--font-size-18);
  font-weight: 600;
  line-height: 26px;
  letter-spacing: 0;
}

.page-description {
  margin: 3px 0 0;
  color: var(--secondary-fc);
  line-height: 18px;
}

.page-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn {
  display: inline-flex;
  min-width: 0;
  height: var(--control-height);
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  overflow: hidden;
  color: var(--regular-fc);
  background: var(--base-white);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
  cursor: pointer;
  font-size: var(--font-size-12);
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: var(--transition-all);
}

.btn:hover,
.btn:focus-visible {
  color: var(--primary);
  border-color: var(--primary);
  outline: none;
}

.btn-primary {
  color: var(--base-white);
  background: var(--primary);
  border-color: transparent;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--base-white);
  background: var(--primary-hover);
  border-color: transparent;
}

.btn-success {
  color: var(--base-white);
  background: var(--success);
  border-color: transparent;
}

.btn-warning {
  color: var(--base-white);
  background: var(--warning);
  border-color: transparent;
}

.btn-danger {
  color: var(--base-white);
  background: var(--danger);
  border-color: transparent;
}

.btn-text {
  height: auto;
  padding: 3px 4px;
  color: var(--primary);
  background: transparent;
  border-color: transparent;
}

.btn-text:hover {
  background: var(--hover-bc);
  border-color: transparent;
}

.btn-small {
  height: 26px;
  padding: 4px 8px;
}

.btn:disabled,
.btn.disabled {
  color: var(--base-white);
  background: #cccccc;
  border-color: transparent;
  cursor: not-allowed;
}

.surface {
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.surface + .surface {
  margin-top: 12px;
}

.surface-header {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: var(--border-solid);
}

.surface-title {
  margin: 0;
  color: var(--main-fc);
  font-family: var(--medium-ff);
  font-size: var(--font-size-14);
  font-weight: 500;
  line-height: 20px;
}

.surface-body {
  padding: 14px;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.metric {
  position: relative;
  min-width: 0;
  padding: 18px 20px;
}

.metric + .metric {
  border-left: var(--border-solid);
}

.metric-label {
  color: var(--secondary-fc);
  line-height: 18px;
}

.metric-value {
  margin-top: 7px;
  overflow: hidden;
  color: var(--main-fc);
  font-family: var(--medium-ff);
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  color: var(--secondary-fc);
}

.metric-change.positive {
  color: #389e0d;
}

.metric-change.warning {
  color: #d48806;
}

.metric-accent {
  position: absolute;
  top: 20px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-xs);
}

.metric-accent.blue {
  color: var(--primary);
  background: #e7f3fb;
}

.metric-accent.green {
  color: #389e0d;
  background: #edf8e9;
}

.metric-accent.amber {
  color: #d48806;
  background: #fff6df;
}

.metric-accent.red {
  color: #cf1322;
  background: #fff0f0;
}

.metric-accent .icon {
  width: 18px;
  height: 18px;
  margin: 9px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 12px;
}

.chart-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px;
  gap: 20px;
  min-height: 240px;
  align-items: center;
}

.bar-chart {
  display: grid;
  height: 184px;
  grid-template-columns: repeat(7, minmax(24px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 10px 8px 28px;
  background-image: repeating-linear-gradient(to top, transparent 0, transparent 39px, var(--diviling-line-color) 40px);
  border-bottom: var(--border-solid);
}

.bar-column {
  position: relative;
  width: min(28px, 70%);
  min-height: 6px;
  justify-self: center;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  transition: var(--transition-h);
}

.bar-column:hover {
  background: var(--primary-hover);
}

.bar-column::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  color: var(--secondary-fc);
  content: attr(data-label);
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-summary {
  display: grid;
  gap: 14px;
}

.chart-summary-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-value {
  color: var(--main-fc);
  font-family: var(--medium-ff);
}

.progress-track {
  height: 6px;
  overflow: hidden;
  background: var(--bg-weak);
  border-radius: 3px;
}

.progress-value {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.activity-list {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  min-height: 52px;
}

.activity-item:not(:last-child)::before {
  position: absolute;
  top: 30px;
  bottom: 0;
  left: 14px;
  width: 1px;
  content: "";
  background: var(--diviling-line-color);
}

.activity-icon {
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--primary);
  background: var(--hover-bc);
  border-radius: 50%;
}

.activity-content {
  padding: 3px 0 13px;
  color: var(--regular-fc);
}

.activity-title {
  color: var(--main-fc);
  line-height: 18px;
}

.activity-meta {
  margin-top: 2px;
  color: var(--secondary-fc);
  font-size: var(--font-size-10);
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.field {
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--regular-fc);
  line-height: 18px;
}

.required::before {
  margin-right: 3px;
  color: var(--danger);
  content: "*";
}

.input,
.select,
.textarea {
  width: 100%;
  height: var(--control-height);
  padding: 4px 8px;
  color: var(--main-fc);
  background: var(--base-white);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
  outline: none;
  transition: var(--transition-all);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--placeholder-fc);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b7c4ce;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(4, 112, 193, 0.1);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  color: var(--secondary-fc);
  background: var(--label-bc);
  cursor: not-allowed;
}

.textarea {
  min-height: 76px;
  resize: vertical;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input {
  padding-left: 30px;
}

.input-with-icon .icon {
  position: absolute;
  top: 8px;
  left: 9px;
  color: var(--secondary-fc);
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.list-surface {
  margin-top: 12px;
  overflow: hidden;
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.list-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: var(--border-solid);
}

.tabs {
  display: flex;
  align-self: stretch;
  gap: 24px;
}

.tab {
  position: relative;
  min-width: 44px;
  padding: 0 2px;
  color: var(--regular-fc);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tab::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: transparent;
}

.tab:hover,
.tab.active {
  color: var(--primary);
}

.tab.active::after {
  background: var(--primary);
}

.toolbar-meta {
  color: var(--secondary-fc);
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 900px;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  height: var(--table-row-height);
  padding: 0 12px;
  overflow: hidden;
  border-bottom: 1px solid var(--diviling-line-color);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table th {
  color: var(--main-fc);
  background: var(--table-head-bg);
  font-family: var(--medium-ff);
  font-weight: 500;
}

.data-table tbody tr {
  cursor: pointer;
  transition: var(--transition-bc);
}

.data-table tbody tr:hover {
  background: var(--hover-bc);
}

.data-table tbody tr.selected {
  background: var(--label-bc-active);
}

.data-table .checkbox-cell {
  width: 44px;
  text-align: center;
}

.data-table .operation-cell {
  width: 82px;
  text-align: right;
}

.record-link {
  overflow: hidden;
  color: var(--primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--primary);
}

.tag {
  display: inline-flex;
  height: 22px;
  align-items: center;
  padding: 0 8px;
  color: var(--regular-fc);
  background: var(--label-bc);
  border: 1px solid transparent;
  border-radius: var(--border-radius-xs);
  font-size: var(--font-size-10);
  line-height: 20px;
  white-space: nowrap;
}

.tag-blue {
  color: #095f9f;
  background: #e9f5fc;
  border-color: #cbe8f8;
}

.tag-green {
  color: #237804;
  background: #f0faeb;
  border-color: #ccebbf;
}

.tag-amber {
  color: #ad6800;
  background: #fff8e6;
  border-color: #ffe2a8;
}

.tag-red {
  color: #a8071a;
  background: #fff1f1;
  border-color: #ffc9cc;
}

.tag-gray {
  color: var(--secondary-fc);
  background: var(--label-bc);
  border-color: var(--border-color);
}

.pagination-bar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 14px;
}

.pagination {
  display: flex;
  gap: 4px;
}

.page-button {
  display: grid;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  place-items: center;
  color: var(--regular-fc);
  background: var(--base-white);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
  cursor: pointer;
}

.page-button:hover,
.page-button.active {
  color: var(--primary);
  border-color: var(--primary);
}

.page-button.active {
  color: var(--base-white);
  background: var(--primary);
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--secondary-fc);
  text-align: center;
}

.empty-visual {
  position: relative;
  width: 88px;
  height: 58px;
  margin: 0 auto 12px;
  background: var(--bg-weak);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.empty-visual::before,
.empty-visual::after {
  position: absolute;
  left: 18px;
  width: 50px;
  height: 1px;
  content: "";
  background: var(--border-color);
}

.empty-visual::before {
  top: 21px;
}

.empty-visual::after {
  top: 34px;
}

.approval-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(440px, 1.28fr);
  min-height: calc(100vh - 126px);
  overflow: hidden;
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.approval-list {
  min-width: 0;
  border-right: var(--border-solid);
}

.approval-list-header {
  padding: 12px;
  border-bottom: var(--border-solid);
}

.approval-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--diviling-line-color);
  cursor: pointer;
  text-align: left;
}

.approval-item:hover,
.approval-item.active {
  background: var(--hover-bc);
}

.approval-item.active {
  box-shadow: inset 3px 0 var(--primary);
}

.approval-item-title {
  overflow: hidden;
  color: var(--main-fc);
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-item-meta {
  margin-top: 4px;
  color: var(--secondary-fc);
  font-size: var(--font-size-10);
}

.approval-detail {
  min-width: 0;
  overflow: auto;
}

.detail-titlebar {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: var(--border-solid);
}

.detail-titlebar h2 {
  margin: 0;
  color: var(--main-fc);
  font-size: var(--font-size-16);
  font-weight: 500;
  letter-spacing: 0;
}

.detail-section {
  padding: 16px 18px;
  border-bottom: var(--border-solid);
}

.detail-section-title {
  margin: 0 0 12px;
  color: var(--main-fc);
  font-size: var(--font-size-14);
  font-weight: 500;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 14px;
  column-gap: 24px;
}

.detail-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.detail-field-label {
  color: var(--secondary-fc);
  text-align: right;
}

.detail-field-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--main-fc);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 18px minmax(0, 1fr);
  gap: 8px;
  min-height: 58px;
}

.timeline-item:not(:last-child)::after {
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 88px;
  width: 1px;
  content: "";
  background: var(--border-color);
}

.timeline-time {
  color: var(--secondary-fc);
  font-size: var(--font-size-10);
  text-align: right;
}

.timeline-dot {
  z-index: 1;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  background: var(--base-white);
  border: 2px solid var(--primary);
  border-radius: 50%;
}

.timeline-content strong {
  display: block;
  color: var(--main-fc);
  font-weight: 500;
}

.timeline-content span {
  display: block;
  margin-top: 2px;
  color: var(--secondary-fc);
}

.recipe-grid,
.component-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
}

.recipe-card,
.component-card {
  min-width: 0;
  overflow: hidden;
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.recipe-preview {
  height: 170px;
  padding: 12px;
  overflow: hidden;
  background: var(--page-bg);
  border-bottom: var(--border-solid);
}

.mini-shell {
  display: grid;
  grid-template: 18px minmax(0, 1fr) / 44px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: 2px;
}

.mini-top {
  grid-column: 1 / -1;
  background: var(--panel-bg);
  border-bottom: var(--border-solid);
}

.mini-side {
  background: var(--panel-bg);
  border-right: var(--border-solid);
}

.mini-main {
  display: grid;
  gap: 6px;
  padding: 7px;
  background: var(--page-bg);
}

.mini-line,
.mini-block {
  min-height: 5px;
  background: #dfe4e8;
  border-radius: 1px;
}

.mini-line.short {
  width: 38%;
}

.mini-line.primary {
  width: 24%;
  margin-left: auto;
  background: var(--primary);
}

.mini-block {
  min-height: 34px;
  background: var(--base-white);
  border: var(--border-solid);
}

.mini-table {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  background: var(--base-white);
  border: var(--border-solid);
}

.mini-table span {
  border-bottom: 1px solid var(--diviling-line-color);
}

.mini-chart {
  display: flex;
  min-height: 76px;
  align-items: end;
  justify-content: space-around;
  padding: 10px;
  background: var(--base-white);
  border: var(--border-solid);
}

.mini-chart span {
  width: 12%;
  background: var(--primary);
}

.recipe-body,
.component-body {
  padding: 14px;
}

.recipe-title,
.component-title {
  margin: 0;
  color: var(--main-fc);
  font-size: var(--font-size-14);
  font-weight: 500;
}

.recipe-description,
.component-description {
  min-height: 36px;
  margin: 5px 0 10px;
  color: var(--secondary-fc);
}

.component-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.component-showcase {
  min-height: 126px;
  padding: 14px;
  background: var(--bg-base);
  border-bottom: var(--border-solid);
}

.showcase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.showcase-row + .showcase-row {
  margin-top: 10px;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-weak);
  border-radius: var(--border-radius-xs);
}

.segment {
  height: 26px;
  padding: 0 12px;
  color: var(--regular-fc);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.segment.active {
  color: var(--primary);
  background: var(--base-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.switch {
  position: relative;
  width: 34px;
  height: 18px;
  background: var(--invalid);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  content: "";
  background: var(--base-white);
  border-radius: 50%;
  transition: var(--transition-all);
}

.switch.on {
  background: var(--primary);
}

.switch.on::after {
  transform: translateX(16px);
}

.token-section {
  padding: 16px;
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.token-section + .token-section {
  margin-top: 12px;
}

.token-section h2 {
  margin: 0 0 14px;
  color: var(--main-fc);
  font-size: var(--font-size-14);
  font-weight: 500;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.color-token {
  overflow: hidden;
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.color-swatch {
  height: 54px;
}

.color-meta {
  padding: 8px;
  background: var(--panel-bg);
}

.color-name {
  color: var(--main-fc);
}

.color-value {
  margin-top: 2px;
  color: var(--secondary-fc);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--font-size-10);
}

.type-scale {
  display: grid;
  gap: 10px;
}

.type-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--diviling-line-color);
}

.type-meta {
  color: var(--secondary-fc);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--font-size-10);
}

.spacing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: end;
}

.spacing-token {
  display: grid;
  gap: 6px;
  color: var(--secondary-fc);
  text-align: center;
}

.spacing-block {
  min-width: 14px;
  height: 18px;
  justify-self: center;
  background: var(--primary);
}

.overlay {
  position: fixed;
  z-index: var(--modal-zindex);
  inset: 0;
  display: none;
  background: var(--mask-bc);
}

.overlay.open {
  display: block;
}

.dialog {
  position: fixed;
  z-index: calc(var(--modal-zindex) + 1);
  top: 50%;
  left: 50%;
  display: none;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--panel-bg);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--box-shadow);
  transform: translate(-50%, -50%);
}

.dialog.open {
  display: flex;
  flex-direction: column;
}

.dialog-wide {
  width: min(900px, calc(100vw - 32px));
}

.dialog-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: var(--border-solid);
}

.dialog-title {
  margin: 0;
  color: var(--main-fc);
  font-size: var(--font-size-16);
  font-weight: 500;
}

.dialog-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.dialog-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px;
  border-top: var(--border-solid);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.field-full {
  grid-column: 1 / -1;
}

.form-error {
  min-height: 18px;
  margin-top: 4px;
  color: var(--danger);
  font-size: var(--font-size-10);
}

.spec-editor {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.72fr);
  gap: 16px;
}

.code-editor {
  width: 100%;
  min-height: 420px;
  padding: 12px;
  color: #d7e2ea;
  background: #17232c;
  border: 1px solid #263844;
  border-radius: var(--border-radius-xs);
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--font-size-12);
  line-height: 1.6;
  resize: vertical;
  tab-size: 2;
}

.spec-guide {
  padding: 14px;
  background: var(--bg-base);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
}

.spec-guide h3 {
  margin: 0 0 10px;
  color: var(--main-fc);
  font-size: var(--font-size-14);
  font-weight: 500;
}

.spec-guide code {
  color: #095f9f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.drawer {
  position: fixed;
  z-index: var(--popup-zindex);
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  display: flex;
  width: min(560px, calc(100vw - 24px));
  flex-direction: column;
  background: var(--panel-bg);
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.12);
  transform: translateX(105%);
  transition: transform var(--transition-du) var(--transition-tf);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: var(--border-solid);
}

.drawer-title {
  margin: 0;
  overflow: hidden;
  color: var(--main-fc);
  font-size: var(--font-size-16);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.drawer-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px;
  border-top: var(--border-solid);
}

.toast {
  position: fixed;
  z-index: var(--toast-zindex);
  top: 68px;
  left: 50%;
  display: flex;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 32px));
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--main-fc);
  background: var(--panel-bg);
  border: var(--border-solid);
  border-radius: var(--border-radius-xs);
  box-shadow: var(--box-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: var(--transition-all);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .icon {
  color: var(--success);
}

.mobile-menu-button {
  display: none;
}

@media (max-width: 1120px) {
  .metric-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(3) {
    border-left: 0;
    border-top: var(--border-solid);
  }

  .metric:nth-child(4) {
    border-top: var(--border-solid);
  }

  .dashboard-grid,
  .approval-layout {
    grid-template-columns: 1fr;
  }

  .approval-list {
    max-height: 330px;
    overflow: auto;
    border-right: 0;
    border-bottom: var(--border-solid);
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .recipe-grid,
  .component-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .color-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .e10-shell {
    grid-template: var(--topbar-height) minmax(0, 1fr) / 1fr;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .brand {
    width: auto;
    padding: 0 10px;
    border-right: 0;
  }

  .brand-copy,
  .global-search {
    display: none;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .user-menu span:not(.avatar) {
    display: none;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 48px));
    box-shadow: 5px 0 16px rgba(0, 0, 0, 0.12);
    transform: translateX(-105%);
    transition: transform var(--transition-du) var(--transition-tf);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    grid-row: 2;
  }

  .view {
    padding: 10px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions,
  .button-row {
    justify-content: flex-start;
  }

  .metric-band,
  .filter-panel,
  .recipe-grid,
  .component-grid,
  .form-grid,
  .spec-editor,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .metric + .metric,
  .metric:nth-child(3) {
    border-top: var(--border-solid);
    border-left: 0;
  }

  .chart-wrap {
    grid-template-columns: 1fr;
  }

  .chart-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-actions,
  .field-full {
    grid-column: 1;
  }

  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .tabs {
    min-height: 38px;
    overflow-x: auto;
  }

  .pagination-bar {
    align-items: flex-end;
    flex-direction: column;
  }

  .color-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .detail-field {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .dialog {
    width: calc(100vw - 20px);
  }

  .dialog-body {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
