:root {
  --bg: #e2e2e2;
  --panel: #ffffff;
  --text: #000000;
  --accent: #d62828;
  --border: #000000;
  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

.app {
  display: grid;
  grid-template-columns: minmax(360px, 600px) 280px;
  gap: 32px;
  padding: 24px;
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
}

.screen { display: flex; flex-direction: column; gap: 16px; }

.ttx-frame {
  background: #000;
  border: 3px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ttx-image {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.select-wrapper {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  width: 100%;
}
.select-wrapper::after {
  content: "▾";
  color: var(--accent);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 18px;
}
#station {
  display: block;
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  background-image: none;
  border: 0;
  outline: 0;
  margin: 0;
  padding: 12px 36px 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  border-radius: 0;
}
#station::-ms-expand { display: none; }
#station:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

.pad {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pad-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.pad-row-page,
.pad-row-sub {
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
}

.key, .nav-btn, .page-input, .sub-label {
  width: 100%;
  min-width: 0;
  height: 44px;
  box-sizing: border-box;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.key:active, .nav-btn:active { transform: translateY(1px); }
.key-zero { grid-column: 1 / -1; }

.nav-btn {
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}

.page-input, .sub-label {
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: text;
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-weight: 700;
}
.sub-label { cursor: default; }

.page-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Imagemap-Linkfeedback im Bild */
area { cursor: pointer; }
