/* BrightClass theme: friendly, rounded, school colours. Bootstrap 5.1 underneath. */
:root {
    --brand: #13873f; --brand-dark: #0d6e32; --brand-soft: #e8f7ee; --brand-bright: #22c55e;
    --sun: #ffc93c; --mint: #20c997; --coral: #ff6b6b; --sky: #4dabf7;
    --ink: #23303f; --muted: #66737f; --bg: #f4f7f5; --line: #e3ebe6; --card: #fff;
    --radius: 18px; --shadow: 0 2px 0 var(--line), 0 6px 20px rgba(35,48,63,.05);
    --sidebar: 268px;
}
html { -webkit-tap-highlight-color: transparent; }
body { font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); font-size: 1rem; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 800; letter-spacing: -.01em; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
.text-muted { color: var(--muted) !important; }
code { color: var(--brand-dark); background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--sun) !important; outline-offset: 2px; }

/* ---------- Bootstrap restyle ---------- */
.btn { border-radius: 999px; font-weight: 700; padding: .5rem 1.15rem; border-width: 2px; }
.btn-sm { padding: .3rem .85rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.6rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); box-shadow: 0 3px 0 var(--brand-dark); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-primary:active { transform: translateY(2px); box-shadow: none; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-warning { background: var(--sun); border-color: var(--sun); color: var(--ink); box-shadow: 0 3px 0 #e0a800; }
.btn-success { background: var(--mint); border-color: var(--mint); box-shadow: 0 3px 0 #12b886; }
.btn-soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 18%, #fff); color: var(--brand-dark); }
.btn-light { background: #fff; border-color: var(--line); }
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
.form-control, .form-select { border-radius: 12px; border: 2px solid var(--line); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label, legend.form-label { font-weight: 700; font-size: .9rem; }
.input-group > .form-control, .input-group > .form-select { border-radius: 12px; }
.input-group > .btn { border-radius: 12px; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.alert { border: 0; border-radius: 14px; font-weight: 600; }
.alert-success { background: #e6fcf5; color: #087f5b; }
.alert-danger { background: #fff0f0; color: #c92a2a; }
.alert-warning { background: #fff9db; color: #8a5a00; }
.alert-info { background: #e7f5ff; color: #1864ab; }
.badge { border-radius: 999px; font-weight: 700; padding: .35em .7em; }
.bg-primary { background: var(--brand) !important; }
.text-primary { color: var(--brand) !important; }
.bg-success { background: var(--mint) !important; }
.bg-warning { background: var(--sun) !important; }
.list-group { border-radius: var(--radius); box-shadow: var(--shadow); }
.list-group-item { border-color: var(--line); padding: .85rem 1rem; }
.list-group-item-action:hover { background: var(--brand-soft); }
.table { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1rem; }
.table > thead th { background: #f8faf9; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-color: var(--line); }
.dropdown-menu { border: 0; border-radius: 14px; box-shadow: 0 10px 30px rgba(35,48,63,.15); }
.progress { height: 10px; border-radius: 99px; background: var(--line); }
.progress-bar { border-radius: 99px; }

/* ---------- avatars & icons ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; flex-shrink: 0; line-height: 1; }
.avatar.critter { box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.avatar.class-icon { border-radius: 30%; }
.avatar.photo { object-fit: cover; background: var(--brand-soft); }
.hero-band .avatar.photo { border: 3px solid rgba(255,255,255,.7); }
.photo-tools { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; }
.photo-tools label { cursor: pointer; }
.branch-photo { width: 100%; height: 150px; object-fit: cover; border-radius: 14px; margin-bottom: .75rem; }
.doc-row { display: flex; gap: .6rem; align-items: center; border-top: 1px solid #edf1ee; padding: .55rem 0; }
.doc-row .doc-ic { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-size: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 900; font-size: 1.25rem; color: var(--ink); }
.brand img { border-radius: 10px; }

/* ---------- app shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #fff; border-right: 1px solid var(--line);
           padding: 18px 14px; overflow-y: auto; z-index: 1040; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 8px; margin-bottom: 14px; }
.school-name { font-weight: 900; font-size: 1.3rem; line-height: 1.2; padding: 0 8px; }
.school-sub { color: var(--muted); font-size: .85rem; padding: 2px 8px 14px; }
.side-heading { color: var(--muted); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 16px 12px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink); font-weight: 700; text-align: left; }
.side-link i { font-size: 1.2rem; width: 26px; text-align: center; color: #54616e; }
.side-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link:hover { background: var(--bg); color: var(--ink); }
.side-link.active { background: var(--brand-soft); color: var(--brand-dark); }
.side-link.active i { color: var(--brand); }
.pill-count { margin-left: auto; background: var(--coral); color: #fff; font-size: .72rem; border-radius: 99px; padding: 1px 8px; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 10px; height: 68px; padding: 0 24px;
          background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 900; font-size: 1.35rem; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.dot-count { position: absolute; top: -2px; right: -2px; background: var(--coral); color: #fff; font-size: .68rem; font-weight: 800; border-radius: 99px; padding: 1px 6px; border: 2px solid #fff; }
.content { padding: 24px; max-width: 1280px; }
.sidebar-backdrop, .tabbar { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 10px 0 40px rgba(0,0,0,.15); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(35,48,63,.35); z-index: 1035; }
    .main { margin-left: 0; }
    .topbar { padding: 0 12px; height: 60px; }
    .topbar-title { font-size: 1.1rem; }
    .content { padding: 16px 16px calc(90px + env(safe-area-inset-bottom)); }
    .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--line);
              padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
    .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none;
                                color: var(--muted); font-size: .7rem; font-weight: 700; padding: 4px 0; border-radius: 12px; }
    .tabbar i { font-size: 1.35rem; }
    .tabbar .active { color: var(--brand); background: var(--brand-soft); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- section (classroom) header & tabs ---------- */
.class-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.class-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.class-tabs a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 16px; border-radius: 999px;
                background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }
.class-tabs a.active { background: var(--brand); color: #fff; box-shadow: 0 3px 0 var(--brand-dark); }

/* ---------- class cards (teacher home) ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.class-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 26px 18px 20px; text-align: center; color: var(--ink);
              border: 2px solid transparent; transition: transform .12s ease, border-color .12s; display: block; }
.class-card:hover { transform: translateY(-3px); border-color: var(--brand-soft); color: var(--ink); }
.class-card .name { font-weight: 800; font-size: 1.05rem; margin-top: 12px; }
.class-card .meta { color: var(--muted); font-size: .85rem; }
.class-card .todo { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: #fff4e6; color: #d9480f; }
.class-card.add { border: 2px dashed color-mix(in srgb, var(--brand) 30%, #fff); box-shadow: none; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--brand); font-weight: 800; }
.plus-circle { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 10px; }
.tile { border-radius: 20px; padding: 18px; color: var(--ink); display: block; min-height: 120px; position: relative; overflow: hidden; }
.tile .emoji { font-size: 2.2rem; }
.tile strong { display: block; font-size: 1.05rem; margin-top: 6px; }
.tile:hover { color: var(--ink); filter: brightness(.98); }
.tile-sun { background: linear-gradient(135deg, #ffe8a3, #ffd6a5); }
.tile-mint { background: linear-gradient(135deg, #c3fae8, #b2f2bb); }
.tile-pink { background: linear-gradient(135deg, #ffdeeb, #e5dbff); }
.tile-sky { background: linear-gradient(135deg, #d0ebff, #c5f6fa); }

/* ---------- classroom points grid ---------- */
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; }
.student-card { position: relative; background: #fff; border-radius: 20px; padding: 18px 8px 12px; text-align: center; cursor: pointer;
                box-shadow: var(--shadow); border: 3px solid transparent; user-select: none; transition: transform .1s; }
.student-card:hover { transform: translateY(-2px); }
.student-card input { position: absolute; opacity: 0; pointer-events: none; }
.student-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.student-card:has(input:focus-visible) { outline: 3px solid var(--sun); }
.student-card .name { font-size: .9rem; font-weight: 800; margin-top: 8px; line-height: 1.2; }
.points-pill { position: absolute; top: 8px; right: 8px; font-size: .8rem; font-weight: 900; border-radius: 999px; padding: 1px 9px; background: #e6fcf5; color: #087f5b; }
.points-pill.neg { background: #fff0f0; color: #c92a2a; }
.no-guardian { position: absolute; top: 6px; left: 9px; font-size: .75rem; }
.award-bar { position: sticky; bottom: 12px; z-index: 5; }
@media (max-width: 991.98px) { .award-bar { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.skill-btn { min-width: 112px; border-radius: 16px; padding: .5rem .7rem; }
.skill-btn .icon { font-size: 1.6rem; display: block; line-height: 1.2; }

/* ---------- misc ---------- */
.big-number { font-size: 2.6rem; font-weight: 900; color: var(--brand); line-height: 1; }
.post-img { max-width: 100%; max-height: 440px; border-radius: 14px; object-fit: cover; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: #fff; box-shadow: var(--shadow); }
.bubble.mine { background: var(--brand); color: #fff; margin-left: auto; border-radius: 18px 18px 6px 18px; }
.bubble.mine .text-muted { color: rgba(255,255,255,.8) !important; }
.reversed { text-decoration: line-through; opacity: .55; }
.code-box { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 1.7rem; letter-spacing: .2em; font-weight: 800; color: var(--brand-dark); }
.hello-card { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; border-radius: 24px; padding: 22px; }
.hello-card .text-muted { color: rgba(255,255,255,.8) !important; }
.hello-card .big-number { color: #fff; }

/* ---------- public site ---------- */
.site-header { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 0; }
.site-links a { color: var(--ink); font-weight: 700; }
.site-main { min-height: 70vh; padding-top: 24px; }
body.site { background: #fff; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; background: var(--bg); margin-top: 60px; }
.site-footer a { color: var(--ink); font-weight: 700; }
.hero { text-align: center; padding: 40px 0 10px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 900; line-height: 1.05; }
.hero .lead { color: var(--muted); font-size: 1.15rem; max-width: 620px; margin: 16px auto 0; }
.role-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 28px auto 0; }
.role-card { width: 132px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 18px 10px 14px; color: var(--ink); font-weight: 800; border: 2px solid var(--line); }
.role-card:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-3px); transition: transform .12s; }
.role-card .bubble-icon { width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; margin-bottom: 8px; }
.role-card .go { display: block; color: var(--brand); font-size: 1.1rem; }
.collage { display: flex; gap: 14px; justify-content: center; margin: 40px -40px 10px; overflow: hidden; padding: 14px 0; }
.collage div { flex: 0 0 auto; width: 128px; height: 128px; border-radius: 26px; display: flex; align-items: center; justify-content: center; font-size: 3.6rem; box-shadow: var(--shadow); }
.collage div:nth-child(odd) { transform: rotate(-6deg) translateY(10px); }
.collage div:nth-child(even) { transform: rotate(5deg); }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 56px 0; }
.feature.flip > :first-child { order: 2; }
.feature h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 900; line-height: 1.1; }
.feature p { color: var(--muted); font-size: 1.05rem; }
.chip-icon { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem; margin-bottom: 12px; }
.blob { border-radius: 40px 60px 40px 70px; padding: 26px; }
@media (max-width: 767.98px) {
    .feature { grid-template-columns: 1fr; gap: 20px; padding: 36px 0; }
    .feature.flip > :first-child { order: 0; }
    .collage div { width: 92px; height: 92px; font-size: 2.6rem; }
}
.band { background: linear-gradient(135deg, var(--brand-soft), #e7f5ff); border-radius: 32px; padding: 40px 28px; text-align: center; }
.auth-wrap { max-width: 460px; margin: 10px auto 0; }
.auth-wrap .card { padding: 32px !important; }

/* Phone: skills become one swipeable row so the class stays visible above them. */
@media (max-width: 767.98px) {
    .skill-row { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; padding: 0 8px 4px; }
    .skill-row .skill-btn { flex: 0 0 auto; min-width: 96px; font-size: .8rem; }
    .award-bar { padding: 10px !important; }
    .award-bar input[name=note] { display: none; }
}

/* ---- admin & profile pages (green tile + yellow star, from the logo) ---- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.5rem; font-weight: 900; margin: 0; }
.page-head .sub { color: var(--muted); font-size: .92rem; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.hero-band { position: relative; overflow: hidden; border-radius: 24px; padding: 24px; color: #fff;
             background: linear-gradient(135deg, var(--brand-dark), var(--brand) 70%, var(--brand-bright)); margin-bottom: 20px; }
.hero-band::after { content: ""; position: absolute; right: -30px; top: -30px; width: 180px; height: 180px; opacity: .18;
                    background: url(/icons/logo.svg) center/contain no-repeat; transform: rotate(12deg); }
.hero-band h1, .hero-band h2 { color: #fff; font-weight: 900; margin: 0; }
.hero-band .sub { color: rgba(255,255,255,.85); }
.hero-band .chip { background: rgba(255,255,255,.18); color: #fff; }
.hero-band a:not(.btn) { color: #fff; text-decoration: underline; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 3px 10px;
        background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap; }
.chip.sun { background: #fff4cc; color: #8a5a00; }
.chip.grey { background: #eef1f3; color: #54616e; }
.chip.red { background: #fff0f0; color: #c92a2a; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: flex; gap: 12px; align-items: center; color: var(--ink); }
a.kpi:hover { color: var(--ink); transform: translateY(-2px); transition: transform .12s; }
.kpi .ic { width: 46px; height: 46px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi .num { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.kpi .lbl { font-size: .8rem; color: var(--muted); font-weight: 700; }
.ic-green { background: var(--brand-soft); color: var(--brand); }
.ic-sun { background: #fff4cc; color: #c08a00; }
.ic-sky { background: #e7f5ff; color: #1c7ed6; }
.ic-pink { background: #fff0f6; color: #d6336c; }
.ic-mint { background: #e6fcf5; color: #0ca678; }

.branch-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.branch-card .top { padding: 18px 18px 14px; background: linear-gradient(135deg, var(--brand-soft), #fff); display: flex; gap: 12px; align-items: center; }
.branch-card .badge-code { width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #fff; font-weight: 900; display: flex;
                           align-items: center; justify-content: center; font-size: .9rem; box-shadow: 0 3px 0 var(--brand-dark); flex-shrink: 0; }
.branch-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.branch-card .stats div { padding: 10px 4px; }
.branch-card .stats strong { display: block; font-size: 1.3rem; font-weight: 900; color: var(--brand); }
.branch-card .stats span { font-size: .75rem; color: var(--muted); font-weight: 700; }
.branch-card .body { padding: 14px 18px; font-size: .88rem; flex: 1; }
.branch-card .body div { margin-bottom: 4px; color: #44515d; }
.branch-card .body i { color: var(--brand); margin-right: 6px; }

.filter-bar { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px; margin-bottom: 16px; }
.people { background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.person:first-child { border-top: 0; }
a.person:hover { background: #f8fbf9; color: var(--ink); }
.person .who { min-width: 0; flex: 1; }
.person .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 45%; }
.person.off { opacity: .55; }
.people-count { color: var(--muted); font-size: .85rem; font-weight: 700; margin: 0 0 8px 4px; }

.form-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.form-card > h2 { font-size: 1.02rem; font-weight: 900; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.form-card > h2 i { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.form-label .req { color: #e03131; }
.save-bar { position: sticky; bottom: 0; z-index: 5; background: rgba(244,247,245,.92); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 8px; }
@media (max-width: 991.98px) { .save-bar { bottom: 64px; } }

.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .9rem; }
.info-list dt { color: var(--muted); font-weight: 700; }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.side-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.side-card h3 { font-size: .95rem; font-weight: 900; margin-bottom: 10px; }

/* ---- sign-in screens ---- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 980px; margin: 0 auto; background: #fff;
             border-radius: 28px; box-shadow: 0 20px 50px rgba(35,48,63,.10); overflow: hidden; }
.auth-art { background: linear-gradient(150deg, var(--brand-bright), var(--brand) 55%, var(--brand-dark)); color: #fff; padding: 40px 36px;
            display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-art img.logo { width: 96px; height: 96px; margin-bottom: 18px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.18)); }
.auth-art h2 { font-weight: 900; font-size: 1.8rem; color: #fff; }
.auth-art p { color: rgba(255,255,255,.9); }
.auth-art ul { list-style: none; padding: 0; margin: 10px 0 0; }
.auth-art li { margin: 8px 0; font-weight: 700; }
.auth-art li i { color: #ffe066; margin-right: 8px; }
.auth-art::after { content: "★"; position: absolute; right: -10px; bottom: -40px; font-size: 220px; color: rgba(255,224,102,.16); line-height: 1; }
.auth-form { padding: 36px; }
@media (max-width: 767.98px) {
    .auth-wrap { grid-template-columns: 1fr; border-radius: 22px; }
    .auth-art { padding: 24px; text-align: center; align-items: center; }
    .auth-art ul, .auth-art p { display: none; }
    .auth-art img.logo { width: 64px; height: 64px; margin-bottom: 8px; }
    .auth-art h2 { font-size: 1.3rem; margin: 0; }
    .auth-form { padding: 22px; }
    .person .meta { display: none; }
}

/* ---------- phone app view (/app) ---------- */
.phone-app { background: var(--bg); min-height: 100vh; }
.pa-framed .pa-page { display: none; }
.pa-top { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
          background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pa-title { flex: 1; font-weight: 900; font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink);
           display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.pa-main { padding: 14px 14px calc(92px + env(safe-area-inset-bottom)); }
.pa-main.guest { padding: 0; }
.pa-main.guest > .alert, .pa-main.guest > .container { margin: 12px; }
.pa-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: #fff; border-top: 1px solid var(--line);
           padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(35,48,63,.05); }
.pa-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .7rem; font-weight: 800;
             padding: 5px 0; border-radius: 14px; }
.pa-tabs i { font-size: 1.35rem; }
.pa-tabs .active { color: var(--brand); background: var(--brand-soft); }
.tab-dot { position: absolute; top: 0; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); border: 2px solid #fff; }

.pa-welcome { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff;
              padding: calc(32px + env(safe-area-inset-top)) 28px calc(32px + env(safe-area-inset-bottom));
              background: radial-gradient(circle at 30% 10%, var(--brand-bright), var(--brand) 55%, var(--brand-dark)); }
.pa-welcome .logo { width: 120px; height: 120px; filter: drop-shadow(0 12px 24px rgba(0,0,0,.25)); animation: bob 3s ease-in-out infinite; }
.pa-welcome h1 { font-weight: 900; font-size: 2.2rem; margin: 18px 0 2px; color: #fff; }
.pa-welcome .school { font-weight: 800; opacity: .9; margin: 0; }
.pa-welcome .tag { opacity: .85; max-width: 300px; margin: 14px auto 30px; }
.pa-welcome .actions { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pa-welcome .actions .btn-lg { font-weight: 800; border-radius: 16px; }
.pa-welcome .link { color: #fff; font-weight: 700; text-decoration: underline; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .pa-welcome .logo { animation: none; } }

.pa-me-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
              border-radius: 22px; padding: 18px; margin-bottom: 18px; }
.pa-me-card .name { font-weight: 900; font-size: 1.2rem; }
.pa-me-card .sub { opacity: .85; font-size: .88rem; }
.pa-list-head { font-size: .78rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 16px 6px 6px; }
.pa-list { background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.pa-list > a, .pa-list > button, .pa-list form > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0;
            background: none; color: var(--ink); font-weight: 700; text-align: left; border-top: 1px solid #eef2ef; }
.pa-list > :first-child, .pa-list > :first-child > button { border-top: 0; }
.pa-list > a > span:not(.ic):not(.pill-count), .pa-list button > span:not(.ic) { flex: 1; }
.pa-list .bi-chevron-right { color: #c0c8c3; }
.pa-list .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.pa-list .text-danger .ic { background: #fff0f0; color: #e03131; }

/* Wide screen: the app runs in a phone-sized frame (see app.js). */
.pa-desk { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 64px; padding: 24px;
           background: radial-gradient(circle at 15% 20%, var(--brand-soft), #eef2f0 60%); }
.pa-desk-side { max-width: 340px; }
.pa-desk-side h1 { font-weight: 900; font-size: 2rem; margin: 14px 0 8px; }
.pa-desk-side p { color: var(--muted); }
.pa-desk-side ul { list-style: none; padding: 0; margin: 0 0 20px; }
.pa-desk-side li { margin: 10px 0; font-weight: 700; display: flex; gap: 10px; }
.pa-desk-side li i { color: var(--brand); }
.pa-phone { width: 400px; height: min(860px, calc(100vh - 48px)); flex-shrink: 0; border-radius: 52px; background: #1d2321; padding: 12px;
            box-shadow: 0 30px 80px rgba(20,40,30,.28), inset 0 0 0 2px #3a433f; }
.pa-phone iframe { width: 100%; height: 100%; border: 0; border-radius: 40px; background: #fff; }
@media (max-width: 900px) { .pa-desk-side { display: none; } }
.student-card.add { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed color-mix(in srgb, var(--brand) 35%, #fff);
                    box-shadow: none; background: transparent; color: var(--brand); }
.student-card.add .plus-circle { width: 56px; height: 56px; margin-bottom: 0; }
