/* GriGsi Cutaway */
:root {
  --cw-teal: #1a9dad;
  --cw-teal-dim: #147a88;
  --cw-coral: #e87d6f;
  --cw-void: #0a1218;
  --cw-panel: #111c24;
  --cw-border: rgba(26, 157, 173, 0.28);
}

body.cw-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 10% -5%, rgba(26, 157, 173, 0.14), transparent 55%),
    radial-gradient(700px 400px at 100% 0%, rgba(232, 125, 111, 0.08), transparent 50%),
    linear-gradient(180deg, var(--cw-void) 0%, #0f1a22 100%);
  color: rgba(255, 255, 255, 0.92);
  font-family: Inter, system-ui, sans-serif;
}

.cw-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.cw-hero {
  text-align: center;
  padding: 16px 0 20px;
}

.cw-hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cw-hero h1 .cw-accent {
  color: var(--cw-teal);
}

.cw-hero p {
  margin: 8px auto 0;
  max-width: 42em;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.68);
}

.cw-ui-lang-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.cw-ui-lang-btn {
  min-width: 2.8em;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.cw-ui-lang-btn.is-on {
  border-color: rgba(26, 157, 173, 0.55);
  background: rgba(26, 157, 173, 0.18);
  color: #fff;
}

.cw-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 820px) {
  .cw-grid {
    grid-template-columns: 1fr 1fr;
  }
  .cw-grid .cw-panel--wide {
    grid-column: 1 / -1;
  }
}

.cw-panel {
  background: var(--cw-panel);
  border: 1px solid var(--cw-border);
  border-radius: 14px;
  padding: 14px 16px;
}

.cw-panel h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cw-teal);
}

.cw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cw-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
}

.cw-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cw-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cw-btn--primary {
  background: var(--cw-teal);
  border-color: var(--cw-teal-dim);
  color: #041014;
}

.cw-btn--primary:hover:not(:disabled) {
  background: #22b3c5;
}

.cw-btn--danger {
  background: rgba(232, 125, 111, 0.2);
  border-color: rgba(232, 125, 111, 0.45);
  color: #ffd4ce;
}

.cw-file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px dashed var(--cw-border);
  background: rgba(26, 157, 173, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.cw-file-label input {
  display: none;
}

.cw-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--cw-border);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.82rem;
}

.cw-status {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  min-height: 1.2em;
}

.cw-transcript {
  margin: 0;
  min-height: 5.5em;
  max-height: 12em;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  white-space: pre-wrap;
}

.cw-player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cw-player-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cw-player-idle {
  margin: 0;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}

.cw-player-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: rgba(255, 255, 255, 0.9);
}

.cw-library {
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.8rem;
}

.cw-lib-group h3 {
  margin: 10px 0 4px;
  font-size: 0.75rem;
  color: var(--cw-coral);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cw-lib-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cw-lib-item {
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.cw-lib-item.is-active {
  background: rgba(26, 157, 173, 0.22);
  outline: 1px solid var(--cw-teal);
}

.cw-lib-type {
  display: inline-block;
  min-width: 1.2em;
  font-weight: 800;
  color: var(--cw-teal);
}

.cw-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
}

.cw-naming {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
}

.cw-naming li {
  display: flex;
  gap: 8px;
}

.cw-naming strong {
  color: var(--cw-teal);
  min-width: 1.4em;
}

.cw-display-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

.cw-display-hint a {
  color: var(--cw-teal);
}

.cw-stt-mode {
  margin: 10px auto 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  max-width: 42em;
}

.cw-input {
  flex: 1 1 180px;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--cw-border);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.82rem;
}

.cw-actions--stack {
  align-items: stretch;
}

.cw-btn--mini {
  padding: 4px 10px;
  font-size: 0.72rem;
}

.cw-remote-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
}

.cw-remote-list li {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 6px;
}

.cw-remote-list strong {
  color: var(--cw-teal);
}

.cw-remote-empty {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.cw-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.cw-pending {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 198, 75, 0.35);
  background: rgba(255, 198, 75, 0.08);
}

.cw-pending-text {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
}

.cd-remote-status {
  font-size: 0.75rem;
  opacity: 0.7;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw-subhead {
  margin: 14px 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
}

.cw-target-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.cw-check--inline {
  font-size: 0.82rem;
}

.cw-invites-list .cw-invite-url {
  margin-top: 4px;
  font-size: 0.68rem;
  word-break: break-all;
  opacity: 0.55;
}

.cw-invite-status {
  font-size: 0.72rem;
  opacity: 0.65;
  margin-left: 6px;
}

.cw-invite-row {
  display: block;
}

/* Display receiver (fullscreen) */
body.cd-page {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  font-family: Inter, system-ui, sans-serif;
}

.cd-root {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
}

.cd-player {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #000;
}

.cd-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cd-idle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
  font-size: 1rem;
}

.cd-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 20px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
}

.cd-label {
  font-weight: 700;
}

.cd-type {
  color: var(--cw-teal, #1a9dad);
  font-weight: 600;
}

.cd-brand {
  margin-left: auto;
  font-weight: 800;
  color: #a693ef;
}
