/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
button, [role="button"] { outline: none; }

body {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  background: #0a0f0a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* Prevent browser autofill white background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0d150d inset !important;
  -webkit-text-fill-color: #e0e0e0 !important;
  caret-color: #e0e0e0;
  transition: background-color 5000s ease-in-out 0s;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1a2e1a;
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.header__brand-icon,
.header__brand-text {
  display: flex;
  align-items: center;
}

.header__icon { border-radius: 4px; }

.header__name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.1rem !important;
  color: #e8e8e8;
}
.header__accent {
  color: #FF5800;
}

.header__live {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #e04040;
  letter-spacing: 0.05em;
}

.header__live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e04040;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.header__nav {
  display: flex;
  gap: 1.8rem;
  align-items: center;
}

.header__link {
  font-size: 0.95rem;
  font-weight: 600;
  color: #888;
  transition: color 0.2s;
  white-space: nowrap;
}

.header__link:hover { color: #e0e0e0; }
.header__link--active { color: #4a9a4a; }

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Language toggler */
.header__lang {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  overflow: hidden;
}

.header__lang-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #666;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}

.header__lang-btn:hover { color: #ccc; background: rgba(255,255,255,0.06); }
.header__lang-btn--active { color: #4a9a4a; background: rgba(74,154,74,0.12); cursor: default; }

.header__lang--mobile {
  justify-content: center;
}

/* User dropdown */
.header__user {
  position: relative;
}

.header__user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  color: #ccc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
  font-size: 0.85rem;
}

.header__user-btn:hover { border-color: #1a2e1a; background: rgba(255,255,255,0.03); }

.header__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a3a1a;
  color: #4a9a4a;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.header__avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.header__user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__chevron {
  opacity: 0.5;
  transition: transform 0.2s;
}

.header__user-btn[aria-expanded="true"] .header__chevron {
  transform: rotate(180deg);
}

.header__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
}

.header__dropdown-header {
  padding: 0.75rem 1rem;
}

.header__dropdown-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e0e0e0;
}

.header__dropdown-email {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  margin-top: 2px;
}

.header__dropdown-divider {
  height: 1px;
  background: #1a2e1a;
}

.header__dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  color: #aaa;
  transition: background 0.15s, color 0.15s;
}

.header__dropdown-item:hover { background: rgba(255,255,255,0.04); color: #e0e0e0; }

.header__dropdown-item--danger { color: #c44; }
.header__dropdown-item--danger:hover { background: rgba(204,68,68,0.1); color: #e55; }

/* Hamburger button — hidden on desktop */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.header__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #aaa;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Mobile slide-out nav */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 500;
}

.mobile-nav__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-nav--open .mobile-nav__overlay { opacity: 1; }

.mobile-nav__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: #0a0f0a;
  border-left: 1px solid #1a2e1a;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-nav--open .mobile-nav__panel { transform: translateX(0); }

.mobile-nav__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1a2e1a;
}

.mobile-nav__close {
  margin-left: auto;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
}
.mobile-nav__close:hover { color: #e0e0e0; }

.mobile-nav__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid #1a2e1a;
}

.mobile-nav__user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.mobile-nav__user-email {
  font-size: 0.75rem;
  color: #666;
  margin-top: 2px;
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  flex: 1;
}

.mobile-nav__link {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: #888;
  transition: background 0.15s, color 0.15s;
}

.mobile-nav__link:hover { background: rgba(255,255,255,0.04); color: #e0e0e0; }
.mobile-nav__link--active { color: #4a9a4a; }
.mobile-nav__link--danger { color: #c44; }
.mobile-nav__link--danger:hover { color: #e55; background: rgba(204,68,68,0.08); }

.mobile-nav__footer {
  padding: 1rem;
  border-top: 1px solid #1a2e1a;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Account page */
.account {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.account__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.form__fieldset {
  border: 1px solid #1a2e1a;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.form__legend {
  font-size: 1rem;
  font-weight: 600;
  color: #4a9a4a;
  padding: 0 0.5rem;
}

.form__hint {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 0.75rem;
}

/* === Cards === */
.card {
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 12px;
  overflow: hidden;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #1a2e1a;
}

.card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ccc;
}

.card__body {
  padding: 1.25rem;
}

.card__body--flush {
  padding: 0;
  overflow-x: auto;
}


.card__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #1a2e1a;
}

.card__empty {
  text-align: center;
  color: #666;
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  cursor: pointer;
}

.btn--primary {
  background: #3a8a3a;
  color: #fff;
}

.btn--primary:hover:not(:disabled) { background: #4a9a4a; }
.btn--primary:disabled { background: #2a4a2a; color: #999; cursor: not-allowed; }

.btn--danger { background: #e04040; color: #fff; }
.btn--danger:hover:not(:disabled) { background: #c03030; }
.btn--danger:disabled { background: #5a2020; color: #999; cursor: not-allowed; }
.btn--warning { background: #e0a020; color: #1a1a1a; }
.btn--warning:hover:not(:disabled) { background: #c08a10; }

.btn--outline {
  background: transparent;
  color: #4a9a4a;
  border: 1.5px solid #3a8a3a;
}

.btn--outline:hover {
  background: rgba(58, 138, 58, 0.1);
}

.btn--full { width: 100%; }

.btn--outline:disabled {
  color: #555;
  border-color: #1a2e1a;
  cursor: not-allowed;
  opacity: 0.5;
}

.btn--outline-warning {
  background: transparent;
  color: #e0a020;
  border: 1.5px solid rgba(224, 160, 32, 0.4);
}

.btn--outline-warning:hover {
  background: rgba(224, 160, 32, 0.1);
}

.btn-group {
  display: inline-flex;
}
.btn-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
}

/* === Page titles === */
.page-subtitle {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 2px;
}
.page-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  margin-bottom: 0;
  word-break: break-word;
  line-height: 110%;
  min-width: 0;
}

/* === Auth pages === */
.auth {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth__inner {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.auth__logo {
  margin-bottom: 0.5rem;
  border-radius: 8px;
}

.auth__title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.auth__text {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.auth__link {
  font-size: 0.8rem;
  color: #4a9a4a;
  transition: color 0.2s;
}

.auth__link:hover { color: #6aba6a; }

/* === Forms === */
.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form__row {
  display: flex;
  gap: 1rem;
}
.edit-form__row {
  display: flex;
  gap: 0.75rem;
}
.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.form__group:last-child { margin-bottom: 0; }

.form__group--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.switch input:checked + .switch__track {
  background: var(--green, #3a8a3a);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
  background: #fff;
}

.form__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #888;
}

.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 8px;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  color-scheme: dark;
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  border-color: #3a8a3a;
}

.form__textarea {
  resize: vertical;
  min-height: 80px;
}

/* Input group (input + action buttons) */
.input-group {
  position: relative;
  display: flex;
}

.input-group .form__input {
  padding-right: 5rem;
}

.input-group--generate .form__input {
  padding-right: 5.5rem;
}

.input-group__actions {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}

.input-group__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #666;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.input-group__btn:hover {
  color: #ccc;
  background: rgba(255,255,255,0.06);
}

.input-group__btn--active {
  color: #4a9a4a;
}

.form__actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
}

/* === Flash container === */
.flash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 0;
}

/* === Alerts === */
.alert {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: alertSlideIn 0.2s ease-out;
}

.alert--error {
  background: rgba(224, 64, 64, 0.12);
  color: #e04040;
  border: 1px solid rgba(224, 64, 64, 0.25);
}

.alert--error::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: #e04040;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E") center / contain no-repeat;
}

.alert--success {
  background: rgba(58, 138, 58, 0.12);
  color: #4a9a4a;
  border: 1px solid rgba(58, 138, 58, 0.25);
}

.alert--success::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: #4a9a4a;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 11-5.93-9.14'/%3E%3Cpath d='M22 4L12 14.01l-3-3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 11-5.93-9.14'/%3E%3Cpath d='M22 4L12 14.01l-3-3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.alert--warning {
  background: rgba(224, 160, 32, 0.12);
  color: #e0a020;
  border: 1px solid rgba(224, 160, 32, 0.25);
}

.alert--warning::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: #e0a020;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
}

.alert--info {
  background: rgba(74, 122, 191, 0.12);
  color: #4a7abf;
  border: 1px solid rgba(74, 122, 191, 0.25);
}

.btn--info {
  background: transparent; color: #4a7abf; border: 1px solid #4a7abf;
}
.btn--info:hover { background: rgba(74, 122, 191, 0.15); }
.btn--xs {
  font-size: 0.7rem; padding: 0.25rem 0.6rem; line-height: 1.3;
}

.alert--info::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: #4a7abf;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E") center / contain no-repeat;
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inline error (for modals/forms) */
.inline-error:empty, .inline-error[hidden] { display: none; }
.inline-error {
  color: #e04040;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  animation: alertSlideIn 0.15s ease-out;
}

.inline-error::before {
  content: '';
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  background: #e04040;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* === Dashboard === */
.dashboard {
  padding: 2rem 1.5rem;
}

.dashboard__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.dashboard__actions {
  margin-top: 1rem;
}

/* === Broadcasts list === */
.broadcasts {
  padding: 2rem 1.5rem;
}

.broadcasts__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.broadcasts__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.broadcasts__header > a,
.broadcasts__header > button {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.broadcasts__header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.broadcasts__empty {
  color: #555;
  font-size: 0.9rem;
  padding: 3rem;
  text-align: center;
}

.broadcasts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* === Broadcast card === */
.broadcast-card {
  display: flex;
  flex-direction: column;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.broadcast-card:hover {
  border-color: #3a8a3a;
}

.broadcast-card__link {
  display: block;
  flex: 1;
}

.broadcast-card__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1a2e1a;
}

.broadcast-card__action {
  background: none;
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  color: #777;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.broadcast-card__action:hover {
  border-color: #3a8a3a;
  color: #aaa;
}

.broadcast-card__action--delete:hover {
  border-color: #8a3a3a;
  color: #e04040;
}

.broadcast-card__stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.5rem;
}

.broadcast-card__stats svg {
  vertical-align: -2px;
  margin-right: 2px;
}

.broadcast-card--archived {
  opacity: 0.8;
}

/* Badges (shared across project) */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 4px;
}

.badge--idle { background: rgba(33,150,243,0.15); color: #2196F3; }
.badge--live { background: rgba(76,175,80,0.15); color: #4CAF50; }
.badge--ended { background: rgba(255,152,0,0.15); color: #FF9800; }
.badge--archived { background: rgba(158,158,158,0.15); color: #9E9E9E; }
.badge--dim { background: rgba(255,255,255,0.05); color: #666; }
.badge--warning { background: rgba(255,152,0,0.15); color: #FF9800; }

.broadcast-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.broadcast-card__date {
  font-size: 0.75rem;
  color: #555;
}

.broadcast-card__title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 110%;
  margin-bottom: 0.4rem;
}

.broadcast-card__desc {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.6rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.broadcast-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: #888;
  margin-top: auto;
}

.broadcast-card__code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #4a9a4a;
}

.broadcast-card__lock {
  opacity: 0.7;
}

.broadcast-card__stat {
  color: #666;
}

/* === Sessions page === */
.sessions-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #999;
}

.sessions-summary__item strong {
  color: #ccc;
}

.sessions-table-wrap {
  overflow-x: auto;
}

.sessions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sessions-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #1a2e1a;
  color: #777;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.sessions-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #111;
  color: #bbb;
}

.sessions-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.sessions-table__row--active td {
  color: #4CAF50;
}

.sessions-table__check { width: 32px; text-align: center; }

/* Custom checkbox — green accent */
input[type="checkbox"].session-check,
#select-all {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #555;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
input[type="checkbox"].session-check:hover,
#select-all:hover {
  border-color: #4a9a4a;
}
input[type="checkbox"].session-check:checked,
#select-all:checked {
  background: #4a9a4a;
  border-color: #4a9a4a;
}
input[type="checkbox"].session-check:checked::after,
#select-all:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.sessions-bulk-actions {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0; margin-bottom: 0.25rem;
}

.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; padding: 1rem 0;
}
.pagination__info { color: #888; font-size: 0.85rem; }

.tech-view-table { width: 100%; border-collapse: collapse; }
.tech-view-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #1a2e1a; font-size: 0.85rem; }
.tech-view-table__label { color: #888; white-space: nowrap; }

.recording-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4a9a4a;
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid #1a2e1a;
  border-radius: 4px;
  transition: all 0.2s;
}

.recording-link:hover {
  border-color: #3a8a3a;
  color: #6aba6a;
}

/* === Broadcast create === */
.broadcast-create {
  padding: 2rem 1.5rem;
}

.broadcast-create__inner {
  max-width: 500px;
  margin: 0 auto;
}

/* === Broadcast control === */
.control {
  padding: 2rem 1.5rem;
}

.control__inner {
  max-width: 100%;
}

.control__layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1200px) {
  .control__layout {
    flex-direction: row;
    align-items: flex-start;
  }
  .control__layout > .main-section {
    flex: 1;
    min-width: 0;
  }
  .control__sidebar {
    flex: 0 0 480px;
    min-width: 0;
  }
  .control__sidebar .device-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 480px;
  }

  /* Expanded sidebar: single-column device grid, narrower sidebar */
  .control__layout--expanded .control__sidebar {
    flex: 0 0 280px;
  }
  .control__layout--expanded .control__sidebar .device-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
  }
  .control__layout--expanded .session-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    row-gap: 0;
    column-gap: 0.5rem;
  }
  .control__layout--expanded .session-item__row {
    display: contents;
    line-height: 1.3;
  }
  .control__layout--expanded .session-item__row > .session-item__date {
    grid-column: 1;
    grid-row: 1;
    margin-right: 0;
  }
  .control__layout--expanded .session-item__time {
    grid-column: 1;
    grid-row: 2;
  }
  .control__layout--expanded .session-item__right {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .control__layout--expanded .session-item__meta {
    display: contents;
  }
  .control__layout--expanded .session-item__stats {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-self: end;
    align-self: center;
  }
  .control__layout--expanded .session-item__size {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  /* Camera channel label shrinks in expanded workspace to leave room for controls */
  .control__layout--expanded .mixer-channel:not(.mixer-channel--mic) .mixer-channel__label {
    flex: 0.5;
  }

  /* Mic grid mirrors camera's expanded proportions (label 0.5 / controls 1) */
  .control__layout--expanded .mixer-channel--mic {
    grid-template-columns: 0.5fr 1fr;
  }
}

.control__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.control__header > div:first-child {
  min-width: 0;
  overflow: hidden;
}

.control__description {
  color: #777;
  font-size: 0.85rem;
  margin: 0.3rem 0 0;
  line-height: 1;
  white-space: pre-line;
}

.control__header-right {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  flex-shrink: 0;
}

.control__code {
  font-size: 0.85rem;
  color: #888;
}

.control__code strong {
  font-family: var(--font-ui);
  color: #4a9a4a;
  letter-spacing: 0.12em;
  font-size: 1rem;
}

.control__live-url {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  color: #888;
}

.control__live-url-select {
  background: transparent;
  border: 1px solid #1a2e1a;
  border-radius: 4px;
  color: #888;
  font-family: var(--font-ui);
  font-size: inherit;
  padding: 2px 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.control__live-url-select:focus {
  outline: none;
  border-color: #3a8a3a;
}
.control__live-url-select option {
  background: #0d150d;
  color: #ccc;
}

.control__live-url-link {
  color: #4a9a4a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.control__copy-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #1a2e1a;
  border-radius: 4px;
  padding: 3px 5px;
  color: #888;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
}

.control__copy-btn:hover {
  color: #4a9a4a;
  border-color: #3a8a3a;
}

.control__copy-btn--copied {
  color: #4a9a4a;
  border-color: #3a8a3a;
}

.control__sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control__sessions-card .card__header .btn--small {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
}

/* Session list (compact card layout) */
.session-list {
  display: flex;
  flex-direction: column;
}
.session-item {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.session-item:last-child { border-bottom: none; }
.session-item--active {
  background: rgba(34,197,94,0.06);
}
.session-item__row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  column-gap: 0.5rem;
  row-gap: 0;
  flex-wrap: wrap;
  line-height: 1;
}
.session-item__row > .session-item__date {
  margin-right: -0.2rem;
}
.session-item__date {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.02em;
}
.session-item__time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
}
.session-item__arrow {
  opacity: 0.35;
  flex-shrink: 0;
}
.session-item__right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.session-item__duration {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}
.session-item__dl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  color: rgba(255,255,255,0.4);
  transition: color 0.15s, background 0.15s;
}
.session-item__dl:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
}
.session-item__rec-badge { font-size: 0.65rem; }
.session-item__meta {
  width: 100%;
  margin-top: 0.1rem;
  font-size: 0.7rem;
  line-height: 1.2;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.session-item__stats {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.session-item__stat {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.session-item__stat svg { flex-shrink: 0; }
.session-item__size {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
}

.control__header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.control__toggle-pips {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #1a2e1a;
  background: #0d150d;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.control__toggle-pips:hover { color: #fff; }
.control__toggle-pips--active { color: #e04040; border-color: #c03030; }
.control__toggle-pips--active:hover { border-color: #e04040; }

.control__master-mute {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}

.control__master-mute:hover { color: #fff; }
.control__master-mute--on { color: #4a9a4a; border-color: #3a8a3a; }
.control__master-mute--on:hover { border-color: #4a9a4a; }

/* === Mixer Panel === */
.mixer-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.mixer-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mixer-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.mixer-section__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #8a8fa3);
}

.mixer-add-mic {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
}

.mic-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-picker-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.mic-picker-modal__dialog {
  position: relative;
  width: min(440px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  background: var(--bg-card, #1f2230);
  border: 1px solid var(--border, #2f3346);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mic-picker-modal__title {
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #e6e8f0);
  border-bottom: 1px solid var(--border, #2f3346);
}

.mic-picker-modal__list {
  padding: 0.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mic-picker-modal__item {
  background: transparent;
  border: 0;
  color: var(--text, #e6e8f0);
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mic-picker-modal__item:hover {
  background: var(--bg-hover, #2a2e40);
}

.mic-picker-modal__empty {
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted, #8a8fa3);
  text-align: center;
}

.mixer-channels {
  display: flex;
  flex-direction: column;
}

.mixer-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted, #8a8fa3);
  margin: 0;
}

.mixer-channel {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 0.5rem;
  min-height: 34px;
}

.mixer-channel:last-child { border-bottom: none; }

/* Mic channel uses grid so its controls column matches camera's flex proportions exactly.
   Camera: [label flex:1] [controls flex:1] -> grid 1fr 1fr
   Expanded camera: [label flex:0.5] [controls flex:1] -> grid 0.5fr 1fr */
.mixer-channel--mic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.5rem;
  row-gap: 0.2rem;
  align-items: center;
}

.mixer-channel--mic .mixer-channel__top {
  grid-column: 1 / -1;
  min-width: 0;
}

.mixer-channel--mic .mixer-channel__controls {
  grid-column: 2;
  flex: none;
  width: auto;
  min-width: 0;
}

.mixer-channel__rename {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.mixer-channel__rename:hover { color: #e8c84a; }

.mixer-channel__top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mixer-channel__label {
  font-size: 0.78rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mixer-channel__status {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.mixer-channel__status--connecting {
  background: rgba(234,179,8,0.15);
  color: #eab308;
}

.mixer-channel__status--connected {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}

.mixer-channel__status--error {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

.mixer-channel__controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
}

.mixer-channel__slider {
  width: 80px;
  height: 3px;
  cursor: pointer;
  accent-color: #4f8ef7;
  flex-shrink: 0;
}

/* Audio level meter */
.mixer-channel__level {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  min-width: 20px;
}

.mixer-channel__level-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.08s linear;
}

.mixer-channel__level--inactive {
  opacity: 0.3;
}

.mixer-channel__level--inactive .mixer-channel__level-fill {
  background: rgba(255,255,255,0.15);
}

.mixer-channel__mute {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  color: var(--text-muted, #8a8fa3);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.mixer-channel__mute--on { color: #22c55e; }
.mixer-channel__mute--off { color: #ef4444; }
.mixer-channel__mute--locked { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

.mixer-channel__remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  color: var(--text-muted, #8a8fa3);
  display: flex;
  align-items: center;
  margin-left: auto;
}

.mixer-channel__remove:hover { color: #ef4444; }

/* === Device grid === */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 240px));
  gap: 1rem;
}

.device-grid__empty {
  color: #555;
  font-size: 0.85rem;
  padding: 3rem;
  text-align: center;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* When only the empty message is shown, override grid to center it */
.device-grid:has(.device-grid__empty) {
  display: flex;
  justify-content: center;
}

/* === Device tile === */
.device-tile {
  position: relative;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Inter', system-ui, sans-serif;
}

.device-tile__video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0d150d;
  overflow: hidden;
}

.device-tile__video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Vertical (portrait) video: show full frame with pillarbox bars */
.device-tile--portrait .device-tile__video-el {
  object-fit: contain;
}
/* When admin toggles "expand" on a portrait tile, crop to fill */
.device-tile--portrait.device-tile--expanded .device-tile__video-el {
  object-fit: cover;
}

/* Portrait expand/collapse toggle (inside video-controls, icon button) */
.device-tile__portrait-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}
.device-tile--portrait .device-tile__portrait-toggle {
  display: flex;
}
.device-tile__portrait-toggle:hover {
  color: #fff;
}
.device-tile--expanded .portrait-expand-icon { display: none; }
.device-tile--expanded .portrait-collapse-icon { display: block !important; }
.portrait-collapse-icon { display: none; }

/* Video loading spinner */
.device-tile__video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #000;
  z-index: 2;
}

.device-tile__video-loader[hidden] { display: none; }

/* SVG SMIL-animated spinner — immune to main thread blocking */
.device-tile__video-spinner {
  width: 32px;
  height: 32px;
}

.device-tile__video-loader-text {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Button spinner (inline, for start/stop buttons) */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #999;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* Video overlay controls — top-right column */
.device-tile__video-controls {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.device-tile__video-mic,
.device-tile__video-speaker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
}

.device-tile__video-mic { color: #4a9a4a; cursor: default; }
.device-tile__video-mic--on { color: #4a9a4a; }
.device-tile__video-mic--off { color: #e04040; }
.device-tile__video-mic--master-muted { color: rgba(255,255,255,0.3); }

.device-tile__video-speaker { color: rgba(255,255,255,0.5); }
.device-tile__video-speaker:hover { color: #fff; }
.device-tile__video-speaker--muted { color: rgba(255,255,255,0.35); }
.device-tile__video-speaker--on { color: #4a9a4a; }
.device-tile__video-speaker--locked { opacity: 0.3; cursor: not-allowed; }
.device-tile__video-speaker .speaker-on,
.device-tile__video-speaker .speaker-off { display: none; }
.device-tile__video-speaker--muted .speaker-off { display: inline; }
.device-tile__video-speaker--on .speaker-on { display: inline; }

/* GPS coords overlay — bottom-left corner */
.device-tile__video-gps {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 3;
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  color: #4a9a4a;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 4px;
  display: none;
  align-items: center;
  gap: 3px;
}

.device-tile__video-gps--active { display: flex; }
.device-tile__video-gps--disabled { color: #888; }

/* PIP position selector: grid matching screen layout, visible on hover
   Layout:  .  .  RT
            .  .  RC
            LB CB RB  */
.pip-corners {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, 18px);
  grid-template-rows: repeat(3, 18px);
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.pip-corners__btn[data-corner="rt"] { grid-column: 3; grid-row: 1; }
.pip-corners__btn[data-corner="rc"] { grid-column: 3; grid-row: 2; }
.pip-corners__btn[data-corner="lb"] { grid-column: 1; grid-row: 3; }
.pip-corners__btn[data-corner="cb"] { grid-column: 2; grid-row: 3; }
.pip-corners__btn[data-corner="rb"] { grid-column: 3; grid-row: 3; }
.device-tile__video:hover .pip-corners:not(.pip-corners--hidden) {
  opacity: 1;
  pointer-events: auto;
}
.pip-corners--hidden { display: none; }
.pip-corners__btn {
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pip-corners__btn:hover:not(:disabled) {
  background: var(--accent, #3b82f6);
  color: #fff;
}
.pip-corners__btn--active {
  background: var(--accent, #3b82f6);
  color: #fff;
  opacity: 0.4;
  cursor: default;
}

/* PIP actions: eye + trash, centered on video, visible on hover when device is PIP'd */
.pip-actions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  display: none;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
/* pip-actions on tiles are unused — actions live on the main overlay */
.pip-actions__eye,
.pip-actions__trash {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.pip-actions__eye {
  background: rgba(34, 197, 94, 0.8);
  color: #fff;
}
.pip-actions__eye--hidden {
  background: rgba(239, 68, 68, 0.8);
}
.pip-actions__eye--hidden .pip-actions__eye-show { display: none; }
.pip-actions__eye:not(.pip-actions__eye--hidden) .pip-actions__eye-hide { display: none; }
.pip-actions__trash {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}
.pip-actions__eye:hover { filter: brightness(1.2); }
.pip-actions__trash:hover { filter: brightness(1.2); }

/* === PIP overlays on the main video === */
.main-pip-overlays {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.main-pip-overlay {
  position: absolute;
  width: calc((100% - 4 * 8px) / 4);
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: auto;
  box-shadow: 0 0 0 var(--audio-border, 0px) var(--audio-color, transparent);
  transition: opacity 0.2s, box-shadow 0.15s ease-out;
}
.main-pip-overlay--rt { top: 8px; right: 8px; }
.main-pip-overlay--rc { top: 50%; right: 8px; transform: translateY(-50%); }
.main-pip-overlay--rb { bottom: 8px; right: 8px; }
.main-pip-overlay--cb { bottom: 8px; left: 50%; transform: translateX(-50%); }
.main-pip-overlay--lb { bottom: 8px; left: 8px; }
.main-pip-overlay--hidden-pip {
  border-color: rgba(239, 68, 68, 0.3);
  background: transparent;
}
.main-pip-overlay--hidden-pip .main-pip-overlay__video {
  opacity: 0.15;
}
.main-pip-overlay--hidden-pip .main-pip-overlay__label {
  opacity: 0.25;
}
.main-pip-overlay--hidden-pip .main-pip-overlay__actions {
  opacity: 0;
}
.main-pip-overlay--hidden-pip:hover .main-pip-overlay__video {
  opacity: 0.5;
}
.main-pip-overlay--hidden-pip:hover .main-pip-overlay__label {
  opacity: 0.7;
}
.main-pip-overlay--hidden-pip:hover .main-pip-overlay__actions {
  opacity: 1;
}
.main-pip-overlay--hidden-pip:hover {
  background: rgba(0, 0, 0, 0.5);
}
.main-pip-overlay__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Portrait PIP: show vertical video letterboxed inside landscape box */
.main-pip-overlay--portrait .main-pip-overlay__video {
  object-fit: contain;
}
/* Expanded portrait PIP: fill landscape box (crop sides) */
.main-pip-overlay--portrait.main-pip-overlay--expanded .main-pip-overlay__video {
  object-fit: cover;
}
.main-pip-overlay__label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 65%;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 5px;
  border-radius: 3px;
}
/* Sound-on badge on workspace videos (main + PIP) */
.main-device__sound-badge,
.main-pip-overlay__sound {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #4a9a4a;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}
.main-pip-overlay__sound {
  top: 4px;
  left: auto;
  right: 4px;
  width: 18px;
  height: 18px;
}
.main-pip-overlay__sound svg { width: 10px; height: 10px; }

/* Audio-reactive glow on workspace (box-shadow grows outside, respects border-radius).
   Driven by JS --audio-border/--audio-color CSS custom properties. */
.main-pip-overlay__actions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.main-pip-overlay:hover .main-pip-overlay__actions {
  opacity: 1;
  pointer-events: auto;
}
.main-pip-overlay__eye,
.main-pip-overlay__trash {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.main-pip-overlay__eye {
  background: rgba(120, 120, 120, 0.85);
  color: #fff;
}
.main-pip-overlay--hidden-pip .main-pip-overlay__eye {
  background: rgba(34, 197, 94, 0.85);
}
.main-pip-overlay__eye:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.main-pip-overlay__trash {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}
.main-pip-overlay__eye:hover,
.main-pip-overlay__trash:hover { filter: brightness(1.2); }

.device-tile__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity 0.3s;
}

.device-tile__overlay--hidden {
  opacity: 0;
  pointer-events: none;
}

.device-tile__overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #e04040;
  font-size: 0.8rem;
  font-weight: 600;
}

.device-tile__overlay-icon {
  opacity: 0.8;
  color: #e04040;
  animation: pulse-bad 2s ease-in-out infinite;
}
.device-tile__overlay--paused .device-tile__overlay-icon {
  color: #e0a020;
}
.device-tile__overlay--paused .device-tile__overlay-text {
  color: #e0a020;
}

@keyframes pulse-bad {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.3; }
}

.device-tile__info {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  overflow: hidden;
}

.device-tile__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #e0e0e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.device-tile__rename {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.device-tile__rename:hover { color: #e8c84a; }

/* Status indicator — icon on video overlay, top-left */
.device-tile__status-icon {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.4);
  transition: background 0.2s;
}

.device-tile__status-icon--online { background: #4a9a4a; }
.device-tile__status-icon--offline { background: #888; }
.device-tile__status-icon--disconnected { background: #e04040; }
.device-tile__status-icon--paused { background: #e0a020; }

.device-tile__resolution {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 3;
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.55);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}
.device-tile__resolution:empty { display: none; }

/* Settings button — on video overlay, bottom-right */
.device-tile__settings {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.device-tile__settings:hover { color: #e8c84a; }

/* === Device Info Modal === */
.device-modal[hidden] { display: none; }
.device-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 0;
}

.device-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.device-modal__content {
  position: relative;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 12px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin: auto;
  flex-shrink: 0;
}

.device-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #1a2e1a;
}

.device-modal__title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.device-modal__close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.device-modal__close:hover { color: #e04040; }

.device-modal__body { padding: 0.4rem 0; font-family: 'Inter', sans-serif; }

.device-modal__row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
}

.device-modal__label { color: #666; white-space: nowrap; flex-shrink: 0; }
.device-modal__value { color: #ccc; font-weight: 500; text-align: right; word-break: break-all; }
.device-modal__value--mono { font-family: monospace; font-size: 0.65rem; letter-spacing: 0.02em; }

/* === Tech Settings form === */
.tech-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1rem;
  font-size: 0.8rem;
}
.tech-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: #888;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tech-form input[type="number"],
.tech-form select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: #111;
  border: 1px solid #2a3e2a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  font-family: 'Inter', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.tech-form input[type="number"]:focus,
.tech-form select:focus {
  border-color: #4a8;
}
.tech-form input[type="number"]::-webkit-inner-spin-button {
  opacity: 0.4;
}
.tech-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.4rem;
}
/* Toggle switch */
.tech-switch {
  display: flex;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.5rem !important;
  grid-column: 1 / -1;
  padding-top: 0.3rem;
}
.tech-switch__track {
  position: relative;
  width: 36px;
  height: 20px;
  background: #222;
  border: 1px solid #2a3e2a;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.tech-switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #666;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.tech-switch input { display: none; }
.tech-switch input:checked + .tech-switch__track {
  background: #1a3a1a;
  border-color: #4a9a4a;
}
.tech-switch input:checked + .tech-switch__track::after {
  transform: translateX(16px);
  background: #4a9a4a;
}
.tech-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: #555;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}
.tech-form__apply {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
}
.tech-form__status {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: #4a8;
  text-align: center;
  margin: 0;
}

/* === Main section (collapsible: video + viewers) === */
.main-section {
  overflow: hidden;
}

.main-section__toggle-bar {
  /* Inherits card__header padding/border via class combo */
  cursor: pointer;
}
.main-section__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #ccc;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: color 0.2s;
}
.main-section__toggle:hover { color: #fff; }

.main-section__toggle-icon {
  color: #666;
  transition: transform 0.3s ease;
}
.main-section--collapsed .main-section__toggle-icon {
  transform: rotate(-90deg);
}
.main-section--collapsed .main-section__toggle-bar {
  border-bottom: none;
}

.main-section__toggle-label { flex: 1; }

.main-section__live-warning {
  font-size: 0.72rem;
  font-weight: 600;
  color: #e0a040;
  letter-spacing: 0.3px;
  white-space: nowrap;
  animation: livePulse 2s ease-in-out infinite;
}
.main-section__live-warning[hidden] { display: none; }
.main-section__live-warning-arrow {
  font-size: 0.6rem;
  vertical-align: middle;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.main-section__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

/* Hide upper viewer count when expanded — the sidebar panel shows it */
.main-section:not(.main-section--collapsed) .main-section__viewer-count { display: none; }

.main-section__lock {
  display: flex;
  align-items: center;
}

.main-section__code {
  font-family: var(--font-ui), monospace;
  font-weight: 700;
  font-size: 0.75rem;
  color: #4a9a4a;
  background: rgba(58, 138, 58, 0.08);
  border: 1px solid rgba(58, 138, 58, 0.15);
  border-radius: 4px;
  padding: 2px 8px;
}

.main-section__viewer-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #4a9a4a;
  font-size: 0.75rem;
  font-weight: 600;
}
.main-section__viewer-count[hidden] { display: none; }

/* Icon buttons in workspace header */
.main-section__icon-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.main-section__icon-btn:hover { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.25); }
.main-section__icon-btn--copied { color: #4a9a4a; border-color: rgba(58,138,58,0.3); }

/* Edit broadcast form */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.edit-form__label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #999;
}
.edit-form__input {
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.9rem;
  font-family: var(--font-ui);
  padding: 0.5rem 0.65rem;
  outline: none;
  transition: border-color 0.15s;
  color-scheme: dark;
}
.edit-form__input:focus { border-color: #3a8a3a; }
.edit-form__textarea {
  resize: vertical;
  min-height: 60px;
}

.btn--small { font-size: 0.75rem; padding: 0.5rem 0.65rem; }
.btn--icon-only { padding: 0.35rem 0.45rem; line-height: 1; display: inline-flex; align-items: center; }
.btn--icon-only svg { display: block; }

.main-section__body {
  display: flex;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  max-height: 800px;
  opacity: 1;
}
.main-section--collapsed .main-section__body {
  max-height: 0;
  opacity: 0;
}

.main-section__divider {
  width: 1px;
  background: #1a2e1a;
  flex-shrink: 0;
}

.main-section__sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === Main device (video area — left side) === */
.main-device {
  flex: 1;
  min-width: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: border-color 0.3s;
}

.main-device--flash {
  border-color: #e04040;
  animation: flash-border 0.5s ease-in-out 3;
}

@keyframes flash-border {
  0%, 100% { border-color: #e04040; }
  50% { border-color: #1a2e1a; }
}

.main-device__video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 0 0 var(--audio-border, 0px) var(--audio-color, transparent);
  transition: box-shadow 0.15s ease-out;
}

.main-device__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Expanded portrait main: crop to fill */
.main-device--portrait.main-device--expanded .main-device__video {
  object-fit: cover;
}

.main-device__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #555;
}

.main-device__placeholder[hidden] { display: none; }

.main-device__placeholder-text {
  font-size: 0.75rem;
  color: #444;
  text-align: center;
}

.main-device__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(58, 138, 58, 0.9);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.05em;
}

.main-device__badge[hidden] { display: none; }

.main-device__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: #e8e8e8;
}

.main-device__label[hidden] { display: none; }

.main-device__timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #0a120a;
  border-top: 1px solid #1a2e1a;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.main-device__timer[hidden] { display: none; }

.main-device__timer-label {
  color: #666;
  font-weight: 500;
}

.main-device__timer-start {
  color: #4a9a4a;
  font-weight: 600;
}

.main-device__timer-separator {
  color: #333;
}

.main-device__timer-duration {
  color: #e04040;
  font-weight: 700;
  font-family: var(--font-ui), monospace;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* === Viewers panel (sidebar) === */
.viewers-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.viewers-panel__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #1a2e1a;
  color: #888;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.viewers-panel__count {
  margin-left: auto;
  background: #1a2e1a;
  color: #4a9a4a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.viewers-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 0;
}

.viewers-panel__empty {
  color: #444;
  font-size: 0.7rem;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.viewer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  transition: background 0.15s;
}
.viewer-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.viewer-item__icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a2e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4a9a4a;
}

.viewer-item__info {
  min-width: 0;
  flex: 1;
}

.viewer-item__device {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-item__ip {
  font-size: 0.62rem;
  color: #666;
  font-family: monospace;
  letter-spacing: 0.02em;
}

/* === Viewers popup (table layout) === */

.viewers-popup__count {
  margin-left: 0.5rem;
  background: #1a2e1a;
  color: #4a9a4a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.viewers-popup__empty {
  color: #555;
  font-size: 0.8rem;
  text-align: center;
  padding: 2rem 1rem;
}

.viewers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.viewers-table thead th {
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid #1a2e1a;
  color: #888;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.viewers-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.viewers-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.viewers-table td {
  padding: 0.4rem 0.8rem;
  vertical-align: middle;
}

.viewers-table__num {
  width: 30px;
  color: #555;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.viewers-table__device {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ccc;
  font-weight: 500;
}

.viewers-table__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a2e1a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4a9a4a;
}

.viewers-table__ip {
  color: #666;
  font-family: monospace;
  font-size: 0.68rem;
}

/* Viewer button in meta bar */
.main-section__viewer-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.main-section__viewer-btn[hidden] { display: none; }

.main-section__viewer-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: #4a9a4a;
}

/* === Map panel (sidebar) === */

.map-panel {
  flex: 0 1 auto;
  max-height: 60%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-panel__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #1a2e1a;
  color: #888;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.map-panel__title {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  margin-right: 0.25rem;
}

.map-panel__class-select {
  flex: 1;
  min-width: 0;
  background: #0a120a;
  border: 1px solid #1a2e1a;
  color: #ccc;
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.map-panel__manage-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}

.map-panel__manage-btn:hover {
  color: #ccc;
  background: rgba(255,255,255,0.05);
}

.map-panel__body {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.map-panel__empty {
  color: #444;
  font-size: 0.72rem;
  text-align: center;
  padding: 2rem 0.5rem;
}

.map-panel__no-map {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #444;
  font-size: 0.72rem;
  text-align: center;
}

/* Map image + canvas + corners wrapper — clickable like a device tile */
.map-panel__map-wrap {
  position: relative;
  overflow: hidden;
  border: 2px solid #333;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin: 6px;
}

.map-panel__map-wrap:hover:not(.map-panel__map-wrap--main) {
  border-color: #555;
}

.map-panel__map-wrap--main,
.map-panel__map-wrap--main:hover {
  border-color: #3a8a3a;
  box-shadow: 0 0 0 1px #3a8a3a, 0 0 8px rgba(58, 138, 58, 0.3);
}

/* Control icons top-right */
.map-panel__controls {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 4;
}

.map-panel__warn-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.map-panel__ctrl-btn {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}

.map-panel__ctrl-btn:hover {
  color: #fff;
  background: rgba(0,0,0,0.7);
}

.map-panel__ctrl-btn--active {
  color: #e04040;
  border-color: rgba(224, 64, 64, 0.4);
}
.map-panel__ctrl-btn--active-green {
  color: #4a9a4a;
  border-color: rgba(74, 154, 74, 0.4);
}

.map-panel__map-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.map-panel__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-panel__corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Static corner dots in sidebar (non-interactive) */
.map-panel__static-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-static-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background: #e04040;
  border: 1.5px solid rgba(255,255,255,0.7);
  box-shadow: 0 0 5px rgba(224, 64, 64, 0.6);
}


/* Map image in edit form (inside modal) */
.class-form__map-container {
  position: relative;
  border-radius: 6px;
  border: 1px solid #1a2e1a;
}

.class-form__map-zoom-controls {
  position: absolute;
  top: 30px;
  left: 6px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.class-form__map-zoom-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #1a2e1a;
  border-radius: 4px;
  background: rgba(13, 21, 13, 0.85);
  color: #ccc;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.class-form__map-zoom-btn:hover:not(:disabled) {
  background: rgba(13, 21, 13, 1);
  color: #fff;
}

.class-form__map-zoom-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.class-form__map-zoom-btn--reset {
  visibility: hidden;
  pointer-events: none;
}

.class-form__map-zoom-btn--reset.visible {
  visibility: visible;
  pointer-events: auto;
}

.class-form__map-scroll-area {
  overflow: hidden;
  background: #0d150d;
}

.class-form__map-scroll-area--zoomed {
  overflow: auto;
  cursor: grab;
}

.class-form__map-scroll-area--zoomed:active {
  cursor: grabbing;
}

.class-form__map-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  vertical-align: bottom;
}


.class-form__map-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.class-form__map-actions {
  margin-top: 0.4rem;
}

.class-form__current-map {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.5rem;
}

/* Corner markers (in edit form) */
.map-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: rgba(102, 102, 102, 0.8);
  border: 2px solid #888;
  color: #fff;
  font-size: 0.5rem;
  font-weight: 700;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  pointer-events: all;
  user-select: none;
  z-index: 5;
  transition: background 0.2s, border-color 0.2s;
}

.map-corner:hover {
  background: rgba(102, 102, 102, 1);
  border-color: #ccc;
}

.map-corner:active {
  cursor: grabbing;
}

.map-corner--calibrated {
  background: rgba(224, 64, 64, 0.9);
  border-color: #e04040;
}

.map-corner--calibrated:hover {
  background: rgba(224, 64, 64, 1);
  border-color: #f06060;
}

/* Corner GPS popup */
.corner-popup {
  position: absolute;
  z-index: 10;
  background: #0d1a0d;
  line-height: 1.4;
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  padding: 0.6rem;
  min-width: 170px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.corner-popup__title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.corner-popup__label {
  display: block;
  font-size: 0.7rem;
  color: #aaa;
  margin-bottom: 0.4rem;
}

.corner-popup__input {
  display: block;
  width: 100%;
  background: #0a120a;
  border: 1px solid #1a2e1a;
  color: #ccc;
  font-size: 0.72rem;
  padding: 4px 6px;
  border-radius: 4px;
  margin-top: 2px;
  font-family: monospace;
}

.corner-popup__input:focus {
  outline: none;
  border-color: #4a9a4a;
}

.corner-popup__actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

/* Calibration hint */
.map-panel__calibrate-hint {
  font-size: 0.65rem;
  color: #887744;
  text-align: center;
  padding: 0.4rem 0.5rem;
  border-top: 1px solid #1a2e1a;
  background: rgba(136, 119, 68, 0.08);
}

.map-panel__calibrate-hint[hidden] { display: none; }


/* Main device map overlay (when map is set as main) */
.main-device__map-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.main-device__map-overlay[hidden] { display: none; }

.main-device__map-overlay-inner {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.main-device__map-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.main-device__map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* === Map zoom toolbar === */

.map-zoom-toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 6px;
  padding: 3px;
}

.map-zoom-toolbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

.map-zoom-toolbar__btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.map-zoom-toolbar__btn:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
}

.map-zoom-toolbar__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* === Manage classes modal === */

.manage-classes__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.manage-classes__empty {
  color: #555;
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem 0;
}

.manage-classes__footer {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid #1a2e1a;
}

.class-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  margin-bottom: 4px;
}

.class-list-item__info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.class-list-item__thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #1a2e1a;
  flex-shrink: 0;
}

.class-list-item__no-thumb {
  width: 48px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a120a;
  border-radius: 4px;
  border: 1px solid #1a2e1a;
  color: #444;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.class-list-item__details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.class-list-item__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.class-list-item__meta {
  font-size: 0.65rem;
  color: #666;
  margin-top: 2px;
}

.class-list-item__drag-handle {
  cursor: grab;
  color: #444;
  padding: 0 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.class-list-item__drag-handle:active { cursor: grabbing; }

.class-list-item--dragging {
  opacity: 0.4;
}

.class-list-item__check {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 2px;
}

.class-list-item__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.class-list-item__icon-btn {
  background: none;
  border: 1px solid #1a2e1a;
  border-radius: 4px;
  color: #888;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.class-list-item__icon-btn:hover {
  color: #ccc;
  border-color: #2a3e2a;
  background: rgba(255,255,255,0.04);
}

.class-list-item__icon-btn--danger:hover {
  color: #e04040;
  border-color: rgba(224, 64, 64, 0.3);
  background: rgba(224, 64, 64, 0.08);
}

/* Class add/edit form */
.class-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.class-form__heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ccc;
  margin: 0;
}

.class-form__row {
  display: flex;
  gap: 0.75rem;
}

.class-form__label--flex {
  flex: 1;
  min-width: 0;
}

.class-form__label--shrink {
  flex: 0 0 140px;
}

.class-form__map-inner {
  position: relative;
  width: 100%;
  transform-origin: 0 0;
  background: inherit;
  line-height: 0;
}

.class-form__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: #aaa;
}

.class-form__input {
  background: #0a120a;
  border: 1px solid #1a2e1a;
  color: #ccc;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 5px;
}

.class-form__input:focus {
  outline: none;
  border-color: #4a9a4a;
}

.class-form__map-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.class-form__current-map {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.class-form__map-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #1a2e1a;
}

/* Map upload drop area */
.map-upload-area {
  border: 2px dashed #1a2e1a;
  border-radius: 6px;
  padding: 1.25rem;
  text-align: center;
  color: #555;
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.map-upload-area:hover {
  border-color: #2a3e2a;
  background: rgba(255,255,255,0.02);
}

.map-upload-area--drag {
  border-color: #4a9a4a;
  background: rgba(74, 154, 74, 0.05);
}

.map-upload-area__preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

.class-form__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Device tile main highlight */
.device-tile--main {
  border: 2px solid #3a8a3a;
  box-shadow: 0 0 0 1px #3a8a3a, 0 0 8px rgba(58, 138, 58, 0.3);
}

.device-tile--main .device-tile__main-badge {
  display: block !important;
}

.device-tile__main-badge {
  position: absolute;
  top: 5px;
  left: 20px;
  z-index: 4;
  background: rgba(58, 138, 58, 0.85);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.5rem;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.06em;
}

.device-tile__main-badge[hidden] { display: none; }

/* Slot limit badge — placed outside .device-tile__video to avoid opacity inheritance */
.device-tile__slot-limit-badge {
  position: absolute;
  top: 5px;
  left: 20px;
  z-index: 12;
  background: rgba(180, 80, 40, 0.95);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.5rem;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.device-tile__slot-limit-badge[hidden] { display: none; }

.device-tile--slot-limited {
  border-color: rgba(180, 80, 40, 0.5);
}
.device-tile--slot-limited .device-tile__video {
  opacity: 0.45;
}
.device-tile--slot-limited .device-tile__video-el {
  cursor: not-allowed;
}
.device-tile--slot-limited:hover {
  border-color: rgba(180, 80, 40, 0.5);
}

.device-tile:hover {
  border-color: #2a5a2a;
}

/* === Confirm modal === */
.confirm-modal[hidden] { display: none; }
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 0;
}

.confirm-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.confirm-modal__content {
  position: relative;
  flex-shrink: 0;
  margin: auto;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.confirm-modal__icon {
  margin-bottom: 1rem;
}

.confirm-modal__title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.2rem;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
}

.confirm-modal__text {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirm-modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-modal__actions .btn {
  min-width: 120px;
}

/* === Live page === */
.live-page {
  background: #0a0a0a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Live header */
.live-header {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
}

.live-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-header__name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1rem !important;
  color: #e8e8e8;
}

.live-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-header__title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: #999;
}

.live-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(224, 64, 64, 0.9);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.live-header__badge[hidden] { display: none; }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 2s ease-in-out infinite;
}

/* Live main */
.live-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Live player */
.live-player {
  position: relative;
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.live-player__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.live-player__video[hidden] { display: none; }

/* Waiting state */
.live-player__waiting {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 5;
}

.live-player__waiting[hidden] { display: none; }

.live-player__waiting-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.live-player__waiting-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.3rem;
  color: #e0e0e0;
}

.live-player__waiting-text {
  font-size: 0.85rem;
  color: #666;
  max-width: 320px;
}

.live-player__waiting-pulse {
  display: flex;
  gap: 6px;
  margin-top: 0.5rem;
}

.live-player__waiting-pulse span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a8a3a;
  animation: waiting-pulse 1.4s ease-in-out infinite;
}

.live-player__waiting-pulse span:nth-child(2) { animation-delay: 0.2s; }
.live-player__waiting-pulse span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waiting-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* Live controls overlay */
.live-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.live-controls[hidden] { display: none; }

.live-controls__top {
  padding: 12px 16px;
  background: linear-gradient(rgba(0,0,0,0.6), transparent);
  display: flex;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.live-controls--visible .live-controls__top {
  opacity: 1;
}

.live-controls__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(224, 64, 64, 0.9);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.live-controls__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  pointer-events: auto;
}

.live-controls__left,
.live-controls__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-controls__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.live-controls__btn:hover {
  background: rgba(255,255,255,0.2);
}
.live-controls__btn svg[hidden] { display: none; }

/* Volume */
.live-controls__volume {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.live-controls__volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  outline: none;
  cursor: pointer;
}

.live-controls__volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.live-controls__volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* Time info */
.live-controls__time {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  margin-left: 0.5rem;
}

.live-controls__time[hidden] { display: none; }

.live-controls__time-start {
  color: #aaa;
}

.live-controls__time-sep {
  color: #444;
}

.live-controls__time-duration {
  color: #e04040;
  font-weight: 600;
  font-family: var(--font-ui), monospace;
}

/* Quality */
.live-controls__quality {
  position: relative;
}

.live-controls__quality[hidden] { display: none; }

.live-controls__quality-btn {
  gap: 0.3rem;
  width: auto;
  padding: 0 10px;
}

.live-controls__quality-label {
  font-size: 0.7rem;
  font-weight: 600;
}

.live-controls__quality-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 4px 0;
  min-width: 100px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.live-controls__quality-menu[hidden] { display: none; }

.live-controls__quality-option {
  display: block;
  width: 100%;
  padding: 6px 14px;
  border: none;
  background: none;
  color: #ccc;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.live-controls__quality-option:hover {
  background: rgba(255,255,255,0.1);
}

.live-controls__quality-option--active {
  color: #4a9a4a;
  font-weight: 700;
}

/* Live footer — sticks to bottom via flex on .live-page */
.live-footer {
  border-top: 1px solid #1a1a1a;
  padding: 0.8rem 1.25rem;
  flex-shrink: 0;
  margin-top: auto;
  text-align: center;
}

.live-footer__inner--unused {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #666;
}

.live-footer__copy {
  font-size: 0.7rem;
  color: #444;
  margin: 0;
}

/* === Footer === */
.footer {
  border-top: 1px solid #1a2e1a;
  margin-top: auto;
  background: #060e06;
  position: relative;
  overflow: hidden;
}

.footer__god {
  position: absolute;
  bottom: 0;
  right: 0;
  opacity: 0.35;
  pointer-events: none;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 2rem 4rem;
  padding: 2rem 1.5rem 1.5rem;
}

.footer__nav-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer__nav-title {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
}
.footer__nav-link {
  font-size: 0.85rem;
  color: #888;
  text-decoration: none;
  transition: color 0.15s;
}
.footer__nav-link:hover {
  color: #4a9a4a;
}

.footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 1rem;
}
.footer__copy {
  font-size: 0.75rem;
  color: #444;
  margin: 0;
}

/* === Legal pages === */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.legal-page__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.legal-page__updated {
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 2rem;
}
.legal-page__content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: #ddd;
}
.legal-page__content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
  color: #bbb;
}
.legal-page__content p {
  font-size: 0.9rem;
  color: #999;
  line-height: 1.6;
  margin: 0 0 0.75rem;
}
.legal-page__content ul {
  margin: 0 0 0.75rem;
  padding-left: 1.5rem;
}
.legal-page__content li {
  font-size: 0.9rem;
  color: #999;
  line-height: 1.6;
  margin-bottom: 0.3rem;
}
.legal-page__content a {
  color: #4a9a4a;
  text-decoration: none;
}
.legal-page__content a:hover {
  text-decoration: underline;
}

/* === Contacts page === */
.contacts-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.contacts-section {
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.contacts-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a9a4a;
}
.contacts-section__row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.9rem;
}
.contacts-section__row:last-of-type {
  border-bottom: none;
}
.contacts-section__label {
  color: #555;
  min-width: 5rem;
  flex-shrink: 0;
  font-size: 0.8rem;
}
.contacts-section__value {
  color: #ccc;
}
.contacts-section__link {
  color: #4a9a4a;
  text-decoration: none;
}
.contacts-section__link:hover {
  text-decoration: underline;
}
.contacts-section__links {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.contacts-section__links a {
  font-size: 0.85rem;
  color: #4a9a4a;
  text-decoration: none;
}
.contacts-section__links a:hover {
  text-decoration: underline;
}

/* Collapsible section */
.contacts-section--collapsible {
  list-style: none;
}
.contacts-section--collapsible > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.contacts-section--collapsible > summary::-webkit-details-marker { display: none; }
.contacts-section--collapsible > summary::marker { display: none; content: ''; }
.contacts-section__chevron {
  margin-left: auto;
  transition: transform 0.2s;
  opacity: 0.5;
}
.contacts-section--collapsible[open] .contacts-section__chevron {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  .footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer__god { transform: scale(0.65); transform-origin: bottom right; }
  .contacts-section__links { flex-direction: column; gap: 0.5rem; }
}

/* === Responsive === */
@media (max-width: 768px) {
  .header__nav { display: none; }
  .header__user { display: none; }
  .header__lang:not(.header__lang--mobile) { display: none; }
  .header__burger { display: flex; }

  .broadcasts__grid,
  .device-grid {
    grid-template-columns: 1fr;
  }

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

  .control__header-right {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .control__live-url-link {
    max-width: none;
  }

  .broadcasts__header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .main-section__body {
    flex-direction: column;
  }
  .main-section__divider {
    width: auto;
    height: 1px;
  }
  .main-section__sidebar {
    width: auto;
    max-height: none;
    flex-direction: column;
  }
  .main-device__video-wrap {
    aspect-ratio: 16 / 9;
  }

  .live-controls__volume-slider {
    width: 50px;
  }

  .live-controls__time {
    font-size: 0.65rem;
  }

  .live-player {
    border-radius: 0;
  }

  .live-main {
    padding: 0;
  }

  .live-player__waiting-title {
    font-size: 1.1rem;
  }
}

/* === Admin Dashboard === */
.admin {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}
.admin__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.admin__title { font-size: 1.5rem; font-weight: 600; }
.admin__health {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}
/* Admin sub-navigation */
.admin__nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.75rem;
}
.admin__nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: #888;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.admin__nav-btn:hover { background: rgba(255,255,255,0.05); color: #ccc; }
.admin__nav-btn--active { background: rgba(58, 138, 58, 0.15); color: #4a9a4a; }
.admin__nav-btn svg { opacity: 0.7; flex-shrink: 0; }
.admin__nav-btn--active svg { opacity: 1; }

@media (max-width: 768px) {
  .admin { padding: 0.75rem; }
  .admin__header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .admin__nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -0.75rem 1rem;
    padding: 0 0.75rem 0.6rem;
    gap: 0.35rem;
  }
  .admin__nav::-webkit-scrollbar { display: none; }
  .admin__nav-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
}
@media (max-width: 480px) {
  .admin__nav-btn span,
  .admin__nav-btn { gap: 0.3rem; }
  /* Icon-only nav on very narrow screens; keep label for active item */
  .admin__nav-btn:not(.admin__nav-btn--active) { font-size: 0; padding: 0.45rem; }
  .admin__nav-btn:not(.admin__nav-btn--active) svg { width: 18px; height: 18px; opacity: 0.85; }
}

/* Admin toggle switch */
.admin__switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.admin__switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.admin__switch-track {
  width: 32px;
  height: 18px;
  background: #333;
  border-radius: 9px;
  transition: background 0.2s;
  position: relative;
}
.admin__switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.admin__switch input:checked + .admin__switch-track { background: #2a5a2a; }
.admin__switch input:checked + .admin__switch-track::after { transform: translateX(14px); background: #4a9a4a; }

/* Admin settings form */
.admin__settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem 1.5rem;
}
.admin__settings-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #ccc;
}
.admin__settings-form input,
.admin__settings-form select {
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  outline: none;
}
.admin__settings-form input:focus,
.admin__settings-form select:focus { border-color: #3a8a3a; }
.admin__settings-form .tech-switch {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.admin__settings-form .btn {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.5rem;
}
.admin__settings-hint {
  grid-column: 1 / -1;
  color: #777;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}
.admin__settings-status {
  grid-column: 1 / -1;
  color: #4a9a4a;
  font-size: 0.85rem;
}

.admin__health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
}
.admin__health-dot--ok { background: #4CAF50; }
.admin__health-dot--err { background: #f44336; }

/* Admin stat counters */
.admin__counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.admin__counter {
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.admin__counter-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e0e0e0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.admin__counter-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  font-weight: 500;
}
.admin__counter--accent {
  border-color: #2a5a2a;
}
.admin__counter--accent .admin__counter-value {
  color: #4CAF50;
}

.admin__charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin__table th,
.admin__table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin__table th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin__table-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem;
}

.admin__cell-title {
  font-weight: 600;
  color: #ddd;
}

.admin__cell-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #666;
  margin-top: 2px;
}

/* Sortable column headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  color: #ccc;
}

.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 0;
  gap: 1px;
}

.sort-arrows::before,
.sort-arrows::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
}

.sort-arrows::before {
  border-bottom: 5px solid #555;
}

.sort-arrows::after {
  border-top: 5px solid #555;
}

.sortable-th--active.sortable-th--asc .sort-arrows::before {
  border-bottom-color: #ccc;
}

.sortable-th--active.sortable-th--desc .sort-arrows::after {
  border-top-color: #ccc;
}

/* === Action dropdown === */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown__trigger {
  background: none;
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  color: #888;
  padding: 4px 6px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.action-dropdown__trigger:hover {
  border-color: #3a8a3a;
  color: #ccc;
}

.action-dropdown__menu {
  position: fixed;
  min-width: 140px;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
}

.action-dropdown__item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  color: #bbb;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.action-dropdown__item:hover {
  background: rgba(255,255,255,0.04);
  color: #e0e0e0;
}

.action-dropdown__item--danger { color: #e04040; }
.action-dropdown__item--danger:hover { background: rgba(224,64,64,0.1); color: #ff5555; }

.action-dropdown__item--warning { color: #e0a020; }
.action-dropdown__item--warning:hover { background: rgba(224,160,32,0.1); color: #ffbb33; }

.btn--sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.btn--lg {
  padding: 0.85rem 2.2rem;
  font-size: 1.05rem;
}

@media (max-width: 768px) {
  .admin__charts { grid-template-columns: 1fr; }
  .admin__settings-form { grid-template-columns: 1fr; }
}

/* === Director lock overlay === */
.director-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.director-overlay__content {
  background: #1a1a2e;
  padding: 2rem 3rem;
  border-radius: 12px;
  text-align: center;
  color: #ccc;
  font-size: 1rem;
}
.director-overlay__content p { margin-bottom: 1rem; }
.director-overlay__actions { display: flex; gap: 10px; justify-content: center; }

/* Read-only mode: hide edit controls */
.control--readonly .btn-group,
.control--readonly #btn-edit-broadcast,
.control--readonly #btn-title-settings,
.control--readonly .title-settings-popup,
.control--readonly #lock-icon { display: none !important; }
.control--readonly .device-tile__settings,
.control--readonly .device-tile__rename,
.control--readonly .pip-corners,
.control--readonly .pip-actions,
.control--readonly .device-tile__portrait-toggle,
.control--readonly #btn-toggle-pips,
.control--readonly #btn-master-mute { display: none !important; }
.control--readonly .device-tile { pointer-events: none; }
.control--readonly .device-tile__video-speaker { pointer-events: auto; }
.director-banner {
  background: #f59e0b;
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* === Plan / User limits modal === */
.plan-modal__content {
  max-width: 480px;
  text-align: left;
}
.plan-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
}
.plan-modal__form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: #ccc;
}
.plan-modal__form input,
.plan-modal__form select {
  background: #0a120a;
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  outline: none;
}
.plan-modal__form input:focus,
.plan-modal__form select:focus {
  border-color: #3a8a3a;
}
.plan-modal__divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 0.5rem 0;
}
.plan-modal__section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  font-weight: 500;
  margin: 0;
}

/* User limits modal override row */
.ulm-override-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ulm-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ulm-default {
  font-size: 0.75rem;
  color: #555;
  font-weight: 400;
}

/* Plan drag reorder */
.plan-drag-cell {
  width: 30px;
}

.plan-drag-handle {
  cursor: grab;
  color: #444;
  display: inline-flex;
  align-items: center;
  padding: 4px 2px;
}

.plan-drag-handle:active { cursor: grabbing; }

.plan-row--dragging {
  opacity: 0.3;
}

.plan-row-indicator td {
  padding: 0 !important;
  border: none !important;
}

.plan-row-indicator__line {
  height: 2px;
  background: #4a9a4a;
  border-radius: 1px;
}

/* Plan actions cell */
.plan-actions {
  display: flex;
  gap: 0.35rem;
  white-space: nowrap;
}

/* Danger outline button */
.btn--danger-outline {
  background: none;
  border: 1px solid #e04040;
  color: #e04040;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all 0.15s;
}
.btn--danger-outline:hover {
  background: rgba(224, 64, 64, 0.1);
  color: #ff5555;
  border-color: #ff5555;
}

/* Plan price tags */
.plan-price-tag {
  display: inline-block;
  background: rgba(255,255,255,0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

/* Gateway sections */
.gw-section {
  margin-top: 1rem;
}

/* === Landing / Home page === */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 1.5rem 4rem;
  background: radial-gradient(ellipse at 30% 80%, rgba(26, 60, 26, 0.25) 0%, transparent 60%);
}
.hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.hero__content {
  flex: 1;
}
.hero__title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.hero__title-accent {
  color: #4a9a4a;
}
.hero__subtitle {
  font-size: 1.1rem;
  color: #888;
  line-height: 1.6;
  max-width: 500px;
  margin-bottom: 2rem;
}
.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero__visual {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Landing sections */
.landing-section {
  padding: 4rem 1.5rem;
}
.landing-section--alt {
  background: rgba(13, 21, 13, 0.6);
}
.landing-section__inner {
  max-width: 1000px;
  margin: 0 auto;
}
.landing-section__title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  text-align: center;
}
.landing-section__subtitle {
  text-align: center;
  color: #666;
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

/* Steps */
.landing-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 720px;
  margin: 0 auto;
}
.landing-step {
  position: relative;
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(74, 154, 74, 0.04);
  border: 1px solid rgba(74, 154, 74, 0.1);
  border-radius: 12px;
}
.landing-step__num {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(74, 154, 74, 0.08);
  line-height: 1;
  pointer-events: none;
}
.landing-step__icon {
  margin-bottom: 1rem;
  position: relative;
}
.landing-step__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.landing-step__text {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.5;
}

/* Features grid */
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.landing-feature {
  background: #0a100a;
  border: 1px solid #152015;
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.landing-feature:hover {
  border-color: #2a4a2a;
}
.landing-feature__icon {
  margin-bottom: 0.75rem;
}
.landing-feature__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.landing-feature__text {
  font-size: 0.82rem;
  color: #777;
  line-height: 1.5;
}

/* Blockquote */
.landing-quote {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem;
  border-left: 3px solid #2a5a2a;
  background: rgba(74, 154, 74, 0.03);
  border-radius: 0 12px 12px 0;
}
.landing-quote__icon {
  position: absolute;
  top: -20px;
  left: 24px;
  background: #0a0f0a;
  padding: 0 0.5rem;
  opacity: 0.5;
}
.landing-quote__text {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #999;
  font-style: italic;
}
.landing-quote__highlight {
  color: #bbb;
  font-style: normal;
}
.landing-quote__o {
  color: #FF5800;
  font-style: normal;
}
.landing-quote__ps {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #4a9a4a;
  font-style: normal;
}

/* CTA section */
.landing-cta {
  padding: 4rem 1.5rem 5rem;
}
.landing-cta__doodle {
  margin-bottom: 1rem;
  opacity: 0.4;
}
.landing-cta__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.landing-cta__text {
  color: #777;
  font-size: 1rem;
  margin-bottom: 1.75rem;
}

/* Eyebrow label above section title */
.landing-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FF5800;
  margin-bottom: 0.5rem;
}

/* App section */
.landing-app__inner {
  display: flex;
  gap: 3rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.landing-app__visual {
  flex-shrink: 0;
  opacity: 0.85;
}
.landing-app__content {
  flex: 1;
  min-width: 280px;
  max-width: 560px;
}
.landing-app__eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FF5800;
  margin-bottom: 0.75rem;
}
.landing-app__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #e6f0e6;
  margin: 0 0 0.75rem;
  line-height: 1.25;
}
.landing-app__subtitle {
  color: #8fae8f;
  font-size: 1rem;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}
.landing-app__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
}
.landing-app__bullets li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.75rem;
  color: #c6d6c6;
  line-height: 1.45;
}
.landing-app__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4a9a4a;
  box-shadow: 0 0 0 3px rgba(74, 154, 74, 0.2);
}

/* Big APK download button (hero of the app section) */
.btn-apk-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.4rem;
  border-radius: 12px;
  background: #FF5800;
  border: 1px solid #FF5800;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(255, 88, 0, 0.25);
}
.btn-apk-lg:hover {
  background: #ff7120;
  border-color: #ff7120;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 88, 0, 0.35);
}
.btn-apk-lg__icon { flex-shrink: 0; }
.btn-apk-lg__labels { display: inline-flex; flex-direction: column; line-height: 1.15; }
.btn-apk-lg__name {
  font-size: 1.1rem;
  font-weight: 700;
}
.btn-apk-lg__hint {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .hero { padding-bottom: 0; }
  .hero__inner { flex-direction: column; text-align: center; }
  .hero__title { font-size: 2rem; }
  .hero__subtitle { max-width: none; }
  .hero__actions { justify-content: center; }
  .hero__visual { opacity: 0.5; }
  .landing-steps { grid-template-columns: 1fr; gap: 1rem; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-app__inner { flex-direction: column; text-align: center; gap: 1.5rem; }
  .landing-app__bullets li { text-align: left; }
  .landing-app__visual svg { width: 180px; height: 240px; }
  .landing-app__title { font-size: 1.4rem; }
}

/* === Plans page (public) === */
.plans-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.plans-page__header {
  text-align: center;
  margin-bottom: 2rem;
}
.plans-page__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.plans-page__subtitle {
  color: #888;
  font-size: 1rem;
}
.plans-page__currency {
  margin-top: 1rem;
}
.plans-page__currency select {
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 8px;
  color: #e0e0e0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.plan-card {
  position: relative;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.plan-card--active {
  border-color: #3a8a3a;
  box-shadow: 0 0 20px rgba(58, 138, 58, 0.15);
}
.plan-card__badge {
  position: absolute;
  top: -10px;
  background: #1a2e1a;
  color: #4a9a4a;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.plan-card__badge--current {
  background: rgba(58, 138, 58, 0.2);
  color: #4CAF50;
}
.plan-card__name {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.5rem 0;
}
.plan-card__price {
  margin: 0.75rem 0 1.25rem;
}
.plan-card__price-value {
  font-size: 2rem;
  font-weight: 700;
  color: #4a9a4a;
}
.plan-card__price-period {
  font-size: 0.85rem;
  color: #666;
}
.plan-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  width: 100%;
  text-align: left;
}
.plan-card__features li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: #bbb;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.plan-card__features li:last-child { border-bottom: none; }
.plan-card__features s { color: #555; }
.plan-card__check { color: #4CAF50; margin-right: 0.4rem; }
.plan-card__cross { color: #666; margin-right: 0.4rem; }
.plan-card__features li {
  display: flex;
  align-items: center;
}

/* Feature hint ? button */
.feature-hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: 1px solid #333;
  border-radius: 50%;
  color: #555;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.feature-hint-btn:hover {
  border-color: #4a9a4a;
  color: #4a9a4a;
}

/* Feature hint popup */
.feature-hint-popup[hidden] { display: none; }
.feature-hint-popup {
  z-index: 300;
  background: #1a2e1a;
  border: 1px solid #2a4a2a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.feature-hint-popup__text {
  margin: 0;
  font-size: 0.82rem;
  color: #ccc;
  line-height: 1.45;
}
.plan-card__btn {
  width: 100%;
  margin-top: auto;
}

/* Alert messages */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert--success {
  background: rgba(76,175,80,0.1);
  color: #4CAF50;
  border: 1px solid rgba(76,175,80,0.2);
}
.alert--error {
  background: rgba(244,67,54,0.1);
  color: #f44336;
  border: 1px solid rgba(244,67,54,0.2);
}

/* Payment return page */
.payment-return {
  max-width: 480px;
  margin: 4rem auto;
  text-align: center;
  padding: 2rem;
}
.payment-return__icon {
  margin-bottom: 1.5rem;
}
.payment-return__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.payment-return__text {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* ── Styled scrollbars (sidebar + modals) ── */
.main-section__sidebar ::-webkit-scrollbar,
.device-modal ::-webkit-scrollbar {
  width: 5px;
}
.main-section__sidebar ::-webkit-scrollbar-track,
.device-modal ::-webkit-scrollbar-track {
  background: transparent;
}
.main-section__sidebar ::-webkit-scrollbar-thumb,
.device-modal ::-webkit-scrollbar-thumb {
  background: #1a2e1a;
  border-radius: 3px;
}
.main-section__sidebar ::-webkit-scrollbar-thumb:hover,
.device-modal ::-webkit-scrollbar-thumb:hover {
  background: #2a3e2a;
}
/* Firefox */
.main-section__sidebar *,
.device-modal * {
  scrollbar-width: thin;
  scrollbar-color: #1a2e1a transparent;
}

/* ── Participant Panel (sidebar) ── */
.participant-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: 1px solid #1a2e1a;
}
.participant-panel__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #1a2e1a;
  color: #888;
  position: relative;
}
.participant-panel__header-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.participant-panel__title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex: 1;
}
.participant-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}
.participant-panel__empty {
  color: #555;
  font-size: 0.72rem;
  text-align: center;
  padding: 1.5rem 0.5rem;
  margin: 0;
}

/* Participant list item */
.participant-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}
.participant-item:hover {
  background: rgba(255,255,255,0.02);
}
.participant-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.participant-item__info {
  min-width: 0;
  flex: 1;
}
.participant-item__main {
  display: flex;
  align-items: center;
  gap: 6px;
}
.participant-item__bib {
  color: #888;
  font-weight: 600;
  font-size: 0.68rem;
  min-width: 36px;
}
.participant-item__name {
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.participant-item__gps {
  font-size: 0.58rem;
  color: #4a9a4a;
  border: 1px solid #4a9a4a;
  border-radius: 3px;
  padding: 0 3px;
  flex-shrink: 0;
  margin-left: auto;
}
.participant-item__gps--no-coords {
  color: #666;
  border-color: #555;
}
/* ── Title settings popup ── */
.title-settings-popup {
  position: absolute;
  top: 100%;
  right: 40px;
  z-index: 100;
  background: #1a2e1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px 14px;
  width: 230px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  font-size: 0.72rem;
}
.title-settings-popup[hidden] { display: none; }
.title-settings-popup__section {
  margin-bottom: 10px;
}
.title-settings-popup__section:last-child { margin-bottom: 0; }
.title-settings-popup__label {
  font-weight: 600;
  color: #aaa;
  margin-bottom: 6px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.title-settings-popup__radio {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
  color: #ccc;
}
.title-settings-popup__radio input[type="radio"] {
  accent-color: #4a9a4a;
  margin: 0;
}
.title-settings-popup__radio span {
  font-size: 0.72rem;
}
.title-settings-popup__help {
  color: #666;
  font-size: 0.72rem;
  margin-top: 6px;
  line-height: 1.1;
  padding-left: 18px;
}

/* Title bar dismiss button (admin only) */
.title-preview__bar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 100%;
  background: rgba(40, 40, 50, 0.9);
  cursor: pointer;
  color: #ff6666;
  flex-shrink: 0;
  pointer-events: auto;
  transition: color 0.2s, background 0.2s;
}
.title-preview__bar-close svg {
  width: 14px;
  height: 14px;
}
.title-preview__bar-close:hover {
  color: #ff4444;
  background: rgba(60, 40, 40, 0.95);
}
.title-preview--manual-dismiss .title-preview__bar-close {
  display: flex;
}

/* "Hide all" button above titles (admin, manual dismiss only) */
.title-preview__clear-all {
  display: none;
  pointer-events: auto;
  position: absolute;
  bottom: 0;
  left: 16px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: #ccc;
  font-size: 12px;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}
.title-preview__clear-all:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

.participant-panel__sort-select {
  font-size: 0.65rem;
  background: #1a2e1a;
  color: #888;
  border: 1px solid #333;
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
}
.participant-panel__sort-select:focus {
  outline: none;
  border-color: #4a9a4a;
}
.participant-panel__class-label {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.participant-item__meta-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.participant-item__meta {
  color: #555;
  font-size: 0.62rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* ── Title preview overlay (admin video) ── */
.title-preview {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

/* Title bars — bottom-left stacking */
.title-preview__titles {
  position: absolute;
  bottom: 16px;
  left: 0;
  display: flex;
  flex-direction: column-reverse;
}

.title-preview__bar {
  display: flex;
  align-items: stretch;
  height: 42px;
  margin: 1px 16px;
  border-radius: 4px;
  overflow: hidden;
  animation: tp-slide-in 0.35s ease-out;
  font-family: 'Exo 2', sans-serif;
}

@keyframes tp-slide-in {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.title-preview__bar-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 100%;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}

.title-preview__bar-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 2;
  height: 100%;
  padding: 0 10px;
  padding-bottom: 2px;
  background: rgba(0, 0, 0, 0.75);
  gap: 0;
  min-width: 234px;
}
.title-preview__bar-info-main {
  display: flex;
  align-items: center;
  gap: 6px;
}
.title-preview__bar-info-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  margin-top: -1px;
}
.title-preview__bar-class {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.title-preview__bar-cp {
  font-size: 11px;
  opacity: 0.7;
  white-space: nowrap;
}

.title-preview__bar-bib {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.title-preview__bar-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-preview__bar-time {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 10px;
  flex-shrink: 0;
}

.title-preview__bar-time span {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.title-preview__bar-delta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  min-width: 70px;
}

.title-preview__bar-delta span {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}

/* Results table overlay */
.title-preview__table {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
}

.title-preview__table[hidden] { display: none !important; }

.tp-results {
  background: rgba(10, 10, 20, 0.92);
  border-radius: 6px;
  width: 520px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.tp-results__header {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  gap: 8px;
}

.tp-results__header-title { flex: 1; }

.tp-results__header-cp {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.8;
  background: rgba(0,0,0,0.2);
  padding: 1px 4px;
  border-radius: 2px;
}

.tp-results__header-count {
  font-weight: 600;
  font-size: 14px;
  opacity: 0.8;
}

.tp-results__close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  pointer-events: auto;
  transition: color 0.2s;
  margin-left: 4px;
}
.tp-results__close-btn:hover {
  color: #fff;
}

.tp-results__empty {
  padding: 20px 16px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
}

.tp-results__row {
  display: flex;
  align-items: center;
  padding: 7px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tp-results__row:nth-child(even) {
  background: rgba(255,255,255,0.03);
}

.tp-results__row-pos {
  font-weight: 700;
  font-size: 15px;
  width: 28px;
  color: rgba(255,255,255,0.5);
}

.tp-results__row:first-child .tp-results__row-pos { color: #ffd700; }

.tp-results__row-bib {
  font-weight: 600;
  width: 48px;
  font-size: 13px;
}

.tp-results__row-info {
  flex: 1;
  min-width: 0;
}
.tp-results__row-name {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-results__row-team {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.tp-results__row-time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  width: 76px;
  text-align: right;
}

.tp-results__row-delta {
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.5);
  width: 70px;
  text-align: right;
  font-size: 13px;
}

.tp-results__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  pointer-events: auto;
}

.tp-results__page-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  line-height: 1;
}

.tp-results__page-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.tp-results__page-info {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.tp-results__dots {
  display: flex;
  gap: 4px;
}

.tp-results__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.tp-results__dot--active { background: currentColor; }

.participant-item__revert-btn {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.participant-item__revert-btn:hover {
  color: #e04040;
}

/* Finish button and finished state */
.participant-item__finish-btn {
  background: none;
  border: 1px solid #555;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s, border-color 0.2s;
}
.participant-item__finish-btn:hover {
  color: #4a9a4a;
  border-color: #4a9a4a;
}
.participant-item__finish-time {
  font-size: 0.62rem;
  color: #4a9a4a;
  font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.participant-item--finished .participant-item__name {
  color: #4a9a4a;
}
.participant-item--finished .participant-item__bib {
  color: #4a9a4a;
}

/* ── Checkin page ── */
.checkin__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #0d150d;
  border: 1px solid #1a2e1a;
  border-radius: 8px;
}
.checkin__filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.checkin__filter-select {
  background: #0a120a;
  border: 1px solid #1a2e1a;
  color: #ccc;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 5px;
}
.checkin__filter-select:focus {
  outline: none;
  border-color: #4a9a4a;
}
.checkin__counters {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #888;
}
.checkin__counter strong {
  color: #ccc;
}
.checkin__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.checkin__empty {
  color: #555;
  font-size: 0.85rem;
  text-align: center;
  padding: 3rem;
}
.checkin__group-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: #4a9a4a;
  padding: 0.4rem 0.5rem 0.25rem;
  border-bottom: 1px solid #1a2e1a;
  margin-bottom: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.checkin__group-header:hover {
  color: #5aba5a;
}
.checkin__group-arrow {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.checkin__group-header--collapsed .checkin__group-arrow {
  transform: rotate(-90deg);
}
.checkin__group-header--all-confirmed {
  color: #555;
}
.checkin__group-header--all-confirmed:hover {
  color: #888;
}
.checkin__group-header--no-connected {
  color: #444;
}
.checkin__group-header--no-connected:hover {
  color: #666;
}
.checkin__group-time {
  font-size: 0.85rem;
}
.checkin__group-count {
  color: #666;
  font-weight: 400;
  font-size: 0.78rem;
}
/* ── Card view (start_time sort) ── */
.checkin__group-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
}
.checkin__group-body:empty {
  padding: 0;
}
.checkin__group-body--collapsed {
  display: none;
}
.checkin__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid #1a2e1a;
  border-radius: 8px;
  flex: 1 1 140px;
  max-width: 180px;
  min-width: 120px;
  text-align: center;
  cursor: pointer;
}
.checkin__card:hover {
  background: rgba(255,255,255,0.05);
}
.checkin__card-spacer { flex: 1; }
.checkin__card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.checkin__card-bib {
  font-weight: 800;
  color: #e0e0e0;
  font-size: 1.1rem;
  line-height: 1;
}
.checkin__card-badge {
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.6rem;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checkin__card-name {
  color: #ccc;
  font-size: 0.7rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}
.checkin__card-status {
  border-top: 1px solid #1a2e1a;
  border-radius: 0 0 7px 7px;
  padding: 5px 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  width: calc(100% + 20px);
  margin: 4px -10px 0;
  text-align: center;
}
.checkin__card-status--new {
  background: rgba(255,255,255,0.04);
  color: #888;
}
.checkin__card:hover .checkin__card-status--new {
  background: rgba(74, 154, 74, 0.15);
  color: #4a9a4a;
}
.checkin__card-status--confirmed {
  background: rgba(74, 154, 74, 0.15);
  color: #4a9a4a;
}
.checkin__card:hover .checkin__card-status--confirmed {
  background: rgba(224, 64, 64, 0.1);
  color: #e04040;
}

.checkin__card--filtered {
  display: none;
}

/* ── Row view (class/bib sort) ── */
.checkin__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid #1a2e1a;
  border-radius: 6px;
  margin-bottom: 2px;
}
.checkin__row:hover { background: rgba(255,255,255,0.04); }
.checkin__row-bib { font-weight: 700; color: #e0e0e0; font-size: 0.85rem; min-width: 50px; }
.checkin__row-name { flex: 1; color: #ccc; font-size: 0.8rem; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkin__row-badge { color: #fff; padding: 1px 6px; border-radius: 3px; font-size: 0.65rem; flex-shrink: 0; }
.checkin__row-meta { color: #666; font-size: 0.72rem; white-space: nowrap; }
.checkin__row-connected { font-size: 0.72rem; color: #555; min-width: 55px; }
.checkin__row-connected--on { color: #4a9a4a; }
.checkin__row-status {
  border: 1px solid #1a2e1a; border-radius: 4px; padding: 3px 10px;
  font-size: 0.68rem; font-weight: 700; cursor: pointer;
  text-transform: uppercase; min-width: 90px; text-align: center;
}
.checkin__row-status--new { background: rgba(255,255,255,0.04); color: #888; }
.checkin__row-status--new:hover { background: rgba(74,154,74,0.15); border-color: #4a9a4a; color: #4a9a4a; }
.checkin__row-status--confirmed { background: rgba(74,154,74,0.15); border-color: #4a9a4a; color: #4a9a4a; }
.checkin__row-status--confirmed:hover { background: rgba(224,64,64,0.1); border-color: #e04040; color: #e04040; }

/* ── Team styles ── */
.team-section { margin-bottom: 32px; }
.team-section__title { font-size: 1.1rem; font-weight: 600; color: #ccc; margin-bottom: 12px; }
.team-section__subtitle { font-size: 0.9rem; font-weight: 600; color: #999; margin: 16px 0 8px; }

.team-member {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(255,255,255,0.02);
  border: 1px solid #1a2e1a; border-radius: 8px; margin-bottom: 8px;
}
.team-member__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #1a2e1a; color: #4a9a4a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.team-member__info { flex: 1; min-width: 0; }
.team-member__name { display: block; color: #ccc; font-weight: 500; font-size: 0.9rem; }
.team-member__email { display: block; color: #666; font-size: 0.8rem; }
.team-member__actions { display: flex; align-items: center; gap: 8px; }

.form__input--small { padding: 6px 10px; font-size: 0.8rem; }

.team-invite-card {
  padding: 16px 20px; background: rgba(255,255,255,0.02);
  border: 1px solid #1a2e1a; border-radius: 8px;
  margin-bottom: 16px;
}
.team-invite-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.team-invite-form__email { flex: 2; min-width: 180px; }
.team-invite-form__permission { flex: 0 0 auto; width: 120px; }
.team-invite-form .btn { flex-shrink: 0; }

.btn--danger-text { color: #e04040; border-color: #e04040; background: transparent; }
.btn--danger-text:hover { background: rgba(224,64,64,0.1); }

.team-invitation-card {
  padding: 24px; background: rgba(255,255,255,0.02);
  border: 1px solid #1a2e1a; border-radius: 8px;
  color: #ccc; font-size: 0.95rem; line-height: 1.6;
}

.broadcasts__section-title {
  font-size: 0.85rem; font-weight: 600; color: #666;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 24px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid #1a2e1a;
}

.broadcast-card__team-row { margin-bottom: 8px; }
.broadcast-card__top:has(+ .broadcast-card__team-row) { margin-bottom: 0; }
.broadcast-card__team-badge {
  font-size: 0.7rem; color: #4a9a4a; background: rgba(74,154,74,0.1);
  padding: 2px 8px; border-radius: 4px; display: inline-block;
}
