.checklist {
  display: grid;
  gap: 10px;
}

.checklist__item {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.024);
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.checklist__item.is-ok {
  border-color: rgba(79, 227, 154, 0.22);
  background: rgba(79, 227, 154, 0.08);
}

.checklist__item.is-warn {
  border-color: rgba(241, 180, 76, 0.22);
  background: rgba(241, 180, 76, 0.08);
}

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

.checklist__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.checklist__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(13, 19, 31, 0.94));
  box-shadow: var(--shadow-soft);
  scrollbar-gutter: stable;
}

.table-wrap--configs {
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
}

.table th,
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  vertical-align: middle;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(13, 19, 31, 0.98);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.table thead th:first-child {
  border-top-left-radius: 14px;
}

.table thead th:last-child {
  border-top-right-radius: 14px;
}

.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.table tbody tr:hover td {
  background: rgba(0, 209, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 209, 255, 0.12);
}

.table td:first-child,
.table th:first-child {
  text-align: left;
}

.records {
  display: grid;
  gap: 12px;
}

.record {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 23, 34, 0.96), rgba(13, 19, 31, 0.94));
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}

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

.record__title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.record__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.record__body {
  margin: 0;
  color: #d8e2ff;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.65;
}

.trade-history {
  display: grid;
  gap: 12px;
}

.trade-history__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(17, 23, 34, 0.96), rgba(13, 19, 31, 0.92));
}

.trade-history__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trade-stat {
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 209, 255, 0.05);
  display: grid;
  gap: 4px;
}

.trade-stat__label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trade-stat__value {
  font-weight: 700;
  font-size: 14px;
}

.trade-history__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trade-table-wrap .table {
  min-width: 980px;
}

.trade-table td,
.trade-table th {
  vertical-align: top;
}

.trade-table__pair {
  display: grid;
  gap: 6px;
}

.trade-pill {
  width: fit-content;
}

.trade-pnl {
  font-weight: 700;
}

.trade-pnl--success {
  color: var(--success);
}

.trade-pnl--danger {
  color: var(--danger);
}

.trade-pnl--muted {
  color: var(--muted);
}

.trade-details summary {
  cursor: pointer;
  color: #9fd0ff;
  font-size: 12px;
}

.trade-details[open] summary {
  margin-bottom: 8px;
}

.trade-details__json {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 8, 20, 0.7);
  color: #dbe7ff;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.log--info {
  color: #9fd0ff;
}

.log--success {
  color: var(--success);
}

.log--warning {
  color: var(--warning);
}

.log--danger {
  color: var(--danger);
}

.empty-state {
  padding: 14px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
  line-height: 1.55;
}

.code {
  margin: 0;
  padding: 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(4, 10, 22, 0.74);
  color: #dbe7ff;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
}

.json-accordion {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.json-accordion__summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 13px;
}

.json-accordion__summary::-webkit-details-marker {
  display: none;
}

.json-accordion__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.json-accordion__hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.json-accordion__body {
  padding: 0 10px 10px;
}

.json-accordion__code {
  max-height: 320px;
  overflow: auto;
  margin: 0;
}

.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
}

.modal-mask.is-open {
  display: flex;
}

.modal {
  width: min(100%, 540px);
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(18, 26, 44, 0.98), rgba(11, 17, 31, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal__header {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.modal__body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.modal__footer {
  padding: 15px 16px 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: none;
  max-width: min(520px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(16, 23, 39, 0.98), rgba(12, 18, 32, 0.96));
  box-shadow: var(--shadow-soft);
  line-height: 1.55;
}

.toast.is-visible {
  display: block;
  animation: toast-in 0.18s ease;
}

@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast--success {
  color: var(--success);
  border-color: rgba(79, 227, 154, 0.24);
}

.toast--warning {
  color: var(--warning);
  border-color: rgba(241, 180, 76, 0.24);
}

.toast--danger {
  color: var(--danger);
  border-color: rgba(255, 117, 130, 0.24);
}

.toast--info {
  color: var(--info);
  border-color: rgba(100, 167, 255, 0.24);
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 20, 0.68);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.busy-overlay[hidden] {
  display: none;
}

.busy-overlay__card {
  width: min(100%, 460px);
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(18, 26, 44, 0.98), rgba(11, 17, 31, 0.98));
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  text-align: center;
}

.busy-overlay__spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--info);
  margin: 0 auto;
  animation: busy-spin 0.8s linear infinite;
}

.busy-overlay__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.busy-overlay__body {
  color: var(--muted);
  line-height: 1.6;
}

.busy-overlay__detail {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(100, 167, 255, 0.22);
  background: rgba(100, 167, 255, 0.1);
  color: #dceaff;
  line-height: 1.55;
  word-break: break-word;
}

@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login__card {
  width: min(100%, 480px);
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(18, 26, 44, 0.98), rgba(11, 17, 31, 0.96));
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.login__brand {
  display: grid;
  gap: 8px;
}

.login__title {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.login__subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.login__component-label {
  margin: 0;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(129, 176, 255, 0.98);
  border: 1px solid rgba(100, 167, 255, 0.28);
  background: rgba(100, 167, 255, 0.08);
}

.login__flow-hint {
  margin: 0;
  padding-top: 4px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.login__flow-hint strong {
  color: #dceaff;
  font-weight: 600;
}

.login__flow-step {
  font-weight: 700;
  color: rgba(129, 176, 255, 0.95);
}

.brand__component-label {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(129, 176, 255, 0.85);
}

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

.login__form {
  display: grid;
  gap: 13px;
}

.login__hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.section-error {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 117, 130, 0.22);
  background: rgba(255, 117, 130, 0.075);
  color: #ffd2d2;
  line-height: 1.55;
}

.section-error[hidden] {
  display: none;
}

.stack {
  display: grid;
  gap: 14px;
}

.card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow-soft);
}

.card--soft {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.014));
}

.card--strong {
  background: linear-gradient(180deg, rgba(18, 26, 44, 0.98), rgba(11, 17, 31, 0.96));
}

.card--accent {
  border-color: rgba(100, 167, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(100, 167, 255, 0.11), rgba(255, 255, 255, 0.02));
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card__title {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.card__body {
  display: grid;
  gap: 12px;
}

.card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.table-wrap {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.014));
}

.table {
  min-width: 900px;
}

.table th {
  text-align: center;
  white-space: nowrap;
}

.table tbody tr:nth-child(2n) td {
  background: rgba(255, 255, 255, 0.01);
}

.table td {
  color: var(--text);
}

.table code {
  padding: 0.1em 0.35em;
}

.table-wrap--configs .table td,
.table-wrap--configs .table th {
  font-size: 12px;
}

.record {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.022));
}

.record__title {
  font-weight: 700;
}

.record__body {
  color: #dfe9ff;
}

.empty-state {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
}

.code {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.08);
}

.modal-mask {
  padding: 24px;
}

.modal {
  width: min(100%, 620px);
  border-radius: 22px;
  box-shadow: var(--shadow-lift);
}

.modal__header {
  padding: 16px 18px;
}

.modal__body {
  padding: 18px;
}

.modal__footer {
  padding: 0 18px 18px;
}

.drawer-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 21;
  background: rgba(2, 6, 18, 0.58);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.drawer-mask.is-open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 22;
  width: min(100vw, 480px);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(18, 26, 44, 0.98), rgba(11, 17, 31, 0.98));
  box-shadow: var(--shadow-lift);
}

.drawer__header,
.drawer__footer {
  padding: 16px 18px;
  border-color: var(--border);
}

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.drawer__body {
  min-height: 0;
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.drawer__footer {
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.toast {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.08);
}

.busy-overlay__card {
  border-radius: 22px;
  box-shadow: var(--shadow-lift);
}

.login__card {
  border-radius: 24px;
  box-shadow: var(--shadow-lift);
}

.section-error {
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.checklist__item,
.kv__item,
.notice,
.empty-state {
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.checklist__item:hover,
.kv__item:hover,
.notice:hover,
.empty-state:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* Phase 2 component system helpers */
.surface {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow-soft);
}

.surface--soft {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.014));
}

.surface--strong {
  background: linear-gradient(180deg, rgba(18, 26, 44, 0.98), rgba(11, 17, 31, 0.96));
}

.surface--accent {
  border-color: rgba(100, 167, 255, 0.24);
  background: linear-gradient(180deg, rgba(100, 167, 255, 0.11), rgba(255, 255, 255, 0.02));
}

.surface--interactive {
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.surface--interactive:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.surface--interactive:focus-within {
  box-shadow: var(--shadow-soft), var(--focus-ring);
}

.state--pending {
  opacity: 0.88;
  cursor: progress;
}

.state--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.state--danger {
  border-color: rgba(255, 117, 130, 0.2);
  background: rgba(255, 117, 130, 0.08);
  color: #ffd2d2;
}

.state--warning {
  border-color: rgba(241, 180, 76, 0.2);
  background: rgba(241, 180, 76, 0.08);
  color: #ffe6af;
}

.state--success {
  border-color: rgba(79, 227, 154, 0.2);
  background: rgba(79, 227, 154, 0.08);
  color: #dbffe9;
}

.state--info {
  border-color: rgba(100, 167, 255, 0.2);
  background: rgba(100, 167, 255, 0.08);
  color: #dceaff;
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

.skeleton--line {
  min-height: 12px;
  border-radius: 999px;
}

.skeleton--title {
  min-height: 18px;
  border-radius: 999px;
}

.skeleton--block {
  min-height: 110px;
  border-radius: 18px;
}

.skeleton--circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.skeleton--compact {
  min-height: 8px;
}

.empty-state--centered {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-state--compact {
  padding: 12px 13px;
}

.loading-stack {
  display: grid;
  gap: 10px;
}

.loading-stack--tight {
  gap: 8px;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}
