* {
  box-sizing: border-box;
}

:root {
  --bg: #fff8f0;
  --stone-950: #0c0a09;
  --stone-900: #1c1917;
  --stone-800: #292524;
  --stone-700: #44403c;
  --stone-500: #78716c;
  --stone-300: #d6d3d1;
  --stone-200: #e7e5e4;
  --stone-100: #f5f5f4;
  --rose: #e11d48;
  --rose-soft: #fecdd3;
  --orange-soft: #fed7aa;
  --amber-soft: #fef3c7;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--stone-900);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.hero {
  position: relative;
  padding: 32px 24px 64px;
}

.orb {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.75;
}

.orb-rose {
  width: 288px;
  height: 288px;
  left: -10%;
  top: -10%;
  background: var(--rose-soft);
}

.orb-orange {
  width: 320px;
  height: 320px;
  right: -10%;
  top: 15%;
  background: var(--orange-soft);
}

.orb-amber {
  width: 384px;
  height: 384px;
  left: 35%;
  bottom: -20%;
  background: var(--amber-soft);
}

.top-nav {
  max-width: 1152px;
  margin: 0 auto;
  padding: 12px 20px;
  border: 1px solid var(--stone-200);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(28, 25, 23, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-mark-img {
  width: 36px;
  height: 36px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--stone-900);
  color: white;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand small {
  display: block;
  color: var(--stone-500);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 14px 28px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn-dark {
  background: var(--stone-900);
  color: white;
}

.btn-dark:hover {
  background: var(--stone-800);
}

.btn-light {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--stone-300);
  color: var(--stone-900);
}

.btn-small {
  padding: 10px 20px;
}

.btn-mini {
  padding: 9px 14px;
  font-size: 14px;
}

.hero-grid {
  max-width: 1152px;
  margin: 0 auto;
  padding: 88px 0 48px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero-copy {
  animation: fadeUp 0.7s ease both;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 0 0 32px;
  border: 1px solid var(--rose-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.05);
  color: var(--stone-700);
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  color: var(--stone-950);
}

.lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--stone-700);
  font-size: 20px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.note {
  margin-top: 18px;
  color: var(--stone-500);
  font-size: 14px;
}

.chat-preview {
  animation: fadeScale 0.8s ease 0.1s both;
}

.phone-card {
  border: 1px solid var(--stone-200);
  border-radius: 32px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 30px 80px rgba(28, 25, 23, 0.18);
  backdrop-filter: blur(12px);
}

.phone-inner {
  padding: 16px;
  border-radius: 24px;
  background: var(--stone-950);
  color: white;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-head small {
  display: block;
  color: rgba(255,255,255,0.5);
}

.online {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.2);
  color: #a7f3d0;
  font-size: 12px;
}

.bubble {
  max-width: 80%;
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 14px;
}

.bubble.left {
  border-top-left-radius: 4px;
  background: rgba(255,255,255,0.1);
}

.bubble.right {
  margin-left: auto;
  border-top-right-radius: 4px;
  background: var(--orange-soft);
  color: var(--stone-900);
}

.reconnect-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(253, 164, 175, 0.3);
  border-radius: 18px;
  background: rgba(244, 63, 94, 0.1);
}

.reconnect-card p {
  margin: 0 0 12px;
  color: #ffe4e6;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.split button {
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  background: white;
  color: var(--stone-900);
  font-weight: 700;
}

.split .ghost {
  background: rgba(255,255,255,0.1);
  color: white;
}

.section {
  max-width: 1152px;
  margin: 0 auto;
  padding: 64px 24px;
}

.section-head {
  max-width: 780px;
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--rose);
  font-weight: 800;
}

.section h2,
.cta h2,
.dark-card h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.section-head p:not(.eyebrow),
.dark-card p,
.cta p {
  color: var(--stone-700);
  font-size: 18px;
  line-height: 1.8;
}

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

.card {
  padding: 28px;
  border: 1px solid var(--stone-200);
  border-radius: 32px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.06);
}

.icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--orange-soft);
  font-weight: 900;
  margin-bottom: 20px;
}

.card h3,
.step h3,
.safety-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.card p,
.step p,
.safety-card p {
  margin: 0;
  color: var(--stone-700);
  line-height: 1.75;
}

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
}

.dark-card {
  padding: 40px;
  border-radius: 32px;
  background: var(--stone-950);
  color: white;
  box-shadow: 0 24px 60px rgba(28, 25, 23, 0.16);
}

.dark-card p {
  color: rgba(255,255,255,0.75);
}

.icon.dark {
  background: rgba(255,255,255,0.1);
}

.steps {
  display: grid;
  gap: 20px;
}

.step {
  padding: 24px;
  border: 1px solid var(--stone-200);
  border-radius: 24px;
  background: rgba(255,255,255,0.76);
  display: flex;
  gap: 20px;
}

.step b {
  color: var(--rose);
}

.white-panel {
  padding: 48px;
  border-radius: 32px;
  background: white;
  box-shadow: 0 24px 60px rgba(28, 25, 23, 0.1);
}

.safety-card {
  padding: 24px;
  border-radius: 24px;
  background: var(--stone-100);
  border: 1px solid var(--stone-200);
}

.safety-card span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: white;
  box-shadow: 0 6px 16px rgba(28, 25, 23, 0.06);
  margin-bottom: 16px;
  font-weight: 900;
}

.cta {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.cta p {
  max-width: 700px;
  margin: 22px auto 32px;
}

/* hub */

.hub-page {
  padding: 32px 24px 80px;
}

.hub-nav {
  margin-bottom: 48px;
}

.logout-link {
  color: var(--stone-700);
  font-weight: 700;
}

.hub-wrap {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.login-card,
.waiting-card {
  border: 1px solid var(--stone-200);
  border-radius: 32px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 18px 50px rgba(28, 25, 23, 0.08);
  backdrop-filter: blur(12px);
}

.login-card {
  padding: 28px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--stone-700);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--stone-700);
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--stone-300);
  border-radius: 16px;
  background: white;
  outline: none;
}

.field input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.08);
}

.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  color: var(--stone-700);
  font-size: 14px;
}

.login-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.waiting-card {
  padding: 28px;
}

.waiting-head {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.waiting-head h1 {
  margin: 0;
  font-size: 36px;
  letter-spacing: -0.05em;
}

.waiting-note {
  max-width: 320px;
  color: var(--stone-700);
  line-height: 1.6;
  margin: 0;
}

.waiting-list {
  position: relative;
  display: grid;
  gap: 14px;
}

.waiting-item {
  padding: 16px;
  border: 1px solid var(--stone-200);
  border-radius: 22px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.waiting-person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--stone-900);
  color: white;
  font-weight: 900;
}

.waiting-person h3 {
  margin: 0;
}

.waiting-person p {
  margin: 4px 0 0;
  color: var(--stone-500);
  font-size: 14px;
}

.waiting-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.message-badge {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  background: #ffe4e6;
  color: #be123c;
  font-weight: 800;
  cursor: pointer;
}

.locked-list {
  display: grid;
  gap: 14px;
  filter: blur(3px);
  opacity: 0.45;
  pointer-events: none;
}

.locked-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 22px;
  background: rgba(255,248,240,0.48);
  color: var(--stone-900);
}

.locked-overlay strong,
.locked-overlay span {
  display: block;
}

.locked-overlay strong {
  font-size: 22px;
}

.locked-overlay span {
  margin-top: 8px;
  color: var(--stone-700);
}

.empty-state {
  padding: 44px 18px;
  text-align: center;
  border: 1px dashed var(--stone-300);
  border-radius: 24px;
  background: rgba(245,245,244,0.7);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.empty-state p {
  margin: 0;
  color: var(--stone-700);
}

.start-chat {
  width: 100%;
  font-size: 18px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12,10,9,0.45);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: min(560px, calc(100% - 32px));
  margin: 10vh auto 0;
  padding: 28px;
  border-radius: 30px;
  background: white;
  box-shadow: 0 30px 90px rgba(12,10,9,0.3);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--stone-200);
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 22px;
}

.modal-panel h2 {
  margin: 0 0 18px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.message-box {
  padding: 16px;
  border: 1px solid var(--stone-200);
  border-radius: 20px;
  background: var(--stone-100);
}

.message-box + .message-box {
  margin-top: 12px;
}

.message-box h3 {
  margin: 0 0 8px;
}

.message-box p {
  margin: 0 0 10px;
  line-height: 1.7;
}

.message-box time {
  color: var(--stone-500);
  font-size: 13px;
}

.modal-ok {
  margin-top: 18px;
  width: 100%;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 820px) {
  .hero-grid,
  .split-section {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-grid {
    padding-top: 56px;
  }

  .waiting-head,
  .waiting-item {
    align-items: stretch;
    flex-direction: column;
  }

  .waiting-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .waiting-actions > * {
    flex: 1;
  }

  .white-panel,
  .dark-card {
    padding: 28px;
  }
}

@media (max-width: 520px) {
  .top-nav {
    border-radius: 24px;
  }

  .brand small {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .login-links {
    flex-direction: column;
  }
}


@media (max-width: 620px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.modal-body {
  margin: 0 0 4px;
}

.compose-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--stone-300);
  border-radius: 16px;
  background: white;
  outline: none;
  resize: vertical;
  min-height: 120px;
  font-size: 14px;
  line-height: 1.6;
}

.compose-textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.08);
}

/* ── Document pages ───────────────────────────────── */
.doc-page { background: var(--bg); min-height: 100vh; }
.doc-nav   { max-width: 1100px; margin: 24px auto 0; padding: 0 24px; }
.doc-main  { max-width: 740px; margin: 0 auto; padding: 40px 24px 64px; }

.doc-page-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.05em;
  margin: 0 0 6px;
  color: var(--stone-950);
}
.doc-subtitle { color: var(--stone-700); margin: 0 0 32px; line-height: 1.75; font-size: 15px; }
.doc-updated  { font-size: 12px; color: var(--stone-500); margin-bottom: 32px; }

.doc-section {
  background: white;
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 14px;
  border: 1px solid var(--stone-200);
  box-shadow: 0 4px 16px rgba(28,25,23,0.05);
}
.doc-section h2 {
  font-size: 16px; font-weight: 700; margin: 0 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--stone-200);
  letter-spacing: -0.02em;
}
.doc-section p, .doc-section li {
  font-size: 14px; line-height: 1.85; color: var(--stone-700); margin-bottom: 8px;
}
.doc-section p:last-child { margin-bottom: 0; }
.doc-section ul { padding-left: 20px; margin-bottom: 8px; }
.doc-section table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.doc-section th { background: var(--stone-100); padding: 8px 12px; text-align: left; border: 1px solid var(--stone-200); font-weight: 600; color: var(--stone-700); }
.doc-section td { padding: 8px 12px; border: 1px solid var(--stone-200); color: var(--stone-700); vertical-align: top; }

.doc-warn {
  background: #fffbeb; border-left: 3px solid #f59e0b;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; color: #78350f; margin-bottom: 12px; line-height: 1.65;
}
.doc-notice {
  background: #fff8f0; border-left: 3px solid var(--rose);
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; color: var(--stone-800); margin-top: 10px; line-height: 1.65;
}
.doc-highlight {
  background: #fff0f3; border-left: 3px solid var(--rose);
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; color: var(--stone-800); margin-bottom: 12px; line-height: 1.65;
}

/* FAQ */
.doc-cat {
  font-size: 11px; font-weight: 800; color: var(--rose);
  text-transform: uppercase; letter-spacing: 1px; margin: 28px 0 10px;
}
.doc-qa {
  background: white; border-radius: 20px;
  border: 1px solid var(--stone-200); margin-bottom: 8px; overflow: hidden;
  box-shadow: 0 3px 10px rgba(28,25,23,0.04);
}
.doc-qa-q {
  width: 100%; text-align: left; background: none; border: none;
  padding: 18px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; line-height: 1.5; color: var(--stone-900); font-family: inherit;
}
.doc-qa-q:hover { background: var(--stone-100); }
.doc-qa-q .arrow { font-size: 11px; color: var(--stone-500); flex-shrink: 0; transition: transform 0.2s; }
.doc-qa.open .doc-qa-q .arrow { transform: rotate(180deg); }
.doc-qa-a {
  display: none; padding: 0 22px 18px;
  font-size: 13px; line-height: 1.85; color: var(--stone-700);
  border-top: 1px solid var(--stone-200);
}
.doc-qa.open .doc-qa-a { display: block; }
.doc-qa-a p { margin-top: 12px; }
.doc-qa-a ul { padding-left: 18px; margin-top: 8px; }
.doc-qa-a ul li { margin-bottom: 4px; }

/* Howto steps */
.doc-step {
  background: white; border-radius: 24px; padding: 24px;
  margin-bottom: 14px; border: 1px solid var(--stone-200);
  display: flex; gap: 20px;
  box-shadow: 0 3px 10px rgba(28,25,23,0.04);
}
.doc-step-num {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--stone-900); color: white;
  border-radius: 18px; display: grid; place-items: center;
  font-size: 17px; font-weight: 800;
}
.doc-step-body { flex: 1; }
.doc-step-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.doc-step-desc { font-size: 13px; line-height: 1.85; color: var(--stone-700); }
.doc-step-desc p { margin-bottom: 8px; }
.doc-step-desc p:last-child { margin-bottom: 0; }
.doc-step-desc ul { padding-left: 18px; }
.doc-step-desc ul li { margin-bottom: 4px; }
.doc-toc {
  background: white; border-radius: 24px; padding: 22px 26px;
  margin-bottom: 24px; border: 1px solid var(--stone-200);
}
.doc-toc h3 {
  font-size: 11px; font-weight: 800; color: var(--stone-500);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
}
.doc-toc a { display: block; font-size: 14px; color: var(--rose); text-decoration: none; padding: 3px 0; }
.doc-toc a:hover { text-decoration: underline; }

.doc-tag { display: inline-block; background: var(--stone-100); color: var(--stone-800); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin: 0 2px; }
.doc-tag.orange { background: var(--orange-soft); color: #92400e; }
.doc-tag.red    { background: var(--rose-soft); color: #9f1239; }
.doc-back   { display: inline-block; margin-top: 24px; font-size: 13px; color: var(--stone-500); text-decoration: none; }
.doc-back:hover { color: var(--stone-900); }
.doc-footer { text-align: center; padding: 20px 0 32px; font-size: 11px; color: var(--stone-500); }
.doc-footer a { color: var(--stone-500); text-decoration: none; margin: 0 8px; }
.doc-footer a:hover { color: var(--stone-900); }
