:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #151b1c;
  --muted: #656966;
  --forest: #255848;
  --forest-hover: #1c4638;
  --line: #d8d9d3;
  --soft-green: #e9eee8;
  --red: #b44846;
  --radius: 10px;
  font-family: "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, textarea, select, summary { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #427eaa;
  outline-offset: 3px;
}
h1, h2, p { margin: 0; }
h1 { font-size: 42px; font-weight: 750; line-height: 1.23; letter-spacing: -.045em; }
h2 { margin-bottom: 16px; font-size: 26px; line-height: 1.4; font-weight: 700; letter-spacing: -.025em; }
p { line-height: 1.65; }
.page-shell {
  width: min(100%, 480px);
  min-height: 100svh;
  margin-inline: auto;
  padding: max(24px, env(safe-area-inset-top)) 28px max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--forest); font-size: 28px; font-weight: 750; line-height: 1; letter-spacing: .02em; }
.brand-mark { width: 38px; height: 40px; flex-shrink: 0; }
.header-note { color: var(--muted); font-size: 16px; white-space: nowrap; }
main { flex: 1; min-width: 0; }
.entry-intro { padding-top: 48px; }
.intro-copy { margin-top: 12px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.entry-wave { display: block; width: 100%; height: 106px; margin: 14px 0 23px; padding-inline: 10px; }
label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 500; line-height: 1.5; }
input, textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border: 1px solid #c9cec8;
  border-radius: var(--radius);
  background: #fcfbf9;
  color: var(--ink);
  padding: 13px 16px;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgb(24 38 30 / 2%);
}
textarea { resize: vertical; }
.voice-mode { margin-top: 16px; }
input::placeholder, textarea::placeholder { color: #888c87; opacity: 1; }
input:disabled, textarea:disabled { opacity: .55; }
.button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 550;
  line-height: 1.5;
  transition: background-color .15s ease, border-color .15s ease;
}
.full-width { width: 100%; }
.primary { background: var(--forest); color: #fff; }
.secondary { background: transparent; border-color: var(--forest); color: var(--forest); }
#createButton, #pasteJoin, #sendText { margin-top: 16px; }
.form-hint { margin-top: 10px; font-size: 16px; color: var(--muted); text-align: center; }
.invite-entry { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.paste-panel { margin-top: 22px; }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 26px; font-size: 16px; color: var(--muted); }
.footer-divider { width: 1px; height: 15px; background: #cbcfc7; }
.help-button { min-width: 60px; min-height: 48px; padding: 8px 0; border: 0; background: transparent; color: var(--forest); font-size: 16px; text-decoration: underline; text-underline-offset: 3px; }
.notice { margin-top: 24px; padding: 14px 16px; border-radius: var(--radius); line-height: 1.6; font-size: 16px; overflow-wrap: anywhere; }
.error-notice { background: #f8eae5; color: #8d3430; border: 1px solid #e7c4bb; }
.waiting-view { padding-top: 60px; text-align: center; }
.waiting-view h1 { font-size: 32px; letter-spacing: -.025em; }
.view-copy { margin-top: 10px; color: var(--muted); font-size: 17px; }
.small-voice { width: 132px; height: 132px; margin: 0 auto 30px; padding: 18px; border-radius: 50%; background: var(--soft-green); color: var(--forest); }
.small-voice svg { display: block; width: 100%; height: 100%; }
.waiting-view .primary { margin-top: 36px; }
.text-button { margin-top: 8px; color: var(--forest); background: transparent; }
.call-view { padding-top: 32px; }
.call-heading { text-align: center; }
.call-heading h1 { font-size: 38px; letter-spacing: -.035em; }
.call-heading .view-copy { min-height: 28px; }
.call-wave { display: flex; align-items: center; justify-content: center; width: 144px; height: 144px; margin: 22px auto 12px; background: #dfe9df; border: 16px solid #edf1eb; border-radius: 50%; color: var(--forest); }
.call-wave svg { width: 108px; height: 90px; overflow: visible; }
.wave-bar { transform-box: fill-box; transform-origin: center; transition: transform .15s ease; }
.call-wave.level-0 .wave-bar { transform: scaleY(.28); }
.call-wave.level-1 .wave-bar { transform: scaleY(.45); }
.call-wave.level-2 .wave-bar { transform: scaleY(.65); }
.call-wave.level-3 .wave-bar { transform: scaleY(.82); }
.call-wave.level-4 .wave-bar { transform: scaleY(1); }
.call-wave.quiet { color: #6d8a76; }
.role-copy { text-align: center; }
.role-label { font-size: 19px; font-weight: 600; }
.role-copy .form-hint { margin-top: 2px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.invitation-panel { margin-top: 20px; }
.invitation-panel label { margin-bottom: 10px; }
.invitation-panel input { font-size: 16px; }
#copyInvite { margin-top: 12px; }
.resume-panel { background: var(--soft-green); border: 1px solid #c6d4c6; }
.resume-panel p { margin-bottom: 12px; }
.transcript-panel { margin-top: 22px; }
.transcript-panel h2 { font-size: 16px; font-weight: 550; line-height: 1.5; margin-bottom: 8px; letter-spacing: 0; }
.transcript { padding: 12px 14px; min-height: 62px; max-height: 164px; overflow-y: auto; overflow-wrap: anywhere; white-space: pre-wrap; background: #f4f5f1; border: 1px solid #d8dcd5; border-radius: 8px; color: #606861; font-size: 16px; }
.call-controls { display: grid; grid-template-columns: 1fr 1.08fr; gap: 10px; margin-top: 16px; }
.control-button { padding: 12px 8px; font-size: 16px; line-height: 1.45; font-weight: 500; color: var(--ink); background: transparent; border-color: #c5cac3; min-height: 58px; gap: 8px; white-space: nowrap; }
.control-button svg { height: 28px; width: 25px; flex: 0 0 auto; }
.mic-slash { display: none; }
#micButton[aria-pressed="true"], #micButton.muted { background: #ecefe9; color: #5b625b; }
#micButton[aria-pressed="true"] .mic-slash, #micButton.muted .mic-slash { display: block; }
.danger { background: var(--red); color: #fff; }
#hangupButton { margin-top: 16px; }
.text-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.text-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 14px; cursor: pointer; font-size: 16px; list-style: none; }
.text-panel summary::-webkit-details-marker { display: none; }
.text-panel summary svg { width: 20px; height: 20px; flex-shrink: 0; }
.text-panel[open] summary svg { transform: rotate(180deg); }
.text-panel form { padding: 0 14px 14px; }
.call-reminder { margin-top: 20px; color: var(--muted); text-align: center; font-size: 16px; }
body:has(#callView:not([hidden])) .site-footer,
body:has(#callView:not([hidden])) .header-note { display: none; }
dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100svh - 48px); padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 64px rgb(15 31 21 / 18%); }
dialog::backdrop { background: rgb(15 27 20 / 40%); }
dialog h2 { font-size: 24px; }
dialog ol { margin: 0 0 18px; padding-left: 24px; line-height: 1.7; }
dialog li + li { margin-top: 12px; }
dialog p { margin-bottom: 14px; color: var(--muted); }
dialog .button { margin-top: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (hover: hover) {
  .primary:not(:disabled):hover { background: var(--forest-hover); }
  .secondary:not(:disabled):hover, .control-button:not(:disabled):hover { background: #eef1eb; }
  .danger:not(:disabled):hover { background: #9d3d3c; }
  .help-button:hover, .text-button:hover { color: #193d31; }
}
@media (min-width: 640px) {
  .page-shell { padding-top: 40px; padding-bottom: 24px; }
  .entry-intro { padding-top: 54px; }
}
@media (max-width: 360px) {
  .page-shell { padding-inline: 20px; }
  h1 { font-size: 38px; }
  .intro-copy { font-size: 17px; }
  .site-footer { gap: 8px; }
  .call-controls { grid-template-columns: 1fr; }
  .call-heading h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Recipient surface follows the simple, unlocked OriginOS telephone layout. */
.phone-avatar, .phone-status { display: none; }
#micButton > .phone-circle { display: inline-flex; }
#hangupButton > .phone-circle { display: none; }
body[data-role="listener"] {
  color-scheme: dark;
  background: linear-gradient(160deg, #34424a, #242e34);
  color: #f7f8f9;
  min-height: 100svh;
}
body[data-role="listener"] .page-shell {
  width: min(100%, 480px);
  min-height: 100svh;
  padding: 0 30px;
}
body[data-role="listener"] .site-header,
body[data-role="listener"] .site-footer,
body[data-role="listener"] #callWave,
body[data-role="listener"] .role-copy,
body[data-role="listener"] .call-reminder,
body[data-role="listener"] #endedView > .small-voice { display: none; }
body[data-role="listener"] main { display: flex; flex-direction: column; position: relative; }
body[data-role="listener"] .waiting-view,
body[data-role="listener"] .call-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: max(620px, 100svh);
  padding: max(60px, env(safe-area-inset-top)) 0 max(104px, env(safe-area-inset-bottom));
  text-align: center;
}
body[data-role="listener"] .phone-status {
  display: block;
  min-height: 30px;
  margin: 0;
  color: #f2f4f6;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: .015em;
}
body[data-role="listener"] h1 {
  margin: 14px 0 0;
  color: #fafbfc;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}
body[data-role="listener"] .call-heading { width: 100%; }
body[data-role="listener"] .phone-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
  margin-top: 24px;
  border-radius: 50%;
  background: #5a6972;
  color: #cbd1d5;
}
.phone-avatar svg { display: block; width: 108px; height: 108px; }
.phone-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: #fafbfc;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
}
body[data-role="listener"] .phone-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #ff4545;
  color: #fff;
}
body[data-role="listener"] .phone-circle svg { width: 48px; height: 48px; }
.phone-green .phone-circle { background: #33c953 !important; }
.phone-incoming-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
  padding: 0 30px;
  margin-top: auto;
  padding-top: 36px;
}
body[data-role="listener"] .call-controls { display: flex; justify-content: center; margin: auto 0 40px; padding-top: 36px; }
body[data-role="listener"] #micButton,
body[data-role="listener"] #hangupButton {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fafbfc;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
}
body[data-role="listener"] #micButton .phone-circle { width: 80px; height: 80px; background: #53616a; }
body[data-role="listener"] #micButton .phone-circle svg { width: 29px; height: 34px; }
body[data-role="listener"] #micButton[aria-pressed="true"] .phone-circle { background: #f5f7f8; color: #293840; }
body[data-role="listener"] #callMessage,
body[data-role="listener"] #errorMessage,
body[data-role="listener"] #resumePanel {
  position: absolute;
  top: 41%;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #34424a;
  font-size: 16px;
  line-height: 1.7;
  text-align: center;
}
body[data-role="listener"] #errorMessage { z-index: 1; color: #ffdbd9; }
body[data-role="listener"] #resumePanel { z-index: 2; }
body[data-role="listener"] #resumeButton { background: #33a75b; }
body[data-role="listener"] #endedMessage { margin-top: 36px; color: #d7dee2; font-size: 17px; }
body[data-role="listener"] button:focus-visible { outline-color: #fff; }
@media (hover: hover) {
  body[data-role="listener"] .phone-action:hover .phone-circle,
  body[data-role="listener"] #micButton:hover .phone-circle,
  body[data-role="listener"] #hangupButton:hover .phone-circle { filter: brightness(1.08); }
}
@media (max-width: 360px) {
  body[data-role="listener"] .page-shell { padding-inline: 24px; }
  .phone-incoming-controls { padding-inline: 10px; }
}
@media (max-height: 700px) {
  body[data-role="listener"] .waiting-view,
  body[data-role="listener"] .call-view { padding-top: max(30px, env(safe-area-inset-top)); padding-bottom: 34px; }
  body[data-role="listener"] .phone-avatar { width: 104px; height: 104px; margin-top: 18px; }
  body[data-role="listener"] .phone-avatar svg { width: 86px; height: 86px; }
  body[data-role="listener"] .call-controls { margin-bottom: 28px; }
  body[data-role="listener"] #callMessage,
  body[data-role="listener"] #errorMessage,
  body[data-role="listener"] #resumePanel { top: 43%; }
}
body[data-role="listener"] #hangupButton > .phone-circle { display: flex; }
