* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #ececec;
  color: #222;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 640px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #ededed;
}
#topbar {
  padding: 12px 16px 10px;
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
  text-align: center;
  flex: none;
}
#topbar .title { font-size: 17px; font-weight: 600; }
#topbar .progress { font-size: 12px; color: #888; margin-top: 3px; }
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.interviewer { align-self: flex-start; align-items: flex-start; }
.msg.her { align-self: flex-end; align-items: flex-end; }
.bubble {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.interviewer .bubble { background: #fff; border: 1px solid #e2e2e2; }
.msg.her .bubble { background: #5b8def; color: #fff; }
.msg.her .bubble.deleted {
  background: #f0f0f0;
  color: #999;
  border: 1px dashed #ccc;
  font-style: italic;
}
.msg .tag { font-size: 11px; color: #999; margin-bottom: 3px; }
.msg.system {
  align-self: center;
  max-width: 90%;
}
.msg.system .bubble {
  background: transparent;
  color: #999;
  font-size: 12px;
  padding: 2px 8px;
}
.dontrecord {
  margin-top: 4px;
  font-size: 12px;
  color: #888;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 0;
}
.hidefromyang {
  margin-top: 4px;
  margin-left: 14px;
  font-size: 12px;
  color: #888;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 0;
}
.hidden-note { color: #b08d3c; }
.recap .bubble { background: #fff8e6; border-color: #eadfae; }
.fatal {
  margin: 40px 20px;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  text-align: center;
  color: #666;
  line-height: 1.8;
}
#composer {
  flex: none;
  background: #f7f7f7;
  border-top: 1px solid #ddd;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.actions { display: flex; gap: 8px; margin-bottom: 8px; }
.actions button {
  flex: 1;
  padding: 8px 0;
  font-size: 14px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  color: #333;
}
.actions button.active { border-color: #5b8def; color: #5b8def; }
.actions button:disabled { opacity: .5; }
.inputrow { display: flex; gap: 8px; align-items: flex-end; }
#input {
  flex: 1;
  resize: none;
  max-height: 110px;
  padding: 9px 10px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  background: #fff;
}
#btn-send {
  flex: none;
  padding: 9px 18px;
  font-size: 15px;
  background: #5b8def;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#btn-send:disabled { opacity: .5; }
.hint { font-size: 12px; color: #5b8def; margin-top: 6px; }
.typing { color: #999; font-size: 13px; padding: 4px 2px; }
