:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-border: #e2e7ec;
  --text: #202a35;
  --muted: #697582;
  --accent: #0b8f73;
  --accent-strong: #0d6f62;
  --secondary: #22577a;
  --secondary-strong: #163f59;
  --danger: #b93820;
  --danger-strong: #8f2113;
  --shadow: 0 24px 70px rgba(79, 59, 31, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "IBM Plex Sans", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(11, 143, 115, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(201, 101, 52, 0.18), transparent 24%),
    linear-gradient(180deg, #fff8ed 0%, #efe1cb 100%);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 56px;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr;
  gap: 24px;
  padding: 34px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(11, 143, 115, 0.18), transparent 68%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.02;
}

.subtext {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tag {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(19, 42, 34, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.hero-card {
  display: grid;
  gap: 16px;
}

.stat {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(24, 33, 28, 0.08);
  background: linear-gradient(135deg, rgba(11, 143, 115, 0.08), rgba(255, 255, 255, 0.72));
}

.stat span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat strong {
  font-size: 32px;
}

.stat-accent {
  background: linear-gradient(135deg, rgba(34, 87, 122, 0.12), rgba(255, 255, 255, 0.72));
}

.panel {
  padding: 24px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(20, 23, 22, 0.05);
}

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

label {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(51, 39, 27, 0.08);
}

label span {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid rgba(40, 55, 48, 0.1);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input:focus {
  outline: none;
  border-color: rgba(11, 143, 115, 0.45);
  box-shadow: 0 0 0 4px rgba(11, 143, 115, 0.12);
}

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

.actions.wide {
  justify-content: flex-start;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 12px 20px rgba(15, 16, 16, 0.08);
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.button.secondary {
  color: white;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-strong));
}

.button.danger {
  color: white;
  background: linear-gradient(135deg, var(--danger), var(--danger-strong));
}

.button.ghost {
  color: var(--text);
  background: rgba(32, 44, 38, 0.08);
  box-shadow: none;
}

.button:disabled,
.mini-button:disabled,
input:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.empty-state {
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(60, 49, 36, 0.18);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid rgba(31, 42, 37, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 15px 14px;
  border-bottom: 1px solid rgba(31, 42, 37, 0.08);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.table-wrap tbody tr:hover {
  background: rgba(11, 143, 115, 0.05);
}

.mono {
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 13px;
  word-break: break-all;
}

.blur {
  filter: blur(4px);
  transition: filter 160ms ease;
}

.blur:hover {
  filter: blur(0);
}

.mini-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(13, 111, 98, 0.1);
  color: var(--accent-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.log {
  margin: 0;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: #16211d;
  color: #d2f4df;
  font-family: "SFMono-Regular", "Menlo", monospace;
  line-height: 1.6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

code {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

/* Compact workspace layout and touch-sized mobile controls. */
body { background: var(--bg); font-size: 14px; line-height: 1.5; }
.page { width: min(1280px, calc(100% - 48px)); background: white; margin: 24px auto 48px; }
.hero, .panel { border: 0; border-bottom: 1px solid var(--panel-border); border-radius: 0; box-shadow: none; backdrop-filter: none; }
.hero { grid-template-columns: 1fr 420px; padding: 28px; margin: 0; }
.hero::after { display: none; }
.hero-tags { display: none; }
.eyebrow { font-size: 11px; }
h1 { line-height: 1.3; }
h2 { font-size: 17px; }
.subtext { font-size: 12px; margin-bottom: 0; }
.hero-card { grid-template-columns: 80px 80px minmax(0, 1fr); gap: 0; align-content: center; }
.stat, .stat-accent { min-width: 0; padding: 0 14px; border: 0; border-left: 1px solid var(--panel-border); border-radius: 0; background: none; }
.stat span { font-size: 11px; margin-bottom: 6px; }
.stat strong { display: block; font-size: 23px; line-height: 1.3; overflow-wrap: anywhere; }
.stat-accent strong { color: var(--accent-strong); font-size: 13px; }
.panel { padding: 24px 28px; margin: 0; }
.panel-head h2 { flex-shrink: 0; }
.panel-head:has(#walletCountInput) { flex-direction: column; align-items: flex-start; }
.hint { padding: 0; border-radius: 0; background: none; font-size: 12px; overflow-wrap: anywhere; }
.grid { gap: 16px 20px; }
label { min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; }
label span { font-size: 12px; font-weight: 500; }
input, select { min-width: 0; width: 100%; min-height: 42px; border: 1px solid #d8dfe6; border-radius: 6px; padding: 9px 11px; color: var(--text); background: #fff; font: inherit; }
input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--accent); }
input[readonly] { background: #f5f8fa; color: var(--accent-strong); }
.actions { gap: 8px; min-width: 0; }
.actions > input, .actions > select { width: 132px; }
.button, .mini-button { min-height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 9px 14px; font-size: 13px; line-height: 1.4; box-shadow: none; overflow-wrap: anywhere; }
.button:hover { transform: none; }
.button.primary { background: #07816c; }
.button.secondary { color: #225e9f; background: #edf4fc; border-color: #d8e6f7; }
.button.danger { color: #bd3341; background: #fff0f1; border-color: #f6d6d9; }
.button.ghost { color: #526171; background: #fff; border-color: #dbe2e8; }
.button:focus-visible { outline: 2px solid #2670c6; outline-offset: 2px; }
.empty-state { border-radius: 6px; text-align: center; font-size: 13px; background: #f7f9fb; }
.table-wrap { width: 100%; height: 500px; max-height: 500px; overflow: auto; border-radius: 6px; }
table { min-width: 900px; table-layout: fixed; }
th, td { padding: 12px 10px; vertical-align: middle; }
th { background: #f7f9fb; font-size: 11px; position: sticky; top: 0; z-index: 1; }
th:first-child, td:first-child { width: 42px; text-align: center; }
th:nth-child(2), th:nth-child(7) { width: 23%; }
th:last-child { width: 70px; }
.mini-button { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.mono { font-size: 11px; }
.log { min-height: 160px; max-height: 320px; background: #f7f9fb; color: #3a5263; border: 1px solid #dce4e9; border-radius: 6px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: none; }
#mintLookupStatus, #autoClaimStatus, #dividendStatus, #whitelistCountdown, #whitelistMintStatus { margin: 12px 0 0; font-size: 12px; overflow-wrap: anywhere; }
#autoClaimStatus { color: var(--accent-strong); }
#mintProgressText { margin: 14px 0 6px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
#mintProgressBar { display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--accent); }
#mintProgressBar::-webkit-progress-bar { background: #eaf0f2; }
#mintProgressBar::-webkit-progress-value { background: var(--accent); }
#mintProgressBar::-moz-progress-bar { background: var(--accent); }
[hidden] { display: none !important; }
#followPanel .grid label:has(#followSource) { grid-column: 1/-1; }
#followPanel .grid label:has(#followWsUrl) { grid-column: 1/-1; }
#followNodes, #followFeedStatus { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media(max-width:640px) {
  .grid label:has(#permitSellerAddress), .grid label:has(#autoSellMode) { grid-column: 1/-1; }
}
@media(max-width:640px) {
  #followPanel .grid label:has(#followMint), #followPanel .grid label:has(#followToken) { grid-column: 1/-1; }
}
.workspace-tabs { display: flex; gap: 24px; padding: 0 28px; border-bottom: 1px solid var(--panel-border); }
.workspace-tabs button { padding: 16px 0 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.workspace-tabs button[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
#sniperStatus, #sniperProgress { overflow-wrap: anywhere; font-size: 13px; }
#sniperProgress { font-weight: 600; }
@media(max-width:640px) { .workspace-tabs { padding: 0 16px; gap: 20px; } #sniperPanel .grid label:has(#sniperMint), #sniperPanel .grid label:has(#sniperToken) { grid-column: 1/-1; } }

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 100%);
    margin-top: 16px;
  }

  .panel,
  .hero {
    padding: 18px;
    border-radius: 22px;
  }

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

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .actions .button,
  .actions input {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .stat:first-child { border: 0; padding-left: 0; }
  .panel-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) {
  .page { width: 100%; margin: 0; padding-bottom: env(safe-area-inset-bottom, 0); }
  .hero { padding: 20px 16px; gap: 18px; border-top: 3px solid var(--accent); border-radius: 0; }
  h1 { font-size: 23px; }
  .hero-card { grid-template-columns: 76px 76px minmax(0, 1fr); }
  .stat { padding: 0 10px; }
  .panel { padding: 20px 16px; border-radius: 0; border-bottom: 8px solid var(--bg); }
  .panel-head { gap: 12px; margin-bottom: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .grid label:has(#tokenAddress), .grid label:has(#collectAddress), .grid label:has(#customRpcUrls), .grid label:has(#mintContractAddress), .grid label:has(#mintAmount) { grid-column: 1 / -1; }
  input, select { min-height: 44px; font-size: 16px; padding: 10px; }
  .toolbar { width: 100%; justify-content: space-between; }
  .toolbar .hint { flex: 1; }
  .actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .actions .button, .actions input, .actions select { width: 100%; }
  .button { min-height: 44px; padding: 10px 6px; font-size: 13px; }
  .toolbar .button { width: auto; flex-shrink: 0; }
  #autoClaimStartBtn, #selectWalletRangeType, .actions:has(#resolveMintBtn) #resolveMintBtn { grid-column: 1 / -1; }
  .table-wrap { height: 500px; max-height: 500px; }
  th { position: sticky; top: 0; }
  .log { max-height: 280px; padding: 12px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
textarea { width: 100%; min-height: 120px; resize: vertical; border: 1px solid #d8dfe6; border-radius: 6px; padding: 10px; font: 13px/1.6 monospace; color: var(--text); background: white; }
.holdings-import { margin: 14px 0; }
.holdings-auto { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
#holdingsAutoStatus { font-size: 12px; color: var(--muted); }
#holdingsStatus, #holdingsSummary { font-size: 13px; overflow-wrap: anywhere; }
.holdings-table table { min-width: 720px; table-layout: fixed; }
.holdings-table th:first-child { width: 42px; }
.holdings-table th:nth-child(2) { width: 60px; }
.holdings-table th:nth-child(3) { width: 40%; }
.holdings-table th:nth-child(4) { width: 23%; }
.holdings-table th:last-child { width: auto; }
.holdings-table td { overflow-wrap: anywhere; }
.holdings-table tr.holdings-low, .holdings-table tr.holdings-low:hover { background: #fff0f1; color: #bb2936; }
.holdings-table tr.holdings-error { color: #94620b; background: #fff9ed; }
@media (max-width:640px) { .workspace-tabs { gap: 14px; overflow-x: auto; } .workspace-tabs button { flex-shrink: 0; font-size: 12px; } #holdingsPanel .grid label:has(#holdingsToken) { grid-column: 1/-1; } textarea { font-size: 16px; } }
