:root {
  color: #1c1915;
  background: #f4f0e8;
  font-family: "Nirmala UI", "Noto Sans Telugu", "Gautami", "Segoe UI", sans-serif;
  line-height: 1.4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
}

button, input {
  font: inherit;
}

button {
  background: #1f4b3a;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

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

.login {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card {
  width: min(28rem, 100%);
  background: #fff;
  border: 1px solid #ddd4c6;
  border-radius: 16px;
  padding: 1.5rem;
}

.lede { color: #5c564c; }

label { display: block; margin-bottom: 0.35rem; }

input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid #c9c0b2;
  border-radius: 8px;
  margin-bottom: 0.9rem;
}

.role-picker button,
.card form button {
  margin: 0.35rem 0.35rem 0.35rem 0;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table td,
.user-table th {
  text-align: left;
  padding: 0.35rem 0.5rem;
  vertical-align: top;
}

.error { color: #8a2b2b; }

.top, .controls, #status, #caption-panel {
  padding-left: 1rem;
  padding-right: 1rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
}

.brand { margin: 0; font-weight: 700; }
.who { margin: 0.2rem 0 0; }

#status { min-height: 1.4rem; }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(12rem, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 1rem 1rem;
}

.tile {
  background: #111;
  color: #f5f1ea;
  border-radius: 12px;
  padding: 0.6rem;
  min-height: 12rem;
}

.tile h2 { margin: 0 0 0.4rem; font-size: 0.95rem; }

.video {
  background: #000;
  border-radius: 8px;
  min-height: 10rem;
  overflow: hidden;
}

.video video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 70vh;
  background: #000;
  object-fit: contain;
}

.remote .video { min-height: 18rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding-bottom: 0.6rem;
}

.talk-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.4rem;
  font-weight: 700;
}

.talk-mode-label {
  font-size: 0.92rem;
  line-height: 1.1;
  color: #6d675e;
  user-select: none;
}

.talk-mode:has(.talk-switch[aria-checked="false"]) .talk-mode-hands,
.talk-mode:has(.talk-switch[aria-checked="true"]) .talk-mode-ptt {
  color: #1f4b3a;
}

.talk-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
  padding: 0;
  border: 2px solid #1f4b3a;
  border-radius: 999px;
  background: #e6e0d6;
  cursor: pointer;
}

.talk-switch:focus-visible {
  outline: 2px solid #1f4b3a;
  outline-offset: 2px;
}

.talk-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1f4b3a;
}

.talk-switch[aria-checked="true"] {
  background: #1f4b3a;
}

.talk-switch[aria-checked="true"] .talk-switch-thumb {
  background: #fff;
  transform: translateX(20px);
}

.top-actions { display: flex; gap: 0.6rem; align-items: center; }

.admin-link { color: #1f4b3a; font-weight: 700; }

.slot, .rec, .placeholder { color: #6d675e; }

.choice-set {
  display: flex;
  flex: 1 1 18rem;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-set legend {
  padding: 0;
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.1rem;
  padding: 0.45rem 0.9rem;
  border: 2px solid #1f4b3a;
  border-radius: 999px;
  background: #fff;
  color: #1c1915;
  font-weight: 700;
  cursor: pointer;
}

.chip input {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  accent-color: #1f4b3a;
}

#ptt.live, #ptt[aria-pressed="true"] { background: #8a2b2b; }

.pause, .warn {
  margin: 0.4rem 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-weight: 700;
}

.pause { background: #f3d6d0; color: #6d1d1d; }

.warn { background: #f6e7c1; color: #6a4b10; }

.rec.on {
  color: #fff;
  background: #9b1c1c;
  border-style: solid;
  border-color: #9b1c1c;
}

body.call[data-role="classroom"] #ptt {
  font-size: 1.7rem;
  min-height: 5.5rem;
  min-width: min(100%, 24rem);
  padding: 1.1rem 1.4rem;
}

body.call[data-role="classroom"] #caption-panel,
body.call[data-role="classroom"] .cap-text,
body.call[data-role="classroom"] .cap-lang,
body.call[data-role="classroom"] .choice-set {
  font-size: 2rem;
  line-height: 1.35;
}

body.call[data-role="classroom"] .chip {
  min-height: 4.2rem;
  padding: 0.7rem 1.1rem;
}

body.call[data-role="classroom"] .chip input {
  width: 1.7rem;
  height: 1.7rem;
}

.rec {
  border: 1px dashed #b7ad9e;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

.bar {
  min-height: 44px;
  padding: 0.55rem 1rem;
  font-weight: 700;
}

.transcript-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.confirm {
  flex-basis: 100%;
  border: 2px solid #1f4b3a;
  border-radius: 12px;
  padding: 0.75rem;
  background: #fff8ee;
}

body.call[data-role="classroom"] .bar {
  min-height: 60px;
  font-size: 1.35rem;
  padding: 0.75rem 1.1rem;
}

.transcript-controls {
  margin: 0 1rem 0.6rem;
  background: #fff;
  border: 1px solid #c9c0b2;
  border-radius: 12px;
  padding: 0.75rem 1rem 0.35rem;
}

body.call[data-role="classroom"] .transcript-controls {
  font-size: 1.35rem;
}

.voice-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.voice-picker label {
  margin: 0;
  font-weight: 700;
}

#interpreter-voice {
  flex: 1 1 12rem;
  width: auto;
  min-height: 44px;
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 2px solid #1f4b3a;
  border-radius: 10px;
  background: #fff;
  color: #1c1915;
}

#interpreter-voice option:disabled {
  color: #6d675e;
}

.voice-status {
  flex-basis: 100%;
  margin: 0;
  color: #1f4b3a;
  font-weight: 700;
}

body.call[data-role="classroom"] #interpreter-voice {
  min-height: 60px;
  font-size: 1.35rem;
}

.paste-box {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.paste-hint { margin: 0; font-weight: 700; }

#paste-script,
#paste-text {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 2px solid #1f4b3a;
  border-radius: 10px;
  background: #fff;
  color: #1c1915;
}

#paste-script { min-height: 44px; }
#paste-text { min-height: 6rem; }

body.call[data-role="classroom"] #paste-script,
body.call[data-role="classroom"] #paste-text {
  min-height: 60px;
  font-size: 1.35rem;
}

.cap-typed {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #6a4b10;
  background: #f6e7c1;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-bottom: 0.2rem;
}

#caption-panel {
  margin: 0 1rem 1rem;
  background: #fff;
  border: 1px dashed #c9c0b2;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  min-height: 6rem;
  max-height: 46vh;
  overflow: auto;
}

.caption { margin: 0.55rem 0; }

.cap-tag,
.cap-lang {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f4b3a;
}

.cap-tag { display: block; font-size: 0.75em; }

.cap-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.15rem 0;
}

.caption[data-final="false"] .cap-text { opacity: 0.72; }

.admin-main {
  width: min(52rem, 100%);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.admin-main section {
  background: #fff;
  border: 1px solid #ddd4c6;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
}

.admin-main table { width: 100%; border-collapse: collapse; }

.admin-main th, .admin-main td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #eee6da;
  vertical-align: top;
}

.admin-main input[type="text"],
.admin-main input[type="number"],
.admin-main input[type="date"],
.admin-main select,
.admin-main textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #c9c0b2;
  border-radius: 8px;
  margin-bottom: 0.7rem;
}

.note { color: #6d675e; }

#caption-panel h2 { margin: 0 0 0.3rem; font-size: 1.15rem; }

@media (max-width: 800px) {
  .stage { grid-template-columns: 1fr; }
  .remote .video { min-height: 14rem; }
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
  padding: 0.5rem 1rem;
}

.meet-tile {
  background: #111;
  color: #f5f1ea;
  border-radius: 12px;
  padding: 0.6rem;
  min-height: 10rem;
}

.meet-tile h2 { margin: 0 0 0.35rem; font-size: 0.95rem; }

.meet-tile.speaking { outline: 3px solid #2f7d57; }

.meet-tile.muted h2 { opacity: 0.7; }

.meet-muted, .meet-kind, .meet-badge {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #1f4b3a;
  background: #e7f2ec;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.meet-kind { color: #fff; background: #1f4b3a; }

.filmstrip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.4rem 1rem;
}

.filmstrip .meet-tile { width: 16rem; flex: 0 0 auto; }

.spotlight {
  margin: 0.4rem 1rem;
  min-height: 16rem;
}

.spotlight .meet-tile .video { min-height: 18rem; }

.meet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 0.75rem;
  padding: 0 1rem 1rem;
}

.meet-side section {
  background: #fff;
  border: 1px solid #ddd4c6;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
}

#people { list-style: none; margin: 0; padding: 0; }

#people li { margin: 0.35rem 0; }

.meeting select,
.meetings-lobby input[type="text"],
.meeting input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #c9c0b2;
  border-radius: 8px;
  margin-bottom: 0.7rem;
  font: inherit;
}

.meet-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem 0;
  overflow-x: auto;
}

.meet-tab {
  border: 1px solid #c9c0b2;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
}

.meet-tab[aria-selected="true"] {
  background: #1f4b3a;
  color: #fff;
  border-color: #1f4b3a;
}

.tile-lines {
  border: 0;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tile-lines legend { font-size: 0.75rem; margin-right: 0.3rem; }

.tile-transcript {
  margin-top: 0.45rem;
  background: #1c1c1c;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  min-height: 2.4rem;
  font-size: 0.85rem;
}

.tile-line { margin: 0.2rem 0; }

.tile-empty { margin: 0; color: #b7b1a6; }

#local-preview {
  width: 100%;
  max-height: 16rem;
  background: #111;
  border-radius: 12px;
  margin-bottom: 0.7rem;
}

#mic-meter {
  height: 0.7rem;
  background: #e6e0d6;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.2rem 0 0.8rem;
}

#mic-meter-bar {
  display: block;
  height: 100%;
  width: 0;
  background: #2f7d57;
}

@media (max-width: 800px) {
  .meet-layout { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
}
