/* IDL Learn – signed-out screens and touch details (Nov 2026 refresh).
 * Sign in and sign up look like a phone app: no top bar, the form straight away, one primary button,
 * "Create an account" at the bottom. On a computer the same screen sits in a centred card. */

/* ---------- full-screen signed-out pages ---------- */
body.is-auth .header, body.is-auth .tabbar-wrap { display: none; }
body.is-auth #app { margin-left: 0; padding: 0; }
body.is-auth .bgfx { display: none !important; }
body.is-auth { background: #F4F5F8; }

.auth--app { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: none; }
.auth--app .auth__card { display: flex; flex-direction: column; width: 100%; max-width: 440px; padding: 32px; border: 1px solid #E4E7EC; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); text-align: left; }
.auth--app h1 { margin: 0 0 4px; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.auth--app .muted { margin: 0; font-size: 15px; }
.auth__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--ink); }
.auth__brand .brand__mark { width: 34px; height: 34px; margin: 0; border-radius: 8px; font-size: 12px; font-weight: 800; }
.auth__brand b { font-size: 16px; font-weight: 700; }
.auth__pic { margin: 0 0 16px; }
.auth__pic .auth__art { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; }
.auth--app .auth__school-kicker { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.auth--app .auth__school { font-size: 24px; }

.auth__form { margin-top: 22px; text-align: left; }
.auth__form .field { margin-bottom: 14px; }
.auth__form .field > span { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.auth__form .field input, .auth__form .field select, .auth__form .field textarea { min-height: 50px; padding: 12px 14px; border: 1.5px solid #D0D5DD; border-radius: 8px; box-shadow: none; font-size: 16px; }
.auth__form .field textarea { min-height: 96px; }
.auth__form .field input:focus, .auth__form .field select:focus, .auth__form .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 62, 196, .15); }
.pw { position: relative; display: block; }
.pw input { padding-right: 52px !important; }
.pw__eye { position: absolute; top: 50%; right: 3px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; transform: translateY(-50%); }
.pw__eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw__eye[aria-pressed="true"] { color: var(--brand); }
.pw__eye[aria-pressed="true"] svg path { stroke-dasharray: none; }
.auth__forgot { display: block; margin: -4px 0 12px auto; padding: 6px 0; border: 0; background: none; color: var(--brand); font: 600 14px var(--font); cursor: pointer; }
.auth__help { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--brand-soft); color: var(--text); font-size: 13.5px; line-height: 1.5; }
.auth__go { min-height: 52px; border-radius: 10px; font-size: 16px; font-weight: 600; }
.auth--app .form-error { margin: 0 0 12px; }
.auth__foot { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid #EEF0F3; color: var(--muted); font-size: 14.5px; text-align: center; }
.auth__foot a { color: var(--brand); font-weight: 600; text-decoration: none; }

/* ---------- sign up ---------- */
.su__bar { display: flex; align-items: center; gap: 12px; margin: -8px 0 20px; }
.su__back { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -8px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; text-decoration: none; }
.su__back:hover { background: var(--line-2); }
.su__back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.su__progress { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: #EEF0F3; }
.su__progress i { display: block; height: 100%; border-radius: 3px; background: var(--brand); transition: width .3s ease; }
.su__count { flex: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.su__grow { flex: 1; }
.su__kicker { margin: 0 0 4px; color: var(--brand); font-size: 13px; font-weight: 600; }
.su__sub { margin-top: 2px !important; }
.su__opts { display: grid; gap: 10px; margin-top: 22px; }
.su__opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 1.5px solid #E4E7EC; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.su__opt:hover, .su__opt:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.su__opt-i { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; background: var(--brand-soft); }
.su__opt-i .mi { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.su__opt-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.su__opt-t b { font-size: 16px; font-weight: 600; }
.su__opt-t small { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.su__chev { flex: none; color: var(--faint); font-size: 24px; line-height: 1; }
.su__opts + .auth__foot { margin-top: 26px; }
.su__two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.su__hint { margin: -6px 0 14px; color: var(--muted); font-size: 13px; }
.su__kid { position: relative; margin: 0 0 12px; padding: 14px 14px 2px; border: 1.5px solid #E4E7EC; border-radius: 10px; }
.su__kid legend { padding: 0 6px; margin-left: -6px; color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.su__rm { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.su__rm:hover { background: var(--no-soft); color: var(--no); }
.su__seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 8px; background: #F2F4F7; }
.su__segb { position: relative; display: block; cursor: pointer; }
.su__segb input { position: absolute; opacity: 0; pointer-events: none; }
.su__segb span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 6px; color: var(--text); font-size: 15px; font-weight: 600; }
.su__segb input:checked + span { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.su__segb input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.su__add { width: 100%; min-height: 48px; margin: 0 0 16px; border: 1.5px dashed #C7CDD6; border-radius: 10px; background: none; color: var(--brand); font: 600 15px var(--font); cursor: pointer; }
.su__add:hover { border-color: var(--brand); background: var(--brand-soft); }
.su__trial { display: flex; flex-direction: column; gap: 2px; margin: 0 0 16px; padding: 14px 16px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }
.su__trial b { font-size: 17px; } .su__trial span { color: var(--text); font-size: 14px; }
.su__sum { margin: 0 0 16px; border: 1.5px solid #E4E7EC; border-radius: 10px; }
.su__sum > div { display: flex; gap: 12px; padding: 12px 14px; }
.su__sum > div + div { border-top: 1px solid #EEF0F3; }
.su__sum dt { flex: none; width: 74px; color: var(--muted); font-size: 13px; }
.su__sum dd { margin: 0; display: flex; flex-direction: column; color: var(--ink); font-weight: 600; }
.su__sum dd small { color: var(--muted); font-size: 13px; font-weight: 400; }
.su__terms { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
.su__terms input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); }
.su__done { align-items: stretch; text-align: center; }
.su__done h1, .su__done .su__sub { text-align: center; }
.su__tick { display: inline-flex; align-self: center; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 4px 0 16px; border-radius: 50%; background: var(--ok-soft); }
.su__tick svg { width: 34px; height: 34px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.su__done .su__kicker { margin-top: 22px; text-align: left; }
.su__logins { display: grid; gap: 8px; text-align: left; }
.su__login { padding: 12px 14px; border: 1.5px solid #E4E7EC; border-radius: 10px; }
.su__login > b { display: block; color: var(--ink); font-size: 15.5px; }
.su__login > span { color: var(--muted); font-size: 13px; }
.su__login dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 0; }
.su__login dt { color: var(--muted); font-size: 12px; }
.su__login dd { margin: 0; color: var(--ink); font: 600 15px/1.4 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; word-break: break-all; }
.su__done .su__hint { margin: 12px 0 14px; text-align: left; }
.su__done .btn { margin-top: 8px; }
.su__list { display: grid; gap: 10px; margin: 20px 0; padding: 0; list-style: none; }
.su__list li { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1.5px solid #E4E7EC; border-radius: 10px; }
.su__list b { color: var(--ink); } .su__list span { color: var(--muted); font-size: 14px; }
.su .btn--ghost.btn--block { margin-top: 10px; min-height: 48px; }

/* ---------- touch screens: no keyboard hints, a back arrow in search ---------- */
@media (pointer: coarse) {
    .top__search kbd { display: none; }
    .cmdk { align-items: stretch; padding: 0 !important; background: #fff; }
    .cmdk__box { max-width: none; height: 100%; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
    .cmdk__in { gap: 4px; padding: 0 8px; padding-top: var(--app-top, 0px); }
    .cmdk__list { flex: 1; max-height: none !important; overflow-y: auto; }
}
.cmdk__back { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.cmdk__back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
    body.is-auth { background: #fff; }
    .auth--app { align-items: stretch; padding: 0; }
    .auth--app .auth__card { min-height: 100vh; min-height: 100dvh; max-width: none; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; box-shadow: none; }
    html.is-app .auth--app .auth__card { padding-top: calc(16px + var(--app-top)); padding-bottom: calc(20px + var(--app-bottom)); }
    html.is-app .auth--app { padding: 0; }
    .auth__pic .auth__art { max-width: 210px; }
    .auth__foot { margin-top: auto; padding-top: 20px; border-top: 0; }
    .auth__form + .auth__foot { margin-top: auto; }
    .auth--app .auth__form { margin-top: 20px; }
    .su__card { justify-content: flex-start; }
    .su__opts + .auth__foot { margin-top: auto; }
    .su__done .su__tick { margin-top: 24px; }
}
@media (max-width: 360px) { .su__two { grid-template-columns: 1fr; } }
.su__gap { margin-top: 24px; }

/* ---------- account menu: a bottom sheet on phones (Nov 2026) ---------- */
@media (max-width: 720px) {
    body.menu-open::after { content: ''; position: fixed; inset: 0; z-index: 290; background: rgba(16, 24, 40, .45); animation: fadeIn .18s ease; }
    body.menu-open { overflow: hidden; }
    .user__menu { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 300; width: auto; min-width: 0; max-height: 85vh; overflow-y: auto; margin: 0;
        padding: 6px 12px calc(14px + var(--app-bottom, env(safe-area-inset-bottom, 0px))); border: 0; border-radius: 12px 12px 0 0; background: #fff;
        box-shadow: 0 -10px 30px rgba(16, 24, 40, .16); animation: sheetUp .24s cubic-bezier(.2, .8, .2, 1); }
    .user__menu::before { content: ''; display: block; width: 36px; height: 4px; margin: 4px auto 12px; border-radius: 2px; background: #D0D5DD; }
    .user__card { align-items: center; gap: 14px; margin: 0 0 8px; padding: 4px 6px 16px; border-bottom: 1px solid #EEF0F3; }
    .user__card .avatar--lg { flex: none; width: 52px; height: 52px; font-size: 20px; }
    .user__card p { min-width: 0; gap: 1px; }
    .user__card b { overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
    .user__card small { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
    .user__menu a, .user__menu button { gap: 14px; min-height: 52px; padding: 0 8px; border-radius: 8px; color: var(--ink); font-size: 16px; font-weight: 500; }
    .user__menu a:active, .user__menu button:active { background: #F2F4F7; }
    .user__menu .mi { width: 22px; height: 22px; stroke: var(--text); }
    .user__menu #sign-out { margin-top: 6px; border-top: 1px solid #EEF0F3; border-radius: 0; color: var(--no); }
    .user__menu #sign-out .mi { stroke: var(--no); }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(100%); } }

/* ---------- top bar: one row, every control the same height and centred ---------- */
@media (max-width: 1024px) {
    .top { display: flex; align-items: center; gap: 8px; min-height: 56px; height: auto; padding-top: 0; padding-bottom: 0; }
    .top__menu, .top__search, .user__btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 0; margin: 0; padding: 0; border: 1px solid #E4E7EC; border-radius: 8px; background: #fff; box-shadow: none; }
    .top__search span, .top__search kbd { display: none; }
    .top__search .mi, .top__menu .mi { width: 20px; height: 20px; }
    .top__menu { padding: 9px; }
    .user__btn { border: 0; border-radius: 50%; background: none; }
    .user__btn .avatar { width: 36px; height: 36px; font-size: 15px; }
    .user__name { display: none; }
    .top__title { margin: 0 4px; font-size: 16px; font-weight: 600; line-height: 1.2; }
    .user { margin-left: 0; }
}

/* ---------- phones: nothing is ever wider than the screen ---------- */
@media (max-width: 720px) {
    table.rt, table.rt tbody, table.rt tr { min-width: 0; max-width: 100%; }
    table.rt tbody { grid-template-columns: minmax(0, 1fr); }
    table.rt tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    table.rt td { max-width: 100%; overflow-wrap: anywhere; }
    table.rt td .row-actions { flex-wrap: wrap; width: 100%; min-width: 0; }
    table.rt td .btn, table.rt td .row-actions > .btn { flex: 0 1 auto; max-width: 100%; white-space: normal; }
    .br-grid { grid-template-columns: minmax(0, 1fr); }
    .br-card, .br-card > *, .br-card header > * { min-width: 0; max-width: 100%; }
    .lvl { max-width: 100%; white-space: normal; }
    .grid2 { grid-template-columns: minmax(0, 1fr) !important; }
    .panel, .panel > *, .grid2 > *, .field, .field input, .field select { min-width: 0; max-width: 100%; }
    img, video, canvas { max-width: 100%; }
    table.rt td.row-actions { grid-column: 1 / -1; display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; white-space: normal; }
    table.rt td.row-actions::before { display: none; }
    .table--compact { width: 100%; max-width: 100%; }
    .table--compact th, .table--compact td { padding-left: 6px; padding-right: 6px; white-space: normal; overflow-wrap: anywhere; }
    .panel > .rec-grid, .panel > .tabs, .panel > .stages { max-width: none; }
    /* a tall pop-up always stops below the status bar */
    .modal__box { max-height: min(92vh, calc(100vh - var(--app-top, 0px) - 12px)); }
}
