:root {
  color-scheme: light;
  --pc-ink: #092238;
  --pc-muted: #52687b;
  --pc-paper: #f6f8fb;
  --pc-card: #ffffff;
  --pc-line: #d9e2ea;
  --pc-deep: #08243c;
  --pc-deep-2: #103b5c;
  --pc-gold: #c88d28;
  --pc-gold-dark: #80560e;
  --pc-focus: #1166b8;
  --pc-success: #0e7149;
  --pc-warn: #a15b00;
  --pc-danger: #ae2634;
  --pc-shadow: 0 12px 32px rgba(9, 34, 56, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pc-native-update { margin: 1rem; padding: 1rem 1.2rem; border: 1px solid #b4c9d8; background: #edf5fa; color: #103d55; border-radius: .8rem; }
.pc-native-update p { margin: .4rem 0; }
.pc-native-update a { display: inline-block; padding: .5rem 0; font-weight: 700; }


/* Professor's working home: separate choices, focused conversation, persistent
   navigation. No remote fonts, invented metrics or decorative loading panels. */
.pc-launcher { padding: 1.1rem clamp(1rem, 3vw, 2rem) 6rem; }
.pc-launcher-heading { max-width: 44rem; margin-bottom: 1.6rem; }
.pc-launcher-heading h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -.045em; line-height: 1.15; margin: .4rem 0 .8rem; }
.pc-launcher-heading p:last-child { color: var(--pc-muted); max-width: 36rem; }
.pc-launcher-options { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1rem; }
.pc-launcher-card { display: flex; gap: 1rem; align-items: flex-start; text-align: left; color: var(--pc-ink); background: white; border: 1px solid var(--pc-line); border-radius: 1.15rem; padding: 1.4rem; min-height: 12rem; text-decoration: none; box-shadow: 0 5px 20px #09223808; }
.pc-launcher-card:hover { border-color: #417598; color: var(--pc-ink); }
.pc-launcher-card strong { display: block; font-size: 1.15rem; margin-bottom: .65rem; line-height: 1.25; }
.pc-launcher-card small { display: block; font-size: .9rem; font-weight: 400; line-height: 1.5; opacity: .85; }
.pc-launcher-card > span:last-child { margin-left: auto; }
.pc-launcher-chat, .pc-launcher-chat:hover { color: white; background: #103d55; border-color: #103d55; }
.pc-launcher-symbol { border: 1px solid currentColor; border-radius: .7rem; width: 2.5rem; height: 2.5rem; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; }
.pc-launcher-section-title { margin: 1.8rem 0 1rem; font-size: 1.1rem; }
.pc-home-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; }
.pc-home-shortcuts button { color: var(--pc-ink); background: #fff; border: 1px solid var(--pc-line); border-radius: .8rem; min-height: 3.4rem; padding: .7rem; font-size: 1rem; text-align: left; }
.pc-home-shortcuts button:hover { background: #e9f2f7; }
.pc-app-dock { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: .4rem; padding: .65rem .8rem calc(.65rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--pc-line); background: #fff; box-shadow: 0 -3px 20px #09223808; }
.pc-app-dock button, .pc-app-dock a { border: 0; border-radius: .7rem; padding: .7rem 1.15rem; background: transparent; color: var(--pc-muted); font: inherit; text-decoration: none; min-height: 44px; }
.pc-app-dock [aria-current="page"] { color: #103d55; background: #e5f0f6; font-weight: 700; }
.pc-mobile-app { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
.pc-mobile-app .pc-release-note { font-size: .8rem; padding: .45rem 1.25rem; margin: 0; background: #e8f0f5; }
.pc-mobile-app .pc-header { box-shadow: none; padding-top: max(.85rem, env(safe-area-inset-top)); }
.pc-mobile-app .pc-conversation-card { border-radius: 1.15rem; box-shadow: none; }
.pc-mobile-app .pc-conversation { min-height: 14rem; max-height: 45dvh; }
.pc-mobile-app .pc-thread-toolbar p, .pc-mobile-app .pc-thread-toolbar .pc-eyebrow { display: none; }
.pc-mobile-app .pc-compose-tools { display: flex; flex-wrap: wrap; gap: .5rem; }
.pc-mobile-app .pc-compose-tools .pc-file-button { min-height: 44px; display: inline-flex; align-items: center; }
.pc-mobile-app .pc-mobile-footer { margin-bottom: 1rem; }
@media(max-width: 760px) {
 .pc-launcher-options { grid-template-columns: 1fr; gap: .8rem; }
 .pc-launcher-card { min-height: 0; padding: 1.2rem; align-items: center; }
 .pc-launcher-card strong { margin-bottom: .35rem; }
 .pc-home-shortcuts { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .pc-app-dock > * { flex: 1; text-align: center; padding: .65rem .3rem !important; font-size: .9rem !important; }
 .pc-mobile-workspace { padding: .85rem 1rem; }
 .pc-mobile-app .pc-thread-toolbar { margin: 0 0 1rem; gap: .5rem; flex-wrap: wrap; }
 .pc-mobile-app .pc-thread-toolbar h2 { font-size: 1.2rem; }
}

/* Do not let a general layout rule accidentally reveal an access, recovery or
   editor panel that JavaScript has deliberately hidden. */
[hidden] { display: none !important; }
[inert] { pointer-events: none; user-select: none; }

* { box-sizing: border-box; }

html { min-height: 100%; overflow-x: hidden; background: var(--pc-paper); }

body {
  /* A minimum viewport width creates a second horizontal scrollbar once a
     mobile browser reserves space for its vertical scrollbar.  Controls
     remain responsive through their own minmax rules instead. */
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--pc-ink);
  background: linear-gradient(180deg, #eef4f8 0, var(--pc-paper) 20rem);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
textarea { font: inherit; }

button,
a,
input,
textarea,
summary { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: 0.62; }

a { color: #075ca8; text-underline-offset: 0.16em; }

a:hover { color: #003f79; }

:focus-visible {
  outline: 3px solid var(--pc-focus);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pc-skip-link {
  position: absolute;
  z-index: 3;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.85rem;
  color: #fff;
  background: var(--pc-deep);
  border-radius: 0.45rem;
  transform: translateY(-150%);
}

.pc-skip-link:focus { transform: translateY(0); }

.pc-app { min-height: 100vh; }

.pc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: max(0.85rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 2.25rem) 0.85rem;
  color: #fff;
  background: linear-gradient(120deg, var(--pc-deep), var(--pc-deep-2));
  border-bottom: 3px solid var(--pc-gold);
}

.pc-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.pc-mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--pc-deep);
  background: #f7e4b6;
  border-radius: 0.7rem;
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 800;
}

.pc-brand strong,
.pc-brand small { display: block; }

.pc-brand strong {
  overflow: hidden;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-brand small { color: #d8e7f1; font-size: 0.75rem; }

.pc-header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

/* Session-only controls must not look actionable before a Professor account
   exists in this browser.  The workspace activates them after session check. */
body:not([data-professor-ready="true"]) #desktopLogoutBtn,
body:not([data-professor-ready="true"]) #mobileLogoutBtn { display: none; }

.pc-status,
.pc-voice-state {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.28rem 0.58rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #d8e7f1;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pc-status[data-tone="ok"],
.pc-voice-state[data-tone="ready"] { color: #9ce1c4; }

.pc-status[data-tone="error"],
.pc-voice-state[data-tone="error"] { color: #ffc0c5; }

.pc-voice-state[data-tone="active"] { color: #ffe4a0; }

.pc-apk-button,
.pc-mode-link {
  min-height: 2.3rem;
  padding: 0.45rem 0.66rem;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 0.48rem;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.pc-apk-button { background: rgba(200, 141, 40, 0.2); }

.pc-apk-button:hover,
.pc-mode-link:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }

.pc-release-note {
  max-width: 92rem;
  margin: 0 auto;
  padding: 0.45rem clamp(1rem, 4vw, 2.25rem);
  color: #5c430c;
  background: #fff2cf;
  border-bottom: 1px solid #e5cc8e;
  font-size: 0.86rem;
  font-weight: 650;
}

.pc-access-shell {
  display: grid;
  min-height: calc(100vh - 9rem);
  place-items: start center;
  padding: clamp(1rem, 5vw, 4rem) 1rem;
}

.pc-access-card {
  width: min(100%, 40rem);
  padding: clamp(1.15rem, 5vw, 2.25rem);
  background: var(--pc-card);
  border: 1px solid var(--pc-line);
  border-radius: 1rem;
  box-shadow: var(--pc-shadow);
}

.pc-access-intro { margin-bottom: 1.25rem; }

.pc-access-intro h1,
.pc-mobile-greeting h1,
.pc-greeting h1,
.pc-view-head h2,
.pc-card h2,
.pc-card h3 { margin: 0; line-height: 1.18; }

.pc-access-intro p:last-child,
.pc-mobile-greeting p:last-child,
.pc-greeting p:last-child { color: var(--pc-muted); }

.pc-eyebrow {
  margin: 0 0 0.38rem;
  color: var(--pc-gold-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pc-form { display: grid; gap: 0.92rem; }

.pc-form label { display: grid; gap: 0.35rem; color: var(--pc-ink); font-weight: 700; }

.pc-form input,
.pc-form textarea,
.pc-chat-form textarea {
  width: 100%;
  padding: 0.68rem 0.72rem;
  color: var(--pc-ink);
  background: #fff;
  border: 1px solid #afbecb;
  border-radius: 0.5rem;
  line-height: 1.4;
}

.pc-form textarea,
.pc-chat-form textarea { resize: vertical; }

.pc-form input:focus,
.pc-form textarea:focus,
.pc-chat-form textarea:focus { border-color: var(--pc-focus); }

.pc-form-compact { margin-top: 0.8rem; }

.pc-invite-help {
  margin-top: 1rem;
  padding: 0.8rem;
  background: #f4f8fb;
  border: 1px solid var(--pc-line);
  border-radius: 0.62rem;
}

.pc-invite-help summary { cursor: pointer; color: #124b78; font-weight: 750; }

.pc-invite-help p { margin: 0.7rem 0 0; color: var(--pc-muted); }

.pc-workspace { width: min(100%, 92rem); margin: 0 auto; padding: clamp(1rem, 4vw, 2.25rem); }

.pc-mobile-home { display: grid; gap: 1rem; }

.pc-mobile-greeting { padding: 0.5rem 0.1rem; }

.pc-release-card,
.pc-card {
  background: var(--pc-card);
  border: 1px solid var(--pc-line);
  border-radius: 0.92rem;
  box-shadow: 0 6px 18px rgba(9, 34, 56, 0.06);
}

.pc-release-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-left: 4px solid var(--pc-gold);
}

.pc-release-card h2 { font-size: 1.05rem; }

.pc-release-card p:last-child { margin: 0.45rem 0 0; color: var(--pc-muted); }

.pc-thread-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem;
  color: #edf5fb;
  background:
    radial-gradient(circle at 88% 12%, rgba(200, 141, 40, 0.38), transparent 28%),
    linear-gradient(135deg, #0a2c48, #164c6f);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 0.92rem;
  box-shadow: 0 12px 30px rgba(9, 34, 56, 0.16);
}

.pc-thread-toolbar .pc-eyebrow { color: #f3d897; }
.pc-thread-toolbar h2 { margin: 0; font-size: clamp(1.05rem, 4vw, 1.35rem); }
.pc-thread-toolbar p:last-child { margin: 0.3rem 0 0; color: #d6e7f1; font-size: 0.88rem; }
.pc-thread-toolbar-actions,
.pc-view-actions,
.pc-sidebar-workspaces-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pc-thread-toolbar-actions { margin-left: auto; }

.pc-thread-drawer {
  display: grid;
  gap: 0.72rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #bcd0df;
  border-radius: 0.85rem;
  box-shadow: var(--pc-shadow);
}

.pc-thread-drawer input,
.pc-sidebar-workspaces input {
  width: 100%;
  min-height: 2.45rem;
  padding: 0.55rem 0.65rem;
  color: var(--pc-ink);
  background: #f9fcfe;
  border: 1px solid #aec5d5;
  border-radius: 0.48rem;
}

.pc-thread-list { display: grid; max-height: 21rem; gap: 0.42rem; overflow: auto; padding-right: 0.12rem; }

.pc-thread-item {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  color: #21435b;
  text-align: left;
  background: #f6fafd;
  border: 1px solid #d3e1ea;
  border-radius: 0.55rem;
}

.pc-thread-item:hover { background: #eaf4fa; border-color: #91b5cb; }
.pc-thread-item.active { color: #fff; background: var(--pc-deep-2); border-color: var(--pc-deep-2); box-shadow: 0 5px 14px rgba(8, 59, 92, 0.22); }
.pc-thread-item small { color: inherit; opacity: 0.76; font-size: 0.75rem; }
.pc-thread-item em { color: inherit; opacity: 0.82; font-size: 0.72rem; font-style: normal; font-weight: 750; }
.pc-thread-title { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }

.pc-card { padding: clamp(0.95rem, 3vw, 1.35rem); }

.pc-card > p:first-child { margin-top: 0; }

.pc-card-head,
.pc-view-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.pc-card-head { margin-bottom: 0.9rem; }

.pc-card-head h2 { font-size: clamp(1.18rem, 4vw, 1.48rem); }

.pc-card-head h3 { font-size: 1.18rem; }

.pc-conversation-card { overflow: clip; }

.pc-conversation {
  display: grid;
  max-height: 31rem;
  min-height: 7.5rem;
  gap: 0.75rem;
  overflow: auto;
  padding: 0.15rem 0.1rem 0.25rem;
  scroll-behavior: smooth;
}

.pc-message {
  width: fit-content;
  max-width: min(92%, 52rem);
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--pc-line);
  border-radius: 0.76rem;
  overflow-wrap: anywhere;
}

.pc-message-benji { background: #f4f8fb; border-top-left-radius: 0.12rem; }

.pc-message-user { justify-self: end; color: #fff; background: var(--pc-deep-2); border-color: var(--pc-deep-2); border-top-right-radius: 0.12rem; }

.pc-message p { margin: 0.35rem 0; }

/* Voice status is also shown inside a white workspace card.  Keep the state
   legible there instead of inheriting the header's pale text colours. */
.pc-card .pc-voice-state { color: #174e73; background: #e9f4fb; border-color: #84b5d4; }
.pc-card .pc-voice-state[data-tone="ready"] { color: #0d6546; background: #eaf8f1; border-color: #87c9a8; }
.pc-card .pc-voice-state[data-tone="active"] { color: #855100; background: #fff3d3; border-color: #e1b75e; }
.pc-card .pc-voice-state[data-tone="error"] { color: #941f31; background: #fff0f2; border-color: #e5a0aa; }

.pc-message.is-pending { opacity: 0.72; }
.pc-message.is-unsent { border: 2px solid #b95a19; background: #fff3df; color: #4f2606; }
.pc-message.is-unsent .pc-message-time { opacity: 0.85; }
.pc-message.is-delivery-uncertain { border: 2px solid #8a5a08; background: #fff9e9; color: #473104; }
.pc-delivery-uncertain { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed rgba(120, 82, 4, 0.45); }
.pc-delivery-uncertain-text { flex: 1 1 14rem; font-weight: 700; }
.pc-retry-message { margin-top: 0.35rem; color: inherit; }
.pc-pending-message { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed rgba(22, 78, 119, 0.36); }
.pc-pending-message-text { flex: 1 1 14rem; font-weight: 700; }
.pc-resume-message { white-space: nowrap; }

.pc-message-evidence { margin-top: 0.65rem; color: #20445f; }
.pc-message-evidence summary { cursor: pointer; font-size: 0.82rem; font-weight: 800; }
.pc-message-evidence-body { display: grid; gap: 0.55rem; margin-top: 0.55rem; padding: 0.65rem; color: var(--pc-ink); background: #fffdf7; border: 1px solid #e5d8b7; border-radius: 0.55rem; }
.pc-file-attachment { gap: 0.35rem; }
.pc-file-preview { width: min(100%, 20rem); max-height: 16rem; margin-top: 0.35rem; object-fit: cover; border: 1px solid rgba(255,255,255,0.5); border-radius: 0.55rem; background: #071e30; }
.pc-generated-concept { background: linear-gradient(145deg, #133e5a, #0b2438); color: #f9fbff; }
.pc-generated-concept .pc-message-author { color: #eac46d; }
.pc-generated-concept-preview { width: min(100%, 42rem); display: block; margin-top: 0.7rem; border-radius: 0.7rem; border: 1px solid rgba(255,255,255,0.32); background: #061726; }
.pc-stored-attachment { margin: 0.7rem 0 0; max-width: min(100%, 31rem); }
.pc-stored-attachment img { display: block; width: 100%; max-height: 24rem; object-fit: contain; background: #071b2b; border: 1px solid rgba(255,255,255,0.28); border-radius: 0.65rem; }
.pc-attachment-caption { display: block; margin-top: 0.3rem; font-size: 0.74rem; opacity: 0.82; }
.pc-inline-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.45rem; }
.pc-library-inspector { width: min(92vw, 58rem); max-height: min(84dvh, 54rem); overflow: auto; color: var(--pc-ink); background: #fbfdff; border: 1px solid #9db4c9; border-radius: 0.9rem; box-shadow: 0 1.2rem 4rem rgba(4, 27, 47, 0.36); padding: 1rem; }
.pc-library-inspector::backdrop { background: rgba(2, 18, 31, 0.64); }
.pc-library-inspector-image { display: block; width: min(100%, 46rem); max-height: 62dvh; object-fit: contain; margin: 1rem auto; border-radius: 0.65rem; background: #061726; }
.pc-library-inspector-text { max-height: 50dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 0.8rem; color: #102a43; background: #f0f5f8; border-radius: 0.6rem; }
.pc-list-item.is-selected { border-color: #5d8eb9; background: #edf6fc; box-shadow: inset 0 0 0 1px rgba(17, 102, 184, 0.12); }
.pc-editor-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; margin: 1rem 0; }
.pc-editor-comparison section { min-width: 0; padding: 0.82rem; background: #f0f5f8; border: 1px solid #d7e2ec; border-radius: 0.65rem; }
.pc-editor-comparison pre { max-height: 46dvh; margin: 0.62rem 0 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 0.86rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
@media (max-width: 680px) { .pc-editor-comparison { grid-template-columns: 1fr; } }

.pc-message-author { display: block; font-size: 0.73rem; letter-spacing: 0.08em; }

.pc-message-time { display: block; color: inherit; opacity: 0.72; font-size: 0.72rem; }

.pc-source-panel {
  display: grid;
  gap: 0.7rem;
  margin: 0.9rem 0;
  padding: 0.85rem;
  background: #fcf8ed;
  border: 1px solid #e7d7a7;
  border-radius: 0.7rem;
}

.pc-source-panel:empty { display: none; }

.pc-source-head { display: grid; gap: 0.2rem; }

.pc-source-head > strong { color: #583d05; }

.pc-verification { margin: 0.15rem 0; color: #583d05; font-size: 0.84rem; font-weight: 800; }

.pc-verification[data-status="verified"] { color: var(--pc-success); }

.pc-verification[data-status="verification_unavailable"],
.pc-verification[data-status="response_unavailable"] { color: var(--pc-danger); }

.pc-source-card {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e8dfc6;
  border-radius: 0.6rem;
}

.pc-source-card strong,
.pc-source-card small,
.pc-source-card a,
.pc-source-provider {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pc-source-card p { margin: 0; color: #40576a; }

.pc-source-card a { width: fit-content; font-weight: 700; }
.pc-source-provider { color: var(--pc-muted); font-size: 0.76rem; }

.pc-source-warning { margin: 0; color: #7d4500; font-weight: 650; }

.pc-map-card {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.2rem;
  padding: 0.72rem;
  background: #f1f8f4;
  border: 1px solid #b8d9c3;
  border-radius: 0.55rem;
}

.pc-map-card p { color: #365747; font-size: 0.86rem; }

.pc-map-frame {
  width: 100%;
  min-height: 13rem;
  border: 1px solid #7fa28b;
  border-radius: 0.42rem;
  background: #e8f0eb;
}

.pc-chat-form { display: grid; gap: 0.75rem; margin-top: 0.7rem; }
.pc-chat-form.is-readonly { opacity: 0.68; }
.pc-chat-form.is-readonly .pc-compose-tools > label { pointer-events: none; }
.pc-archived-thread-action { display: grid; gap: 0.55rem; margin-top: 0.75rem; padding: 0.85rem; border: 1px solid #e3c370; background: #fff8e4; border-radius: 0.65rem; }
.pc-archived-thread-action p { margin: 0; color: #5f4308; font-weight: 700; }

.pc-compose-tools,
.pc-mobile-actions,
.pc-chat-actions,
.pc-listen-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.62rem;
}

.pc-mobile-actions > .pc-btn { flex: 1 1 11rem; }

.pc-chat-actions > .pc-btn { flex: 1 1 11rem; }

.pc-lane-selector {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  background: #edf3f7;
  border: 1px solid #cedbe5;
  border-radius: 0.54rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.pc-lane-btn {
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  color: #294a63;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.38rem;
}

.pc-lane-btn.active { color: #fff; background: var(--pc-deep-2); border-color: var(--pc-deep-2); }

.pc-file-button {
  min-height: 2.45rem;
  padding: 0.52rem 0.7rem;
  color: #124b78;
  background: #edf5fb;
  border: 1px solid #aac7dc;
  border-radius: 0.48rem;
  font-weight: 750;
  cursor: pointer;
}

.pc-btn {
  min-height: 2.65rem;
  padding: 0.58rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-weight: 800;
  line-height: 1.25;
}

.pc-btn-primary { color: #fff; background: var(--pc-deep-2); border-color: var(--pc-deep-2); }

.pc-btn-primary:hover { background: #082c49; }

.pc-btn-secondary { color: #123f61; background: #eef5f9; border-color: #abc5d6; }

.pc-btn-secondary:hover { background: #deedf5; }

.pc-btn-voice { color: #5d3500; background: #fff1d0; border-color: #ddb260; }

.pc-btn-voice.is-recording { color: #fff; background: #ae2634; border-color: #ae2634; animation: pc-pulse 1.2s ease-in-out infinite; }

.pc-btn-xl { min-height: 3.1rem; }

.pc-btn-large { min-height: 3rem; }

.pc-text-btn {
  min-height: 2.3rem;
  padding: 0.35rem 0.35rem;
  color: #075ca8;
  background: transparent;
  border: 0;
  border-radius: 0.38rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.pc-text-btn:hover { color: #003f79; background: #e9f3fa; }

.pc-hint,
.pc-notice { margin: 0; font-size: 0.88rem; }

.pc-hint { color: var(--pc-muted); }

.pc-notice { min-height: 1.25rem; color: var(--pc-success); font-weight: 700; }

.pc-notice[data-tone="error"] { color: var(--pc-danger); }

.pc-voice-attachment {
  display: grid;
  gap: 0.62rem;
  padding: 0.72rem;
  color: #294a63;
  background: #eff7fb;
  border: 1px solid #aac7dc;
  border-radius: 0.62rem;
}

.pc-voice-attachment > strong { color: var(--pc-ink); }

.pc-voice-attachment > p { margin: 0; font-size: 0.86rem; }

.pc-voice-audio { width: 100%; min-height: 2.4rem; }

.pc-voice-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52rem;
}

.pc-listen-row { color: #335166; font-size: 0.88rem; }

.pc-listen-row label,
.pc-check-row { display: inline-flex !important; align-items: center; gap: 0.45rem; }

.pc-listen-row input,
.pc-check-row input { width: 1.1rem; height: 1.1rem; }

.pc-mobile-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.72rem; }

.pc-quick-tile {
  display: grid;
  min-height: 8rem;
  gap: 0.3rem;
  padding: 0.8rem;
  color: var(--pc-ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--pc-line);
  border-radius: 0.7rem;
}

.pc-quick-tile:hover { background: #f1f7fa; border-color: #95b6ca; }

.pc-quick-tile > span { color: var(--pc-gold-dark); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }

.pc-quick-tile small { color: var(--pc-muted); }

.pc-mobile-panel { margin-top: 0.25rem; }

.pc-icon-btn {
  display: inline-grid;
  width: 2.3rem;
  height: 2.3rem;
  flex: 0 0 auto;
  place-items: center;
  color: #22435a;
  background: #edf3f7;
  border: 1px solid #c7d7e1;
  border-radius: 50%;
  font-size: 1.35rem;
}

.pc-mobile-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 1rem 0 env(safe-area-inset-bottom);
}

/* The authenticated phone Companion is a bounded conversation surface: the
 * transcript is the only scrolling region and the composer remains visible.
 * Access and onboarding deliberately keep the regular document flow. */
body[data-mode="mobile"][data-professor-ready="true"] {
  height: 100dvh;
  overflow: hidden;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-app.pc-mobile-app {
  display: flex;
  height: 100dvh;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-header,
body[data-mode="mobile"][data-professor-ready="true"] .pc-release-note {
  flex: 0 0 auto;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-workspace {
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-home {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-greeting,
body[data-mode="mobile"][data-professor-ready="true"] .pc-release-card,
body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-footer {
  display: none;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-home {
  display: flex;
  flex-direction: column;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0.65rem clamp(0.76rem, 3vw, 1.15rem);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar p:last-child { display: none; }

body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-drawer {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(78dvh, 38rem);
  overflow: auto;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -1rem 3rem rgba(5, 26, 43, 0.26);
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-quick-grid {
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.5rem 0.72rem;
  background: #f5f9fc;
  border-top: 1px solid var(--pc-line);
  border-bottom: 1px solid var(--pc-line);
  scrollbar-width: thin;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-quick-tile {
  display: inline-flex;
  min-width: max-content;
  min-height: 2.45rem;
  align-items: center;
  padding: 0.42rem 0.65rem;
  color: #123f61;
  background: #fff;
  border-color: #c9d9e4;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-quick-tile > span,
body[data-mode="mobile"][data-professor-ready="true"] .pc-quick-tile small { display: none; }

body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-panel {
  position: fixed;
  z-index: 28;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(76dvh, 40rem);
  overflow: auto;
  padding: 0.7rem;
  background: rgba(6, 25, 42, 0.38);
  backdrop-filter: blur(4px);
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-panel > .pc-card {
  margin: 0;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -1rem 3rem rgba(5, 26, 43, 0.25);
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation-card {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0;
  overflow: hidden;
  padding: 0.78rem clamp(0.76rem, 3vw, 1.15rem) max(0.78rem, env(safe-area-inset-bottom));
  background: var(--pc-paper);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  flex: 1 1 auto;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation {
  max-height: none;
  min-height: 0;
  overscroll-behavior: contain;
  padding: 0.18rem 0.1rem 0.86rem;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-source-panel {
  max-height: min(22dvh, 12rem);
  overflow: auto;
  overscroll-behavior: contain;
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 0;
  padding-top: 0.75rem;
  background: var(--pc-paper);
  border-top: 1px solid var(--pc-line);
  box-shadow: 0 -0.6rem 1rem rgba(246, 248, 251, 0.96);
}

body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form textarea {
  min-height: 3.15rem;
  max-height: 17dvh;
}

.pc-sidebar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--pc-deep);
  border-radius: 0.9rem;
}

.pc-sidebar-workspaces {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 0.7rem;
}

.pc-sidebar-workspaces .pc-eyebrow { margin: 0; color: #f3d897; }
.pc-sidebar-workspaces .pc-icon-btn { color: #fff; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.28); }
.pc-sidebar-workspaces input { color: #e7f2f8; background: rgba(5,28,46,0.36); border-color: rgba(255,255,255,0.22); }
.pc-sidebar-workspaces input::placeholder { color: #c7dbe7; }
.pc-sidebar-workspaces .pc-thread-list { max-height: 18rem; }
.pc-sidebar-workspaces .pc-thread-item { color: #e8f3f9; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.13); }
.pc-sidebar-workspaces .pc-thread-item:hover { background: rgba(255,255,255,0.17); border-color: rgba(255,255,255,0.28); }
.pc-sidebar-workspaces .pc-thread-item.active { color: #08243c; background: #f3d897; border-color: #f3d897; }

.pc-greeting { color: #fff; }

.pc-greeting .pc-eyebrow { color: #f3d897; }

.pc-greeting p:last-child { color: #d3e1eb; }

.pc-nav { display: grid; gap: 0.42rem; }

.pc-nav button {
  min-height: 2.65rem;
  padding: 0.6rem 0.72rem;
  color: #e4eef4;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.48rem;
  font-weight: 750;
}

.pc-nav button:hover,
.pc-nav button.active { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.22); }

.pc-mobile-link { color: #f3d897; font-weight: 750; }

.pc-main { min-width: 0; }

.pc-view { display: none; }

.pc-view.active { display: grid; gap: 1rem; }

.pc-view-head { align-items: end; }

.pc-subtle { color: var(--pc-muted); font-size: 0.88rem; }

.pc-grid-2 { display: grid; gap: 1rem; }

.pc-list { display: grid; gap: 0.55rem; }

.pc-list-item {
  display: grid;
  gap: 0.16rem;
  padding: 0.68rem 0;
  border-bottom: 1px solid #e3ebf0;
}

.pc-list-item:last-child { border-bottom: 0; }

.pc-list-item-action { cursor: pointer; border-radius: 0.46rem; }
.pc-list-item-action:hover { background: #edf6fb; }

.pc-list-item small { color: var(--pc-muted); overflow-wrap: anywhere; }

.pc-empty { margin: 0; color: var(--pc-muted); font-style: italic; }

@keyframes pc-pulse {
  50% { box-shadow: 0 0 0 0.34rem rgba(174, 38, 52, 0.16); }
}

@media (min-width: 42rem) {
  .pc-release-card { grid-template-columns: 1fr auto; align-items: center; }
  .pc-mobile-actions > .pc-btn { flex: 0 1 auto; }
  .pc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 62rem) {
  body[data-mode="studio"] .pc-workspace { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 1.4rem; align-items: start; }
  body[data-mode="studio"] .pc-sidebar { position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); margin-bottom: 0; overflow: auto; }
  .pc-header { padding-inline: clamp(1.5rem, 5vw, 3.5rem); }
  .pc-release-note { padding-inline: clamp(1.5rem, 5vw, 3.5rem); }
}

@media (max-width: 41.99rem) {
  .pc-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0.72rem;
  }
  .pc-header-tools {
    width: 100%;
    justify-content: flex-start;
  }
  .pc-brand { max-width: 100%; }
  .pc-brand small { max-width: 20rem; line-height: 1.3; white-space: normal; }
  .pc-status { display: inline-flex; font-size: 0.67rem; }
  .pc-apk-button,
  .pc-mode-link { min-height: 2.45rem; font-size: 0.78rem; text-align: center; }
  body[data-mode="studio"] .pc-header-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-mode="studio"] .pc-header-tools #desktopLogoutBtn { grid-column: 1 / -1; justify-self: start; }
  .pc-conversation { max-height: 24rem; }
  .pc-card-head { align-items: start; }
  .pc-voice-state { font-size: 0.66rem; }
  .pc-mobile-actions,
  .pc-chat-actions { display: grid; grid-template-columns: 1fr; }
  .pc-mobile-actions > .pc-btn,
  .pc-chat-actions > .pc-btn { min-width: 0; }
  .pc-thread-toolbar-actions .pc-btn { min-height: 2.35rem; padding: 0.45rem 0.65rem; }
  .pc-thread-toolbar h2 { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Authenticated phone layout, revision 2026-08-31-r2.
 * Keep every Professor tool available while reserving a real row for the
 * transcript and composer.  The module shortcuts sit above the conversation,
 * so neither the browser keyboard nor a short viewport can cover Enviar. */
@media (max-width: 41.99rem) {
  body[data-mode="mobile"][data-professor-ready="true"] .pc-header {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.55rem;
    padding: max(0.55rem, env(safe-area-inset-top)) 0.7rem 0.55rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-brand small,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-release-note {
    display: none;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-header-tools {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    justify-content: flex-end;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-status {
    min-width: 0;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-home {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-workspace,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-app.pc-mobile-app {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 54vw);
    gap: 0.45rem;
    order: 0;
    overflow: hidden;
    padding: 0.48rem 0.7rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar > div:first-child,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar h2 {
    min-width: 0;
    max-width: 100%;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar .pc-eyebrow {
    display: none;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions {
    width: min(54vw, 13.5rem);
    min-width: 0;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions .pc-btn {
    min-width: max-content;
    min-height: 2.15rem;
    flex: 0 0 auto;
    padding: 0.35rem 0.52rem;
    font-size: 0.78rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-quick-grid {
    width: 100%;
    min-width: 0;
    order: 1;
    padding: 0.38rem 0.62rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-quick-tile {
    min-height: 2.2rem;
    padding: 0.32rem 0.58rem;
    font-size: 0.76rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation-card {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    order: 2;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    padding: 0.5rem 0.7rem max(0.45rem, env(safe-area-inset-bottom));
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation-card > .pc-card-head {
    display: none;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation {
    min-width: 0;
    padding-bottom: 0.42rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-source-panel {
    min-width: 0;
    max-height: min(14dvh, 7rem);
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-source-panel:empty {
    display: none;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form {
    position: relative;
    bottom: auto;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.42rem;
    overflow: visible;
    padding-top: 0.48rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form textarea {
    min-width: 0;
    min-height: 3rem;
    max-height: min(13dvh, 6.5rem);
    resize: none;
    padding: 0.55rem 0.62rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-compose-tools {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.12rem;
    scrollbar-width: thin;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-compose-tools > * {
    min-width: max-content;
    flex: 0 0 auto;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-lane-selector {
    flex-wrap: nowrap;
    padding: 0.24rem;
    font-size: 0.76rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-lane-btn,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-file-button {
    min-height: 1.95rem;
    padding: 0.25rem 0.45rem;
    font-size: 0.76rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-actions {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
    gap: 0.48rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-actions > .pc-btn {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.48rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form > .pc-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-listen-row {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    white-space: nowrap;
    scrollbar-width: thin;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-listen-row > * {
    min-width: max-content;
    flex: 0 0 auto;
    font-size: 0.75rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-notice {
    min-height: 0;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-notice:empty {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  .pc-btn,
  .pc-apk-button,
  .pc-mode-link,
  .pc-quick-tile { border: 1px solid CanvasText; }
}

/* Professor r3: compact phone workspace with every action reachable without
 * horizontal scrolling or controls covering the send button. */
.pc-release-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.pc-apk-button {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.78rem;
  color: #fff;
  background: #0b577e;
  border: 1px solid #0b577e;
  border-radius: 0.55rem;
  font-weight: 800;
  text-decoration: none;
}

.pc-release-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

@media (max-width: 41.99rem) {
  html,
  body[data-mode="mobile"],
  body[data-mode="mobile"] .pc-app,
  body[data-mode="mobile"] .pc-workspace,
  body[data-mode="mobile"] .pc-mobile-home {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .pc-release-note {
    padding: 0.55rem 0.7rem;
    font-size: 0.76rem;
  }

  .pc-release-note .pc-apk-button {
    width: 100%;
  }

  .pc-release-card,
  .pc-release-actions,
  .pc-release-actions > * {
    width: 100%;
    min-width: 0;
  }

  .pc-release-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
    padding: 0.48rem 0.62rem;
    overflow: visible;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar > div:first-child,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar h2 {
    width: 100%;
    max-width: 100%;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.38rem;
    overflow: visible;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions .pc-btn {
    width: 100%;
    min-width: 0;
    min-height: 2.15rem;
    padding: 0.34rem 0.3rem;
    font-size: 0.72rem;
    white-space: normal;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-quick-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    overflow: visible;
    padding: 0.42rem 0.62rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-quick-tile {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 2.25rem;
    justify-content: center;
    padding: 0.32rem 0.2rem;
    border-radius: 0.55rem;
    font-size: 0.7rem;
    white-space: normal;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation-card {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 0.48rem 0.62rem max(0.5rem, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation {
    width: 100%;
    min-width: 0;
    min-height: 7.5rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form textarea,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-compose-tools,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-actions,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-listen-row {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-compose-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.38rem;
    overflow: visible;
    padding: 0;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-compose-tools > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-lane-selector {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 0.3rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-lane-btn,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-file-button {
    width: 100%;
    min-width: 0;
    min-height: 2.05rem;
    justify-content: center;
    padding: 0.28rem 0.24rem;
    font-size: 0.72rem;
    text-align: center;
    white-space: normal;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-actions > .pc-btn {
    width: 100%;
    min-width: 0;
    min-height: 2.8rem;
    padding: 0.48rem 0.35rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-listen-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    overflow: visible;
    white-space: normal;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-listen-row > * {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-listen-row > label {
    grid-column: 1 / -1;
  }
}

/* Professor r5: secondary modules live behind one compact disclosure. The
 * transcript and its composer keep the available phone height; opening a
 * module menu overlays it temporarily and never covers or shifts Enviar. */
.pc-mobile-tools {
  display: block;
}

.pc-mobile-tools > summary {
  cursor: pointer;
  list-style: none;
}

.pc-mobile-tools > summary::-webkit-details-marker {
  display: none;
}

.pc-source-disclosure {
  color: #4f3705;
  background: #fff9e9;
  border: 1px solid #ead59f;
  border-radius: 0.65rem;
}

.pc-source-disclosure > summary {
  cursor: pointer;
  padding: 0.58rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 850;
}

.pc-source-disclosure-body {
  display: grid;
  gap: 0.55rem;
  max-height: min(42dvh, 24rem);
  overflow: auto;
  padding: 0 0.7rem 0.7rem;
}

.pc-mobile-listen > summary {
  cursor: pointer;
  list-style: none;
}

.pc-mobile-listen > summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 41.99rem) {
  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools {
    position: relative;
    z-index: 8;
    width: 100%;
    min-width: 0;
    order: 1;
    padding: 0.34rem 0.62rem;
    background: #f5f9fc;
    border-top: 1px solid var(--pc-line);
    border-bottom: 1px solid var(--pc-line);
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools > summary {
    display: flex;
    min-height: 2.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.38rem 0.62rem;
    color: #123f61;
    background: #fff;
    border: 1px solid #c9d9e4;
    border-radius: 0.62rem;
    font-weight: 850;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools > summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 1.1rem;
    line-height: 1;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools[open] > summary::after {
    content: "−";
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools > summary small {
    overflow: hidden;
    color: #587389;
    font-size: 0.7rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools:not([open]) .pc-mobile-quick-grid {
    display: none;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools[open] .pc-mobile-quick-grid {
    position: absolute;
    z-index: 18;
    top: calc(100% + 0.18rem);
    right: 0.62rem;
    left: 0.62rem;
    display: grid;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
    overflow: visible;
    padding: 0.62rem;
    background: #fff;
    border: 1px solid #c9d9e4;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2.4rem rgba(5, 26, 43, 0.24);
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-tools[open] .pc-quick-tile {
    min-height: 2.65rem;
    color: #123f61;
    background: #f5f9fc;
    border-color: #c9d9e4;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-conversation-card {
    order: 2;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-source-panel {
    max-height: none;
    overflow: visible;
    padding-block: 0.28rem;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-source-disclosure-body {
    max-height: min(34dvh, 14rem);
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-listen {
    position: relative;
    width: 100%;
    min-width: 0;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-listen > summary {
    display: flex;
    min-height: 2.1rem;
    align-items: center;
    justify-content: center;
    padding: 0.36rem 0.55rem;
    color: #0b577e;
    background: #eef7fb;
    border: 1px solid #b9d5e4;
    border-radius: 0.55rem;
    font-size: 0.78rem;
    font-weight: 850;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-listen > summary::after {
    content: " +";
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-listen[open] > summary::after {
    content: " −";
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-listen:not([open]) .pc-listen-row {
    display: none;
  }

  body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-listen[open] .pc-listen-row {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: calc(100% + 0.25rem);
    left: 0;
    display: grid;
    padding: 0.65rem;
    background: #fff;
    border: 1px solid #b9d5e4;
    border-radius: 0.65rem;
    box-shadow: 0 0.8rem 2rem rgba(5, 26, 43, 0.22);
  }
}

/* The launcher and conversation must remain scrollable above the fixed dock. */
body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-workspace {
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
body[data-mode="mobile"][data-professor-ready="true"] .pc-mobile-home {
  display: block;
  overflow: visible;
}
#conversationWorkspace { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }

/* R92 mobile conversation controls: menu actions stay reachable without
   squeezing four destructive controls into a narrow Android toolbar. */
.pc-thread-menu { position: relative; min-width: 0; }
.pc-thread-menu > summary {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.65rem;
  color: #123f61;
  background: #fff;
  border: 1px solid #b9d5e4;
  border-radius: 0.55rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  list-style: none;
}
.pc-thread-menu > summary::-webkit-details-marker { display: none; }
.pc-thread-menu > summary::after { content: '⌄'; font-size: 0.82em; }
.pc-thread-menu[open] > summary::after { content: '⌃'; }
.pc-thread-menu-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.38rem);
  right: 0;
  display: grid;
  width: max-content;
  min-width: 13rem;
  gap: 0.22rem;
  padding: 0.38rem;
  background: #fff;
  border: 1px solid #b9d5e4;
  border-radius: 0.72rem;
  box-shadow: 0 0.9rem 2rem rgba(5, 26, 43, 0.22);
}
.pc-thread-menu-panel .pc-text-btn { width: 100%; min-height: 2.45rem; text-align: left; }
.pc-danger-action { color: #9b2020 !important; }
.pc-thread-drawer-actions { display: grid; gap: 0.45rem; padding-top: 0.62rem; border-top: 1px solid var(--pc-line); }
.pc-thread-drawer-actions .pc-text-btn { min-height: 2.5rem; text-align: left; }

.pc-memory-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.48rem;
  color: #36566d;
  font-size: 0.78rem;
  line-height: 1.35;
}
.pc-memory-consent input { flex: 0 0 auto; margin-top: 0.14rem; accent-color: #0e5f91; }
.pc-memory-consent-help { margin: -0.25rem 0 0; }

.pc-source-card { overflow: hidden; }
.pc-source-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.pc-source-card a,
.pc-source-provider {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 41.99rem) {
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions > .pc-thread-menu {
    width: 100%;
    min-width: 0;
  }
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-menu > summary {
    width: 100%;
    min-height: 2.15rem;
    padding: 0.34rem 0.3rem;
    font-size: 0.72rem;
  }
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-menu-panel {
    right: 0;
    min-width: min(18rem, calc(100vw - 1.25rem));
  }
  body[data-mode="mobile"][data-professor-ready="true"] .pc-chat-form {
    position: sticky;
    bottom: 0;
    z-index: 9;
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
    background: var(--pc-paper);
    border-top: 1px solid var(--pc-line);
    box-shadow: 0 -0.6rem 1rem rgba(246, 248, 251, 0.96);
  }
}


/* R93: equal touch targets, readable media failure, hosted confirmation. */
.pc-thread-toolbar-actions{align-items:stretch}
.pc-thread-toolbar-actions .pc-thread-menu{display:flex;align-self:stretch}
.pc-thread-toolbar-actions .pc-thread-menu>summary{box-sizing:border-box;align-self:stretch;min-height:44px;height:100%;font:inherit;font-weight:700}
.pc-thread-toolbar-actions>.pc-btn{min-height:44px}
.pc-thread-menu-panel{max-width:calc(100vw - 24px)}
.pc-thread-menu-panel .pc-text-btn{text-decoration:none;line-height:1.4;padding:.65rem .8rem;min-height:44px}
.pc-generated-concept>.pc-source-warning,.pc-generated-concept>a{display:block;margin-top:.6rem;overflow-wrap:anywhere}
.pc-media-status{font-size:.88rem;line-height:1.5}
.pc-generated-concept-preview{max-width:100%;height:auto;min-height:0;object-fit:contain}
.pc-confirm-conversation{width:min(28rem,calc(100vw - 32px));box-sizing:border-box;padding:1.25rem;border:1px solid #bfd0db;border-radius:18px;background:#fff;color:#183248}
.pc-confirm-conversation::backdrop{background:#102b40aa}
.pc-confirm-conversation h3{margin:0 0 .7rem}
.pc-confirm-actions{display:flex;justify-content:flex-end;gap:.7rem;margin-top:1rem}
@media(max-width:42rem){body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions .pc-btn,body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-menu>summary{min-height:44px;font-size:.8rem;padding:.5rem .4rem}}

/* R132: the installed Professor PWA must not inherit the compact R125 toolbar.
   Keep the title readable and the three primary controls equal-width on phones. */
@media (max-width: 42rem) {
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar h2 {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.2;
  }
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions > .pc-btn,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-toolbar-actions > .pc-thread-menu,
  body[data-mode="mobile"][data-professor-ready="true"] .pc-thread-menu > summary {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
}

/* R135 mobile toolbar and evidence containment. */
/* The three conversation controls must remain equally usable in the installed
   phone shell even before a session hydration flag is present. */
@media (max-width: 42rem) {
  body[data-mode="mobile"] .pc-thread-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    overflow: visible;
  }
  body[data-mode="mobile"] .pc-conversation-heading { min-width: 0; }
  body[data-mode="mobile"] .pc-thread-toolbar h2 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-mode="mobile"] .pc-thread-toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: .5rem;
    margin-left: 0;
    overflow: visible;
  }
  body[data-mode="mobile"] .pc-thread-toolbar-actions > .pc-btn,
  body[data-mode="mobile"] .pc-thread-toolbar-actions > .pc-thread-menu,
  body[data-mode="mobile"] .pc-thread-menu > summary {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }
  body[data-mode="mobile"] .pc-thread-toolbar-actions > .pc-btn,
  body[data-mode="mobile"] .pc-thread-menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .62rem .38rem;
    border-radius: .76rem;
    font-size: .88rem;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body[data-mode="mobile"] .pc-thread-toolbar-actions > .pc-thread-menu { display: block; align-self: stretch; }
  body[data-mode="mobile"] .pc-thread-menu-panel {
    width: min(22rem, calc(100vw - 2rem));
    min-width: min(17rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
  }
}
#sourcePanel, .pc-message-evidence-body, .pc-source-disclosure-body, .pc-source-card { min-width: 0; }
#sourcePanel *, .pc-message-evidence-body *, .pc-source-disclosure-body * { max-width: 100%; overflow-wrap: anywhere; }
.pc-generated-concept { overflow: hidden; }

/* V1: phone controls and source citations must have the same containment
   contract as the rest of the conversation.  A long authority URL is useful
   only when it remains readable and cannot widen the installed PWA viewport. */
@media (max-width: 42rem) {
  body[data-mode="mobile"] .pc-thread-toolbar-actions > .pc-btn,
  body[data-mode="mobile"] .pc-thread-menu > summary {
    font-size: clamp(.75rem, 3.1vw, .88rem);
  }
}
.pc-source-card { min-width: 0; max-width: 100%; }
.pc-source-card a,
.pc-source-provider {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#sourcePanel, .pc-message-evidence-body, .pc-source-disclosure-body, .pc-source-card { max-width: 100%; }
#sourcePanel *, .pc-message-evidence-body *, .pc-source-disclosure-body * { word-break: break-word; }
/* V1 native shell: do not briefly show a second APK installation route before the hosted UI hydrates. */
html[data-native-shell="true"] .pc-apk-button,
html[data-native-shell="true"] .pc-release-card { display: none !important; }