* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font: 16px/1.75 system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  color: #223047;
  background: #f4f6f8;
  --muted: #57677d;
  --green: #138253;
  --line: #dce2e8;
  --surface: #f3f6f5;
}
body { margin: 0; padding: 0 12px max(20px, env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.375rem; line-height: 1.4; }
h2 { font-size: 1rem; line-height: 1.5; }
.phone {
  max-width: 420px;
  margin: max(18px, env(safe-area-inset-top)) auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 5px 20px #24384b0c;
  min-width: 0;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.people { margin-top: 15px; }
.person { padding: 14px 6px; border-radius: 14px; background: var(--surface); text-align: center; }
.person h2 { overflow-wrap: anywhere; }
.person-state { min-height: 1.5em; }
.muted, small { font-size: .8125rem; color: var(--muted); }
.green { color: var(--green); }
.clock { font-size: clamp(1.25rem, 5.3vw, 1.8125rem); font-weight: 750; font-variant-numeric: tabular-nums; }
.comparison { margin-top: 12px; }
.bar { display: flex; height: 12px; gap: 3px; margin: 8px 0; }
.bar span { flex: 1; border-radius: 4px; background: #16a34a; }
.bar span:last-child { background: #94a3b8; }
.center { text-align: center; }
.lead { margin: 10px 0; font-weight: 700; }
button, .file-choice {
  display: inline-block;
  min-height: 44px;
  border: 1px solid #cbd5df;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  padding: 9px 13px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
button:disabled { cursor: default; opacity: .57; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, .file-choice:focus-within, .activity-scroll:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.wide { width: 100%; display: block; margin: 10px 0; }
.primary { background: #16834f; color: #fff; border-color: #16834f; }
.danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.stats { padding: 12px 0 0; margin-top: 12px; border-top: 1px solid #e2e8ee; }
.activity-scroll { max-height: 246px; overflow-y: auto; overscroll-behavior: contain; }
.activity { list-style: none; padding: 0; margin: 6px 0 0; }
.activity li { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; overflow-wrap: anywhere; }
.activity time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.activity a { color: #087b65; text-underline-offset: 3px; }
.activity-status { color: var(--green); }
.notice, .feedback { padding: 10px 12px; margin: 8px 0; border-radius: 10px; font-size: .875rem; }
.notice { background: #edf5ef; color: #24513e; }
.feedback { background: #f0f4f7; }
.feedback[data-error="true"] { color: #9c2525; background: #fff0ee; }
.sheet {
  width: min(420px, calc(100% - 24px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  color: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet::backdrop { background: #142f2b66; }
.sheet h2 { font-size: 1.1875rem; }
.sheet p { margin: 10px 0; }
.sheet .row + p { margin-top: 6px; }
.close { min-width: 44px; font-size: 1.25rem; padding: 0; border-color: transparent; background: var(--surface); }
.camera { overflow: hidden; background: var(--surface); border-radius: 14px; text-align: center; }
.camera-placeholder { padding: 32px 10px; font-size: 2.625rem; }
.camera small { display: block; }
.camera video, .camera img { display: block; width: 100%; max-height: 36vh; object-fit: contain; }
.caption { text-align: center; color: var(--muted); font-size: .8125rem; }
.emojis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.emojis button { padding: 1px; font-size: 1.4375rem; }
.chosen { border-color: #16834f; box-shadow: inset 0 0 0 1px #16834f; background: #eaf6ef; }
.phrases button { display: block; width: 100%; text-align: left; margin: 5px 0; font-size: .875rem; }
.file-choice { position: relative; margin-top: 7px; font-size: .875rem; }
.file-choice input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
textarea, input:not([type="file"]) {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}
textarea { resize: vertical; }
.character-count { display: block; text-align: right; }
.preview { background: var(--surface); text-align: center; padding: 10px 14px; border-radius: 12px; }
.preview b { display: block; font-size: 2.25rem; }
.preview span, .receive-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.reaction-image { display: block; width: 82px; height: 82px; object-fit: contain; margin: 4px auto 8px; border-radius: 10px; }
.receive-emoji { font-size: 3rem; }
#receive-image { width: 130px; height: 130px; }
.history-image { display: block; max-width: 100%; max-height: 68vh; object-fit: contain; margin: 12px auto 0; border-radius: 12px; }
.login-page { min-height: 100dvh; display: grid; place-content: center; }
.login { width: min(360px, calc(100vw - 24px)); margin: 0; }
.login label { display: block; margin-top: 12px; }
.login input { margin-top: 4px; }
.login button { margin: 18px 0 0; }
@media (max-width: 360px) {
  .phone { padding: 15px; }
  .clock { font-size: 1.2rem; }
  .pair { gap: 8px; }
}
