:root {
  --bg: #0e0e0e;
  --bg-2: #161616;
  --text: #e6e6e6;
  --hint: #888;
  --link: #62a0ff;
  --up: #2bd17e;
  --down: #ff5d5d;
  --grid-line: #232323;
  --button-bg: #2ea1ff;
  --button-text: #fff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--grid-line);
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 10px;
}

#symForm { flex: 0 0 auto; margin: 0; }

#symInput {
  background: var(--bg-2);
  border: 1px solid var(--grid-line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
#symInput:focus { outline: 2px solid var(--button-bg); outline-offset: 0; }

#symLabel {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--hint);
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--down); flex: 0 0 auto;
  transition: background 200ms ease;
}
.dot.on  { background: var(--up); }
.dot.off { background: var(--down); }
.dot.warm { background: #d4b94b; }

main { padding: 0; }

h2.section {
  margin: 14px 12px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--hint);
  font-weight: 600;
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

thead th {
  background: var(--bg);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--hint);
  font-weight: 500;
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grid-line);
}
thead th.ex { text-align: left; }

tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--grid-line);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
tbody td.ex {
  text-align: left;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 4px;
}

a.exlink {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
a.exlink:hover { color: var(--link); }
a.exlink:hover .logo { filter: brightness(1.15); }
tbody td.dim { color: var(--hint); }
tbody tr.hidden { display: none; }

.flash-up   { animation: flashUp   600ms ease-out; }
.flash-down { animation: flashDown 600ms ease-out; }

@keyframes flashUp {
  0%   { background: rgba(43,209,126,0.35); }
  100% { background: transparent; }
}
@keyframes flashDown {
  0%   { background: rgba(255,93,93,0.35); }
  100% { background: transparent; }
}

footer {
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  font-size: 11px;
  color: var(--hint);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (min-width: 600px) {
  body { max-width: 600px; margin: 0 auto; }
}
