:root {
  --ink: #18332e;
  --ink-soft: #536862;
  --forest: #173c35;
  --forest-2: #24574c;
  --mint: #b8ddc8;
  --mint-soft: #e4f0e8;
  --cream: #f5f2ea;
  --paper: #fffdf8;
  --sand: #e9e2d3;
  --peach: #e9a68f;
  --danger: #a34c43;
  --shadow: 0 20px 60px rgba(26, 51, 45, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 5%, rgba(184, 221, 200, 0.56), transparent 27rem),
    radial-gradient(circle at 92% 80%, rgba(233, 166, 143, 0.22), transparent 30rem),
    var(--cream);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 87, 76, 0.35);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--ink-soft);
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 23rem;
  height: 23rem;
  left: -14rem;
  bottom: 12%;
  border: 1px solid rgba(23, 60, 53, 0.09);
}

.ambient-two {
  width: 14rem;
  height: 14rem;
  right: -6rem;
  top: 17%;
  border: 1px solid rgba(23, 60, 53, 0.09);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--forest-2);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-lockup h1 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-lockup .eyebrow {
  margin-bottom: 2px;
  font-size: 0.57rem;
}

.brand-lockup.compact h1 {
  font-size: 1.55rem;
}

.brand-mark {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: var(--forest);
  box-shadow: 0 12px 24px rgba(23, 60, 53, 0.18);
}

.brand-mark span {
  position: absolute;
  bottom: 13px;
  width: 9px;
  border-radius: 9px 9px 3px 3px;
  background: var(--mint);
  transform-origin: bottom;
}

.brand-mark span:nth-child(1) {
  left: 12px;
  height: 16px;
  transform: rotate(-26deg);
}

.brand-mark span:nth-child(2) {
  left: 23px;
  height: 26px;
}

.brand-mark span:nth-child(3) {
  right: 12px;
  height: 19px;
  transform: rotate(26deg);
}

.brand-lockup.compact .brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 14px;
}

.brand-lockup.compact .brand-mark span {
  width: 7px;
  bottom: 10px;
}

.brand-lockup.compact .brand-mark span:nth-child(1) { left: 10px; height: 13px; }
.brand-lockup.compact .brand-mark span:nth-child(2) { left: 18px; height: 21px; }
.brand-lockup.compact .brand-mark span:nth-child(3) { right: 10px; height: 15px; }

.button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 12px 25px rgba(23, 60, 53, 0.2);
}

.button-primary:hover {
  background: var(--forest-2);
}

.button-secondary {
  color: var(--forest);
  background: rgba(255, 253, 248, 0.76);
  border-color: rgba(23, 60, 53, 0.18);
}

.button-secondary:hover {
  background: var(--paper);
}

.button-quiet {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(23, 60, 53, 0.15);
}

.button-wide {
  width: 100%;
}

.button-icon {
  font-size: 1.35rem;
  font-weight: 400;
}

.text-button {
  border: 0;
  padding: 8px;
  color: var(--forest-2);
  background: transparent;
  font-weight: 700;
}

.subtle-link {
  display: block;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  text-align: center;
  text-decoration: none;
}

.subtle-link:hover {
  color: var(--forest);
  text-decoration: underline;
}

.button-link {
  width: 100%;
  border: 0;
  background: transparent;
}

.approval-card {
  text-align: center;
}

.approval-card h2 {
  margin: 18px 0 10px;
  font-family: "STSong", "SimSun", serif;
  font-size: 2rem;
}

.approval-card .waiting-rings {
  margin: 0 auto 8px;
}

.auth-layout {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: clamp(40px, 8vw, 110px);
}

.auth-story {
  min-height: 650px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}

.story-copy {
  max-width: 570px;
}

.story-copy h2 {
  margin: 12px 0 22px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(3.5rem, 7vw, 6.4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.story-copy h2 span {
  white-space: nowrap;
}

.story-copy > p:last-of-type {
  max-width: 430px;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.9;
}

.trust-strip {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.trust-strip span {
  padding: 8px 13px;
  border: 1px solid rgba(23, 60, 53, 0.13);
  border-radius: 999px;
  color: var(--forest-2);
  background: rgba(255, 253, 248, 0.52);
  font-size: 0.79rem;
  font-weight: 700;
}

.care-note {
  max-width: 390px;
  padding: 22px 25px;
  display: flex;
  gap: 15px;
  border-radius: 20px;
  color: var(--forest);
  background: rgba(255, 253, 248, 0.58);
  border: 1px solid rgba(23, 60, 53, 0.09);
}

.care-note p {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.12rem;
  line-height: 1.6;
}

.care-note-icon {
  font-family: Georgia, serif;
  font-size: 2.4rem;
  line-height: 0.7;
  color: var(--peach);
}

.auth-card {
  padding: clamp(30px, 4vw, 44px);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.89);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.card-heading {
  margin-bottom: 28px;
}

.card-heading h2,
.modal h2 {
  margin: 15px 0 8px;
  font-family: "STSong", "SimSun", serif;
  font-size: 2rem;
  font-weight: 700;
}

.card-heading p,
.modal > form > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.step-chip {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--forest-2);
  background: var(--mint-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

label {
  display: block;
  margin-bottom: 18px;
}

label > span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(23, 60, 53, 0.16);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  transition: border 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 4px rgba(36, 87, 76, 0.08);
  outline: 0;
}

input::placeholder {
  color: #9baba7;
}

.form-error {
  min-height: 21px;
  margin: 0 0 10px !important;
  color: var(--danger) !important;
  font-size: 0.86rem;
}

.form-error a {
  color: inherit;
  font-weight: 800;
}

.loading-card {
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.8);
  box-shadow: var(--shadow);
}

.pulse-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--forest-2);
  box-shadow: 0 0 0 0 rgba(36, 87, 76, 0.3);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  60% { box-shadow: 0 0 0 12px rgba(36, 87, 76, 0); }
  100% { box-shadow: 0 0 0 0 rgba(36, 87, 76, 0); }
}

.dashboard {
  min-height: 100vh;
}

.app-header {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.connection-badge {
  min-height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(23, 60, 53, 0.12);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.6);
  font-size: 0.78rem;
  font-weight: 700;
}

.connection-badge i,
.terminal-status i,
.call-quality i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c2a64e;
}

.connection-badge.online i {
  background: #4e9b70;
  box-shadow: 0 0 0 4px rgba(78, 155, 112, 0.12);
}

.avatar-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--paper);
  background: var(--forest);
  font-weight: 800;
}

.dashboard-body {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 70px;
}

.welcome-row {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.welcome-row h2 {
  margin: 4px 0 8px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.welcome-row p {
  margin: 0;
}

.summary-strip {
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-radius: var(--radius-lg);
  color: #eaf6ef;
  background:
    linear-gradient(105deg, rgba(255,255,255,0.035), transparent 36%),
    var(--forest);
  box-shadow: 0 18px 40px rgba(23, 60, 53, 0.17);
}

.summary-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 0.86rem;
  color: rgba(234, 246, 239, 0.7);
}

.summary-num {
  color: #fff;
  font-family: "STSong", "SimSun", serif;
  font-size: 2.1rem;
  line-height: 1;
}

.summary-divider {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, 0.15);
}

.summary-note {
  margin-left: auto;
  align-items: center;
  color: rgba(234, 246, 239, 0.8);
}

.leaf-icon {
  color: var(--mint);
  font-size: 1.3rem;
}

.section-heading {
  margin: 52px 0 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.section-heading h3,
.how-it-works h3 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.8rem;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.device-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 60, 53, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.87);
  box-shadow: 0 12px 32px rgba(23, 60, 53, 0.06);
}

.device-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -85px;
  top: -95px;
  border-radius: 50%;
  background: var(--mint-soft);
  opacity: 0.6;
}

.device-card-head {
  position: relative;
  z-index: 1;
  padding: 25px 26px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.device-title {
  display: flex;
  gap: 14px;
  align-items: center;
}

.device-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--forest);
  background: var(--mint-soft);
  font-size: 1.25rem;
  font-weight: 800;
}

.device-title h4 {
  margin: 0 0 4px;
  font-size: 1.13rem;
}

.device-title p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.status-pill {
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  color: #547063;
  background: #eef3ef;
  font-size: 0.73rem;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca9a5;
}

.status-pill.online {
  color: #3e7358;
  background: #e3f2e8;
}

.status-pill.online::before {
  background: #53a574;
  box-shadow: 0 0 0 4px rgba(83, 165, 116, 0.11);
}

.device-metrics {
  margin: 0 26px;
  padding: 16px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(23, 60, 53, 0.07);
  border-bottom: 1px solid rgba(23, 60, 53, 0.07);
}

.metric {
  padding: 0 14px;
  border-right: 1px solid rgba(23, 60, 53, 0.07);
}

.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--ink-soft); font-size: 0.71rem; }
.metric strong { display: block; margin-top: 5px; font-size: 0.91rem; }

.device-actions {
  position: relative;
  z-index: 1;
  padding: 18px 26px 24px;
  display: flex;
  gap: 10px;
}

.device-actions .button {
  min-height: 44px;
  padding: 0 16px;
  flex: 1;
  font-size: 0.88rem;
}

.device-actions .icon-only {
  max-width: 48px;
  padding: 0;
  font-size: 1.12rem;
}

.device-card.offline .device-actions .button-primary {
  color: #82928c;
  background: #eaeeeb;
  box-shadow: none;
}

.empty-state {
  padding: 52px 24px;
  text-align: center;
  border: 1px dashed rgba(23, 60, 53, 0.2);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.55);
}

.empty-state h3 {
  margin: 22px 0 8px;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.6rem;
}

.empty-state p {
  max-width: 470px;
  margin: 0 auto 22px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.empty-illustration {
  position: relative;
  width: 140px;
  height: 100px;
  margin: 0 auto;
}

.phone-outline {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 52px;
  height: 82px;
  border: 3px solid var(--forest);
  border-radius: 12px;
  transform: translateX(-50%);
  background: var(--mint-soft);
}

.phone-outline span {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 16px;
  height: 3px;
  border-radius: 4px;
  background: var(--forest);
  transform: translateX(-50%);
}

.wifi-ring {
  position: absolute;
  left: 50%;
  top: 35px;
  border: 1px solid rgba(23, 60, 53, 0.24);
  border-radius: 50%;
  transform: translateX(-50%);
}

.ring-one { width: 90px; height: 58px; }
.ring-two { width: 140px; height: 90px; }

.how-it-works {
  margin-top: 70px;
  padding-top: 38px;
  border-top: 1px solid rgba(23, 60, 53, 0.1);
}

.steps-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.steps-grid article {
  padding: 21px;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.47);
}

.steps-grid article > span {
  color: var(--peach);
  font-family: Georgia, serif;
  font-size: 0.76rem;
}

.steps-grid h4 {
  margin: 10px 0 7px;
  font-size: 1rem;
}

.steps-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.83rem;
  line-height: 1.65;
}

.modal {
  width: min(500px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(16, 40, 34, 0.28);
}

.modal::backdrop {
  background: rgba(17, 38, 33, 0.55);
  backdrop-filter: blur(7px);
}

.modal > form,
.wide-modal {
  padding: 30px;
}

.modal-heading {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-heading h2 {
  margin-bottom: 0;
}

.close-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: #f0eee7;
  font-size: 1.5rem;
  line-height: 1;
}

.code-input {
  height: 66px;
  text-align: center;
  font-family: "Consolas", monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.35em;
}

.wide-modal {
  width: min(700px, calc(100% - 32px));
}

.member-list {
  margin: 24px 0;
  border-top: 1px solid rgba(23, 60, 53, 0.09);
}

.member-guidance {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--mint-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.member-row.pending {
  flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(228, 240, 232, 0.5), transparent 65%);
}

.member-approval {
  width: 100%;
  padding-top: 8px;
  display: flex;
  align-items: end;
  gap: 8px;
}

.member-approval label {
  min-width: 170px;
  flex: 1;
  margin: 0;
}

.member-approval select {
  min-height: 40px;
}

.member-approval .button {
  min-height: 40px;
}

.pending-badge {
  color: #8a6720;
  background: #fbf1d9;
}

.member-row {
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(23, 60, 53, 0.09);
}

.member-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--forest-2);
  font-weight: 800;
}

.member-info { flex: 1; }
.member-info strong { display: block; font-size: 0.92rem; }
.member-info small { color: var(--ink-soft); }

.role-badge {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--forest-2);
  background: var(--mint-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.member-remove {
  border: 0;
  padding: 6px;
  color: var(--danger);
  background: transparent;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  align-items: end;
  gap: 10px;
}

.inline-form label {
  margin: 0;
}

.inline-form.stacked {
  margin-top: 16px;
  grid-template-columns: 1fr 1fr;
}

.inline-form.stacked button {
  grid-column: 1 / -1;
}

.member-create {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(23, 60, 53, 0.09);
}

.member-create summary {
  cursor: pointer;
  color: var(--forest-2);
  font-size: 0.86rem;
  font-weight: 700;
}

.invite-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgba(23, 60, 53, 0.1);
  border-radius: 18px;
  background: var(--mint-soft);
}

.invite-panel h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.invite-panel > div:first-child p {
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.invite-result {
  margin-top: 18px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid rgba(23, 60, 53, 0.1);
}

.invite-result img {
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #fff;
}

.invite-result > div {
  min-width: 0;
  flex: 1;
}

.invite-result strong,
.invite-result a {
  display: block;
}

.invite-result a {
  margin: 8px 0;
  color: var(--forest-2);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.invite-result p {
  margin: 0 0 10px;
  font-size: 0.78rem;
}

.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
}

.switch-label > span {
  margin: 0;
}

.switch-label small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-weight: 400;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-label i {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd3cf;
  transition: background 160ms ease;
}

.switch-label i::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 160ms ease;
}

.switch-label input:checked + i {
  background: var(--forest-2);
}

.switch-label input:checked + i::after {
  transform: translateX(20px);
}

.terminal {
  width: min(1020px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 0 54px;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-status {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.75);
  font-size: 0.83rem;
  font-weight: 800;
}

.terminal-status.online {
  color: #3c7355;
  background: #e2f2e7;
}

.terminal-status.online i {
  background: #50a06e;
}

.terminal-panel {
  margin-top: clamp(30px, 6vh, 70px);
}

.pair-panel {
  min-height: min(640px, 72vh);
  padding: clamp(30px, 6vw, 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(23, 60, 53, 0.08);
  border-radius: 38px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow);
}

.pair-panel h2 {
  margin: 8px 0 12px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(2.3rem, 5vw, 4rem);
  font-weight: 500;
}

.terminal-lead {
  max-width: 580px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.75;
}

.pair-code {
  margin: 26px 0 4px;
  font-family: "Consolas", monospace;
  font-size: clamp(3.6rem, 10vw, 7.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--forest);
}

.pair-countdown {
  margin: 10px 0 20px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.pair-qr {
  width: 180px;
  height: 180px;
  margin: 5px 0 20px;
  border-radius: 16px;
}

.terminal-button {
  min-width: 230px;
  min-height: 58px;
  font-size: 1.08rem;
}

.privacy-note {
  margin: 22px 0 0;
  color: #75857f;
  font-size: 0.8rem;
}

.waiting-rings {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 25px;
}

.waiting-rings i {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  border: 1px solid var(--forest-2);
  opacity: 0;
  animation: waiting 2.4s infinite;
}

.waiting-rings i:nth-child(2) { animation-delay: 0.8s; }
.waiting-rings i:nth-child(3) { animation-delay: 1.6s; }

@keyframes waiting {
  0% { width: 32px; height: 32px; opacity: 0.6; }
  100% { width: 130px; height: 130px; opacity: 0; }
}

.active-terminal {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 26px;
  align-items: stretch;
}

.terminal-main-copy {
  padding: 34px 10px 20px;
}

.terminal-main-copy h2 {
  margin: 8px 0 16px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  font-weight: 500;
  line-height: 1.08;
}

.terminal-main-copy .terminal-lead {
  margin: 0;
}

.terminal-stage {
  position: relative;
  min-height: 450px;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 30%, rgba(184, 221, 200, 0.19), transparent 40%),
    #17302b;
  box-shadow: 0 22px 55px rgba(23, 60, 53, 0.23);
}

.terminal-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(234, 246, 239, 0.7);
}

.camera-glyph {
  width: 78px;
  height: 78px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234, 246, 239, 0.2);
  border-radius: 50%;
  color: var(--mint);
  font-size: 2.1rem;
}

.stage-placeholder p {
  font-size: 0.92rem;
}

.terminal-stage-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.76rem;
}

.incoming-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  background: rgba(15, 45, 37, 0.93);
  backdrop-filter: blur(10px);
}

.ringing-label {
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.incoming-card h3 {
  margin: 20px 0;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.incoming-actions {
  display: flex;
  gap: 12px;
}

.large-action {
  min-width: 118px;
  min-height: 56px;
  font-size: 1.05rem;
}

.terminal-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.terminal-action {
  min-height: 72px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(23, 60, 53, 0.12);
  border-radius: 18px;
  color: var(--forest);
  background: rgba(255, 253, 248, 0.76);
  font-size: 1rem;
  font-weight: 800;
}

.terminal-action > span:first-child {
  color: var(--peach);
  font-size: 1.35rem;
}

.voice-help {
  grid-column: 1 / -1;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 17px;
  border-radius: 16px;
  color: var(--ink-soft);
  background: rgba(228, 240, 232, 0.74);
  font-size: 0.88rem;
}

.voice-help strong {
  color: var(--ink);
}

.terminal-footnote {
  grid-column: 1 / -1;
  margin: 0;
  color: #7c8c86;
  font-size: 0.76rem;
  line-height: 1.6;
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  color: #fff;
  background: #142b26;
}

.remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #10231f;
}

.local-video {
  position: absolute;
  z-index: 4;
  right: 24px;
  top: 90px;
  width: min(24vw, 260px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: #203b34;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

.call-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(184, 221, 200, 0.12), transparent 28rem),
    #142b26;
}

.call-placeholder h2 {
  position: relative;
  margin: 28px 0 8px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
}

.call-placeholder p {
  position: relative;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
}

.calling-rings {
  position: relative;
  width: 130px;
  height: 130px;
}

.calling-rings i {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  border: 1px solid var(--mint);
  animation: call-ring 2.1s infinite;
}

.calling-rings i:nth-child(2) { animation-delay: 0.7s; }
.calling-rings i:nth-child(3) { animation-delay: 1.4s; }

@keyframes call-ring {
  0% { width: 30px; height: 30px; opacity: 0.8; }
  100% { width: 130px; height: 130px; opacity: 0; }
}

.call-topbar {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: 0;
  padding: max(22px, env(safe-area-inset-top)) 28px 50px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(3, 13, 10, 0.75), transparent);
}

.call-mode-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--mint);
}

.call-topbar h3 {
  margin: 7px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.55rem;
}

.call-quality {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(7, 26, 20, 0.55);
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
}

.call-quality i {
  background: var(--mint);
}

.call-bottom {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  padding: 10px;
  display: flex;
  gap: 8px;
  border-radius: 25px;
  background: rgba(7, 25, 20, 0.64);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.call-control {
  width: 78px;
  min-height: 68px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.call-control span {
  display: block;
  margin-bottom: 3px;
  font-size: 1.35rem;
}

.call-control small {
  font-size: 0.7rem;
}

.call-control.active {
  color: var(--forest);
  background: var(--mint);
}

.call-control.hangup-control {
  background: var(--danger);
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  width: min(360px, calc(100vw - 40px));
  padding: 14px 17px;
  border-radius: 14px;
  color: #fff;
  background: var(--forest);
  box-shadow: 0 15px 40px rgba(23, 60, 53, 0.25);
  animation: toast-in 220ms ease both;
  font-size: 0.88rem;
  line-height: 1.5;
}

.toast.error {
  background: #83443e;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 26px 0 40px;
  }

  .auth-story {
    min-height: auto;
    gap: 32px;
  }

  .story-copy h2 {
    font-size: clamp(3rem, 12vw, 5rem);
  }

  .care-note,
  .trust-strip {
    display: none;
  }

  .dashboard-body {
    padding-top: 25px;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .active-terminal {
    grid-template-columns: 1fr;
  }

  .terminal-main-copy {
    padding: 10px 2px;
    text-align: center;
  }

  .terminal-main-copy .terminal-lead {
    max-width: 540px;
  }

  .terminal-stage {
    min-height: 430px;
  }
}

@media (max-width: 620px) {
  .auth-layout,
  .dashboard-body,
  .app-header,
  .terminal {
    width: min(100% - 28px, 1120px);
  }

  .app-header {
    padding: 16px 0;
  }

  .app-header .brand-mark {
    width: 43px;
    height: 43px;
  }

  .app-header .brand-mark span { width: 7px; bottom: 10px; }
  .app-header .brand-mark span:nth-child(1) { left: 10px; height: 13px; }
  .app-header .brand-mark span:nth-child(2) { left: 18px; height: 21px; }
  .app-header .brand-mark span:nth-child(3) { right: 10px; height: 15px; }
  .app-header h1 { font-size: 1.35rem; }
  .app-header .eyebrow { display: none; }
  .connection-badge { display: none; }

  .welcome-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-row h2 {
    font-size: 2.8rem;
  }

  .summary-strip {
    padding: 18px;
    gap: 18px;
  }

  .summary-note {
    display: none;
  }

  .summary-divider:last-of-type {
    display: none;
  }

  .section-heading {
    margin-top: 38px;
  }

  .device-metrics {
    margin: 0 18px;
  }

  .device-card-head {
    padding: 21px 18px 17px;
  }

  .device-actions {
    padding: 15px 18px 19px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .modal > form,
  .wide-modal {
    padding: 24px;
  }

  .inline-form,
  .inline-form.stacked {
    grid-template-columns: 1fr;
  }

  .inline-form.stacked label:nth-of-type(3),
  .inline-form.stacked button {
    grid-column: auto;
  }

  .member-approval {
    align-items: stretch;
    flex-direction: column;
  }

  .invite-result {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .terminal {
    padding-top: 18px;
  }

  .terminal-header .brand-lockup h1 {
    font-size: 1.25rem;
  }

  .terminal-status {
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  .pair-panel {
    min-height: 72vh;
    padding: 26px 18px;
    border-radius: 26px;
  }

  .pair-code {
    font-size: 3.75rem;
    letter-spacing: 0.08em;
  }

  .pair-qr {
    width: 145px;
    height: 145px;
  }

  .terminal-stage {
    min-height: 58vh;
    border-radius: 24px;
  }

  .terminal-actions {
    grid-template-columns: 1fr;
  }

  .terminal-action {
    min-height: 61px;
  }

  .voice-help {
    line-height: 1.6;
  }

  .local-video {
    right: 14px;
    top: 82px;
    width: 112px;
    border-radius: 14px;
  }

  .call-topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .call-bottom {
    width: calc(100% - 20px);
    justify-content: center;
  }

  .call-control {
    width: min(21vw, 72px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
