:root {
  color-scheme: light;
  --ink: #151726;
  --muted: #697086;
  --line: #e4e7f0;
  --surface: rgba(255, 255, 255, .9);
  --violet: #6c4cff;
  --violet-dark: #5131e8;
  --mint: #17b890;
  --amber: #f2a93b;
  --danger: #d9475b;
  --shadow: 0 20px 70px rgba(44, 37, 92, .09);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 2%, rgba(108, 76, 255, .13), transparent 31rem),
    radial-gradient(circle at 92% 12%, rgba(23, 184, 144, .10), transparent 29rem),
    #f7f8fc;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; white-space: nowrap; }
button:disabled { cursor: not-allowed; opacity: .45; }
code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  background: rgba(247, 248, 252, .88);
  border-bottom: 1px solid rgba(228, 231, 240, .9);
  backdrop-filter: blur(18px);
}
.brand, .top-actions, .inline, .panel-head, .step { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: white; font-weight: 800; background: linear-gradient(145deg, #7f65ff, #5335d9);
  box-shadow: 0 8px 20px rgba(108, 76, 255, .27);
}
.brand div { display: flex; flex-direction: column; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.top-actions { gap: 10px; flex: 0 0 auto; }
.network {
  padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .08em; background: #e9e4ff; color: var(--violet-dark);
}
.network.mainnet { color: #8b5511; background: #fff0d9; }
.wallet-address { color: var(--muted); min-width: 68px; max-width: 120px; overflow: hidden; text-align: right; white-space: nowrap; }
select, input, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px;
  color: var(--ink); background: #fbfbfe; outline: none; transition: .18s ease;
}
select:focus, input:focus, textarea:focus {
  border-color: rgba(108, 76, 255, .7);
  box-shadow: 0 0 0 4px rgba(108, 76, 255, .09);
}
textarea { resize: vertical; }
main { max-width: 1260px; margin: auto; padding: 52px clamp(18px, 4vw, 50px) 80px; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 56px; align-items: end; margin-bottom: 34px;
}
.eyebrow, .kicker {
  color: var(--violet); font-size: 11px; font-weight: 800; letter-spacing: .16em;
}
h1 { margin: 12px 0 18px; font-size: clamp(38px, 5.5vw, 72px); line-height: .98; letter-spacing: -.05em; }
h1 em { color: var(--violet); font-style: normal; }
.hero p { max-width: 650px; color: var(--muted); line-height: 1.75; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.step {
  gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .76);
}
.step b { color: var(--violet); font-size: 12px; }
.step span { font-weight: 650; font-size: 13px; }
.step.locked { opacity: .45; }
.step.complete { border-color: rgba(23, 184, 144, .3); background: rgba(234, 255, 249, .8); }
.step.complete::after { content: "✓"; margin-left: auto; color: var(--mint); font-weight: 900; }
.notice { padding: 13px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.55; }
.notice.info { background: #efedff; color: #4c35b7; }
.notice.ok { background: #e7fbf4; color: #067d61; }
.notice.error { background: #ffeaee; color: #a52639; }
.notice details { margin-top: 7px; }
.notice summary { width: max-content; cursor: pointer; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.notice pre {
  margin: 8px 0 0;
  padding: 9px 11px;
  max-height: 180px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: #4d2931;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.busy-label { min-height: 20px; color: var(--violet); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.panel {
  background: var(--surface); border: 1px solid rgba(228, 231, 240, .95);
  border-radius: 22px; padding: clamp(20px, 3vw, 34px); margin-bottom: 18px;
  box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.panel.locked { opacity: .58; filter: saturate(.5); }
.panel.network-mainnet { border-color: rgba(242, 169, 59, .5); }
.panel-head { justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.025em; }
.panel-tag {
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 11px; font-size: 11px; white-space: nowrap;
}
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.compact { gap: 12px; }
.field-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
label { display: flex; flex-direction: column; gap: 7px; color: #52586d; font-size: 12px; font-weight: 650; }
.inline { gap: 8px; align-items: stretch; }
.inline input { min-width: 0; }
.inline select { width: 120px; }
.inline button { white-space: nowrap; }
.button {
  border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 750;
  background: #eceef6; color: #343846; transition: transform .16s ease, box-shadow .16s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: white; background: linear-gradient(135deg, #795dff, #5637e7); box-shadow: 0 10px 24px rgba(92, 61, 223, .25); }
.button.secondary { background: white; border: 1px solid var(--line); }
.button.quiet { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.button.large { padding: 14px 20px; font-size: 14px; }
.source-preview, .summary-box, .result {
  border-radius: 14px; padding: 16px; background: #f7f7fc; border: 1px solid #ececf5;
}
.source-preview div { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.source-preview span { color: var(--muted); font-size: 12px; }
.source-preview code, .result code { display: block; word-break: break-all; font-size: 12px; }
.checks { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.checks label { flex-direction: row; align-items: center; gap: 9px; color: var(--ink); }
.checks input { width: auto; }
.summary-box { display: grid; gap: 6px; }
.summary-box span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.summary-box strong { font-size: 16px; }
.summary-box small, .hint { color: var(--muted); line-height: 1.6; }
.result:empty { display: none; }
.result { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.result a { color: var(--violet); font-weight: 700; }
.result span { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.wallet-list { display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.wallet-list div { display: flex; gap: 10px; align-items: center; }
.wallet-list span { color: var(--muted); min-width: 20px; }
.result-table { overflow-x: auto; font-size: 11px; }
.result-table > div { display: grid; grid-template-columns: 1.4fr .5fr .5fr .9fr .9fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 560px; }
.result-head { color: var(--muted); font-weight: 800; }
.activity { background: rgba(22, 24, 38, .96); color: white; }
.activity .kicker { color: #a99aff; }
.activity .panel-head { margin-bottom: 12px; }
.log-list { display: flex; flex-direction: column; gap: 2px; max-height: 250px; overflow: auto; }
.log-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 12px; }
.log-row time { color: #858ba2; }
.busy .button[data-action]:not(#connect-wallet):not([data-keep-enabled="1"]) { pointer-events: none; }
@media (max-width: 860px) {
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .wallet-address { display: none; }
  .hero, .grid.two { grid-template-columns: 1fr; }
  .hero { gap: 24px; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .brand small { display: none; }
  .top-actions select { width: 150px; }
  main { padding: 30px 14px 60px; }
  .grid.three { grid-template-columns: 1fr; }
  .inline { flex-wrap: wrap; }
  .inline select { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .panel { border-radius: 17px; padding: 18px; }
}

/* Compact one-screen workflow. */
html, body {
  height: 100%;
  overflow: hidden;
}
.topbar {
  position: relative;
  min-height: 62px;
  padding: 10px clamp(18px, 3vw, 40px);
}
.brand-mark { width: 34px; height: 34px; border-radius: 10px; }
main.workspace-shell {
  height: calc(100vh - 62px);
  max-width: 1380px;
  padding: 16px clamp(16px, 3vw, 38px) 74px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.workflow-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex: 0 0 auto;
}
button.step {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  text-align: left;
  transition: .18s ease;
}
button.step:hover { border-color: rgba(108, 76, 255, .4); }
button.step.active {
  border-color: rgba(108, 76, 255, .62);
  background: #eeeaff;
  box-shadow: 0 8px 24px rgba(108, 76, 255, .12);
}
button.step.complete b { color: var(--mint); }
.content-shell {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: auto;
}
.content-shell.market-active {
  display: grid;
  grid-template-columns: minmax(280px, .68fr) minmax(620px, 1.55fr);
  align-items: start;
  gap: 0;
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid rgba(228, 231, 240, .95);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.market-panel,
.monitor-panel { min-width: 0; }
.market-panel { zoom: .78; }
.content-shell.market-active > .panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.content-shell.market-active .market-panel {
  padding-right: 18px !important;
  border-right: 1px solid var(--line) !important;
}
.content-shell.market-active .monitor-panel { padding-left: 18px !important; }
.content-shell.market-active .monitor-panel { margin-top: 0 !important; }
.module-view {
  display: none;
  height: auto;
  overflow: visible;
  margin: 0;
}
.module-view.active { display: block; }
.step[hidden] { display: none !important; }
.module-view.locked { opacity: .8; filter: none; }
.module-view .panel-head { margin-bottom: 16px; }
.monitor-panel { margin-top: 18px !important; }
@media (max-width: 1180px) {
  .content-shell.market-active { grid-template-columns: 1fr; }
  .market-panel { zoom: 1; }
  .content-shell.market-active .market-panel {
    padding-right: 0 !important;
    border-right: 0 !important;
  }
  .content-shell.market-active .monitor-panel { padding-left: 0 !important; }
  .content-shell.market-active .monitor-panel { margin-top: 18px !important; }
}
.source-preview {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 76px;
}
.source-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 6px 18px rgba(35, 31, 70, .1);
}
.source-logo-fallback {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  color: white;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(145deg, #7f65ff, #4730c7);
}
.source-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.source-copy strong { font-size: 16px; }
.source-copy span { color: var(--muted); font-size: 12px; }
.source-copy code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clone-autofill {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  background: #f4f1ff;
}
.clone-autofill::before {
  content: "自动填充";
  color: var(--violet);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  background: #e8e1ff;
}
.clone-autofill span {
  padding: 3px 7px;
  border-radius: 999px;
  color: #58516f;
  background: white;
  font-size: 10px;
}
.action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}
.action-row .wide { grid-column: span 2; }
.action-row .button { min-height: 43px; white-space: nowrap; }
.token-actions {
  grid-template-columns: 150px 230px minmax(220px, 1fr);
}
.launch-config-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e6e2f8;
  border-radius: 15px;
  background: linear-gradient(145deg, #fbfaff, #f7f8fc);
}
.launch-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 15px;
  background: #27233b;
  color: #fff;
}
.launch-submit-row > span {
  max-width: 650px;
  color: #c9c5da;
  font-size: 12px;
  line-height: 1.55;
}
.launch-submit-row .launch-button { min-width: 280px; }
.details-divider { height: 1px; background: var(--line); margin: 2px 0; }
.launch-confirm-dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 0;
  border-radius: 22px;
  padding: 24px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 100px rgba(22, 18, 52, .35);
}
.launch-confirm-dialog::backdrop {
  background: rgba(22, 20, 38, .58);
  backdrop-filter: blur(4px);
}
.launch-confirm-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.launch-confirm-dialog h3 { margin: 5px 0 0; font-size: 25px; }
.dialog-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #f7f7fb;
  font-size: 22px;
}
.launch-confirm-summary { margin: 0 0 14px; color: var(--muted); line-height: 1.6; }
.launch-confirm-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.launch-confirm-facts > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafe;
}
.launch-confirm-facts span { color: var(--muted); font-size: 10px; }
.launch-confirm-facts strong { font-size: 14px; }
.launch-fee-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.launch-fee-option {
  position: relative;
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfbfe;
  cursor: pointer;
  transition: .18s ease;
}
.launch-fee-option.selected {
  border-color: rgba(108, 76, 255, .75);
  background: #f2efff;
  box-shadow: 0 8px 25px rgba(108, 76, 255, .12);
}
.launch-fee-option input { position: absolute; opacity: 0; pointer-events: none; }
.launch-fee-option strong { display: block; margin-bottom: 10px; font-size: 15px; }
.launch-fee-option dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0; }
.launch-fee-option dt { color: var(--muted); font-size: 11px; }
.launch-fee-option dd { margin: 0; font-size: 11px; font-weight: 700; text-align: right; }
.launch-fee-option dt.fee-total {
  grid-column: 1 / -1;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  margin-top: 5px;
  color: var(--violet-dark);
  font-weight: 750;
}
.launch-fee-option dd.fee-total {
  grid-column: 1 / -1;
  font-size: 16px;
  color: var(--violet-dark);
}
.launch-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.cleanup-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cleanup-options { display: grid; gap: 9px; }
.cleanup-options label {
  flex-direction: row;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfe;
  cursor: pointer;
}
.cleanup-options input { width: auto; margin-top: 3px; }
.cleanup-options span { display: flex; flex-direction: column; gap: 3px; }
.cleanup-options b { color: var(--ink); font-size: 12px; }
.cleanup-options small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }
.cleanup-options input:disabled + span { opacity: .55; }
.delete-token-warning {
  padding: 13px 14px;
  border: 1px solid #ffd7a8;
  border-radius: 12px;
  color: #87500c;
  background: #fff8eb;
  font-size: 12px;
  line-height: 1.65;
}
.delete-token-actions { flex-wrap: wrap; }
.module-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.module-details summary,
.activity-drawer summary {
  width: max-content;
  cursor: pointer;
  color: var(--violet);
  font-size: 12px;
  font-weight: 750;
  user-select: none;
}
.details-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(46vh, 380px);
  overflow: auto;
  margin-top: 14px;
  padding-right: 4px;
}
.details-body .grid.two { gap: 12px; }
.notice {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 20px;
  z-index: 20;
  width: max-content;
  max-width: min(720px, calc(100vw - 220px));
  max-height: min(45vh, 420px);
  overflow: auto;
  margin: 0;
  box-shadow: 0 14px 40px rgba(28, 25, 51, .2);
}
.busy-label {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 21;
  min-height: 0;
  margin: 0;
  padding: 9px 14px;
  border-radius: 10px;
  background: #27233b;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}
.busy-label button {
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 7px;
  padding: 3px 7px;
  color: white;
  background: transparent;
  font-size: 10px;
}
.busy-label:empty { display: none; }
.button.small { padding: 8px 11px; font-size: 11px; }
.history-strip {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.history-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}
.history-head strong { margin-right: auto; font-size: 13px; }
.history-head select { width: 150px; padding: 7px 9px; }
.category-editor {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.category-editor[hidden] { display: none; }
.category-editor input { max-width: 220px; }
.token-history {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.token-history:empty::before {
  content: "还没有创建记录";
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
}
.token-history-card {
  display: grid;
  grid-template-columns: 38px minmax(100px, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 230px;
  max-width: 300px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.token-history-card img,
.token-history-card .source-logo-fallback {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
}
.token-history-card .source-logo-fallback { font-size: 13px; }
.history-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.history-copy strong { font-size: 12px; }
.history-copy small,
.history-copy code { color: var(--muted); font-size: 10px; }
.history-copy code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-category {
  align-self: start;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--violet);
  background: #efebff;
  font-size: 9px;
}
.button-line,
.group-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.button-line select { width: 180px; }
.main-wallet-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  margin-bottom: 12px;
  border: 1px solid rgba(108, 76, 255, .22);
  border-radius: 14px;
  background: linear-gradient(135deg, #f5f2ff, #fbfbff);
}
.main-wallet-card > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  min-width: 0;
}
.main-wallet-card span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.main-wallet-card code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 750; }
.main-wallet-card small { color: var(--muted); font-size: 10px; }
.main-wallet-card small:nth-of-type(1) { grid-column: 2; }
.main-wallet-card small:nth-of-type(2) { grid-column: 2; }
.main-wallet-qr {
  grid-column: 3;
  grid-row: 1 / span 4;
  align-self: center;
  width: 88px;
  height: 88px;
  padding: 4px;
  border: 1px solid rgba(108, 76, 255, .2);
  border-radius: 9px;
  background: #fff;
}
.main-wallet-qr[hidden] { display: none; }
.main-wallet-qr svg { display: block; width: 100%; height: 100%; }
.group-toolbar { justify-content: space-between; color: var(--muted); font-size: 12px; }
.group-toolbar span { margin-right: auto; }
.wallet-group-list,
.market-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 13px;
  max-height: 50vh;
  overflow: auto;
}
.market-groups {
  grid-template-columns: 1fr;
  gap: 7px;
  max-height: none;
  overflow: visible;
}
.wallet-group-card,
.market-group-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafaff;
  padding: 13px;
}
.market-group-card {
  padding: 10px 12px;
  border-radius: 12px;
}
.market-group-card header { margin-bottom: 6px; }
.market-group-card header strong { font-size: 14px; }
.market-group-card .group-meta { gap: 5px; font-size: 10px; }
.market-group-card .group-params { gap: 5px 7px; margin-top: 6px; }
.market-group-card .group-params label { font-size: 11px; }
.market-group-card .group-params input,
.market-group-card .group-params select {
  padding: 5px 6px;
  font-size: 11px;
}
.market-group-card .market-param-section {
  margin-top: 1px;
  padding: 4px 6px;
}
.market-group-card .market-param-grid { gap: 5px 7px; margin-top: 5px; }
.market-group-card .market-switches { gap: 5px 10px; margin-top: 5px; }
.market-group-card .hint { margin: 4px 0 0; font-size: 10.5px; line-height: 1.4; }
.market-group-card .group-actions { margin-top: 6px; }
.wallet-group-card {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.wallet-group-card:hover { border-color: rgba(108, 76, 255, .35); }
.wallet-group-card.selected {
  border-color: rgba(108, 76, 255, .7);
  background: #f1edff;
  box-shadow: 0 0 0 3px rgba(108, 76, 255, .08);
}
.wallet-group-card .group-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #8168ff, #5134d1);
  color: white;
  font-weight: 800;
}
.wallet-group-card .group-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.group-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.current-group-badge {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--violet);
  background: #e8e1ff;
  font-size: 9px;
  font-weight: 800;
}
.wallet-group-card .group-actions { cursor: default; }
.group-result {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(108, 76, 255, .12);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.02em;
}
.group-result.success { color: var(--mint); }
.group-result.partial { color: #b97814; }
.group-result.failed { color: var(--danger); }
.group-result.running { color: var(--violet); font-size: 13px; }
.group-error {
  margin-top: 7px;
  color: var(--danger);
  font-size: 11px;
}
.group-error summary { cursor: pointer; font-weight: 700; }
.group-error p {
  margin: 7px 0 0;
  max-height: 150px;
  overflow: auto;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wallet-group-card header,
.market-group-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.wallet-group-card header strong,
.market-group-card header strong { font-size: 13px; }
.wallet-group-card header span,
.market-group-card header span { color: var(--muted); font-size: 10px; }
.group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}
.group-meta b { color: var(--ink); }
.group-params {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.group-params label { font-size: 10px; }
.group-params input { padding: 7px 8px; font-size: 11px; }
.market-param-section {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}
.market-param-section.buy-param-section {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffd0cb;
}
.market-param-section.sell-param-section {
  color: #946200;
  background: #fff8df;
  border: 1px solid #f2d987;
}
.market-mode-panel { grid-column: 1 / -1; }
.market-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.market-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 9px;
}
.market-switch {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 5px !important;
  color: var(--muted);
}
.market-switch input { width: auto; }
.group-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.new-template-button {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 5px;
  align-items: center;
  border: 0;
  padding: 4px 8px;
  color: var(--violet);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}
.new-template-button b { grid-row: 1 / span 2; font-size: 22px; line-height: 1; }
.new-template-button small { color: var(--muted); font-size: 9px; font-weight: 500; }
.inline-editor {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f7ff;
}
.inline-editor[hidden] { display: none; }
.inline-editor input { min-width: 150px; max-width: 230px; padding: 8px 10px; }
.funding-editor > strong { align-self: center; font-size: 12px; }
.funding-editor label { min-width: 135px; gap: 4px; }
.estimate-text,
.distribution-estimate {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.distribution-estimate {
  min-height: 17px;
  margin-top: 7px;
}
.market-group-card.running { border-color: rgba(108, 76, 255, .55); box-shadow: 0 6px 18px rgba(108, 76, 255, .1); }
.history-empty { color: var(--muted); font-size: 12px; }
.balance-loading {
  padding: 28px 16px;
  text-align: center;
  color: var(--violet);
  font-size: 13px;
  font-weight: 700;
}
.token-history-card {
  grid-template-columns: 38px minmax(110px, 1fr) auto auto auto;
  min-width: 350px;
  max-width: 410px;
}
.history-main {
  display: contents;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}
.history-remove {
  border: 1px solid #ffd4dc;
  border-radius: 8px;
  padding: 5px 7px;
  color: var(--danger);
  background: #fff2f5;
  font-size: 9px;
  font-weight: 750;
}
.history-remove:disabled { color: #9ba0af; border-color: var(--line); background: #f6f7fa; }
.history-delete {
  border: 1px solid #ffd4dc;
  border-radius: 8px;
  padding: 5px 7px;
  color: #b23145;
  background: #fff7f8;
  font-size: 9px;
  font-weight: 750;
}
.monitor-summary {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(145px, 1fr);
  grid-template-columns: none;
  gap: 7px;
  margin-top: 15px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.monitor-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}
.monitor-controls .wide { flex: 1 1 auto; grid-column: auto; }
.monitor-controls .monitor-live { flex: 0 0 auto; }
.monitor-live {
  align-self: center;
  color: var(--mint);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
#monitor-token { min-height: 48px; }
.monitor-stat {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafaff;
}
.monitor-stat span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.monitor-stat strong { font-size: 14px; }
.monitor-table {
  max-height: 42vh;
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.monitor-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, minmax(80px, .7fr));
  gap: 10px;
  min-width: 850px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.monitor-row.header { position: sticky; top: 0; background: #f2f1fa; font-weight: 750; color: var(--muted); }
.monitor-row:last-child { border-bottom: 0; }
.monitor-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.positive { color: var(--mint); }
.negative { color: var(--danger); }
.activity-drawer {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 19;
  width: 300px;
  max-height: 48vh;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #343348;
  border-radius: 14px;
  color: white;
  background: rgba(22, 24, 38, .97);
  box-shadow: 0 16px 45px rgba(25, 24, 40, .24);
}
.activity-drawer:not([open]) { width: max-content; }
.activity-drawer summary { color: #c7bdff; }
.activity-drawer .log-list { margin-top: 12px; max-height: 38vh; }
.activity-drawer .log-row { grid-template-columns: 72px 1fr; }
.activity-drawer .panel-head { display: none; }
@media (max-width: 1050px) {
  .launch-config-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  html, body { overflow: auto; }
  main.workspace-shell { height: auto; min-height: calc(100vh - 62px); }
  .workflow-tabs { grid-template-columns: 1fr 1fr; }
  .action-row .wide { grid-column: auto; }
  .token-actions { grid-template-columns: 1fr; }
  .launch-config-grid { grid-template-columns: 1fr 1fr; }
  .launch-config-grid label:nth-child(5) { grid-column: 1 / -1; }
  .launch-submit-row { align-items: stretch; flex-direction: column; }
  .launch-submit-row .launch-button { min-width: 0; width: 100%; }
  .launch-confirm-facts,
  .launch-fee-options { grid-template-columns: 1fr; }
  .module-view { height: auto; overflow: visible; }
  .notice { left: 12px; right: 12px; max-width: none; width: auto; bottom: 12px; }
  .activity-drawer { right: 12px; bottom: 72px; }
}
