/* Layout of the big screen (/). Laptop or TV first; below 900px the panels stack, the
   architecture strip turns vertical and the tables scroll inside their own box. */

header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 20px 32px;
  background: var(--anthracite);
  color: #ffffff;
}

.brand-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 0;
  font: 400 18px/1.3 var(--text-font);
}

.brand img {
  height: 44px;
  width: auto;
  display: block;
}

.brand-demo {
  font-family: var(--display);
  font-weight: 900;
  color: #c9d1d7;
}

.brand-sub {
  color: #c9d1d7;
}

.join {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.join-label {
  color: #c9d1d7;
  font-size: 17px;
}

.join-url {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: 0;
}

.live {
  padding: 4px 12px;
  border: 2px solid #ffffff;
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live[data-kind="live"] {
  background: #ffffff;
  color: var(--anthracite);
}

.live[data-kind="offline"],
.live[data-kind="locked"] {
  background: var(--err);
  border-color: var(--err);
}

.header-cta {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--anthracite);
}

.header-cta:hover,
.header-cta:focus-visible {
  background: var(--soft);
  border-color: var(--soft);
  color: var(--anthracite);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 32px 40px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--paper);
}

.panel > h2 {
  margin-bottom: 16px;
  font-size: 26px;
}

.panel > h2 .tag {
  margin-left: 8px;
}

/* ---- architecture strip ---- */

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1.25fr);
  align-items: stretch;
  gap: 4px;
}

.arrow::before {
  content: "→";
  display: block;
  padding-top: 40px;
  color: var(--muted);
  font-size: 24px;
  text-align: center;
}

.box {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  background: var(--soft);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.box h3 {
  font-size: 21px;
}

.box-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.box-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.box .ms {
  margin: 8px 0 0;
  min-height: 1.4em;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.box.is-done {
  border-color: var(--anthracite);
}

.box.is-active {
  border-color: var(--anthracite);
  background: var(--paper);
  box-shadow: 0 0 0 5px rgba(35, 45, 52, 0.14);
}

.box.is-error {
  border-color: var(--err);
  background: var(--err-bg);
  box-shadow: 0 0 0 5px var(--err-bg);
}

.flow-panel .notice {
  margin-top: 16px;
  font-size: 18px;
}

/* ---- split: chat and parte ---- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}

/* ---- tables: each one scrolls sideways inside its own box ---- */

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

.tables-wide {
  grid-column: 1 / -1;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

td.empty {
  color: var(--muted);
  text-align: center;
}

.num {
  text-align: right;
  white-space: nowrap;
}

table.mini {
  font-size: 16px;
}

table.mini td {
  padding: 4px 6px;
}

tr.flash td {
  animation: flash 2.6s ease-out;
}

@keyframes flash {
  from {
    background: #fff1b8;
  }
  to {
    background: transparent;
  }
}

/* ---- narrow screens: stack everything, keep the text readable ---- */

@media (max-width: 1100px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .arrow::before {
    content: "↓";
    padding-top: 0;
    line-height: 1.2;
  }

  .arrow {
    height: 24px;
  }
}

@media (max-width: 900px) {
  .split,
  .tables {
    grid-template-columns: minmax(0, 1fr);
  }

  header.top,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .phone-frame {
    height: 70vh;
    max-width: none;
  }
}

@media (max-width: 480px) {
  header.top {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .brand img {
    height: 36px;
  }

  .header-cta {
    width: 100%;
  }

  .join-label {
    display: block;
    width: 100%;
  }

  .panel {
    padding: 16px;
  }

  .panel > h2 {
    font-size: 24px;
  }

  .phone-frame {
    min-height: 360px;
  }

  .msg {
    max-width: 92%;
  }
}
