html, body {
  height: 100%;
  margin: 0;
  background: #0e1a14;
  color: #f2f7f4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}

#app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

button, input {
  font-family: inherit;
  font-size: 16px;
}

button {
  touch-action: manipulation;
  border: 0;
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 12px;
  font-weight: 700;
  color: #f2f7f4;
  background: #1b7a4e;
}

button.secondary {
  background: transparent;
  border: 1px solid #9bb5a6;
  font-weight: 600;
}

button:disabled {
  opacity: 0.45;
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 22px;
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
  margin: 0;
}

.muted {
  color: #9bb5a6;
  font-size: 13px;
  margin: 4px 0 0;
}

.lead {
  font-size: 15px;
  line-height: 1.35;
  margin: 14px 0;
}

.stack > * {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
}

label {
  display: block;
  margin-top: 10px;
  color: #9bb5a6;
  font-size: 13px;
}

input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #16261d;
  color: #f2f7f4;
}

.card {
  background: #16261d;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  text-align: left;
  font-weight: 600;
}

.card small {
  display: block;
  color: #9bb5a6;
  font-weight: 500;
  margin-top: 2px;
}

.live {
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .grow {
  flex: 1;
  min-width: 0;
}

.topbar h1 {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar button {
  width: auto;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.prompt {
  margin: 8px 0;
  font-size: 14px;
  font-weight: 700;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 220px;
  background: #0a120d;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}

#cam, #overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

#cam {
  object-fit: contain;
  background: #0a120d;
  z-index: 1;
}

#overlay {
  z-index: 2;
}

.banner {
  margin-top: 8px;
  border-radius: 12px;
  padding: 8px 10px;
  background: #16261d;
}

.banner strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.banner.in strong { color: #1faf5a; }
.banner.out strong { color: #e23d3d; }
.banner.noCall strong { color: #e6a817; }
.banner.unknown strong { color: #9bb5a6; }

.banner span {
  display: block;
  margin-top: 4px;
  color: #9bb5a6;
  font-size: 13px;
}

.row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.row button {
  flex: 1;
}

.row button.in { background: #1faf5a; color: #06210f; }
.row button.out { background: #e23d3d; }
.row button.nocall { background: #e6a817; color: #2a2108; }

.error {
  min-height: 16px;
  margin: 6px 0 0;
  color: #e6a817;
  font-size: 12px;
}

.log-item {
  width: 100%;
  text-align: left;
  background: #16261d;
  margin-top: 8px;
  font-weight: 600;
}

.log-item .tag {
  font-weight: 800;
}

.log-item .tag.in { color: #1faf5a; }
.log-item .tag.out { color: #e23d3d; }
.log-item .tag.noCall { color: #e6a817; }

.version {
  position: fixed;
  right: 8px;
  bottom: calc(4px + env(safe-area-inset-bottom));
  z-index: 5;
  pointer-events: none;
  color: #9bb5a6;
  font-size: 11px;
}
