/* copytrade.css — Industrial style, no shadow/radius */
.ct-sheet-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.65); align-items: center; justify-content: center;
  padding: 24px 12px;
}
.ct-sheet-backdrop.open { display: flex; }

.ct-sheet {
  background: #0a0a0a; border: 1px solid #262626;
  width: 100%; max-width: 760px; max-height: 88vh;
  display: flex; flex-direction: column;
}
.ct-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid #1a1a1a; flex-shrink: 0;
}
.ct-sheet-title { font-size: 14px; font-weight: 600; color: #fff; }
.ct-sheet-close { background: none; border: none; color: #71717a; cursor: pointer; padding: 0; line-height: 1; font-size: 18px; width: 22px; flex: 0 0 auto; }
.ct-sheet-close:hover { color: #fff; }
.ct-body { flex: 1 1 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* top action bar */
.ct-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ct-btn-new {
  height: 28px; padding: 0 12px; font-size: 11px; font-family: inherit;
  background: #2E5EFF; color: #fff; border: none; cursor: pointer; font-weight: 600;
}
.ct-btn-new:hover { background: #1f4fe0; }

/* list */
.ct-list { display: flex; flex-direction: column; gap: 10px; }
.ct-card {
  background: #0a0a0a; border: 1px solid #3f3f46; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: border-color .15s;
}
.ct-card:hover { border-color: #52525b; }
.ct-card-info { flex: 1 1 0; min-width: 0; }
.ct-tag { font-size: 13px; color: #fff; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-addr { font-size: 11px; color: #a1a1aa; font-family: inherit; }
.ct-badge {
  font-size: 10px; padding: 3px 8px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  border: 1px solid; flex-shrink: 0;
}
.ct-badge.running { color: #22c55e; border-color: #22c55e; background: #14532d; }
.ct-badge.paused  { color: #f59e0b; border-color: #f59e0b; background: #78350f; }
.ct-badge.disabled { color: #71717a; border-color: #3f3f46; background: #18181b; }
.ct-toggle {
  width: 34px; height: 18px; flex-shrink: 0; cursor: pointer;
  background: #262626; border: none; position: relative; padding: 0;
  transition: background .2s;
}
.ct-toggle.on { background: #2E5EFF; }
.ct-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; background: #fff; transition: left .2s;
}
.ct-toggle.on::after { left: 18px; }
.ct-empty { text-align: center; padding: 32px 0; color: #52525b; font-size: 13px; }

/* API key setup prompt */
.ct-apikey-wrap { background: #111113; border: 1px solid #2E5EFF44; padding: 16px; }
.ct-apikey-title { font-size: 13px; color: #fff; margin-bottom: 6px; }
.ct-apikey-desc  { font-size: 12px; color: #71717a; margin-bottom: 12px; line-height: 1.5; }
.ct-apikey-row   { display: flex; gap: 8px; }
.ct-apikey-row input {
  flex: 1; height: 34px; padding: 0 10px; font-size: 13px; font-family: inherit;
  background: #000; border: 1px solid #262626; color: #fff; outline: none;
}
.ct-apikey-row input:focus { border-color: #2E5EFF; }
.ct-btn-sm {
  height: 34px; padding: 0 14px; font-size: 12px; font-family: inherit;
  background: #2E5EFF; color: #fff; border: none; cursor: pointer; flex-shrink: 0;
}
.ct-btn-sm:hover { background: #1f4fe0; }
.ct-btn-sm.sec { background: #18181b; border: 1px solid #262626; color: #a1a1aa; }
.ct-btn-sm.sec:hover { border-color: #3f3f46; color: #fff; }
.ct-msg { font-size: 11px; margin-top: 6px; }
.ct-msg.err { color: #f43f5e; }
.ct-msg.ok  { color: #22c55e; }

/* detail / create form */
.ct-form { display: flex; flex-direction: column; gap: 0; }
.ct-section {
  border: 1px solid #1a1a1a; margin-bottom: 8px;
}
.ct-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer; user-select: none; background: #111113;
}
.ct-section-head:hover { background: #141416; }
.ct-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #a1a1aa; }
.ct-section-caret { color: #52525b; font-size: 12px; transition: transform .2s; }
.ct-section-caret.open { transform: rotate(90deg); }
.ct-section-body { padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid #1a1a1a; }
.ct-section-body.collapsed { display: none; }

.ct-field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; flex: 1 1 160px; }
.ct-field.full { flex: 1 1 100%; }
.ct-field.w2   { flex: 1 1 240px; }
.ct-field label { font-size: 10px; color: #71717a; text-transform: uppercase; letter-spacing: .07em; }
.ct-field input, .ct-field select {
  height: 32px; padding: 0 8px; font-size: 12px; font-family: inherit;
  background: #000; border: 1px solid #262626; color: #fff; outline: none; width: 100%;
}
.ct-field input:focus, .ct-field select:focus { border-color: #2E5EFF; }
.ct-field input:disabled { color: #52525b; cursor: not-allowed; }
.ct-field select option { background: #111; }
.ct-bool-row { display: flex; align-items: center; gap: 8px; min-width: 160px; flex: 1 1 160px; padding-top: 18px; }
.ct-bool-label { font-size: 12px; color: #a1a1aa; }
.ct-toggle-sm {
  width: 28px; height: 16px; flex-shrink: 0; cursor: pointer;
  background: #262626; border: none; position: relative; padding: 0; transition: background .2s;
}
.ct-toggle-sm.on { background: #2E5EFF; }
.ct-toggle-sm::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; background: #fff; transition: left .2s;
}
.ct-toggle-sm.on::after { left: 14px; }

.ct-tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-kw-tag {
  display: flex; align-items: center; gap: 4px;
  background: #18181b; border: 1px solid #262626; padding: 2px 8px; font-size: 11px; color: #a1a1aa;
}
.ct-kw-tag button { background: none; border: none; color: #52525b; cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }
.ct-kw-tag button:hover { color: #f43f5e; }

/* market types grid */
.ct-mt-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-mt-chip {
  font-size: 11px; padding: 3px 9px; cursor: pointer; border: 1px solid #262626;
  color: #71717a; background: #000; user-select: none; transition: all .15s;
}
.ct-mt-chip.on { border-color: #2E5EFF; color: #2E5EFF; background: #0d1533; }

/* save bar */
.ct-save-bar {
  padding: 14px 0 2px; display: flex; gap: 8px; align-items: center; flex-shrink: 0;
  border-top: 1px solid #1a1a1a;
}
.ct-save-bar button {
  height: 28px; padding: 0 14px; font-size: 12px; font-family: inherit;
  cursor: pointer; border: none;
}
.ct-save-bar .primary { background: #2E5EFF; color: #fff; }
.ct-save-bar .primary:hover { background: #1f4fe0; }
.ct-save-bar .ghost { background: #18181b; border: 1px solid #262626; color: #a1a1aa; }
.ct-save-bar .ghost:hover { border-color: #3f3f46; color: #fff; }
.ct-save-bar .danger { background: #18181b; border: 1px solid #f43f5e44; color: #f43f5e; }
.ct-save-bar .danger:hover { background: #f43f5e22; }

/* records mini-table */
.ct-records-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.ct-records-tbl th { color: #52525b; padding: 4px 8px; text-align: left; border-bottom: 1px solid #1a1a1a; }
.ct-records-tbl td { padding: 5px 8px; color: #a1a1aa; border-bottom: 1px solid #111; }
.ct-records-tbl tr:hover td { background: #111113; }

@media (max-width: 600px) {
  .ct-sheet { max-width: 100%; }
  .ct-field, .ct-bool-row { flex: 1 1 100%; }
}
