/* terminal.css — section_terminal (order ticket → API call).
   Scoped to #terminal. Deliberately compact: the ticket and code panes
   should sit under ~420px tall on desktop. */

#terminal h2 .trm-struck {
  color: var(--muted);
  text-decoration-thickness: 3px;
}

#terminal .trm-grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 22px;
  align-items: start; margin-top: 28px;
}
#terminal .trm-grid > * { min-width: 0; }

/* ---------- order ticket ---------- */
#terminal .trm-ticket { display: block; margin: 0; padding: 16px; }
#terminal .trm-row { margin-bottom: 12px; }

#terminal .trm-syms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
#terminal .trm-sym {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; min-width: 0; margin: 0; padding: .3rem .2rem; border-radius: 7px;
  background: transparent; border: 1px solid transparent;
  font: 600 12.5px var(--mono); color: var(--muted);
}
#terminal .trm-symicon { display: block; flex: 0 0 auto; object-fit: contain; }
#terminal .trm-sym.trm-on { background: #EFEDE6; color: var(--fg); }

#terminal .trm-sides {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
}
#terminal .trm-side-btn {
  display: grid; place-items: center;
  margin: 0; padding: .5rem 0; border: none; border-radius: 0;
  background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center;
}
#terminal .trm-buy.trm-on { background: #E7F0EA; color: #2E6B4F; }
#terminal .trm-sell.trm-on { background: #F6E9E7; color: #A04437; }

#terminal .trm-fields { display: grid; grid-template-columns: 1fr; gap: 10px; }
#terminal .trm-field > span { display: block; font: 400 11px var(--mono); color: var(--muted); margin-bottom: 5px; }
#terminal .trm-inwrap { position: relative; display: block; }
#terminal .trm-inwrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font: 400 13px var(--mono); color: var(--muted); }
#terminal .trm-field input, #terminal .trm-field select {
  width: 100%; margin: 0; padding: .45rem .6rem;
  font: 500 13px var(--mono);
}
/* selects get no global app.css treatment — match the input's chrome */
#terminal .trm-field select {
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
#terminal .trm-field select:focus { outline: none; border-color: var(--accent); }
#terminal .trm-inwrap input { padding-left: 22px; }

#terminal .trm-sum {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px 12px;
  padding: 9px 11px; border-radius: 8px; background: #F4F2EC;
  font: 400 11.5px var(--mono); color: var(--muted); margin-bottom: 12px;
}
#terminal .trm-metric { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
#terminal .trm-metric b { font-weight: 600; color: var(--fg); }

#terminal .trm-place {
  width: 100%; margin: 0; padding: .6rem 0;
  background: var(--accent); color: #fff; font-weight: 600;
}
#terminal .trm-place:hover { filter: brightness(1.08); }
#terminal .trm-place:disabled { cursor: wait; opacity: .72; }
#terminal .trm-place.trm-success { background: #2E6B4F; }
#terminal .trm-note { margin: 9px 2px 0; font: 400 11px var(--mono); color: var(--muted); }
#terminal .trm-note a { color: inherit; text-underline-offset: 2px; }
#terminal .trm-note a:hover { color: var(--accent); }

/* ---------- code pane ---------- */
#terminal .trm-code { padding: 0; overflow: hidden; }
/* the shared .code style is a standalone white box (bg/border/radius);
   inside this card the panes must read as one surface */
#terminal .trm-code .code {
  background: transparent; border: none; border-radius: 0;
}
#terminal .trm-codehead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
#terminal .trm-endpoint { font: 400 12.5px var(--mono); color: var(--muted); }
#terminal .trm-endpoint b { font-weight: 700; color: var(--accent); }
#terminal .trm-langs { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
#terminal .trm-langs .tab { flex: 0 0 auto; padding: 5px 8px; font-size: 12px; white-space: nowrap; }

#terminal .trm-req { margin: 0; padding: 12px 14px; font-size: 12px; line-height: 1.55; }
#terminal .trm-respline {
  padding: 6px 14px; border-top: 1px solid var(--border); background: #F7F5F0;
  font: 400 11.5px var(--mono); color: var(--muted);
}
#terminal .trm-arrow { color: var(--accent); }
#terminal .trm-resp { margin: 0; padding: 8px 14px 10px; font-size: 12px; line-height: 1.5; background: #F7F5F0; }
#terminal .trm-stale { opacity: .38; transition: opacity .15s; }
#terminal .trm-hint { padding: 8px 14px 10px; margin: 0; border-top: 1px dashed var(--border); font: 400 11.5px var(--mono); color: var(--muted); }
#terminal .trm-hint b { font-weight: 600; color: var(--fg); }

@media (max-width: 800px) {
  #terminal .trm-grid { grid-template-columns: 1fr; }
  #terminal .trm-field input, #terminal .trm-field select { font-size: 16px; }
}

@media (max-width: 520px) {
  #terminal .trm-codehead { align-items: flex-start; flex-direction: column; }
  #terminal .trm-langs { width: 100%; justify-content: flex-start; }
}

@media (max-width: 360px) {
  #terminal .trm-syms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #terminal .trm-sum { gap: 8px; padding-inline: 9px; font-size: 10.5px; }
  #terminal .trm-metric { gap: 4px; }
  #terminal .trm-langs { gap: 2px; }
  #terminal .trm-langs .tab { padding: 4px 5px; font-size: 10.5px; }
}
