/* www @4.4 — chat desk layout + option/radio completeness (overlay)
   Owner: layout + radio/option controls incomplete on chat desk. */

/* Keep stage + desk filling viewport without clipping composer */
html, body, #app {
  height: 100%;
  max-height: 100dvh;
}
.desk {
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat desk: full-bleed thread + composer; rail optional */
.chat-desk {
  flex: 1;
  min-height: 0;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr auto !important;
  height: 100%;
}
.game-rail { display: none !important; }

.thread {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 12px !important;
}

/* Composer always visible; clear task dock + safe area */
.composer-wrap {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  padding: 10px 16px !important;
  padding-bottom: max(72px, calc(12px + env(safe-area-inset-bottom))) !important;
  background: rgb(0 12 36 / 0.88) !important;
  border-top: 1px solid rgb(0 71 171 / 0.45) !important;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.composer {
  display: grid !important;
  grid-template-columns: 1fr auto auto !important;
  gap: 8px !important;
  align-items: center !important;
  min-height: 44px !important;
}
.composer textarea {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 120px !important;
  border-radius: 10px !important;
  border: 1px solid rgb(61 140 255 / 0.35) !important;
  background: #000 !important;
  color: #e8eef8 !important;
  padding: 10px 12px !important;
}
.composer .btn,
.composer .btn-primary,
.composer button {
  height: 44px !important;
  min-width: 72px !important;
  border-radius: 10px !important;
}

/* Chrome nav as completed segmented options (radio-like) */
.chrome {
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-height: 48px;
  padding: 8px 14px !important;
  border-bottom: 1px solid rgb(0 71 171 / 0.5) !important;
  background: rgb(0 8 24 / 0.92) !important;
}
.chrome-nav {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  align-items: center;
}
.chrome-nav a {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgb(61 140 255 / 0.28) !important;
  background: transparent !important;
  color: #8b9bb8 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
}
.chrome-nav a.on,
.chrome-nav a[aria-current="page"] {
  color: #0a0c00 !important;
  background: #E1FF00 !important;
  border-color: #E1FF00 !important;
  box-shadow: 0 0 18px rgb(225 255 0 / 0.35) !important;
}
.chrome-nav a:hover {
  color: #e8eef8 !important;
  border-color: rgb(61 140 255 / 0.65) !important;
  background: rgb(0 71 171 / 0.28) !important;
}
.chrome-nav a.on:hover {
  color: #0a0c00 !important;
  background: #E1FF00 !important;
}

/* Native radios / checkboxes / selects — finish incomplete affordances */
input[type="radio"],
input[type="checkbox"] {
  appearance: auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #0047AB;
  cursor: pointer;
  flex-shrink: 0;
}
label.row,
.row label,
.field label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #e8eef8;
}
select,
.field select,
#theme {
  min-height: 40px;
  width: 100%;
  max-width: 420px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgb(61 140 255 / 0.4);
  background: #000;
  color: #e8eef8;
  cursor: pointer;
}
select:focus-visible,
input[type="radio"]:focus-visible,
input[type="checkbox"]:focus-visible,
.chrome-nav a:focus-visible,
.composer textarea:focus-visible,
.composer button:focus-visible {
  outline: 2px solid #E1FF00;
  outline-offset: 2px;
}

/* Task dock: don't cover Send */
#hector-task-dock {
  bottom: 8px;
  left: 12px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 24px));
  opacity: 0.92;
}
@media (max-width: 720px) {
  .composer-wrap {
    padding-bottom: max(88px, calc(16px + env(safe-area-inset-bottom))) !important;
  }
  .chrome-nav a {
    min-height: 32px;
    padding: 5px 10px !important;
    font-size: 10px !important;
  }
}
