:root {
  color-scheme: dark;
  --bg: #05080d;
  --bg-2: #080d16;
  --surface: rgba(13, 20, 34, 0.92);
  --surface-2: rgba(17, 27, 45, 0.94);
  --surface-3: #111827;
  --text: #f4f8ff;
  --muted: #93a4b8;
  --faint: #64748b;
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(203, 213, 225, 0.32);
  --accent: #29e0b0;
  --accent-2: #60a5fa;
  --amber: #fbbf24;
  --danger: #fb7185;
  --ok: #4ade80;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(41, 224, 176, 0.13), transparent 30rem),
    radial-gradient(circle at 82% 6%, rgba(96, 165, 250, 0.12), transparent 28rem),
    linear-gradient(180deg, #05080d 0%, #060912 46%, #03060b 100%);
  background-size: 54px 54px, 54px 54px, auto, auto, auto;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid rgba(41, 224, 176, 0.75); outline-offset: 2px; }

.shell {
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 0;
  background: linear-gradient(180deg, rgba(5, 8, 13, 0.98), rgba(5, 8, 13, 0.82));
  backdrop-filter: blur(14px);
}

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

.mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(41, 224, 176, 0.4);
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.26), transparent 30%),
    linear-gradient(145deg, #29e0b0 0%, #2563eb 100%);
  color: #04100d;
  font-weight: 900;
  box-shadow: 0 14px 38px rgba(41, 224, 176, 0.16);
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand p, .muted { color: var(--muted); margin: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2.2rem, 5vw, 4.9rem); line-height: 0.92; letter-spacing: 0; }
h2 { margin-bottom: 13px; font-size: 1rem; font-weight: 750; letter-spacing: 0; }
h3 { margin-bottom: 8px; font-size: 0.92rem; }

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.nav a, .button, button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
  color: #d9e5f5;
  cursor: pointer;
  padding: 10px 12px;
  transition: 150ms ease;
}

.nav a {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.nav a:hover, .nav a[aria-current="page"], .button:hover, button:hover {
  border-color: rgba(41, 224, 176, 0.48);
  background: rgba(41, 224, 176, 0.1);
  color: white;
}

.svg-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.primary, button.primary {
  border-color: rgba(41, 224, 176, 0.75);
  background: linear-gradient(180deg, rgba(41, 224, 176, 0.95), rgba(14, 165, 233, 0.9));
  color: #03100e;
  font-weight: 850;
}

.danger, button.danger {
  border-color: rgba(251, 113, 133, 0.42);
  color: #ffdce2;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(330px, 1fr);
  gap: 16px;
  align-items: start;
}

.panel, .card, .item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(7, 13, 24, 0.94)),
    var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.panel { padding: 18px; }
.item { padding: 13px; box-shadow: none; }

.item.file-item,
.item.download-item,
.item.contact-item,
.item.sos-item {
  display: grid;
  gap: 9px;
}

.file-meta,
.download-meta,
.sos-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.command-panel {
  position: relative;
  overflow: hidden;
  min-height: 326px;
}

.command-panel::after {
  content: "";
  position: absolute;
  right: -5rem;
  bottom: -7rem;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(41, 224, 176, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 224, 176, 0.11), transparent 60%);
  pointer-events: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 760px;
  color: #c6d3e3;
  font-size: 1.02rem;
}

.page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(6, 13, 24, 0.78)),
    var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  padding: 22px;
}

.page-hero h1 {
  margin-bottom: 8px;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
}

.page-hero .hero-copy {
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 4px;
}

.section-heading h2 {
  margin-bottom: 3px;
}

.icon.compact {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(41, 224, 176, 0.26);
  border-radius: 8px;
  background: rgba(41, 224, 176, 0.08);
  color: var(--accent);
}

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

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.stat {
  min-height: 86px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 12, 0.48);
  padding: 13px;
}

.stat span:first-child {
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.online { color: var(--ok); }

.path-card {
  min-height: 326px;
}

.path-card p {
  overflow-wrap: anywhere;
}

.access-card {
  display: grid;
  justify-items: start;
  gap: 10px;
  border: 1px solid rgba(41, 224, 176, 0.22);
  border-radius: 8px;
  background: rgba(2, 6, 12, 0.42);
  padding: 13px;
}

.qr-canvas {
  width: 148px;
  height: 148px;
  border: 8px solid #f4f8ff;
  border-radius: 8px;
  background: #f4f8ff;
  image-rendering: pixelated;
}

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

.readiness .item {
  background: rgba(2, 6, 12, 0.42);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.card {
  min-height: 142px;
  padding: 15px;
}

.card:hover {
  border-color: rgba(41, 224, 176, 0.42);
  transform: translateY(-1px);
}

.card .icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.1);
  color: var(--accent);
}

.card strong {
  display: block;
  margin-top: 18px;
  font-size: 1rem;
}

.card .muted {
  display: block;
  margin-top: 4px;
}

.stack { display: grid; gap: 12px; }
.list { display: grid; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(251, 113, 133, 0.36);
  border-radius: 8px;
  background: rgba(251, 113, 133, 0.1);
  padding: 13px 15px;
  margin-bottom: 14px;
}

.banner.emergency, .item.hot {
  border-color: rgba(251, 113, 133, 0.42);
  background: rgba(251, 113, 133, 0.1);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.badge.important { color: #ffe08a; border-color: rgba(251, 191, 36, 0.38); background: rgba(251, 191, 36, 0.08); }
.badge.emergency { color: #ffdce2; border-color: rgba(251, 113, 133, 0.45); background: rgba(251, 113, 133, 0.12); }

form { display: grid; gap: 12px; }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(2, 6, 12, 0.7);
  color: var(--text);
  padding: 11px 12px;
}

input[type="checkbox"] { width: auto; min-height: auto; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.completed { opacity: 0.58; }
.error { color: var(--danger); }
.success { color: var(--ok); }

.chat-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
}

.chat-shell {
  width: min(1480px, calc(100% - 24px));
}

.social-chat {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  height: calc(100vh - 126px);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(5, 9, 16, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
}

.chat-sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(15, 33, 56, 0.78), rgba(7, 13, 24, 0.94));
  padding: 16px;
}

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

.chat-profile h1 {
  margin: 0;
  font-size: 2.4rem;
}

.identity-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(2, 6, 12, 0.38);
  padding: 12px;
}

.conversation-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  min-height: 0;
}

.conversation-heading {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.conversation {
  justify-content: flex-start;
  width: 100%;
  min-height: 58px;
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.52);
  text-align: left;
}

.conversation.active,
.conversation:hover {
  border-color: rgba(41, 224, 176, 0.42);
  background: rgba(41, 224, 176, 0.1);
}

.conversation span:last-child {
  display: grid;
  gap: 2px;
}

.conversation small {
  color: var(--muted);
}

.people-list {
  display: grid;
  gap: 8px;
}

.avatar {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(41, 224, 176, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(145deg, rgba(41, 224, 176, 0.9), rgba(96, 165, 250, 0.8));
  color: #04100d;
  font-weight: 900;
}

.avatar.large {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.avatar.small {
  width: 34px;
  height: 34px;
  font-size: 0.86rem;
}

.chat-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto 1fr auto auto;
  background:
    linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    rgba(3, 7, 13, 0.66);
  background-size: 48px 48px;
}

.chat-header {
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 22, 0.86);
  padding: 14px 16px;
}

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

.chat-title h2 {
  margin: 0 0 2px;
  font-size: 1.06rem;
}

.chat-tabs {
  display: inline-flex;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(2, 6, 12, 0.42);
  padding: 4px;
}

.chat-tabs button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
}

.chat-tabs button.active {
  border-color: rgba(41, 224, 176, 0.42);
  background: rgba(41, 224, 176, 0.12);
  color: white;
}

.chat-box {
  display: grid;
  min-height: 680px;
  grid-template-rows: 1fr auto;
  gap: 12px;
}

.messages {
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(2, 6, 12, 0.46);
}

.message {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}

.message strong { color: var(--accent); }
.message.system { color: var(--muted); background: transparent; }
.message.private { border-color: rgba(96, 165, 250, 0.28); background: rgba(96, 165, 250, 0.08); }
.message.ansh { border-color: rgba(41, 224, 176, 0.25); background: rgba(41, 224, 176, 0.07); }
.answer { min-height: 320px; }

.bubble-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 18px;
}

.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.bubble-row.mine {
  justify-content: flex-end;
}

.bubble {
  max-width: min(680px, 82%);
  margin: 0;
  border-radius: 18px;
  padding: 10px 12px;
  line-height: 1.45;
}

.bubble.mine {
  border-bottom-right-radius: 6px;
  border-color: rgba(41, 224, 176, 0.26);
  background: linear-gradient(180deg, rgba(23, 130, 111, 0.92), rgba(18, 94, 88, 0.94));
  color: #effffb;
}

.bubble.theirs {
  border-bottom-left-radius: 6px;
  background: rgba(18, 31, 51, 0.92);
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.75rem;
}

.message-meta strong {
  color: #b5fff0;
}

.timeline-note {
  align-self: center;
  max-width: 80%;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  padding: 6px 11px;
  font-size: 0.78rem;
}

.composer {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(8, 13, 22, 0.94);
  padding: 12px;
}

.composer input,
.composer select {
  border-radius: 999px;
}

.composer button {
  border-radius: 999px;
  padding-inline: 18px;
}

.private-thread {
  display: grid;
  max-height: 190px;
  min-height: 150px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 12, 0.48);
  padding: 12px;
}

.private-messages {
  min-height: 86px;
  margin-top: 8px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.045);
}

.checklist {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.checklist li { margin-bottom: 8px; }

.review-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 240px)) auto;
  align-items: end;
  gap: 12px;
}

.review-note {
  border-left: 3px solid rgba(41, 224, 176, 0.72);
}

.export-box {
  min-height: 120px;
  resize: vertical;
}

.review-shortcut {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid rgba(41, 224, 176, 0.42);
  border-radius: 999px;
  background: rgba(8, 13, 22, 0.94);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 800;
  padding: 10px 14px;
}

.review-shortcut:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 224, 176, 0.78);
}

@media (max-width: 980px) {
  .topbar, .hero, .two-column, .chat-layout, .social-chat { grid-template-columns: 1fr; }
  .nav { justify-content: flex-start; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-hero { align-items: stretch; }
  .path-card, .command-panel { min-height: auto; }
  .social-chat {
    height: auto;
    overflow: visible;
  }
  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .chat-stage {
    min-height: 680px;
  }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 18px, 1360px); padding-top: 8px; }
  .topbar { position: static; }
  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav a { justify-content: flex-start; }
  .status-grid, .readiness { grid-template-columns: 1fr; }
  .hint-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .row { align-items: stretch; flex-direction: column; }
  h1 { font-size: 2.5rem; }
  .chat-box { min-height: 620px; }
  .chat-profile h1 { font-size: 2rem; }
  .composer { grid-template-columns: 1fr; }
  .review-toolbar { grid-template-columns: 1fr; }
  .review-shortcut {
    right: 10px;
    bottom: 10px;
    padding-inline: 12px;
  }
  .bubble { max-width: 92%; }
  .private-thread { max-height: none; }
}
