:root {
  color-scheme: dark;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: #101318;
  color: #eef2f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(24, 84, 104, 0.36), transparent 44%),
    linear-gradient(315deg, rgba(120, 61, 71, 0.28), transparent 42%),
    #101318;
}

button,
textarea,
input {
  font: inherit;
}

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

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.home-shell {
  display: grid;
  min-height: 100vh;
  align-content: center;
}

.hero {
  margin-bottom: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.topbar p,
.hero p,
.muted,
.role-card p {
  color: #b8c0c7;
}

.nav-link,
.status {
  border: 1px solid #3b4652;
  background: rgba(18, 22, 27, 0.82);
  border-radius: 8px;
}

.nav-link {
  padding: 10px 12px;
}

.status {
  min-width: 140px;
  padding: 10px 12px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.docked-status {
  position: sticky;
  bottom: 16px;
  margin-top: 16px;
}

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

.role-card {
  display: grid;
  min-height: 220px;
  align-content: end;
  gap: 8px;
  border: 1px solid #34404b;
  border-radius: 8px;
  padding: 22px;
  background: rgba(17, 21, 27, 0.86);
}

.role-card:hover {
  border-color: #5e8d92;
  background: rgba(25, 33, 40, 0.9);
}

.role-card strong {
  font-size: 28px;
}

.role-kicker {
  color: #79d1c3;
}

.customer-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.customer-flow {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 16px;
}

.technician-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.panel {
  border: 1px solid #34404b;
  background: rgba(17, 21, 27, 0.86);
  border-radius: 8px;
  padding: 16px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.focus-panel {
  min-height: 360px;
}

.support-step {
  min-height: 300px;
}

.side-panel {
  align-self: start;
}

.step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #1f6f64;
  color: #fff;
  font-weight: 700;
}

label {
  display: block;
  margin-top: 12px;
  color: #dce3e7;
}

textarea,
input {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #394653;
  border-radius: 6px;
  padding: 10px;
  background: #0d1015;
  color: #eaf0f3;
}

textarea {
  height: 136px;
  resize: vertical;
  font-family: Consolas, ui-monospace, monospace;
  font-size: 12px;
}

input {
  min-height: 42px;
}

button {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid #52616d;
  border-radius: 6px;
  color: #f4f8fa;
  background: #26323c;
  cursor: pointer;
}

button:hover {
  background: #30404d;
}

button.primary {
  border-color: #579a8d;
  background: #1f6f64;
}

button.primary:hover {
  background: #258174;
}

button.pending {
  border-color: #c99845;
  background: #5f451b;
}

button.success {
  border-color: #4aa775;
  background: #1f6f4c;
}

button.danger {
  border-color: #b76767;
  background: #6f2b30;
}

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

.danger-button {
  border-color: #9a5761;
  background: #6f1f2c;
}

.danger-button:hover {
  background: #842637;
}

.large-action {
  min-height: 58px;
  font-size: 18px;
}

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

.toggle input {
  width: 18px;
  height: 18px;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.badge.success {
  background: rgba(38, 129, 116, 0.25);
  color: #86e0d1;
}

.badge.danger {
  background: rgba(132, 38, 55, 0.25);
  color: #ffb2bf;
}

.session-card {
  border: 1px solid #3b4652;
  border-radius: 8px;
  padding: 12px;
  background: #0d1015;
}

.session-card span {
  color: #b8c0c7;
}

.big-code {
  margin-top: 8px;
  font-family: Consolas, ui-monospace, monospace;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #79d1c3;
}

.state-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.state-list li {
  border: 1px solid #34404b;
  border-radius: 6px;
  padding: 9px 10px;
  color: #b8c0c7;
  background: rgba(13, 16, 21, 0.7);
}

.state-list li.active {
  border-color: #579a8d;
  color: #eaf0f3;
  background: rgba(31, 111, 100, 0.2);
}

.password-box {
  margin-top: 16px;
  border: 1px solid #34404b;
  border-radius: 8px;
  padding: 12px;
  background: rgba(13, 16, 21, 0.7);
}

.password-box summary {
  cursor: pointer;
  color: #dce3e7;
  font-weight: 700;
}

.control-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
  border: 1px solid #465460;
  border-radius: 8px;
  padding: 14px;
  background: #0d1015;
}

.control-card input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 2px 0 0;
}

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

.control-card small {
  margin-top: 4px;
  color: #b8c0c7;
  line-height: 1.35;
}

.permission-status {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(120, 224, 203, 0.5);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.72);
}

.permission-status strong,
.permission-status small {
  display: block;
}

.permission-status small {
  margin-top: 6px;
  color: #d7e0e8;
  line-height: 1.45;
}

.permission-status.success {
  border-color: rgba(80, 216, 146, 0.75);
  background: rgba(14, 66, 50, 0.35);
}

.permission-status.pending {
  border-color: rgba(245, 186, 84, 0.85);
  background: rgba(78, 54, 18, 0.32);
}

.permission-status.danger {
  border-color: rgba(255, 119, 119, 0.78);
  background: rgba(82, 22, 28, 0.34);
}

.customer-control {
  border-color: #579a8d;
}

.download-agent {
  display: grid;
  place-items: center;
  min-height: 44px;
  margin-top: 14px;
  border: 1px solid #579a8d;
  border-radius: 6px;
  background: rgba(31, 111, 100, 0.28);
  color: #f4f8fa;
}

.agent-box {
  margin-top: 14px;
  border: 1px solid #34404b;
  border-radius: 8px;
  padding: 12px;
  background: rgba(13, 16, 21, 0.7);
}

.agent-ready {
  border-color: #579a8d;
}

.download-agent:hover {
  background: rgba(37, 129, 116, 0.38);
}

.small-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.gate-panel {
  max-width: 620px;
}

.code-entry {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.code-entry input {
  min-height: 58px;
  text-align: center;
  font-size: 30px;
  letter-spacing: 8px;
  font-weight: 800;
}

.screen {
  position: relative;
  min-height: 610px;
  border: 1px solid #34404b;
  border-radius: 8px;
  overflow: hidden;
  background: #080a0d;
}

.screen-action {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  width: auto;
  min-width: 118px;
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
  border-color: rgba(121, 209, 195, 0.7);
  background: rgba(13, 16, 21, 0.82);
}

.screen.is-fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

video {
  display: block;
  width: 100%;
  min-height: 610px;
  max-height: 76vh;
  object-fit: contain;
  outline: none;
}

.screen.is-fullscreen video {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  max-height: none;
}

#emptyState {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #95a1aa;
  pointer-events: none;
}

.screen.has-video #emptyState {
  display: none;
}

@media (max-width: 980px) {
  .customer-layout,
  .customer-flow,
  .technician-grid,
  .role-grid,
  .topbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .code-entry {
    grid-template-columns: 1fr;
  }

  .screen,
  video {
    min-height: 420px;
  }
}
