* { box-sizing: border-box; margin: 0; }

/* author display rules below would otherwise beat the hidden attribute */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: #111113;
  color: #e6e6e9;
  font: 16px/1.5 -apple-system, system-ui, sans-serif;
}

#gate {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding: 32px;
}

#gate input, #gate button {
  font-size: 18px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1c1c1f;
  color: inherit;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

#transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}

.line { max-width: 85%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.line.you { align-self: flex-end; background: #2b4a7a; }
.line.talk { align-self: flex-start; background: #26262b; }
.line.tool, .line.sys, .line.err { align-self: stretch; max-width: 100%; font-size: 12px; color: #8a8a92; background: none; padding: 0 4px; }
.line.err { color: #d07070; }

#approval {
  margin: 0 16px 8px;
  padding: 12px;
  border: 1px solid #6a5a20;
  border-radius: 12px;
  background: #221e10;
}

#approval pre { white-space: pre-wrap; word-break: break-all; font-size: 13px; margin-bottom: 10px; }
.row { display: flex; gap: 10px; }
.row button { flex: 1; font-size: 16px; padding: 10px; border-radius: 10px; border: none; background: #2e5c34; color: inherit; }
.row button.danger { background: #5c2e2e; }

#status {
  text-align: center;
  font-size: 13px;
  color: #8a8a92;
  padding: 4px 16px;
  min-height: 24px;
}

#ptt {
  margin: 8px 16px calc(16px + env(safe-area-inset-bottom));
  padding: 26px;
  font-size: 19px;
  font-weight: 600;
  border: none;
  border-radius: 18px;
  background: #26262b;
  color: inherit;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#ptt.recording { background: #7a2b2b; }
#ptt.responding { background: #2b4a7a; }
#gate-msg { color: #d07070; font-size: 13px; min-height: 18px; }
