:root {
  --bg: #0e1211;
  --panel: #171d1b;
  --panel-strong: #202825;
  --line: #2c3733;
  --text: #f0f7f3;
  --muted: #9baca4;
  --accent: #52d28f;
  --danger: #ff6d6d;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

button,
input,
select {
  font: inherit;
  font-size: 16px;
}

.shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0;
}

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

.eyebrow,
h1,
h2 {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #06110b;
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
}

.connectButton {
  white-space: nowrap;
}

.walletApps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.walletAppButton {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.walletAppButton img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 60px var(--shadow);
}

.createPanel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

label,
.tradeBox {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  padding: 0 12px;
  transform: translateZ(0);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(82, 210, 143, 0.14);
}

.amountRow {
  display: grid;
  grid-template-columns: minmax(138px, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
  align-items: center;
}

.tokenSelect {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
}

.tokenSelect img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  object-fit: cover;
}

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

.balanceLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  min-height: 28px;
}

.tinyButton {
  min-height: 28px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 14px;
  padding: 0 10px;
  touch-action: manipulation;
}

.maxStatus {
  color: var(--accent);
  font-size: 12px;
  min-height: 16px;
}

.submitStatus {
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.restrictedField {
  color: var(--muted);
  font-size: 13px;
}

.primaryButton {
  width: 100%;
}

.toolbar {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.offerList {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.offer {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121816;
  padding: 12px;
}

.offerTop,
.offerActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.offer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ghostButton {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.dangerButton {
  border: 1px solid rgba(255, 109, 109, 0.4);
  background: var(--panel-strong);
  color: #ffd1d1;
}

.emptyState {
  display: none;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  max-width: min(520px, calc(100% - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101715;
  box-shadow: 0 18px 70px var(--shadow);
  padding: 14px 16px;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 7, 0.72);
  padding: 18px;
}

.modalOverlay[hidden] {
  display: none;
}

.confirmDialog {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101715;
  box-shadow: 0 22px 90px var(--shadow);
  padding: 18px;
}

.confirmDialog h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

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

.confirmDetails div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.confirmDetails span {
  color: var(--muted);
  font-size: 13px;
}

.confirmDetails strong {
  text-align: right;
  font-size: 14px;
}

.confirmActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 780px) {
  .topbar,
  .walletApps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

  .amountRow {
    grid-template-columns: minmax(126px, 0.9fr) minmax(0, 1.1fr);
  }

  .shell {
    width: min(100% - 20px, 980px);
  }
}
