:root {
  --bg: #c9c9c9;
  --text: #111;
  --muted: #666;
  --border: #ddd;
  --panel: #f0f0f0;
  --danger: #b00020;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Kosugi Maru', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

main {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}

h1 { margin: 0 0 8px 0; font-size: 28px; }

p { margin: 0 0 16px 0; color: var(--muted); }

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

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

label { display: inline-flex; gap: 8px; align-items: center; }

input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 160px;
}

input[type="number"] { min-width: 90px; width: 90px; }

button {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

#cancelOrder {
  border-color: rgba(176, 0, 32, 0.35);
}

#cancelOrder:hover {
  border-color: rgba(176, 0, 32, 0.7);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.mono {
  font-family: "LXGW WenKai Mono TC", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.copyable {
  cursor: pointer;
  user-select: all;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.copyable:hover {
  opacity: 0.85;
}

.error { color: var(--danger); font-size: 12px; }

.disabled {
  opacity: 0.55;
}

/* Step sections */
.stepHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.stepTitle {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stepHeader h2 {
  margin: 0;
  font-size: 16px;
}

.notice {
  font-size: 12px;
  color: var(--muted);
}

.stepIndicator {
  font-size: 12px;
  color: var(--muted);
}

.summaryBox {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.summaryPrimary {
  font-size: 14px;
  color: var(--text);
}

.summarySecondary {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* Quantity control */
.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.stepBtn {
  width: 34px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--border);
  background: #fff;
}

.stepBtn[data-stepper="up"] {
  border-right: 0;
  border-left: 1px solid var(--border);
}

.qtyInput {
  width: 72px;
  min-width: 72px;
  border: 0;
  border-radius: 0;
  text-align: center;
}

/* Basic combo list */
.combo { position: relative; width: 260px; }
.comboInput { width: 100%; min-width: 0; }
.comboList {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  display: none;
  z-index: 10;
}
.comboList.open { display: block; }
.comboItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
}
.comboItem:hover { background: #f4f4f4; }
.comboItem.active { background: #eee; }

.comboLeft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.coinIcon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.coinCode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
}

.toast.show {
  animation: toastUp 1.05s ease-out forwards;
}

@keyframes toastUp {
  0% { opacity: 0; transform: translate(-50%, -50%) translateY(10px); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-18px); }
}

.footer {
  margin-top: 18px;
  padding: 10px 2px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
}

.footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
}

.footer a:hover {
  border-bottom-color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 640px) {
  main { margin: 16px auto; }
  .comboInput { width: 100%; }
  input { width: 100%; }
}
