:root {
  --paper: #f4f2e9;
  --paper-deep: #e9e6da;
  --ink: #153a32;
  --ink-deep: #0b2823;
  --mint: #d9ff78;
  --mint-soft: #edffc0;
  --coral: #ff775f;
  --blue: #7aa8ff;
  --line: rgba(21, 58, 50, 0.15);
  --muted: #6d7771;
  --white: #fffefa;
  --shadow: 0 28px 80px rgba(23, 46, 39, 0.15);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: var(--mint);
}

.brand-mark svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-mark.small {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 13px;
}

.brand-en {
  margin-left: 2px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.header-proof,
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.pulse-dot,
.connection-badge > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57aa6d;
  box-shadow: 0 0 0 5px rgba(87, 170, 109, 0.12);
}

.hero {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  min-height: 680px;
  align-items: center;
  gap: 42px;
  padding-block: 50px 80px;
}

.eyebrow,
.section-kicker {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  letter-spacing: 0;
}

.hero h1 {
  margin: 28px 0 24px;
  color: var(--ink-deep);
  font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: clamp(58px, 6.2vw, 88px);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.hero-lead {
  max-width: 500px;
  margin: 0;
  color: #65716b;
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 38px;
}

.primary-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(20, 58, 50, 0.2);
  color: white;
  cursor: pointer;
  font-weight: 720;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button:hover {
  background: #1d4b40;
  box-shadow: 0 16px 34px rgba(20, 58, 50, 0.26);
  transform: translateY(-2px);
}

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

.primary-button svg {
  width: 19px;
  fill: none;
  stroke: var(--mint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.action-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.action-note svg {
  width: 23px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.hero-visual {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
}

.hero-visual::before {
  position: absolute;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background: var(--mint);
  content: "";
  filter: blur(1px);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(21, 58, 50, 0.14);
  border-radius: 50%;
}

.orbit-one {
  width: 475px;
  height: 475px;
}

.orbit-two {
  width: 550px;
  height: 550px;
  border-style: dashed;
  opacity: 0.55;
}

.preview-card {
  position: relative;
  z-index: 2;
  width: min(390px, 78%);
  overflow: hidden;
  border: 1px solid rgba(21, 58, 50, 0.12);
  border-radius: 28px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: var(--shadow);
  transform: rotate(-2.5deg);
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.preview-room {
  display: flex;
  align-items: center;
  gap: 11px;
}

.tiny-lock {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: var(--mint);
}

.tiny-lock svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.preview-room strong,
.preview-room small {
  display: block;
}

.preview-room strong {
  font-size: 13px;
}

.preview-room small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.preview-menu {
  color: var(--muted);
  letter-spacing: 2px;
}

.preview-messages {
  min-height: 320px;
  padding: 22px 18px 16px;
  background: #f7f5ee;
}

.preview-date {
  margin-bottom: 19px;
  color: #9a9e9b;
  font-size: 8px;
  text-align: center;
}

.preview-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 13px 0;
}

.preview-row-me {
  justify-content: flex-end;
}

.preview-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  color: white;
  font-size: 9px;
  font-weight: 800;
}

.avatar-coral { background: var(--coral); }
.avatar-mint { background: #2c7a62; }
.avatar-blue { background: var(--blue); }

.preview-bubble {
  max-width: 76%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 10px;
  line-height: 1.5;
}

.bubble-light {
  border: 1px solid rgba(21, 58, 50, 0.09);
  border-bottom-left-radius: 4px;
  background: white;
}

.bubble-dark {
  border-bottom-right-radius: 4px;
  background: var(--ink);
  color: white;
}

.encrypted-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block: 21px;
  color: #8c9590;
  font-size: 8px;
}

.encrypted-line .line {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.encrypted-line svg {
  width: 10px;
  margin-right: 3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  vertical-align: -2px;
}

.preview-compose {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 14px 15px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #9aa09d;
  font-size: 9px;
}

.preview-compose b {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--mint);
}

.floating-note {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid rgba(21, 58, 50, 0.12);
  border-radius: 15px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: 0 14px 32px rgba(23, 46, 39, 0.12);
}

.floating-note svg {
  width: 27px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-width: 1.6;
}

.floating-note small,
.floating-note strong {
  display: block;
}

.floating-note small {
  color: var(--muted);
  font-size: 8px;
}

.floating-note strong {
  margin-top: 3px;
  font-size: 10px;
}

.key-note {
  top: 88px;
  right: -8px;
  transform: rotate(4deg);
}

.server-note {
  bottom: 66px;
  left: -10px;
  transform: rotate(-4deg);
}

.cipher-glyph {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.trust-strip {
  border-block: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.42);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.trust-grid article {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 126px;
  padding-inline: 34px;
  border-right: 1px solid var(--line);
}

.trust-grid article:first-child {
  padding-left: 0;
}

.trust-grid article:last-child {
  border-right: 0;
}

.trust-grid article > span {
  font-family: Georgia, serif;
  font-size: 28px;
  font-style: italic;
}

.trust-grid strong,
.trust-grid p {
  display: block;
}

.trust-grid strong {
  font-size: 13px;
}

.trust-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.how {
  padding-block: 130px;
}

.how h2 {
  margin: 18px 0 56px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(38px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.05em;
}

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

.steps article {
  min-height: 220px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 254, 250, 0.45);
}

.step-number {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.steps h3 {
  margin: 28px 0 12px;
  font-size: 17px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.footer-brand {
  color: var(--ink);
  font-size: 14px;
}

/* Room */
.room-page {
  min-height: 100vh;
  background: #ebe9df;
}

.room-header {
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

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

.connection-badge {
  min-width: 92px;
  justify-content: flex-end;
  font-size: 11px;
}

.connection-badge.is-connecting > span,
.connection-badge.is-offline > span {
  background: #d99a42;
  box-shadow: 0 0 0 5px rgba(217, 154, 66, 0.12);
}

.copy-button {
  display: inline-flex;
  height: 39px;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.copy-button:hover {
  background: #1d4b40;
}

.copy-button svg {
  width: 15px;
  fill: none;
  stroke: var(--mint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.room-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  width: min(1180px, calc(100% - 40px));
  height: calc(100vh - 104px);
  min-height: 580px;
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid rgba(21, 58, 50, 0.12);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 20px 60px rgba(23, 46, 39, 0.1);
}

.room-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 26px 24px 20px;
  border-right: 1px solid var(--line);
  background: #f5f3eb;
}

.room-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  color: var(--mint);
}

.room-icon svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.room-identity small,
.room-identity strong {
  display: block;
}

.room-identity small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

.room-identity strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.sidebar-divider {
  height: 1px;
  margin: 23px 0;
  background: var(--line);
}

.nickname-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nickname-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-deep);
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.nickname-field input:focus {
  border-color: rgba(21, 58, 50, 0.5);
  box-shadow: 0 0 0 3px rgba(21, 58, 50, 0.07);
}

.room-facts {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}

.room-facts > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.fact-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-size: 14px;
}

.room-facts strong,
.room-facts small {
  display: block;
}

.room-facts strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.room-facts small {
  color: var(--muted);
  font-size: 9px;
}

.key-reminder {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(21, 58, 50, 0.11);
  border-radius: 14px;
  background: var(--mint-soft);
}

.key-reminder svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.key-reminder p {
  margin: 0;
  color: #466057;
  font-size: 9px;
  line-height: 1.55;
}

.key-reminder strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-deep);
  font-size: 10px;
}

.leave-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
  transition: color 160ms ease;
}

.leave-link:hover {
  color: var(--ink);
}

.chat-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
  background: var(--white);
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 32px clamp(24px, 5vw, 72px) 18px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(21, 58, 50, 0.2) transparent;
}

.empty-state {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.empty-lock {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 20px;
  background: var(--mint-soft);
  color: var(--ink);
}

.empty-lock svg {
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.empty-state h2 {
  margin: 20px 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.empty-state button {
  margin-top: 18px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 22px;
  animation: message-in 220ms ease both;
}

.message-row.is-own {
  flex-direction: row-reverse;
}

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

.message-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: #6d8bd7;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.message-avatar[data-color="1"] { background: #db735f; }
.message-avatar[data-color="2"] { background: #638b70; }
.message-avatar[data-color="3"] { background: #9a72c7; }
.message-avatar[data-color="4"] { background: #be8e3d; }
.message-avatar[data-color="5"] { background: #377e8b; }

.message-content {
  max-width: min(72%, 640px);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 5px 6px;
}

.is-own .message-meta {
  justify-content: flex-end;
}

.message-meta strong {
  font-size: 10px;
}

.message-meta time,
.unreadable-row time {
  color: #9ba29e;
  font-size: 8px;
}

.message-status {
  color: #929b96;
  font-size: 8px;
}

.delivery-pending .message-status,
.delivery-retrying .message-status {
  animation: delivery-pulse 1.2s ease-in-out infinite alternate;
}

.delivery-accepted .message-status {
  color: #548e66;
}

.delivery-uncertain .message-status {
  color: #ae7832;
}

.delivery-failed .message-status {
  color: #c95643;
}

.delivery-failed .message-bubble {
  outline: 2px solid rgba(201, 86, 67, 0.22);
}

@keyframes delivery-pulse {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.message-bubble {
  margin: 0;
  padding: 11px 14px;
  border: 1px solid rgba(21, 58, 50, 0.09);
  border-radius: 14px 14px 14px 4px;
  background: #f2f0e8;
  color: #233d36;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.is-own .message-bubble {
  border-color: var(--ink);
  border-radius: 14px 14px 4px;
  background: var(--ink);
  color: white;
}

.unreadable-row {
  justify-content: center;
}

.unreadable-row .message-content {
  text-align: center;
}

.unreadable-row .message-bubble {
  border-style: dashed;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.file-transfer-content {
  width: min(380px, 76%);
  max-width: min(380px, 76%);
}

.file-card {
  padding: 15px;
  border: 1px solid rgba(21, 58, 50, 0.11);
  border-radius: 16px 16px 16px 5px;
  background: #f2f0e8;
}

.is-own .file-card {
  border-color: rgba(21, 58, 50, 0.2);
  border-radius: 16px 16px 5px;
  background: var(--ink);
  color: white;
}

.file-card-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.file-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
}

.is-own .file-card-icon {
  background: var(--mint);
}

.file-card-details {
  min-width: 0;
}

.file-card-details strong,
.file-card-details small {
  display: block;
}

.file-card-details strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-details small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.is-own .file-card-details small {
  color: rgba(255, 255, 255, 0.58);
}

.file-progress {
  width: 100%;
  height: 4px;
  margin-top: 14px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(21, 58, 50, 0.1);
  color: var(--ink);
}

.file-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(21, 58, 50, 0.1);
}

.file-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--ink);
}

.is-own .file-progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.14);
}

.is-own .file-progress::-webkit-progress-value {
  background: var(--mint);
}

.file-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.is-own .file-status {
  color: rgba(255, 255, 255, 0.68);
}

.file-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin-top: 13px;
}

.file-actions button {
  height: 34px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.file-reject-button {
  background: rgba(21, 58, 50, 0.08);
  color: var(--muted);
}

.file-accept-button {
  background: var(--ink);
  color: var(--mint);
}

.file-save-link {
  display: inline-flex;
  margin-top: 12px;
  color: #397554;
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.file-save-link[hidden] {
  display: none;
}

.file-card[data-state="failed"] {
  outline: 2px solid rgba(201, 86, 67, 0.22);
}

.file-card[data-state="completed"] .file-status {
  color: #548e66;
}

.image-message-content {
  width: min(420px, 78%);
  max-width: min(420px, 78%);
}

.image-card {
  overflow: hidden;
  border: 1px solid rgba(21, 58, 50, 0.12);
  border-radius: 17px 17px 17px 5px;
  background: #f2f0e8;
}

.is-own .image-card {
  border-color: rgba(21, 58, 50, 0.2);
  border-radius: 17px 17px 5px;
  background: var(--ink);
}

.image-frame {
  display: grid;
  min-height: 150px;
  place-items: center;
  background: rgba(21, 58, 50, 0.06);
}

.image-frame img {
  display: block;
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  background: #e9e7df;
}

.image-placeholder {
  padding: 44px 24px;
  color: var(--muted);
  font-size: 10px;
}

.is-own .image-placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.image-progress {
  display: block;
  width: calc(100% - 28px);
  margin-inline: 14px;
}

.image-footer {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 4px;
}

.image-download {
  flex: 0 0 auto;
  color: #397554;
  font-size: 9px;
  font-weight: 750;
  text-decoration: none;
}

.image-card[data-state="failed"] {
  outline: 2px solid rgba(201, 86, 67, 0.22);
}

.image-card[data-state="completed"] .file-status {
  color: #548e66;
}

.message-composer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 46px;
  gap: 10px;
  margin: 0 clamp(20px, 4vw, 60px);
}

.image-draft {
  grid-column: 1 / -1;
  width: min(520px, 100%);
  padding: 10px;
  border: 1px solid rgba(21, 58, 50, 0.14);
  border-radius: 14px;
  background: var(--mint-soft);
}

.image-draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.image-draft-header strong,
.image-draft-header small {
  display: block;
}

.image-draft-header strong {
  color: var(--ink);
  font-size: 11px;
}

.image-draft-header small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.image-draft-header button {
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: rgba(21, 58, 50, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.image-draft-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.image-draft-item {
  position: relative;
  min-width: 0;
  margin: 0;
  aspect-ratio: 1;
}

.image-draft-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  background: #e7e5dd;
}

.image-draft-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(12, 40, 35, 0.78);
  color: white;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.attach-button {
  display: grid;
  width: 42px;
  height: 42px;
  align-self: end;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f6f4ed;
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.attach-button:hover {
  background: var(--mint-soft);
  transform: translateY(-1px);
}

.attach-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.composer-field {
  position: relative;
}

.message-composer textarea {
  width: 100%;
  min-height: 48px;
  max-height: 132px;
  padding: 14px 78px 13px 15px;
  resize: none;
  field-sizing: content;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: #f6f4ed;
  color: var(--ink-deep);
  font-size: 12px;
  line-height: 1.6;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.message-composer textarea:focus {
  border-color: rgba(21, 58, 50, 0.48);
  box-shadow: 0 0 0 3px rgba(21, 58, 50, 0.06);
}

.message-composer textarea::placeholder {
  color: #9da29f;
}

.character-count {
  position: absolute;
  right: 13px;
  bottom: 14px;
  color: #a0a6a2;
  font-size: 8px;
}

.send-button {
  display: grid;
  width: 46px;
  height: 46px;
  align-self: end;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--mint);
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.send-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.send-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.composer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  color: #999f9b;
  font-size: 8px;
}

.composer-note svg {
  width: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 28px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink-deep);
  box-shadow: 0 12px 32px rgba(12, 40, 35, 0.25);
  color: white;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Invalid link */
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.error-card {
  width: min(560px, 100%);
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 254, 250, 0.8);
  box-shadow: var(--shadow);
  text-align: center;
}

.broken-key {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 20px;
  background: #ffe2db;
  color: #ad4938;
  font-size: 28px;
}

.error-card h1 {
  margin: 15px 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 36px;
  font-weight: 500;
}

.error-card > p:not(.eyebrow) {
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.error-card code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--paper-deep);
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 70px;
    text-align: center;
  }

  .hero-copy {
    position: relative;
    z-index: 4;
  }

  .hero-lead {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    margin-top: 10px;
  }

  .trust-grid article {
    padding-inline: 18px;
  }

  .room-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .room-sidebar {
    padding-inline: 18px;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 30px, 1180px);
  }

  .site-header {
    height: 74px;
  }

  .brand-en,
  .header-proof {
    display: none;
  }

  .hero {
    min-height: 0;
    gap: 20px;
    padding: 64px 0 40px;
  }

  .hero h1 {
    font-size: clamp(52px, 16vw, 70px);
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-actions {
    flex-direction: column;
    margin-top: 30px;
  }

  .primary-button {
    width: 100%;
  }

  .hero-visual {
    min-height: 475px;
    transform: scale(0.9);
  }

  .orbit-two {
    display: none;
  }

  .key-note {
    right: -10px;
  }

  .server-note {
    left: -10px;
  }

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

  .trust-grid article,
  .trust-grid article:first-child {
    min-height: 100px;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .trust-grid article:last-child {
    border-bottom: 0;
  }

  .how {
    padding-block: 90px;
  }

  .how h2 {
    margin-bottom: 36px;
  }

  .site-footer {
    min-height: 160px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
  }

  .site-footer p {
    margin: 0;
  }

  .room-header {
    height: 64px;
    padding-inline: 15px;
  }

  .room-header .brand-mark {
    width: 32px;
    height: 32px;
  }

  .room-header-actions {
    gap: 10px;
  }

  .connection-badge {
    display: none;
  }

  .copy-button {
    height: 36px;
    padding-inline: 12px;
  }

  .room-layout {
    display: block;
    width: 100%;
    height: calc(100dvh - 64px);
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .room-sidebar {
    display: none;
  }

  .chat-panel {
    height: 100%;
  }

  .messages {
    padding: 22px 14px 14px;
  }

  .message-content {
    max-width: 80%;
  }

  .file-transfer-content {
    width: min(84%, 380px);
    max-width: min(84%, 380px);
  }

  .image-message-content {
    width: min(86%, 420px);
    max-width: min(86%, 420px);
  }

  .message-composer {
    margin-inline: 12px;
  }

  .composer-note {
    min-height: 30px;
  }

  .error-card {
    padding: 38px 24px;
  }

  .error-card h1 {
    font-size: 29px;
  }
}

@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;
  }
}
