:root {
  --bg: #07080c;
  --panel: #16141f;
  --line: rgba(244, 236, 220, 0.12);
  --text: #f4ecdc;
  --mute: #9a927f;
  --amber: #e07a3d;
  --amber-2: #ffb27a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}
body {
  padding: calc(10px + var(--safe-top)) 14px calc(16px + var(--safe-bottom) + var(--keyboard, 0px));
}

.app {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.04em;
}
.quota {
  font-size: 12px;
  color: var(--amber);
  font-weight: 600;
}
.status {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
  min-height: 1.3em;
}
.status.err { color: var(--amber-2); }

.lanes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
}
.lane.on {
  border-color: var(--amber);
}
.who {
  font-size: 12px;
  color: var(--mute);
}
.lang {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.row {
  display: flex;
  gap: 6px;
}
.chip, .talk, .btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.chip {
  flex: 1;
  background: #221f2c;
  color: var(--text);
  border-radius: 10px;
  padding: 6px 0;
  font-size: 16px;
}
.talk {
  width: 100%;
  margin-top: auto;
  background: var(--amber);
  color: #1a120c;
  font-weight: 700;
  border-radius: 14px;
  padding: 12px 8px;
  font-size: 15px;
}
.talk:disabled { opacity: 0.4; }
.lane.rec .talk {
  background: #c94b2a;
  color: #fff;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.card label {
  display: block;
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 4px;
}
.card p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.4em;
}

.compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compose textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  font: inherit;
  scroll-margin-bottom: 88px;
}
.btn {
  background: var(--amber);
  color: #1a120c;
  font-weight: 700;
  border-radius: 16px;
  padding: 12px;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
}
.btn.ghost {
  background: transparent;
  color: var(--amber-2);
  border: 1px solid var(--line);
}
.btn:disabled { opacity: 0.4; }

.pay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 8, 12, 0.86);
  z-index: 20;
  padding: 24px 18px;
  align-items: center;
  justify-content: center;
}
.pay.show { display: flex; }
.pay-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 18px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pay-box h2 { margin: 0; font-size: 22px; }
.pay-box p { margin: 0; color: var(--mute); font-size: 14px; }

.hint {
  font-size: 12px;
  color: var(--mute);
  text-align: center;
}
