body.console-page {
  height: 100dvh;
  overflow: hidden;
  background: var(--paper-2);
}

.cs-app {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

.cs-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 14px 16px;
  background: var(--ink);
  color: var(--paper);
  overflow-y: auto;
  z-index: 60;
}

.cs-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px 22px;
  text-decoration: none;
}

.cs-brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(242, 200, 75, 0.22);
}

.cs-brand .brand-word {
  color: var(--paper);
  font-size: 20px;
}

.cs-brand .brand-code {
  color: var(--maize);
  font-size: 12px;
}

.cs-brand-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--maize);
  border: 1px solid rgba(242, 200, 75, 0.35);
  padding: 2px 5px;
  border-radius: 2px;
}

.cs-nav-group {
  margin-top: 18px;
}

.cs-nav-label {
  padding: 0 10px;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 243, 236, 0.38);
}

.cs-nav {
  display: grid;
  gap: 2px;
}

.cs-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-left: 2px solid transparent;
  border-radius: 2px;
  font-size: 13px;
  text-decoration: none;
  color: rgba(243, 243, 236, 0.66);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.cs-nav a .od-icon {
  --od-icon-size: 17px;
  opacity: 0.8;
}

.cs-nav a:hover {
  background: rgba(243, 243, 236, 0.05);
  color: var(--paper);
}

.cs-nav a[aria-current="page"] {
  background: rgba(242, 200, 75, 0.1);
  border-left-color: var(--maize);
  color: var(--paper);
}

.cs-nav a[aria-current="page"] .od-icon {
  color: var(--maize);
  opacity: 1;
}

.cs-sidebar-foot {
  margin-top: auto;
  padding-top: 24px;
}

.cs-balance {
  border: 1px solid var(--ink-line);
  padding: 12px;
  border-radius: 3px;
  background: rgba(243, 243, 236, 0.03);
}

.cs-balance span {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(243, 243, 236, 0.45);
}

.cs-balance strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.cs-balance a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--maize);
  text-decoration: none;
}

.cs-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 8px 6px;
  border-top: 1px solid var(--ink-line);
}

.cs-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

.cs-user-meta {
  min-width: 0;
}

.cs-user-meta strong {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.cs-user-meta span {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: rgba(243, 243, 236, 0.42);
}

.cs-main {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.cs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 3vw, 34px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.cs-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cs-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  align-items: center;
  justify-content: center;
  flex: none;
}

.cs-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted-2);
  white-space: nowrap;
}

.cs-crumb span {
  color: var(--ink);
  font-weight: 500;
}

.cs-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.cs-topbar-right a {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}

.cs-topbar-right a:hover {
  color: var(--ink);
}

.cs-env {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.cs-env::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--maize-deep);
}

.cs-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(16px, 2vw, 24px) clamp(18px, 3vw, 40px) 56px;
  min-height: 0;
}

.cs-view[hidden] {
  display: none;
}

.cs-view {
  max-width: 1180px;
  margin-inline: auto;
}

.cs-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.cs-page-head h1 {
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.cs-page-head p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.cs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.cs-btn .od-icon {
  --od-icon-size: 15px;
}

.cs-btn-ink {
  background: var(--ink);
  color: var(--paper);
}

.cs-btn-ink:hover {
  background: var(--ink-3);
}

.cs-btn-line {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.cs-btn-line:hover {
  border-color: var(--ink);
}

.cs-btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding-inline: 8px;
}

.cs-btn-quiet:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.cs-btn-danger:hover {
  color: #8a2f1d;
  background: rgba(138, 47, 29, 0.07);
}

.cs-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cs-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.cs-stat {
  background: #fbfbf6;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px 18px;
  min-width: 0;
}

.cs-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cs-stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.cs-stat-delta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--maize-deep);
  white-space: nowrap;
}

.cs-stat strong {
  display: block;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 31px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cs-stat strong small {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--muted-2);
  margin-left: 3px;
  letter-spacing: 0;
}

.cs-stat-foot {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.cs-board {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.cs-card {
  background: #fbfbf6;
  border: 1px solid var(--line);
  border-radius: 3px;
  min-width: 0;
}

.cs-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.cs-card-title {
  font-size: 13px;
  font-weight: 600;
}

.cs-card-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}

.cs-card-body {
  padding: 16px 18px;
}

.cs-chart-tabs {
  display: flex;
  gap: 2px;
}

.cs-chart-tabs button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.cs-chart-tabs button[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.cs-chart {
  position: relative;
  margin-top: 4px;
}

.cs-chart svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 230;
}

.chart-axis {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--muted-2);
}

.chart-label {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 2px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
}

.cs-chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.cs-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 12px;
  height: 2px;
  background: var(--maize-deep);
}

.swatch.alt {
  background: var(--celadon);
}

.cs-quick {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.cs-quick button,
.cs-quick a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  background: #fbfbf6;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.16s var(--ease);
}

.cs-quick button:hover,
.cs-quick a:hover {
  background: var(--paper);
}

.cs-quick span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cs-quick .od-icon {
  --od-icon-size: 16px;
  color: var(--muted);
}

.cs-quick em {
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

.cs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cs-select,
.cs-input {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbfbf6;
  font-size: 12.5px;
  color: var(--ink);
}

.cs-select:focus,
.cs-input:focus {
  outline: 2px solid var(--maize-deep);
  outline-offset: 1px;
}

.cs-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbfbf6;
  min-width: 200px;
}

.cs-search:focus-within {
  border-color: var(--ink);
}

.cs-search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  width: 100%;
}

.cs-search .od-icon {
  --od-icon-size: 15px;
  color: var(--muted-2);
}

.cs-table-wrap {
  overflow-x: auto;
}

.cs-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
}

.cs-table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}

.cs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}

.cs-table tr:last-child td {
  border-bottom: 0;
}

.cs-table tbody tr:hover {
  background: var(--paper);
}

.cs-table .cell-main {
  color: var(--ink);
  font-weight: 500;
}

.cs-table .cell-mono {
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cs-table .cell-actions {
  text-align: right;
}

.cs-table .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.cs-table .row-actions button {
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.cs-table .row-actions button:hover {
  border-color: var(--line);
  color: var(--ink);
  background: #fbfbf6;
}

.cs-table .row-actions button.is-danger:hover {
  color: #8a2f1d;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border-radius: 2px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--celadon);
}

.badge.warn::before {
  background: var(--maize-deep);
}

.badge.off::before {
  background: var(--muted-2);
}

.badge.danger::before {
  background: #a5442f;
}

.cs-empty {
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  background: #fbfbf6;
}

.cs-empty h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.cs-empty p {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.mono-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.secret-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(150, 104, 15, 0.35);
  background: rgba(242, 200, 75, 0.1);
  border-radius: 3px;
}

.secret-banner[hidden] {
  display: none;
}

.secret-banner strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.secret-banner p {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.secret-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.secret-value code {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 7px 10px;
  background: var(--ink);
  color: var(--maize);
  border-radius: 2px;
}

.cs-note {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.cs-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #fbfbf6;
  border-radius: 3px 3px 0 0;
}

.cs-summary {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.cs-summary div span {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.cs-summary div strong {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.cs-summary + .cs-card {
  border-radius: 0 0 3px 3px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.model-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fbfbf6;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
  transition: border-color 0.18s var(--ease);
}

.model-card:hover {
  border-color: var(--line-strong);
}

.model-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.model-card h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.model-card .model-vendor {
  padding: 0 6px;
  min-height: 20px;
  font-size: 9.5px;
}

.model-card-id {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
  overflow-wrap: anywhere;
}

.model-card-spec {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.model-card-spec div span {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.model-card-spec div strong {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.model-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.model-card-foot button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
}

.model-card-foot button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.model-card-foot .price {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.pg-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 12px;
  align-items: stretch;
  /* 兜底高度（不支持 :has 的浏览器）；支持时由下方弹性布局精确撑满 */
  height: clamp(420px, calc(100dvh - 276px), 900px);
  /* 显式行高，避免隐式行按内容撑开覆盖固定高度 */
  grid-template-rows: minmax(0, 1fr);
}

/* 体验场：让内容区精确占满剩余空间，避免依赖视口高度魔法数字 */
.cs-scroll:has(#view-playground:not([hidden])) {
  display: flex;
  flex-direction: column;
  /* 体验场自身占满视口，不需要额外的底部留白，否则会出现轻微滚动 */
  padding-bottom: 0;
}

#view-playground:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  /* flex 子项上的 margin-inline:auto 会阻止横向拉伸，需显式给宽度才能保持 1180px 居中 */
  width: 100%;
}

#view-playground:not([hidden]) .pg-wrap {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.pg-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* 固定高度由 .pg-wrap 决定，这里必须撑满且不参与内容撑高 */
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  overflow: hidden;
  background: #fbfbf6;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.pg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.pg-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pg-head-left strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.pg-head-left .cs-select {
  height: 32px;
  font-size: 11.5px;
  max-width: 230px;
}

.pg-messages {
  overflow-y: auto;
  padding: 22px 20px;
  min-height: 0;
}

.pg-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  text-align: center;
  padding: 24px;
}

.pg-empty h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pg-empty p {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.pg-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 18px;
}

.pg-suggestions button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.pg-suggestions button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.pg-msg {
  max-width: 62ch;
  margin-bottom: 24px;
}

.pg-msg-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.pg-msg-label::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--maize-deep);
}

.pg-msg-body {
  margin-top: 7px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pg-msg.user .pg-msg-body {
  color: var(--muted);
}

.pg-msg.assistant .pg-msg-body {
  padding-left: 15px;
  border-left: 1px solid var(--line);
}

.pg-caret {
  display: inline-block;
  width: 6px;
  height: 1.1em;
  vertical-align: -0.15em;
  background: var(--maize-deep);
  margin-left: 2px;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.pg-meta {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
}

.pg-composer {
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
}

.pg-composer-box {
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper);
  padding: 10px 12px;
}

.pg-composer-box:focus-within {
  border-color: var(--ink);
}

.pg-composer textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 160px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.7;
}

.pg-composer textarea::placeholder {
  color: var(--muted-2);
}

.pg-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.pg-composer-hint {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
}

.pg-send {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pg-send:hover {
  background: var(--ink-3);
}

.pg-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pg-settings {
  background: #fbfbf6;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
  /* 与对话区同高；内容超出时自身滚动，避免把整行撑高 */
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  align-self: stretch;
}

.pg-settings h3 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.pg-field {
  margin-top: 18px;
}

.pg-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.pg-field label output {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink);
}

.pg-field .cs-select {
  width: 100%;
  height: 34px;
  font-size: 11.5px;
  background: var(--paper);
}

.pg-field textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.65;
  resize: vertical;
}

.pg-settings-note {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted-2);
}

.cs-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(16, 26, 21, 0.42);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 26, 21, 0.5);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(468px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 4px;
  padding: clamp(22px, 4vw, 30px);
  box-shadow: 0 40px 80px -40px rgba(16, 26, 21, 0.6);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.modal-head p {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  display: grid;
  place-items: center;
  flex: none;
}

.modal-form {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.form-field label {
  font-size: 12px;
  font-weight: 500;
}

.form-field label span {
  color: var(--maize-deep);
}

.form-field input,
.form-field select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fbfbf6;
  font-size: 13px;
}

.form-field input:focus,
.form-field select:focus {
  outline: 2px solid var(--maize-deep);
  outline-offset: 1px;
}

.form-hint {
  font-size: 10.5px;
  color: var(--muted-2);
}

.form-error {
  font-size: 11.5px;
  color: #8a2f1d;
}

.form-error:empty {
  display: none;
}

.form-field.has-error input {
  border-color: #a5442f;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

  .pg-wrap {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
}

@media (max-width: 1020px) {
  .cs-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .pg-settings {
    display: none;
  }
}

@media (max-width: 900px) {
  .cs-app {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 242px;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: 30px 0 60px -40px rgba(0, 0, 0, 0.6);
  }

  .cs-app.is-open .cs-sidebar {
    transform: none;
  }

  .cs-app.is-open .cs-drawer-backdrop {
    display: block;
  }

  .cs-burger {
    display: inline-flex;
  }

  .cs-topbar-right .cs-env {
    display: none;
  }
}

@media (max-width: 640px) {
  .cs-topbar {
    height: 58px;
    padding-inline: 14px;
  }

  .cs-main {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .cs-topbar-right a {
    display: none;
  }

  .cs-scroll {
    padding: 14px 14px 48px;
  }

  .cs-page-head {
    align-items: flex-start;
  }

  .cs-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .cs-stat {
    padding: 13px;
  }

  .cs-stat strong {
    font-size: 23px;
  }

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

  .pg-wrap {
    height: clamp(360px, calc(100dvh - 240px), 720px);
    grid-template-rows: minmax(0, 1fr);
  }

  .pg-chat {
    min-height: 0;
  }

  .pg-messages {
    padding: 18px 14px;
  }

  .pg-head {
    padding: 10px 12px;
  }

  .pg-composer {
    padding: 10px 12px 12px;
  }

  .cs-summary {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-sidebar {
    transition: none;
  }

  .pg-caret {
    animation: none;
  }
}

/* ============================================================
   CONSOLE MOTION
   ============================================================ */

@keyframes cs-view-in {
  from { opacity: 0; translate: 0 14px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.975); }
  to { opacity: 1; transform: none; }
}

@keyframes pg-msg-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}

.cs-view {
  animation: cs-view-in 0.5s var(--ease) both;
}

.cs-brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: 0 0 0 1px rgba(242, 200, 75, 0.5), 0 8px 18px -10px rgba(0, 0, 0, 0.5);
}

.cs-nav a {
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), padding-left 0.25s var(--ease);
}

.cs-nav a[aria-current="page"] {
  padding-left: 12px;
}

.cs-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.cs-btn::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(242, 200, 75, 0.22), transparent);
  transform: translateX(-170%) skewX(-18deg);
  transition: transform 0.65s var(--ease);
  pointer-events: none;
}

.cs-btn:hover::after {
  transform: translateX(420%) skewX(-18deg);
}

.cs-stat,
.cs-card {
  transition: border-color 0.3s var(--ease), box-shadow 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.cs-stat:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 38px -32px rgba(27, 30, 26, 0.6);
}

.cs-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 46px -40px rgba(27, 30, 26, 0.45);
}

.cs-chart-tabs button {
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.cs-table tbody tr {
  transition: background-color 0.22s var(--ease);
}

.cs-table tbody tr:hover {
  background: rgba(242, 200, 75, 0.07);
}

.cs-table tbody td {
  transition: background-color 0.22s var(--ease);
}

.modal-backdrop {
  animation: modal-fade 0.25s ease both;
}

.modal {
  animation: modal-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pg-msg {
  animation: pg-msg-in 0.4s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
  .cs-view,
  .modal,
  .modal-backdrop,
  .pg-msg {
    animation: none;
  }

  .cs-stat:hover {
    transform: none;
  }
}

/* ============================================================
   Wallet · Subscription · Security · Profile
   ============================================================ */

.cs-user {
  text-decoration: none;
  border-radius: 2px;
  transition: background-color 0.18s var(--ease);
}

.cs-user:hover {
  background: rgba(243, 243, 236, 0.05);
}

.cs-user-arrow {
  --od-icon-size: 13px;
  margin-left: auto;
  color: rgba(243, 243, 236, 0.35);
  flex: none;
}

.cs-signout {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 2px;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  border-radius: 2px;
  font-size: 10.5px;
  color: rgba(243, 243, 236, 0.42);
  text-align: left;
}

.cs-signout .od-icon {
  --od-icon-size: 14px;
}

.cs-signout:hover {
  background: rgba(243, 243, 236, 0.05);
  color: var(--paper);
}

.cs-stack {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.wallet-board {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.72fr);
}

.amount-in {
  color: var(--sage-deep);
}

.amount-out {
  color: var(--ink);
}

.ledger-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.pay-list {
  display: grid;
}

.pay-list.is-compact {
  border: 1px solid var(--line);
  border-radius: 2px;
  margin-top: 2px;
}

.pay-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.16s var(--ease);
}

.pay-list .pay-option:last-child {
  border-bottom: 0;
}

.pay-option:hover {
  background: var(--paper);
}

.pay-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pay-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.pay-meta {
  min-width: 0;
}

.pay-meta strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.pay-meta small {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--muted-2);
}

.pay-check {
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.16s var(--ease), box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}

.pay-option input:checked ~ .pay-mark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--maize);
}

.pay-option input:checked ~ .pay-check {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 3px #fbfbf6;
}

.pay-option:has(input:checked) {
  background: rgba(242, 200, 75, 0.08);
}

.pay-option input:focus-visible ~ .pay-check {
  outline: 2px solid var(--maize-deep);
  outline-offset: 2px;
}

.card-note {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted-2);
}

.cs-badge-current {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.cs-badge-current::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--celadon);
}

.cs-badge-current.is-off::before {
  background: var(--muted-2);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row.compact {
  padding: 13px 18px;
}

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

.setting-copy strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.setting-copy p {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-flex;
  flex: none;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fbfbf6;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.switch-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: var(--muted-2);
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--ink);
  border-color: var(--ink);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: var(--maize);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--maize-deep);
  outline-offset: 2px;
}

/* ---------------------------------------------------------- plans */
.plan-hero {
  margin-bottom: 16px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--maize-deep);
  border-radius: 3px;
  background: #fbfbf6;
}

.plan-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.plan-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--maize-deep);
}

.plan-hero h2 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.plan-desc {
  margin-top: 7px;
  max-width: 46ch;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}

.plan-price {
  text-align: right;
}

.plan-price strong {
  display: block;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.plan-price span {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.plan-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  border: 1px solid var(--line);
  background: var(--line);
}

.plan-facts div {
  padding: 11px 13px;
  background: var(--paper);
}

.plan-facts span {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.plan-facts strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
}

.plan-facts strong.is-ok {
  color: var(--sage-deep);
}

.plan-quota {
  margin-top: 20px;
}

.plan-quota-head,
.plan-quota-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.plan-quota-head strong {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.meter {
  height: 6px;
  margin: 8px 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.meter i {
  display: block;
  height: 100%;
  background: var(--ink);
}

.plan-quota-foot {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.plan-hero-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fbfbf6;
}

.plan-card.is-current {
  border-color: var(--ink);
  box-shadow: inset 0 2px 0 var(--maize);
  background: #fffdf4;
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-card-head h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.plan-tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  border: 1px solid var(--line);
  padding: 3px 5px;
}

.plan-tag.is-solid {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--maize);
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 14px;
}

.plan-card-price strong {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plan-card-price span {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.plan-card-desc {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.plan-features {
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.plan-features li::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-top: 6px;
  flex: none;
  background: var(--sage);
}

.plan-card .cs-btn {
  width: 100%;
  margin-top: auto;
}

.plan-disclaimer {
  margin-top: 14px;
}

/* ------------------------------------------------------- security */
.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
  margin-bottom: 12px;
}

.cs-form-grid {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.cs-form-grid textarea,
.form-field textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fbfbf6;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
}

.cs-form-grid textarea:focus,
.form-field textarea:focus {
  outline: 2px solid var(--maize-deep);
  outline-offset: 1px;
}

.cs-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.cs-btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.link-danger,
.link-muted {
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
}

.link-danger:hover {
  border-color: rgba(138, 47, 29, 0.35);
  color: #8a2f1d;
  background: rgba(138, 47, 29, 0.04);
}

.link-muted:disabled {
  color: var(--muted-2);
  cursor: default;
}

.danger-card {
  margin-top: 12px;
}

.cs-btn.is-danger {
  color: #8a2f1d;
}

.cs-btn.is-danger:hover {
  border-color: rgba(138, 47, 29, 0.5);
  background: rgba(138, 47, 29, 0.05);
}

/* -------------------------------------------------------- profile */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
  gap: 12px;
  align-items: start;
}

.profile-form {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 20px;
}

.avatar-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.avatar-row p {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.avatar-row .cs-btn {
  margin-left: auto;
}

.profile-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.profile-field-grid .form-field input:disabled,
.profile-field-grid .form-field select:disabled {
  background: var(--paper-2);
  color: var(--muted);
}

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

/* 表单内按钮（如"绑定邮箱"）不撑满整行，与输入框左对齐 */
.form-field > .cs-btn {
  justify-self: start;
}

.input-with-badge input {
  width: 100%;
  padding-right: 76px;
}

.input-with-badge .badge {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: #fbfbf6;
}

.profile-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account-facts {
  display: grid;
}

.account-facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
}

.account-facts div:last-child {
  border-bottom: 0;
}

.account-facts dt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.account-facts dd {
  font-size: 12px;
  color: var(--ink);
}

.account-facts dd.mono {
  font-family: var(--mono);
  font-size: 10.5px;
}

.account-facts a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quick-links {
  display: grid;
}

.quick-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.16s var(--ease);
}

.quick-links a:last-child {
  border-bottom: 0;
}

.quick-links a:hover {
  background: var(--paper);
}

.quick-links span {
  font-family: var(--mono);
  color: var(--muted-2);
}

.profile-disclaimer {
  margin-top: 14px;
}

/* -------------------------------------------------------- recharge */
.amount-chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.amount-chips button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbfbf6;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.amount-chips button:hover {
  border-color: var(--line-strong);
}

.amount-chips button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--maize);
}

.recharge-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.recharge-summary strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  color: var(--ink);
}

/* ------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .wallet-board,
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

@media (max-width: 720px) {
  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .setting-row {
    align-items: flex-start;
    gap: 14px;
  }

  .avatar-row .cs-btn {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .amount-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plan-price {
    text-align: left;
  }

  .plan-hero-actions {
    justify-content: stretch;
  }

  .plan-hero-actions .cs-btn {
    flex: 1;
  }
}

/* ============================================================
   Admin: channels · users · redemption · settings
   ============================================================ */

.cs-sidebar {
  overflow: hidden;
}

.cs-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 0 4px 8px;
}

.cs-sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.cs-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(243, 243, 236, 0.18);
}

.cs-sidebar-foot {
  border-top: 1px solid var(--ink-line);
  padding-top: 14px;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  color: var(--muted-2);
}

.channel-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--sage);
}

.status-dot.is-off {
  background: var(--muted-2);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar-xs {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-2);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

.user-cell strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.user-cell small {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--muted-2);
}

.admin-note {
  display: block;
  margin-top: 12px;
  line-height: 1.7;
}

.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.settings-body .setting-row {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.settings-body .setting-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-body .form-field textarea {
  min-height: 68px;
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.invite-link-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.invite-link-box > span {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.invite-link-box code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
  align-self: center;
}

.mini-copy {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 2px;
  font-size: 10px;
  color: var(--ink);
}

.mini-copy:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

@media (max-width: 1020px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .field-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cs-nav-group {
  margin-top: 9px;
}

.cs-nav-label {
  margin-bottom: 4px;
}

.cs-nav a {
  min-height: 32px;
}

.cs-table .cell-check {
  width: 38px;
  padding-right: 0;
  text-align: center;
}

.cs-table .cell-check input,
.bulk-bar input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #1b1e1a;
  cursor: pointer;
}

.cs-table-wide {
  min-width: 900px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #f7f4e6;
  font-size: 11px;
  color: var(--muted);
}

.bulk-bar[hidden] {
  display: none;
}

.bulk-summary {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.bulk-summary strong {
  color: var(--ink);
  font-weight: 600;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  margin-left: auto;
}

.bulk-actions button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.bulk-actions button:hover {
  border-color: var(--line);
  background: #fffdf6;
  color: var(--ink);
}

.bulk-actions button.is-danger:hover {
  color: #8a2f1d;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
}

.segmented button {
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.segmented button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-tabs button {
  position: relative;
  height: 38px;
  margin-bottom: -1px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.settings-tabs button:hover {
  color: var(--ink);
}

.settings-tabs button[aria-selected="true"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.settings-panel[hidden] {
  display: none;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.info-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.info-row strong {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}

@media (max-width: 640px) {
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .settings-tabs button {
    flex: 0 0 auto;
  }

  .bulk-actions {
    margin-left: 0;
    width: 100%;
  }
}
