/* The old shop's look: near-black green, its green for what matters (the price, the one main button, the chart,
   where the keyboard is). Dark only, as it always was: that green does not read on white. No decoration. */

:root {
  color-scheme: dark;
  --bg: #090c09;
  --card: #101510;
  --field: #161d16;
  --line: #233023;
  --fg: #effaef;
  --dim: #8fa38f;
  --accent: #00ff00;
  --on-accent: #031203;
  --good: #00ff00;
  --bad: #fb7185;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  max-width: 27rem;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

h1 { display: flex; align-items: center; gap: .5rem; font-size: 1.125rem; font-weight: 800; letter-spacing: -.01em; }
h1 img { image-rendering: pixelated; }
h1 span { color: var(--accent); }

nav { display: flex; align-items: center; gap: .25rem; }
#balance { font-weight: 600; margin-right: .5rem; }

main { display: grid; gap: 1.5rem; }

button, input, select { font: inherit; color: inherit; }

button {
  background: none;
  border: 1px solid var(--line);
  border-radius: .5rem;
  padding: .4rem .7rem;
  cursor: pointer;
}
button:hover { border-color: var(--dim); }
button[aria-expanded="true"], button[aria-pressed="true"] { background: var(--field); border-color: var(--dim); }
button:disabled { color: var(--dim); cursor: default; border-color: var(--line); }

button.main {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
  padding: .8rem 1rem;
  width: 100%;
}
button.main:disabled { background: var(--field); color: var(--dim); border-color: var(--line); }

input:not([type="radio"]), textarea, select {
  background: var(--field);
  border: 1px solid transparent;
  border-radius: .5rem;
  padding: .75rem .8rem;
  width: 100%;
  min-width: 0;
}
textarea { display: block; resize: none; field-sizing: content; max-height: 9rem; font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.row { display: flex; gap: .5rem; align-items: center; }
.row > button { flex: none; }

#notice { color: var(--bad); }
#save, #found { display: grid; gap: .5rem; border: 1px solid var(--accent); border-radius: .75rem; padding: .6rem; }
#save p, #found p { justify-content: space-between; padding-left: .4rem; }

/* The key: hidden until it is pressed. */
#key-text, #found-text { flex: 1; text-align: left; font: .9375rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; min-width: 0; }
/* Being told: what stands beside the buttons. */
#push-state, #hook-state { flex: 1; color: var(--dim); font-size: .875rem; overflow-wrap: anywhere; min-width: 0; }
#hook-state.bad { color: var(--bad); }
#guard { display: grid; gap: .5rem; border-top: 1px solid var(--line); padding-top: .75rem; }
#guard p { color: var(--bad); }

/* The price. */
#market { display: grid; gap: .25rem; }
#price span, #stock { color: var(--dim); }
#rate { color: var(--accent); font-size: 2.75rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
#plot { position: relative; margin-top: .5rem; touch-action: pan-y; }
#chart { display: block; width: 100%; height: 6rem; overflow: visible; }
#chart #chart-mark { stroke: var(--dim); stroke-width: 1; }
#chart-high, #chart-low { position: absolute; right: 0; color: var(--dim); font-size: .75rem; line-height: 1; pointer-events: none; background: var(--bg); padding: 0 0 0 .25rem; }
#chart-high { top: 0; }
#chart-low { bottom: 0; }
#chart-at { color: var(--dim); font-size: .8125rem; min-height: 1.2em; }
#chart path { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
#ranges { display: flex; gap: .25rem; }
#ranges button { border-color: transparent; color: var(--dim); padding: .2rem .5rem; font-size: .8125rem; }
#ranges button[aria-pressed="true"] { color: var(--fg); background: var(--field); }

/* Coming in, and buying. */
#enter, #buy, .panel { display: grid; gap: .5rem; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; }
.panel p { color: var(--dim); }

fieldset { border: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; background: var(--field); border-radius: .5rem; padding: .2rem; }
legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
fieldset label { text-align: center; padding: .5rem; border-radius: .35rem; cursor: pointer; color: var(--dim); }
fieldset input { position: absolute; opacity: 0; pointer-events: none; }
fieldset label:has(:checked) { background: var(--line); color: var(--fg); font-weight: 600; }
fieldset label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

#limit-row { display: flex; align-items: center; gap: .5rem; color: var(--dim); white-space: nowrap; }

.state { color: var(--dim); min-height: 1.4em; overflow-wrap: anywhere; }
.state.good { color: var(--good); }
.state.bad { color: var(--bad); }

/* The key, and where money is sent. */
code { font: .9375rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
ul { list-style: none; padding: 0; }
#add .row { align-items: start; }
#add code { flex: 1; }
#add small { color: var(--dim); font-size: .875rem; }
#incoming { display: grid; gap: .25rem; color: var(--dim); }
#incoming:empty { display: none; }

/* What rests, and what happened. */
#orders li, #history li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .1rem 1rem;
  align-items: center;
  padding: .6rem 0;
  border-top: 1px solid var(--line);
}
#history li > :nth-child(2), #orders li > :nth-child(2) { text-align: right; }
#history small, #orders small { color: var(--dim); font-size: .875rem; grid-column: 1 / -1; overflow-wrap: anywhere; }
#history a { color: inherit; }
#history details { color: var(--dim); font-size: .875rem; grid-column: 1 / -1; }
#history summary { cursor: pointer; }
#history small button { padding: 0 .4rem; font-size: inherit; }
#older { margin-top: .5rem; width: 100%; color: var(--dim); }

/* The coin picker: the coins as tiles, under them the networks of the coin chosen. A coin on one network says it
   on the same line, so the line is always there. */
.pick, .pick .coins { display: grid; gap: .375rem; }
.pick .coins { grid-template-columns: repeat(5, 1fr); }
.pick .nets div { display: flex; flex-wrap: wrap; gap: .375rem; }
.pick button, .pick span { display: flex; align-items: center; gap: .4rem; min-height: 2.5rem; color: var(--dim); font-size: .875rem; }
.pick button { padding: .3rem .65rem .3rem .45rem; }
.pick .coins button { flex-direction: column; justify-content: center; gap: .25rem; padding: .5rem .25rem; font-size: .8125rem; font-weight: 600; }
.pick button[aria-pressed="true"] { color: var(--fg); }
.pick svg { flex: none; width: 1.25rem; height: 1.25rem; }
.pick .coins svg { width: 1.75rem; height: 1.75rem; }
.pick svg > circle:not([fill]) { fill: var(--line); }
.pick svg text { fill: var(--fg); font: 600 17px system-ui, sans-serif; }
#marks { position: absolute; }

/* The address as a code: black on white whatever the page's colours, as scanners want it. */
#add-qr { display: block; width: 11rem; height: 11rem; margin: .75rem auto 0; border-radius: .5rem; shape-rendering: crispEdges; }
#add-qr[hidden] { display: none; }
