:root {
  --bg: #f2efe6;
  --panel: rgba(255, 252, 245, 0.82);
  --panel-strong: #fffaf0;
  --line: rgba(72, 58, 37, 0.14);
  --text: #271d12;
  --muted: #766652;
  --accent: #0a7f62;
  --accent-strong: #045640;
  --warning: #c46a00;
  --shadow: 0 24px 80px rgba(55, 35, 12, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 219, 142, 0.45), transparent 36%),
    radial-gradient(circle at top right, rgba(111, 181, 154, 0.35), transparent 32%),
    linear-gradient(180deg, #fbf7ee 0%, #efe8d9 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  background: #fff;
  color: var(--text);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 127, 98, 0.28);
}

button.primary {
  background: linear-gradient(135deg, var(--accent), #11a17b);
  color: #fff;
  border-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.9rem 1rem;
  color: var(--text);
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin: 0.4rem 0 0.8rem;
  max-width: 12ch;
  font-size: clamp(2.2rem, 4vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero-copy,
.subtle,
.pointer-help,
#safetyStatus {
  color: var(--muted);
}

.eyebrow,
.card-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--accent-strong);
}

.hero-card,
.panel {
  border: 1px solid rgba(90, 73, 49, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 1.4rem;
  align-self: end;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
}

.panel {
  padding: 1.2rem;
}

.panel.inset {
  background: var(--panel-strong);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mode-tabs {
  display: inline-flex;
  gap: 0.5rem;
}

.tab-button.active {
  background: rgba(10, 127, 98, 0.12);
  border-color: rgba(10, 127, 98, 0.22);
  color: var(--accent-strong);
}

.button-row,
.toolbar,
.split {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.button-row.grow input {
  flex: 1;
}

.button-row.tight {
  justify-content: flex-end;
}

.split {
  justify-content: space-between;
  align-items: flex-start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field span {
  font-size: 0.92rem;
  color: var(--muted);
}

.status-grid,
.video-stack {
  display: grid;
  gap: 1rem;
}

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

.video-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-card,
.video-card {
  border: 1px solid rgba(77, 61, 36, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  padding: 1rem;
}

.video-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.video-header h3,
.panel h2,
.panel h3 {
  margin: 0;
}

.video-surface,
.browser-frame {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #151311;
  min-height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

video,
iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0d0b0a;
}

.browser-frame {
  min-height: 500px;
}

.toolbar {
  flex-wrap: wrap;
}

.toolbar input {
  min-width: 240px;
  flex: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(10, 127, 98, 0.1);
  color: var(--accent-strong);
  font-size: 0.88rem;
}

.pill.muted {
  background: rgba(62, 49, 31, 0.08);
  color: var(--muted);
}

.viewer-list {
  display: grid;
  gap: 0.8rem;
}

.viewer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid rgba(79, 62, 37, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 1rem;
}

.viewer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.viewer-meta strong {
  font-size: 1rem;
}

.viewer-actions {
  display: flex;
  gap: 0.55rem;
}

.empty-state {
  min-height: 80px;
  place-items: center;
  display: grid;
  color: var(--muted);
  border: 1px dashed rgba(70, 55, 33, 0.2);
  border-radius: 16px;
}

.activity-log {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 640px;
  overflow: auto;
}

.activity-item {
  border: 1px solid rgba(79, 62, 37, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.9rem 1rem;
}

.activity-item p {
  margin: 0;
}

.activity-item time {
  color: var(--muted);
  font-size: 0.8rem;
}

.inline-block {
  display: inline-block;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #f6f1e6;
  border: 1px solid var(--line);
}

.remote-pointer {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(255, 115, 0, 0.92);
  box-shadow: 0 0 0 6px rgba(255, 115, 0, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .hero,
  .layout,
  .video-stack {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 1rem;
  }

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