/* ============================================================
   AEROGYAN OFFICE — app mode + the Apps launcher (2026-11-11)
   html.ag-app (set by the server on /apps/<slug>/) = app mode.
   office-apps.js builds .oa-bar, .oa-stage, .oa-pop, .oa-modal.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --oa-c: #4f46e5; --oa-c2: #312e81;
  --oa-surface: var(--bg-elevated, var(--bg-surface, #fff));
  --oa-ink: var(--text-primary, #1f2937);
  --oa-ink2: var(--text-secondary, #4b5563);
  --oa-ink3: var(--text-tertiary, #6b7280);
  --oa-line: var(--border-subtle, #e5e7eb);
  --oa-hover: color-mix(in srgb, var(--oa-ink) 7%, transparent);
  --oa-shadow: 0 18px 50px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
}
[data-theme="dark"], [data-theme="dim"] { --oa-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4); }
html.ag-app {
  --oa-bar-h: 52px;
  --oa-top: calc(var(--oa-bar-h) + env(safe-area-inset-top, 0px));
}
@media (max-width: 640px) { html.ag-app { --oa-bar-h: 50px; } }

/* ---------- app icon (a squircle in the app colours; the picture loads over it) ---------- */
.oa-ic { position: relative; flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 24%;
  background: linear-gradient(145deg, var(--c, var(--oa-c)), var(--c2, var(--oa-c2))); color: #fff; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.oa-ic b { font-weight: 800; font-size: 46%; letter-spacing: -.02em; }
.oa-ic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.oa-ic.oa-brand-ic { width: 30px; height: 30px; }
.oa-ic.oa-ic-sm { width: 22px; height: 22px; vertical-align: -6px; margin: 0 2px; }
.oa-ic.oa-ic-lg { width: 64px; height: 64px; }
.oa-ic.oa-ic-xl { width: 88px; height: 88px; box-shadow: 0 10px 30px color-mix(in srgb, var(--c, var(--oa-c)) 35%, transparent); }

/* ---------- app mode: the portal's chrome steps aside ---------- */
html.ag-app #appHeader, html.ag-app .mobile-bottom-nav, html.ag-app #appFooter, html.ag-app .app-footer,
html.ag-app #askFab, html.ag-app .app-install-pill { display: none !important; }
html.ag-app #app { padding-top: var(--oa-top); }
html.ag-app .main-content { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)) !important; }
@media (max-width: 760px) { html.ag-app .main-content { padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); } }
/* a fn: app (professors' Notes, Interview) and the cards: nothing of the portal shows through */
html.ag-app.oa-booting .main-content, html.ag-app.oa-staged .main-content, html.ag-app.oa-linking .main-content { visibility: hidden; }
html.ag-app.oa-booting .main-content { animation: oaReveal 0s linear 6s forwards; }   /* never stuck hidden */
@keyframes oaReveal { to { visibility: visible; } }
/* the Interview app is the Interview Room tab of Placement prep, alone */
html.ag-app-interview #studentPrepView .pp-tabs, html.ag-app-interview #studentPrepView .pp-head { display: none !important; }
/* sign-in: only what this app needs */
html.ag-app #loginView .login-role-toggle [data-role="notes"], html.ag-app #loginView .lg-links, html.ag-app #loginView .lg-made-in { display: none !important; }

/* the studios' full-window editors sit under the app bar */
html.ag-app .sh-ed, html.ag-app .sl-ed { top: var(--oa-top) !important; }
html.ag-app.lx-studio .lx-ed:not(.lx-full) { top: var(--oa-top); height: auto; bottom: 0; }
html.ag-app #studentNotesView.active.nt-editing, html.ag-app #aeroProfNotes, html.ag-app #aeroNotesOnly, html.ag-app #aeroOfflineNotes { top: var(--oa-top); }
html.ag-app #aeroProfNotes .apn-bar { padding-top: 8px; }
/* phones: an open workbook / deck / project / notebook takes the whole screen (its own Back returns) */
@media (max-width: 640px) {
  html.ag-app.sh-editing, html.ag-app.sl-editing, html.ag-app.lx-studio, html.ag-app.aero-nt-full { --oa-top: 0px; }
  html.ag-app.sh-editing .oa-bar, html.ag-app.sl-editing .oa-bar, html.ag-app.lx-studio .oa-bar, html.ag-app.aero-nt-full .oa-bar,
  html.ag-app.sh-editing .oa-bar-bg, html.ag-app.sl-editing .oa-bar-bg, html.ag-app.lx-studio .oa-bar-bg, html.ag-app.aero-nt-full .oa-bar-bg { display: none; }
  html.ag-app.sh-editing .sh-ed, html.ag-app.sl-editing .sl-ed { top: env(safe-area-inset-top, 0px) !important; }
}
html.sl-presenting .oa-bar, html.sl-presenting .oa-bar-bg { display: none; }

/* ---------- the app bar ---------- */
.oa-bar-bg { position: fixed; top: 0; left: 0; right: 0; height: var(--oa-top); z-index: 959;
  background: color-mix(in srgb, var(--oa-c) 7%, var(--bg-surface, #fff));
  border-bottom: 1px solid color-mix(in srgb, var(--oa-c) 16%, var(--oa-line)); }
[data-theme="dark"] .oa-bar-bg, [data-theme="dim"] .oa-bar-bg { background: color-mix(in srgb, var(--oa-c) 12%, var(--bg-surface, #1f1f29)); }
.oa-bar { position: fixed; z-index: 960; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: var(--oa-bar-h);
  display: flex; align-items: center; gap: 6px;
  padding: 0 max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px));
  color: var(--oa-ink); font-family: inherit; }
.oa-bar button { font: inherit; color: inherit; }
.oa-brand { display: flex; align-items: center; gap: 10px; min-width: 0; height: 40px; padding: 0 10px 0 5px; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.oa-brand:hover { background: var(--oa-hover); }
.oa-brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-bar-fill { flex: 1; align-self: stretch; }
.oa-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: none; cursor: pointer; color: var(--oa-ink2) !important; }
.oa-icon-btn:hover, .oa-icon-btn[aria-expanded="true"] { background: var(--oa-hover); color: var(--oa-ink) !important; }
.oa-install { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--oa-c); color: #fff !important; font-weight: 650 !important; font-size: 13.5px !important; box-shadow: 0 4px 14px color-mix(in srgb, var(--oa-c) 35%, transparent); }
.oa-install:hover { filter: brightness(1.07); }
.oa-install[hidden], .oa-acct[hidden] { display: none; }
.oa-acct { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border: 0; border-radius: 999px; background: none; cursor: pointer; max-width: 160px; }
.oa-acct:hover, .oa-acct[aria-expanded="true"] { background: var(--oa-hover); }
.oa-acct-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(145deg, var(--oa-c), var(--oa-c2)); color: #fff; font-size: 12.5px; font-weight: 750; letter-spacing: .02em; }
.oa-av.big { width: 44px; height: 44px; font-size: 15px; }
@media (max-width: 520px) {
  .oa-brand-name { font-size: 15px; }
  .oa-acct-name { display: none; }
  .oa-acct { padding: 0 4px; }
  .oa-install span { display: none; }
  .oa-install { width: 36px; padding: 0; justify-content: center; }
}
/* installed on a computer with the title bar as part of the app (window-controls-overlay) */
@media (display-mode: window-controls-overlay) {
  html.ag-app { --oa-bar-h: env(titlebar-area-height, 36px); --oa-top: env(titlebar-area-height, 36px); }
  .oa-bar { top: env(titlebar-area-y, 0px); left: env(titlebar-area-x, 0px); right: auto; width: env(titlebar-area-width, 100%);
    height: env(titlebar-area-height, 36px); padding: 0 8px; -webkit-app-region: drag; app-region: drag; }
  .oa-bar button, .oa-bar a { -webkit-app-region: no-drag; app-region: no-drag; }
  .oa-brand, .oa-icon-btn, .oa-acct { height: calc(env(titlebar-area-height, 36px) - 6px); }
  .oa-icon-btn { width: calc(env(titlebar-area-height, 36px) - 2px); }
  .oa-ic.oa-brand-ic { width: 22px; height: 22px; }
  .oa-brand-name { font-size: 13.5px; }
  .oa-av { width: 24px; height: 24px; font-size: 10.5px; }
  .oa-install { height: 26px; }
}

/* focus rings (keyboard) */
.oa-bar :focus-visible, .oa-pop :focus-visible, .oa-modal :focus-visible, .oa-stage :focus-visible, .oa-codebox :focus-visible, .oa-dev-link :focus-visible, #officeAppsBtn:focus-visible {
  outline: 2px solid var(--oa-c, #4f46e5); outline-offset: 2px; }

/* ---------- popovers (switcher, account) ---------- */
.oa-pop { position: fixed; z-index: 9600; width: min(372px, calc(100vw - 16px)); overflow: auto; overscroll-behavior: contain;
  background: var(--oa-surface); color: var(--oa-ink); border: 1px solid var(--oa-line); border-radius: 20px; box-shadow: var(--oa-shadow);
  padding: 10px; animation: oaPop .16s ease-out; outline: none; }
@keyframes oaPop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .oa-pop, .oa-modal { animation: none !important; } }
.oa-portal.oa-pop { width: min(430px, calc(100vw - 16px)); }
.oa-pop-head { padding: 6px 8px 10px; }
.oa-pop-head b { display: block; font-size: 15px; }
.oa-pop-head span { display: block; font-size: 12.5px; color: var(--oa-ink3); margin-top: 2px; line-height: 1.4; }
.oa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.oa-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px 10px; border-radius: 14px; text-decoration: none !important;
  color: var(--oa-ink) !important; font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.2; position: relative; }
.oa-tile:hover { background: var(--oa-hover); }
.oa-tile .oa-ic { width: 48px; height: 48px; }
.oa-tile.on { background: color-mix(in srgb, var(--oa-c) 10%, transparent); }
.oa-tile.on::after { content: ""; position: absolute; bottom: 4px; width: 16px; height: 3px; border-radius: 3px; background: var(--oa-c); }
.oa-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.oa-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; }
.oa-row:hover { background: var(--oa-hover); }
.oa-row-text { flex: 1; min-width: 0; }
.oa-row-text b { display: block; font-size: 14px; }
.oa-row-text small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--oa-ink3); line-height: 1.35; }
.oa-row-acts { display: flex; gap: 6px; flex: none; }
.oa-pop-foot { display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; border-top: 1px solid var(--oa-line); margin-top: 8px; padding-top: 8px; }
.oa-link-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--oa-ink2) !important; font: inherit; font-size: 13px; font-weight: 600; text-decoration: none !important; }
.oa-link-btn:hover { background: var(--oa-hover); color: var(--oa-ink) !important; }

/* account menu */
.oa-acct-pop.oa-pop { width: min(300px, calc(100vw - 16px)); padding: 8px; }
.oa-acct-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; border-bottom: 1px solid var(--oa-line); margin-bottom: 6px; }
.oa-acct-head b { display: block; font-size: 14.5px; }
.oa-role { font-size: 12.5px; color: var(--oa-ink3); }
.oa-menu { display: flex; flex-direction: column; }
.oa-menu > button, .oa-menu > a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--oa-ink) !important; font: inherit; font-size: 14px; text-align: left; text-decoration: none !important; }
.oa-menu > button:hover, .oa-menu > a:hover { background: var(--oa-hover); }
.oa-menu i { width: 18px; text-align: center; color: var(--oa-ink3); }
.oa-menu span:not(.oa-sw) { flex: 1; }
.oa-menu .danger, .oa-menu .danger i { color: var(--rose-600, #e11d48) !important; }
.oa-sw { position: relative; width: 34px; height: 20px; border-radius: 20px; background: var(--border-default, #cbd5e1); flex: none; transition: background .15s; }
.oa-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.oa-sw.on { background: var(--oa-c); }
.oa-sw.on::after { transform: translateX(14px); }

/* ---------- buttons ---------- */
.oa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px;
  background: var(--oa-c); color: #fff !important; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.oa-btn:hover { filter: brightness(1.07); }
.oa-btn.ghost { background: transparent; color: var(--oa-ink) !important; border-color: var(--oa-line); }
.oa-btn.ghost:hover { background: var(--oa-hover); filter: none; }
.oa-btn.big { min-height: 46px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.oa-btn:disabled { opacity: .5; cursor: default; filter: none; }
.oa-portal .oa-btn { min-height: 32px; padding: 0 12px; }
.oa-portal .oa-btn.ghost { width: 32px; padding: 0; }
.oa-x { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--oa-ink3); cursor: pointer; font-size: 16px; }
.oa-x:hover { background: var(--oa-hover); color: var(--oa-ink); }

/* ---------- dialogs (install, link a phone) — a bottom sheet on phones ---------- */
.oa-modal-ov { position: fixed; inset: 0; z-index: 9700; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.oa-modal { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  background: var(--oa-surface); color: var(--oa-ink); border-radius: 24px; box-shadow: var(--oa-shadow); padding: 24px 24px 22px; animation: oaPop .18s ease-out; outline: none; }
.oa-modal-x { position: absolute; top: 12px; right: 12px; }
.oa-modal h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; padding-right: 34px; }
.oa-modal p { margin: 0; color: var(--oa-ink2); font-size: 14px; line-height: 1.5; }
@media (max-width: 560px) {
  .oa-modal-ov { align-items: flex-end; padding: 0; }
  .oa-modal { width: 100%; border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px)); max-height: 88dvh; animation: oaSheet .22s ease-out; }
}
@keyframes oaSheet { from { transform: translateY(40px); opacity: .4; } }
.oa-inst-head, .oa-dlg-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.oa-dlg-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--oa-c) 12%, transparent); color: var(--oa-c); font-size: 19px; }
.oa-feats { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13.5px; color: var(--oa-ink2); }
.oa-feats li { display: flex; gap: 8px; align-items: baseline; }
.oa-feats i { color: var(--oa-c); font-size: 12px; }
.oa-feats.small { font-size: 13px; }
.oa-steps { list-style: none; margin: 0 0 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; border-radius: 16px; background: color-mix(in srgb, var(--oa-c) 6%, transparent); font-size: 14.5px; line-height: 1.45; }
.oa-steps li { display: flex; gap: 12px; align-items: flex-start; }
.oa-step-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--oa-c); color: #fff; font-size: 12.5px; font-weight: 750; }
.oa-glyph { width: 20px; height: 20px; vertical-align: -4px; color: #0a84ff; margin: 0 2px; }
.oa-kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--oa-line); border-radius: 6px; font-size: 12px; }
.oa-inst-note { font-size: 13.5px !important; }
.oa-inst-note i { color: var(--oa-c); margin-right: 4px; }
.oa-inst .oa-btn.big { width: 100%; margin-bottom: 12px; }
.oa-dlg-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.oa-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--oa-ink2); }
.oa-field select { font: inherit; font-size: 14.5px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-default, var(--oa-line)); background: var(--bg-surface, #fff); color: var(--oa-ink); }
.oa-code { margin: 18px 0 6px; text-align: center; padding: 18px 10px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--oa-c) 45%, transparent); background: color-mix(in srgb, var(--oa-c) 6%, transparent); }
.oa-code-txt { font: 750 34px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--oa-ink); }
.oa-code-sub { text-align: center; font-size: 13px !important; color: var(--oa-ink3) !important; }
@media (max-width: 380px) { .oa-code-txt { font-size: 28px; } .oa-feats { grid-template-columns: 1fr; } }

/* ---------- the stage: start card, role / admin card ---------- */
.oa-stage { position: fixed; z-index: 950; top: var(--oa-top, 0px); left: 0; right: 0; bottom: 0; overflow: auto;
  display: flex; align-items: center; justify-content: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--oa-c) 12%, transparent), transparent 70%), var(--bg-page, #f6f7fb); }
.oa-card { width: min(480px, 100%); text-align: center; background: var(--oa-surface); color: var(--oa-ink); border: 1px solid var(--oa-line); border-radius: 28px; padding: 34px 28px 28px; box-shadow: var(--oa-shadow); }
.oa-card h2 { margin: 18px 0 6px; font-size: 22px; letter-spacing: -.02em; }
.oa-card .oa-line { margin: 0 0 18px; color: var(--oa-ink2); font-size: 14.5px; line-height: 1.5; }
.oa-card .oa-feats { text-align: left; margin: 0 auto 22px; max-width: 360px; }
.oa-card-slim { padding: 28px; }
.oa-card-slim .oa-line { margin: 14px 0 0; }
.oa-card-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.oa-grid-card { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); text-align: center; }
.oa-muted { color: var(--oa-ink3); font-size: 13.5px; grid-column: 1 / -1; }

/* ---------- the branded sign-in ---------- */
html.ag-app #loginView .lg-brand { background:
    radial-gradient(120% 70% at 100% 0%, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(155deg, var(--oa-c) 0%, var(--oa-c2) 100%); }
html.ag-app #loginView .lg-brand-top, html.ag-app #loginView .lg-brand-body, html.ag-app #loginView .lg-brand-foot { display: none !important; }
.oa-login-brand { position: relative; display: flex; flex-direction: column; gap: 14px; margin-top: auto; margin-bottom: auto; color: #fff; }
.oa-login-brand > div strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.oa-login-brand > div span { display: block; margin-top: 8px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .86); max-width: 400px; }
.oa-login-brand .oa-ic { box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 0 0 3px rgba(255, 255, 255, .25); }
.oa-login-feats { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 9px; font-size: 14.5px; }
.oa-login-feats i { margin-right: 9px; color: #fff; opacity: .9; }
.oa-login-one { margin: 8px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.oa-login-one i { margin-right: 6px; }
.oa-one-line { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--oa-ink3); }
.oa-one-line i { color: var(--oa-c); margin-right: 4px; }
.oa-codebox { margin-top: 12px; border: 1px solid var(--oa-line); border-radius: 14px; overflow: hidden; }
.oa-code-toggle { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--oa-ink2); text-align: left; }
.oa-code-toggle:hover { background: var(--oa-hover); }
.oa-code-toggle i { color: var(--oa-c); }
.oa-code-form { padding: 0 14px 14px; }
.oa-code-form label { display: block; font-size: 12.5px; font-weight: 600; color: var(--oa-ink2); margin-bottom: 6px; }
.oa-code-form label small { font-weight: 400; color: var(--oa-ink3); }
.oa-code-row { display: flex; gap: 8px; }
.oa-code-row input { flex: 1; min-width: 0; font: 650 17px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-default, var(--oa-line)); background: var(--bg-surface, #fff); color: var(--oa-ink); }
.oa-code-row .btn { flex: none; }
.oa-code-msg { margin: 8px 0 0; min-height: 0; font-size: 13px; color: var(--rose-600, #e11d48); }
.oa-code-msg:empty { display: none; }
@media (max-width: 880px) {
  html.ag-app #loginView .lg-brand { padding: 20px 22px; }
  .oa-login-brand { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px 14px; margin: 0; }
  .oa-login-brand .oa-ic.oa-ic-lg { width: 52px; height: 52px; }
  .oa-login-brand > div { flex: 1; min-width: 0; }
  .oa-login-brand > div strong { font-size: 19px; }
  .oa-login-brand > div span { font-size: 13px; margin-top: 3px; }
  .oa-login-feats, .oa-login-one { display: none; }
}
/* signing in with a link code: a calm page instead of the form flashing */
html.ag-app.oa-linking body::after { content: "Signing you in…"; position: fixed; inset: var(--oa-top) 0 0 0; z-index: 940; display: grid; place-items: center;
  background: var(--bg-page, #f6f7fb); color: var(--oa-ink2); font-size: 15px; font-weight: 600; }

/* ---------- small things ---------- */
.oa-notice { position: fixed; z-index: 9800; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--oa-surface); color: var(--oa-ink); border: 1px solid var(--oa-line); box-shadow: var(--oa-shadow); font-size: 14px; max-width: calc(100vw - 24px); }
.oa-notice a { font-weight: 650; color: var(--oa-c); }
.oa-flash { animation: oaFlash 1.5s ease-out; border-radius: 14px; }
@keyframes oaFlash { 0%, 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--oa-c) 45%, transparent); } 100% { box-shadow: 0 0 0 4px transparent; } }

/* ---------- the portal (/app): header Apps button, Settings → Your devices ---------- */
#officeAppsBtn[hidden] { display: none !important; }
#officeAppsBtn svg { display: block; }
.oa-dev-apps { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-tertiary, #6b7280); }
.oa-dev-apps i { margin-right: 4px; }
.oa-dev-apps b { font-weight: 600; color: var(--text-secondary, #4b5563); }
.oa-dev-link { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12.5px; color: var(--text-tertiary, #6b7280); }

/* ---------- ⭐ 2026-11-11 (2) — the install page (Install → this, never the sign-in) ---------- */
html.oa-ip-open, html.oa-ip-open body { overflow: hidden; }
.oa-ipage { position: fixed; inset: 0; z-index: 9800; overflow: auto; overscroll-behavior: contain; display: flex; justify-content: center; align-items: flex-start;
  padding: max(24px, env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--c) 30%, transparent), transparent 62%), var(--bg-page, #f6f7fb); color: var(--oa-ink);
  animation: oaIpIn .2s ease-out; }
@keyframes oaIpIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .oa-ipage { animation: none; } }
.oa-ipage-in { position: relative; width: min(560px, 100%); margin: auto 0; background: var(--oa-surface); border: 1px solid var(--oa-line); border-radius: 30px;
  box-shadow: var(--oa-shadow); padding: 34px 32px 26px; }
.oa-ipage-in > .oa-modal-x { position: absolute; top: 14px; right: 14px; }
.oa-ip-hero { text-align: center; }
.oa-ic.oa-ic-xl { width: 104px; height: 104px; border-radius: 24%; box-shadow: 0 14px 34px color-mix(in srgb, var(--c) 40%, transparent); }
.oa-ic.oa-ic-xl b { font-size: 42px; }
.oa-ip-hero h1 { margin: 18px 0 6px; font-size: clamp(24px, 4.6vw, 30px); letter-spacing: -.025em; line-height: 1.15; }
.oa-ip-line { margin: 0 auto; max-width: 440px; color: var(--oa-ink2); font-size: 15px; line-height: 1.5; }
.oa-ip-feats { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; }
.oa-ip-feats li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--oa-ink); }
.oa-ip-feats i { color: var(--c); font-size: 11px; }
.oa-ip-main { margin: 24px 0 6px; }
.oa-ip-main .oa-steps { --oa-c: var(--c); }
.oa-steps.big { font-size: 15.5px; padding: 16px 18px; gap: 14px; }
.oa-ip-go { width: 100%; min-height: 56px !important; font-size: 17px !important; border-radius: 16px !important; color: #fff !important;
  background: linear-gradient(135deg, var(--c), var(--c2)) !important; border: 0 !important; box-shadow: 0 10px 26px color-mix(in srgb, var(--c) 38%, transparent); }
.oa-ip-go:disabled { opacity: .8; }
.oa-ip-note { margin: 12px 0 0; text-align: center; font-size: 13.5px; color: var(--oa-ink3); line-height: 1.5; }
.oa-ip-note.big { font-size: 14.5px; color: var(--oa-ink2); text-align: left; margin-bottom: 14px; }
.oa-ip-note i { color: var(--c); }
.oa-ip-ok { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: color-mix(in srgb, #16a34a 10%, transparent); }
.oa-ip-ok > i { color: #16a34a; font-size: 26px; margin-top: 1px; }
.oa-ip-ok b { display: block; font-size: 16px; margin-bottom: 3px; }
.oa-ip-ok span { color: var(--oa-ink2); font-size: 14px; line-height: 1.5; }
.oa-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: oaSpin .8s linear infinite; }
@keyframes oaSpin { to { transform: rotate(360deg); } }
.oa-ip-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 10px 0 0; padding: 10px; border: 0; border-radius: 12px;
  background: none; color: var(--oa-ink2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.oa-ip-link:hover { background: var(--oa-hover); color: var(--oa-ink); }
.oa-ip-more { margin-top: 6px; border-top: 1px solid var(--oa-line); padding-top: 6px; }
.oa-ip-other { margin-top: 8px; border-radius: 16px; background: color-mix(in srgb, var(--oa-ink) 4%, transparent); }
.oa-ip-other summary { cursor: pointer; padding: 12px 16px; font-size: 14px; font-weight: 650; list-style: none; display: flex; gap: 8px; align-items: center; }
.oa-ip-other summary::-webkit-details-marker { display: none; }
.oa-ip-other summary::after { content: '▾'; margin-left: auto; color: var(--oa-ink3); }
.oa-ip-other[open] summary::after { content: '▴'; }
.oa-ip-qr { display: flex; gap: 16px; align-items: center; padding: 0 16px 6px; }
.oa-ip-qr img { flex: none; width: 148px; height: 148px; border-radius: 14px; background: #fff; padding: 6px; border: 1px solid var(--oa-line); image-rendering: pixelated; }
.oa-ip-qr p { margin: 0 0 8px; font-size: 13.5px; color: var(--oa-ink2); line-height: 1.45; }
.oa-ip-url { display: block; word-break: break-all; font-size: 12.5px; padding: 6px 9px; border-radius: 8px; background: var(--oa-surface); border: 1px solid var(--oa-line); }
.oa-ip-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.oa-ip-small { margin: 4px 16px 0; padding-bottom: 14px; font-size: 12.5px; color: var(--oa-ink3); line-height: 1.45; }
.oa-ip-upd { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--oa-ink3); }
/* iPhone: an arrow points at Safari's Share button at the bottom of the screen */
.oa-ip-arrow { position: fixed; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff; font-size: 18px;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 45%, transparent); animation: oaBob 1.3s ease-in-out infinite; }
@keyframes oaBob { 50% { transform: translate(-50%, 8px); } }
@media (min-width: 700px) { .oa-ip-arrow { display: none; } }   /* iPad: Share is at the top right */
/* ⭐ 2026-11-11 (3) — the real app's download (Android / Windows) and its 3 steps */
.oa-ip-dlsteps { margin: 16px 0 0; }
.oa-ip-dlsteps.is-on li:first-child { font-weight: 650; }
.oa-ip-dlsteps.is-on li:first-child .oa-step-n { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); }
/* desktop Chrome / Edge: where the browser's small install box opens (top right) */
.oa-ip-hint { display: flex; align-items: flex-start; justify-content: center; gap: 8px; margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--oa-ink2); text-align: left; }
.oa-ip-hint i { flex: none; margin-top: 3px; font-size: 12px; color: var(--c); }
.oa-ip-hint.is-up { color: var(--oa-ink); font-weight: 650; }
.oa-ip-up { position: fixed; top: 6px; right: 70px; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--c); color: #fff; font-size: 20px; pointer-events: none; box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 45%, transparent);
  animation: oaUp 1.1s ease-in-out infinite; }
@keyframes oaUp { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .oa-ip-up { animation: none; } }
@media (max-width: 560px) {
  .oa-ipage { padding: 0; align-items: stretch; }
  .oa-ipage-in { border-radius: 0; border: 0; box-shadow: none; padding: calc(30px + env(safe-area-inset-top, 0px)) 20px calc(80px + env(safe-area-inset-bottom, 0px)); min-height: 100%; }
  .oa-ip-qr { flex-direction: column; align-items: stretch; }
}
/* a new version is ready while you were busy — one tap reloads */
.oa-upd { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--oa-c) 40%, transparent);
  border-radius: 999px; background: color-mix(in srgb, var(--oa-c) 10%, transparent); color: var(--oa-ink) !important; font-size: 12.5px; font-weight: 650; cursor: pointer; margin-right: 4px; }
@media (max-width: 640px) { .oa-upd span { display: none; } .oa-upd { width: 34px; padding: 0; justify-content: center; } }

/* ============================================================
   ⭐ round 4 (2026-11-11): professor apps, professor-only sign-in, packs
   ============================================================ */
/* a professor app's sign-in: only the Professor form (no Student tab, no institute activation, no student sign-up) */
html.ag-app-for-professor #loginView .login-role-toggle,
html.ag-app-for-professor #loginView .lg-activate,
html.ag-app-for-professor #loginView .lg-cta-row .lg-cta[onclick^="showRegisterModal"] { display: none !important; }
html.ag-app-for-professor #loginView .lg-cta-row { justify-content: center; }
.oa-prof-note { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4;
  background: color-mix(in srgb, var(--oa-c) 9%, transparent); color: var(--oa-ink2); }
.oa-prof-note i { color: var(--oa-c); }
/* the server said no (APP_ROLE): the reason + where this account's apps are */
.oa-approle { margin: 0 0 14px; padding: 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, #dc2626 35%, var(--oa-line));
  background: color-mix(in srgb, #dc2626 7%, var(--oa-surface)); color: var(--oa-ink); }
.oa-approle-msg { display: flex; gap: 10px; align-items: flex-start; }
.oa-approle-msg > i { color: #dc2626; font-size: 18px; margin-top: 1px; }
.oa-approle-msg b { display: block; font-size: 14px; line-height: 1.4; }
.oa-approle-msg span { display: block; font-size: 12.5px; color: var(--oa-ink2); margin-top: 3px; }
.oa-approle .oa-grid-card { margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.oa-approle .oa-tile { padding: 8px 2px; font-size: 11.5px; color: var(--oa-ink) !important; }
.oa-approle .oa-tile .oa-ic { width: 38px; height: 38px; }
/* the install page of a professor app */
.oa-ip-for { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 0; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .16); color: inherit; border: 1px solid rgba(255, 255, 255, .28); }

/* a professor app shows just its tool: the portal workspace sidebar and greeting step aside */
html.ag-app #professorContent .pw-shell { grid-template-columns: minmax(0, 1fr); }
html.ag-app #professorContent .pw-side { display: none !important; }
html.ag-app:not(.ag-app-courses) #professorContent .pw-hero { display: none; }
.oa-ptabs { display: flex; gap: 4px; margin: 0 0 14px; padding: 4px; border-radius: 14px; background: var(--bg-surface-3, color-mix(in srgb, var(--oa-ink) 5%, transparent));
  overflow-x: auto; scrollbar-width: none; }
.oa-ptabs::-webkit-scrollbar { display: none; }
.oa-ptabs button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 11px; background: none;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--oa-ink2); cursor: pointer; white-space: nowrap; }
.oa-ptabs button:hover { background: var(--oa-hover); color: var(--oa-ink); }
.oa-ptabs button.on { background: var(--oa-surface); color: var(--oa-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.oa-ptabs button.on i { color: var(--oa-c); }
.oa-ptab-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--oa-c); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* "Install all" (the pack of this role) */
.oa-packall { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 8px; padding: 10px; border: 1px solid color-mix(in srgb, var(--oa-c) 30%, var(--oa-line));
  border-radius: 14px; background: color-mix(in srgb, var(--oa-c) 7%, transparent); color: var(--oa-ink); font: inherit; text-align: left; cursor: pointer; }
.oa-packall:hover { background: color-mix(in srgb, var(--oa-c) 12%, transparent); }
.oa-packall .oa-ic { width: 40px; height: 40px; }
.oa-packall-t { flex: 1; min-width: 0; }
.oa-packall-t b { display: block; font-size: 14px; }
.oa-packall-t small { display: block; font-size: 12px; color: var(--oa-ink3); line-height: 1.35; }
.oa-packall > i { color: var(--oa-c); }
.oa-packdlg { width: min(520px, 100%); }
.oa-pack-rows { margin-top: 12px; max-height: min(56vh, 520px); overflow: auto; }
.oa-done { display: inline-grid; place-items: center; width: 32px; color: #16a34a; font-size: 18px; }
.oa-done[hidden] { display: none; }
.oa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.oa-pack-count { margin: 10px 0 0; font-size: 12.5px; color: var(--oa-ink3); text-align: right; min-height: 1em; }
@media (max-width: 640px) {
  .oa-pack-rows .oa-row-text small { display: none; }
  .oa-ptabs { margin-bottom: 10px; }
  .oa-ptabs button { flex: 1 0 auto; justify-content: center; padding: 0 10px; font-size: 13px; }
  .oa-ptabs button i { display: none; }
}
