.tool-overlay-thought_courtroom {
  padding: 0;
  place-items: stretch;
}

.tool-overlay-thought_courtroom .tool-panel {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  background: #14110f;
  border-color: #2f2318;
}

.tool-overlay-thought_courtroom .tool-panel-header {
  padding: 8px 12px;
}

.tool-overlay-thought_courtroom .tool-panel-header p {
  margin-bottom: 1px;
  font-size: 7px;
  letter-spacing: .06em;
}

.tool-overlay-thought_courtroom .tool-panel-header h2 {
  font-size: 16px;
  line-height: 1.05;
}

.tool-overlay-thought_courtroom .tool-panel-header small {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.2;
}

.tool-overlay-thought_courtroom .tool-panel-body {
  padding: 0;
  overflow: hidden;
}

.thought-courtroom-app {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  color: #f7efe4;
  background:
    linear-gradient(180deg, rgba(8,6,5,.18), rgba(8,6,5,.55)),
    radial-gradient(circle at top, rgba(255,212,138,.16), transparent 38%);
}

.thought-courtroom-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.thought-courtroom-scoreboard {
  display: grid;
  grid-template-columns: auto minmax(84px, 280px) auto;
  gap: 6px;
  align-items: center;
}

.thought-courtroom-score {
  min-width: 0;
  padding: 5px 7px;
  display: flex;
  gap: 5px;
  align-items: baseline;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.thought-courtroom-score small {
  color: rgba(255,255,255,.7);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.thought-courtroom-score strong {
  font: 850 14px/1 Arial,Helvetica,sans-serif;
  color: white;
}

.thought-courtroom-score.opposition {
  background: linear-gradient(180deg, rgba(133,33,29,.95), rgba(76,17,15,.9));
}

.thought-courtroom-score.defender {
  background: linear-gradient(180deg, rgba(28,64,127,.95), rgba(16,39,84,.9));
}

.thought-courtroom-meter {
  display: grid;
}

.thought-courtroom-meter-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--opp, 50%) var(--def, 50%);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.thought-courtroom-meter-track span {
  display: block;
}

.thought-courtroom-meter-track .opposition {
  background: linear-gradient(90deg, #b03a32, #7e1815);
}

.thought-courtroom-meter-track .defender {
  background: linear-gradient(90deg, #4775d1, #183b7a);
}

.thought-courtroom-meter-labels {
  display: none;
}

.thought-courtroom-timer {
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 999px;
  color: white;
  background: rgba(255,255,255,.08);
  text-align: center;
  font: 800 12px/1 Arial,Helvetica,sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}

.thought-courtroom-timer.is-urgent {
  color: #ffd2c9;
  background: rgba(150,38,32,.24);
}

.thought-courtroom-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background-color: #20150f;
  background-position: center top;
  background-size: cover;
  box-shadow: 0 26px 70px rgba(0,0,0,.34);
}

.thought-courtroom-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13,9,7,.18) 0%, rgba(13,9,7,.38) 38%, rgba(13,9,7,.66) 100%),
    radial-gradient(circle at 50% 20%, rgba(255,226,170,.12), transparent 38%);
  pointer-events: none;
}

.thought-courtroom-case-card,
.thought-courtroom-final-card,
.thought-courtroom-compose-card {
  position: relative;
  z-index: 1;
  margin: 8px;
}

.thought-courtroom-case-card,
.thought-courtroom-compose-card,
.thought-courtroom-final-card {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 16px 40px rgba(0,0,0,.18);
}

.thought-courtroom-case-card {
  display: grid;
  gap: 10px;
  align-self: start;
}

.thought-courtroom-case-card label,
.thought-courtroom-compose-card label {
  display: grid;
  gap: 5px;
  color: rgba(255,255,255,.92);
  font-size: 10px;
  font-weight: 800;
}

.thought-courtroom-case-card textarea,
.thought-courtroom-compose-card textarea {
  width: 100%;
  min-height: 90px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  color: #2c1f17;
  background: rgba(255,255,255,.95);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  resize: vertical;
}

.thought-courtroom-case-card textarea:focus,
.thought-courtroom-compose-card textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,206,130,.24);
}

.thought-courtroom-case-actions,
.thought-courtroom-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.thought-courtroom-case-actions .button,
.thought-courtroom-compose-actions .button,
.thought-courtroom-final-card .button {
  min-height: 0;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1;
}

.thought-courtroom-transcript {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.thought-courtroom-bubble {
  position: relative;
  max-width: min(78%, 620px);
  padding: 9px 10px 10px;
  border: 1px solid rgba(31,21,15,.18);
  border-radius: 14px;
  color: #251b15;
  background: rgba(255,255,255,.98);
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}

.thought-courtroom-bubble::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 14px;
  height: 14px;
  background: inherit;
  border-bottom: inherit;
  border-right: inherit;
  transform: rotate(45deg);
}

.thought-courtroom-bubble.left {
  justify-self: start;
  border-top-left-radius: 7px;
}

.thought-courtroom-bubble.left::after {
  left: 22px;
  bottom: -7px;
}

.thought-courtroom-bubble.right {
  justify-self: end;
  border-top-right-radius: 7px;
}

.thought-courtroom-bubble.right::after {
  right: 22px;
  bottom: -7px;
}

.thought-courtroom-bubble header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.thought-courtroom-bubble header span {
  padding: 3px 6px;
  border-radius: 999px;
  color: white;
}

.thought-courtroom-bubble.lawyer header span { background: linear-gradient(180deg, #b54a41, #7e1815); }
.thought-courtroom-bubble.defender header span { background: linear-gradient(180deg, #4c7de2, #26438a); }
.thought-courtroom-bubble.critique header span { background: linear-gradient(180deg, #b54a41, #7e1815); }

.thought-courtroom-bubble p {
  margin: 0;
  font: 700 12px/1.3 Arial,Helvetica,sans-serif;
}

.thought-courtroom-case-line {
  padding: 8px 10px;
  border-radius: 10px;
  color: #311f12;
  background: rgba(255,244,229,.96);
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
  font-size: 12px;
  line-height: 1.3;
}

.thought-courtroom-case-line small {
  display: block;
  margin-bottom: 3px;
  color: #80522a;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.thought-courtroom-compose-card {
  display: grid;
  gap: 8px;
}

.thought-courtroom-compose-card textarea {
  min-height: 82px;
}

.thought-courtroom-empty {
  position: relative;
  z-index: 1;
  margin: 16px;
  padding: 18px;
  color: white;
  text-align: center;
}

.thought-courtroom-empty h3 {
  margin: 0 0 8px;
  font: 850 22px/1.1 Arial,Helvetica,sans-serif;
}

.thought-courtroom-empty p {
  margin: 0;
  color: rgba(255,255,255,.82);
}

@media (max-width: 820px) {
  .tool-overlay-thought_courtroom .tool-panel {
    max-height: none;
    border-radius: 0;
  }
  .thought-courtroom-app { min-height: 0; padding: 6px; gap: 6px; }
  .thought-courtroom-topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
  .thought-courtroom-scoreboard { grid-template-columns: auto minmax(56px, 1fr) auto; gap: 4px; }
  .thought-courtroom-score { padding: 4px 5px; }
  .thought-courtroom-score small { font-size: 7px; }
  .thought-courtroom-score strong { font-size: 12px; }
  .thought-courtroom-timer { min-width: 47px; padding: 5px 6px; font-size: 11px; }
  .thought-courtroom-bubble { max-width: 92%; }
  .thought-courtroom-bubble p { font-size: 11px; }
  .thought-courtroom-compose-card textarea { min-height: 74px; }
}
