/* Ewings Lab O/L — the students' site only (ollab.ewingspapers.lk): the sign-in pages, the account menu, and the phone
   layout of the lab (the controls become a bottom sheet). Loaded after sim.css and ol-lab.css; the teacher's /OL-Lab
   never loads this file. */

/* ================================================================ sign-in pages */
#auth[hidden] { display: none; }
.au { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 44%) 1fr; background: var(--color-bg); color: var(--color-text); font-family: var(--font); }
.au__hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 28px; padding: 36px clamp(24px, 4vw, 56px); color: #fff;
  background: radial-gradient(120% 80% at 100% 0%, rgba(243, 192, 75, .22), transparent 60%), linear-gradient(160deg, #17356b 0%, #2b5fe2 58%, #1f3f85 100%); }
.au__hero::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 340px; height: 340px; border-radius: 50%; border: 46px solid rgba(255, 255, 255, .06); pointer-events: none; }
.au__brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -.3px; }
.au__brand img { height: 32px; width: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .2)); }
.au__brand b { color: #f3c04b; }
.au__brand em { font-style: normal; font-weight: 600; color: #c9d6ff; font-size: 16px; }
.au__pitch { margin-top: auto; margin-bottom: auto; max-width: 460px; }
.au__kicker { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #f3c04b; }
.au__pitch h1 { margin: 12px 0 24px; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -.6px; }
.au__pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.au__pitch li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: #dce5ff; }
.au__pitch li b { color: #fff; }
.au__pitch li svg { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #f3c04b; }
.au__credit { font-size: 13px; color: #b9c8f3; }
@media (min-width: 861px) { .au__hero { position: sticky; top: 0; height: 100vh; height: 100dvh; } }
.au__credit b { color: #fff; }

.au__main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px 20px; gap: 18px; }
.au__card { width: min(460px, 100%); padding: 30px 28px 24px; border-radius: 26px; background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: var(--shadow-panel); }
.au__foot { font-size: 12.5px; color: var(--color-text-faint); text-align: center; }
.au__foot b { color: var(--color-text-muted); }
.au__head { margin-bottom: 18px; }
.au__head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.au__head p { margin: 6px 0 0; color: var(--color-text-muted); font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.au__head p b { color: var(--color-text); }
.au__badge { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 15px; background: var(--color-gold-soft); color: var(--color-gold-ink); }
.au__badge svg { width: 24px; height: 24px; }
.au__back { display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 14px -8px; padding: 6px 10px 6px 4px; border: 0; border-radius: 999px; background: none; color: var(--color-text-muted); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.au__back:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.au__back svg { width: 18px; height: 18px; }

.au__form { display: grid; gap: 14px; }
.au__f { display: grid; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.au__f > span, .au__f legend { font-weight: 700; font-size: 13.5px; color: var(--color-text); padding: 0; margin-bottom: 0; }
.au__f small { font-size: 12px; color: var(--color-text-faint); }
.au__in { position: relative; display: flex; align-items: center; border-radius: 14px; background: var(--color-surface-sunken); box-shadow: inset 0 0 0 1px var(--color-border); transition: box-shadow .15s ease; }
.au__in:focus-within { box-shadow: inset 0 0 0 2px var(--color-blue); background: var(--color-surface); }
.au__in.is-bad { box-shadow: inset 0 0 0 2px var(--color-danger); }
.au__in input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; border: 0; background: none; color: var(--color-text); font: inherit; font-size: 16px; outline: none; }
.au__in input::placeholder { color: var(--color-text-faint); }
.au__in--pw input { padding-right: 48px; }
.au__eye { position: absolute; right: 4px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--color-text-muted); cursor: pointer; }
.au__eye:hover { color: var(--color-blue); }
.au__eye svg { width: 20px; height: 20px; }
.au__ferr { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--color-danger); }
.au__ferr:empty { display: none; }
.au__err { padding: 10px 14px; border-radius: 12px; background: var(--color-danger-soft); color: var(--color-danger); font-weight: 600; font-size: 13.5px; line-height: 1.45; }
.au__note { margin: -4px 0 16px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.au__note--info { background: var(--color-blue-soft); color: var(--color-blue); }
.au__note--warn { background: var(--color-gold-soft); color: var(--color-gold-ink); }

.au__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.au__chips label { position: relative; }
.au__chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.au__chips span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--color-surface-sunken); box-shadow: inset 0 0 0 1px var(--color-border); font-weight: 700; font-size: 13.5px; color: var(--color-text-muted); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.au__chips input:checked + span { background: var(--color-blue); color: var(--color-blue-contrast); box-shadow: none; }
.au__chips input:focus-visible + span { box-shadow: var(--focus-ring); }

.au__code { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.au__code input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; z-index: 1; caret-color: transparent; }
.au__code i { height: 56px; display: grid; place-items: center; border-radius: 14px; background: var(--color-surface-sunken); box-shadow: inset 0 0 0 1px var(--color-border); font-style: normal; font-weight: 800; font-size: 24px; color: var(--color-text); }
.au__code i.is-on { background: var(--color-blue-soft); color: var(--color-blue); box-shadow: none; }
.au__code i.is-cur { box-shadow: inset 0 0 0 2px var(--color-blue); }

.au__btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 4px; border: 0; border-radius: 999px; background: var(--color-blue); color: var(--color-blue-contrast); font: inherit; font-weight: 800; font-size: 15.5px; cursor: pointer; box-shadow: 0 10px 24px -12px var(--color-blue); transition: background-color .15s ease, transform .1s ease; }
.au__btn:hover { background: var(--color-blue-hover); }
.au__btn:active { transform: translateY(1px); }
.au__btn:disabled { opacity: .7; cursor: default; }
.au__btn.is-busy::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: au-spin .8s linear infinite; }
.au__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.au__row--end { justify-content: flex-end; margin-top: -6px; }
.au__row--center { justify-content: center; font-size: 13.5px; }
.au__muted { color: var(--color-text-muted); }
.au__link { padding: 4px 2px; border: 0; background: none; color: var(--color-blue); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.au__link:hover { text-decoration: underline; }
.au__link:disabled { color: var(--color-text-faint); cursor: default; text-decoration: none; }
.au__alt { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--color-border); text-align: center; font-size: 14px; color: var(--color-text-muted); }

.au-splash { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--color-bg); color: var(--color-text); font-family: var(--font); text-align: center; padding: 20px; }
.au-splash img { height: 40px; }
.au-splash b { font-size: 22px; font-weight: 800; }
.au-splash b i { font-style: normal; color: var(--color-gold); }
.au-splash b em { font-style: normal; font-weight: 600; color: var(--color-text-muted); font-size: 17px; }
.au-splash p { margin: 0; color: var(--color-text-muted); font-weight: 600; font-size: 14px; }
.au-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--color-blue-soft); border-top-color: var(--color-blue); animation: au-spin .8s linear infinite; }
@keyframes au-spin { to { transform: rotate(360deg); } }
/* while the lab loads, the splash covers it */
html:not(.is-lab) #root { visibility: hidden; }

.au-kick { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 24, .55); backdrop-filter: blur(6px); }
.au-kick__card { width: min(400px, 100%); padding: 26px 24px 22px; border-radius: 24px; background: var(--color-surface); color: var(--color-text); text-align: center; box-shadow: var(--shadow-panel); font-family: var(--font); }
.au-kick__card h2 { margin: 0 0 6px; font-size: 22px; }
.au-kick__card p { margin: 0 0 16px; color: var(--color-text-muted); font-size: 14.5px; line-height: 1.55; }

@media (max-width: 860px) {
  .au { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .au__hero { gap: 14px; padding: 18px 20px 22px; }
  .au__hero::after { width: 220px; height: 220px; right: -70px; top: -90px; bottom: auto; border-width: 34px; }
  .au__brand { font-size: 18px; } .au__brand img { height: 26px; }
  .au__pitch { margin: 0; }
  .au__pitch h1 { margin: 8px 0 0; font-size: 22px; }
  .au__pitch ul, .au__credit { display: none; }
  .au__main { justify-content: flex-start; padding: 0 12px 16px; margin-top: -10px; }
  .au__card { position: relative; padding: 24px 18px 20px; border-radius: 22px; }
  .au__head h2 { font-size: 23px; }
}
@media (max-width: 380px) { .au__code { gap: 5px; } .au__code i { height: 50px; font-size: 21px; } .au__chips span { padding: 0 11px; font-size: 13px; } }

/* ================================================================ the lab: account button + menu, credit line */
.ol-acct { position: relative; flex: none; }
.ol-acct__btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: linear-gradient(150deg, #2b5fe2, #17356b); color: #fff; font: inherit; font-weight: 800; font-size: 17px; cursor: pointer; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-gold-soft); }
.ol-acct__btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-gold); }
.ol-acct__menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; width: 260px; padding: 8px; border-radius: 20px; background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: var(--shadow-panel); display: grid; gap: 2px; }
.ol-acct__who { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--color-border); min-width: 0; }
.ol-acct__who > span:last-child { display: grid; min-width: 0; }
.ol-acct__who b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-acct__who small { font-size: 12.5px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-acct__av { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--color-blue-soft); color: var(--color-blue); font-weight: 800; }
.ol-acct__menu > button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: none; color: var(--color-text); font: inherit; font-weight: 700; font-size: 14px; text-align: left; cursor: pointer; }
.ol-acct__menu > button:hover { background: var(--color-surface-sunken); }
.ol-acct__menu > button svg { width: 18px; height: 18px; flex: none; color: var(--color-text-muted); }
.ol-acct__out { color: var(--color-danger) !important; }
.ol-acct__out svg { color: var(--color-danger) !important; }
.ol-acct__credit { padding: 8px 10px 4px; margin-top: 4px; border-top: 1px solid var(--color-border); font-size: 11.5px; color: var(--color-text-faint); }
.ol-credit { margin-top: 4px; padding: 6px 4px 2px; text-align: center; font-size: 12px; color: var(--color-text-faint); }
.ol-credit b { color: var(--color-text-muted); font-weight: 700; }

/* ================================================================ the lab on a phone or tablet: the panel is a bottom sheet */
@media (max-width: 1000px) {
  .ol-student .simpage { height: 100vh; height: 100dvh; overflow: hidden; }
  .ol-student .simpage .ew-nav { padding: 8px 8px 6px; }
  .ol-student .ew-nav__bar { gap: 6px; padding: 6px 6px 6px 10px; }
  .ol-student .ol-title, .ol-student .ew-chip { display: none; }
  .ol-student .ew-brand img { height: 26px; }

  .ol-student .stage.ol-mob { --pad: 46dvh; display: block; position: relative; flex: 1; min-height: 0; padding: 0 8px; padding-bottom: calc(var(--pad) + 6px); }
  .ol-student .stage.ol-mob--peek { --pad: 92px; }
  .ol-student .stage.ol-mob .view { height: 100%; min-height: 0; border-radius: 18px; }

  .ol-sheet { --h: 46dvh; position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--h); max-height: calc(100dvh - 70px); border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, .35), 0 -1px 0 var(--color-border); transition: height .22s ease; padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain; }
  .ol-sheet.is-peek { --h: 92px; overflow: hidden; }
  .ol-sheet.is-full { --h: calc(100dvh - 70px); }
  .ol-sheet__grip { position: sticky; top: 0; z-index: 3; flex: none; width: 100%; height: 22px; display: grid; place-items: center; padding: 0; border: 0; background: var(--color-surface-alt); cursor: pointer; }
  .ol-sheet__grip i { width: 44px; height: 5px; border-radius: 99px; background: var(--color-border-strong); }
  .ol-sheet .tabs { top: 22px; margin-top: 0; }

  /* over the 3D view: the view buttons along the top, the step buttons bottom-left, readings bottom-right */
  .ol-student .ol-mob .views { top: 8px; bottom: auto; left: 8px; right: 8px; max-width: none; padding: 4px; }
  .ol-student .ol-mob .views button { min-height: 36px; padding: 0 11px; font-size: 12.5px; }
  .ol-student .ol-mob .status { top: 58px; bottom: auto; right: 8px; }
  .ol-student .ol-mob .toast { top: 58px; max-width: calc(100% - 24px); white-space: normal; text-align: center; }
  .ol-student .ol-mob .ol-stepnav { left: 8px; bottom: 8px; padding: 6px; gap: 8px; }
  .ol-student .ol-mob .ol-stepnav .ew-round { width: 44px; height: 44px; }
  .ol-student .ol-mob .inspect { left: 8px; right: 8px; bottom: 70px; top: auto; max-height: 52%; }
  .ol-student .ol-mob .loading { inset: 0; }
}
@media (max-width: 560px) {
  .ol-student .ew-nav__bar { padding: 5px 5px 5px 8px; gap: 5px; min-height: 0; }
  .ol-student .ew-lang button { padding-inline: 9px; }
  .ol-student .ew-panelbtn { width: 40px; height: 40px; }
  .ol-acct__btn { width: 40px; height: 40px; font-size: 15px; }
  .ol-acct__menu { position: fixed; left: 8px; right: 8px; top: 64px; width: auto; }
}
@media (max-width: 400px) {
  .ol-student .ew-brand { display: none; }
}
@media (min-width: 1001px) { .ol-acct__full { display: none !important; } }
