@font-face {
  font-family: StudioHeaderFlash;
  src: url("/fonts/studio-header-flash.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

.campus-quota {
  margin: 0;
  padding: .65rem clamp(1rem, 4vw, 4rem);
  background: #edf3ed;
  color: #254333;
  font-size: .9rem;
}

#app {
  --mode-ink: #254533;
  --mode-accent: #dafa86;
}

#app[data-mode="pro"] {
  --mode-ink: #323044;
  --mode-accent: #f1d5a4;
}

.studio-modes {
  display: flex;
  gap: 4px;
  min-inline-size: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid #d7ddd0;
  border-radius: 12px;
  background: #f1f3ec;
}

.mode-option {
  position: relative;
  cursor: pointer;
}

.mode-face {
  display: grid;
  grid-template-columns: 19px auto;
  align-items: center;
  gap: 1px 10px;
  min-width: 112px;
  padding: 5px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #535b53;
}

.mode-face strong {
  font: italic 500 21px/1 StudioHeaderFlash, Arial, sans-serif;
}

.mode-pro strong {
  font: 800 21px/1 StudioHeaderPro, Arial, sans-serif;
}

.mode-face small {
  grid-column: 2;
  font-size: 11px;
  line-height: 1.3;
}

.mode-icon {
  grid-row: span 2;
  justify-self: center;
  display: block;
  width: 17px;
  height: 24px;
}

.mode-flash .mode-icon {
  background: currentColor;
  clip-path: polygon(48% 0, 94% 0, 61% 40%, 94% 40%, 15% 100%, 38% 54%, 7% 54%);
}

.mode-pro .mode-icon {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  transform: rotate(45deg);
}

.mode-pro .mode-icon::after {
  content: "";
  display: block;
  height: 100%;
  background: currentColor;
  transform: scale(.43);
}

.mode-option:hover input:enabled + .mode-face {
  border-color: #9daa95;
}

.mode-option input:checked + .mode-face {
  background: var(--mode-ink);
  color: white;
}

.mode-option input:checked + .mode-face .mode-icon,
.mode-option input:checked + .mode-face strong {
  color: var(--mode-accent);
}

.mode-option:focus-within {
  outline: none;
}

.mode-option input:focus-visible + .mode-face {
  outline: 3px solid #54794c;
  outline-offset: 2px;
}

.studio-modes:disabled .mode-option { cursor: default; }
.studio-modes:disabled input:not(:checked) + .mode-face { opacity: .65; }
.send-button { background: var(--mode-ink); }
.send-button span[aria-hidden] { color: var(--mode-accent); }

.composer-footnote { align-items: baseline; flex-wrap: wrap; }
#composer-hint { flex: 1 1 15rem; color: #52624c; font-size: 12px; line-height: 1.55; }
.composer-footnote > span:last-child { margin-inline-start: auto; white-space: nowrap; }

.active-job {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  gap: 2px 8px;
  margin-bottom: 8px;
  padding: 8px 11px;
  border: 1px solid #d9dfd2;
  border-radius: 8px;
  background: #f3f5ef;
  color: var(--mode-ink);
  font-size: 12px;
}

#job-stage { overflow-wrap: anywhere; }
#job-elapsed { font-variant-numeric: tabular-nums; white-space: nowrap; }
#job-wait-note { grid-column: 2 / -1; color: #55614e; }
@media (prefers-reduced-motion: reduce) {
  .active-job::before { animation: none; }
}

@media (min-width: 701px) {
  .workspace {
    grid-template-columns: clamp(27rem, 38vw, 36rem) minmax(0, 1fr);
  }

  /* Leave room to read messages even when warnings or retry actions grow. */
  .conversation-panel {
    display: grid;
    grid-template-rows: auto minmax(15rem, 1fr) auto;
    align-self: start;
    min-width: 0;
    min-height: min-content;
    height: calc(100dvh - 10rem);
  }

  .panel-heading {
    padding-block: 14px 10px;
  }

  .conversation-scroll {
    min-width: 0;
  }

  .composer-wrap {
    min-width: 0;
    padding: 12px 16px;
  }

  .composer textarea {
    height: clamp(6rem, 13dvh, 8rem);
    min-height: 6rem;
    font-size: 14px;
    line-height: 1.6;
  }

  .composer-toolbar {
    align-items: center;
    flex-wrap: wrap;
  }

  .upload-actions {
    flex: 1 1 14rem;
    max-width: none;
  }

  .upload-button {
    font-size: 11px;
  }

  .send-button {
    margin-inline-start: auto;
    font-size: 12px;
  }
}
@media (min-width: 701px) and (max-height: 850px) {
  .app-header {
    height: 68px;
    padding-block: 8px;
  }

  .campus-quota {
    padding-block: 6px;
  }

  .workspace {
    padding-top: 16px;
  }

  .conversation-panel {
    height: calc(100dvh - 8rem);
  }

  .panel-heading {
    padding-block: 12px 8px;
  }

  .composer-wrap {
    padding-block: 10px;
  }
}

@media (min-width: 701px) and (max-width: 959px) {
  .app-header { gap: 12px; }
  .brand-title .brand-pro { display: none; }
  .mode-face { min-width: 92px; padding-inline: 9px; gap: 1px 6px; }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .conversation-panel {
    height: auto;
    grid-template-rows: auto clamp(15rem, 36dvh, 24rem) auto;
  }
}
