/* =========================================================
   Trang học sinh & phụ huynh (/hoc-sinh)
   Đăng nhập: khung chung auth.css (form bên trái, vở ô li bên phải).
   Sau khi đăng nhập: thanh trên + tab gạch chân, nền xám nhạt, thẻ viền mảnh, một màu nhấn;
   điểm nhấn duy nhất là biểu đồ điểm trong tháng. Chỉ dùng biến màu chung để sáng / tối đều đúng.
   ========================================================= */
body.fam { background: var(--surface); }
body.fam.fam-in { background: var(--bg); }
.fam .grow { flex: 1; min-width: 0; }
.fam .auth .err { margin: 0; }
.fam .auth .form-msg { margin: 0; }
.fam .auth .form-msg .i { width: 16px; height: 16px; margin-top: 2px; }
.fam .desk-notes li > span { min-width: 0; }

/* ---------- thanh trên ---------- */
.fp-top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.fp-top[hidden] { display: none; }
.fp-bar { max-width: 1080px; height: 64px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.fp-top .brand { padding: 0; gap: 8px; font-size: 18px; font-weight: 600; letter-spacing: 0; color: var(--ink); min-width: 0; }
.fp-top .brand .logo { width: 28px; height: 28px; }
.fp-top .brand:hover { text-decoration: none; }
.brand-sub { margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line-2); font-size: 14px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.fp-actions { position: relative; display: flex; align-items: center; gap: 8px; }
.fp-top .icon-btn { border-color: var(--line); }
.fp-top .icon-btn .i { width: 18px; height: 18px; }
.kid-switch { display: inline-flex; align-items: center; gap: 8px; height: 36px; max-width: 260px; padding: 0 10px 0 4px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .15s; }
.kid-switch:hover { background: var(--surface-2); }
.kid-switch:focus-visible { outline: none; box-shadow: var(--ring); }
.kid-switch .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-switch .i { width: 16px; height: 16px; color: var(--muted); }
.fp-av { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; letter-spacing: 0;
  background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

/* menu chọn con */
.fp-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 300px; max-width: calc(100vw - 32px); padding: 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: pop .14s ease; }
.fp-menu-h { padding: 6px 10px 4px; font-size: 12px; color: var(--muted); }
.fp-menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.fp-menu button:hover, .fp-menu button:focus-visible { background: var(--surface-2); outline: none; }
.fp-menu button b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-menu button small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-menu button > .i { width: 16px; height: 16px; color: var(--primary-2); }
.fp-menu button[data-add] > .i { color: var(--muted); margin: 0 6px; }
.fp-menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* tab gạch chân (máy tính) */
.fp-tabs { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: flex; gap: 24px; }
.fp-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 44px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fp-tabs a:hover { color: var(--ink); text-decoration: none; }
.fp-tabs a .i { width: 16px; height: 16px; }
.fp-tabs a.on { color: var(--ink); font-weight: 500; border-color: var(--primary); }
.fp-tabs a .n, .fam-tabbar .n { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* tab dưới đáy (điện thoại) */
.fam-tabbar { display: none; }

/* ---------- khung nội dung ---------- */
main.fp { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; animation: rise .32s cubic-bezier(.2, .7, .2, 1) both; }
.fp h1 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.fp h2 { font-weight: 600; }
.fp h3 { font-weight: 600; }

/* chọn thầy cô (một em học nhiều thầy cô / trung tâm) */
.fp-who { display: flex; align-items: center; gap: 8px 12px; margin-bottom: 24px; flex-wrap: wrap; }
.fp-who .lbl { font-size: 13px; color: var(--muted); }
.fp-who .seg button { gap: 8px; }
.t0 { --t: var(--sky); } .t1 { --t: var(--grape); } .t2 { --t: var(--sun); } .t3 { --t: var(--coral); } .t4 { --t: var(--mint); }
.t-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--t); flex: none; }
.t-tag { display: inline-flex; align-items: center; gap: 6px; margin-left: 2px; font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.t-tag .t-dot { width: 6px; height: 6px; }

/* học sinh */
.fp-kid { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.fp-kid-l { display: flex; align-items: center; gap: 16px; min-width: 0; }
.kid-av { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 20px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary-2); box-shadow: inset 0 0 0 1px var(--line); }
.fp-kid h1 { overflow-wrap: anywhere; }
.fp-kid .classes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.fp-kid .classes span { display: inline-flex; align-items: center; gap: 6px; }
.fp-kid .sw { width: 8px; height: 8px; flex: none; border-radius: 2px; background: var(--c, var(--muted)); }
.fp-teachers { display: grid; gap: 8px; flex: none; }
.fp-teacher { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.fp-teacher small { display: block; font-size: 12px; color: var(--muted); text-align: right; }
.fp-teacher b { display: block; font-size: 14px; font-weight: 500; text-align: right; }
/* SĐT thầy/cô hiện ngay dưới nút Gọi (không mở tel: → Skype trên máy tính) */
.fp-teacher { position: relative; }
.fp-kid:has(.fp-callpop) { position: relative; z-index: 20; }  /* ô số nổi trên các thẻ bên dưới (điện thoại) */
.fp-callpop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 35; min-width: 220px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: pop .14s ease; text-align: left; }
.fp-callpop small { display: block; font-size: 12px; color: var(--muted); text-align: left; }
.fp-callpop-num { margin: 2px 0 10px; font-size: 22px; font-weight: 600; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; user-select: all; }
.fp-callpop-act { display: flex; gap: 8px; }
.fp-callpop-act .btn { flex: 1; justify-content: center; }

/* buổi học tiếp theo */
.fp-next { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px; margin-bottom: 16px; }
.fp-next .when { padding: 10px 4px; border-radius: 12px; text-align: center; background: var(--primary-soft); color: var(--primary-2); }
.fp-next .when small { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; }
.fp-next .when b { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fp-next .lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.fp-next .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse-ring 1.6s infinite; }
.fp-next h3 { margin-top: 2px; font-size: 17px; font-weight: 600; letter-spacing: 0; }
.fp-next .meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fp-next .meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.fp-next .meta .i { width: 14px; height: 14px; color: var(--muted); }
.fp-next .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fp-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); vertical-align: 2px; white-space: nowrap; }

/* số liệu */
.fp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fp-stats .stat { gap: 8px; }
.fp-stats .stat .lbl { font-size: 13px; color: var(--muted); }
.fp-stats .stat .num { font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fp-stats .stat .num small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.fp-stats .stat .chg { font-size: 13px; color: var(--ink-2); }

/* hai cột */
.fp-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.fp-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.fp-card > .card-head { margin: 0; min-height: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fp-card > .card-head h2 { font-size: 17px; }
.fp-card > .card-head > .small { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-body { padding: 16px 20px 20px; }
.fp-more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--primary-2); white-space: nowrap; }
.fp-more .i { width: 14px; height: 14px; }
.fp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* danh sách dòng */
.fp-rows { list-style: none; margin: 0; padding: 0; }
.fp-rows > li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.fp-rows > li:first-child { border-top: 0; }
.fp-rows > li.click { cursor: pointer; transition: background-color .12s; }
.fp-rows > li.click:hover { background: var(--surface-2); }
.fp-rows > li.click:focus-visible { outline: none; box-shadow: inset var(--ring); }
.fp-rows > li.off { opacity: .55; }
.fp-rows .who { flex: 1; min-width: 0; }
.fp-rows .who b { display: block; font-size: 14px; font-weight: 500; }
.fp-rows .who small { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-rows .who small.note { color: var(--ink-2); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fp-rows .date { flex: none; width: 44px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-rows .btn { flex: none; }
.fp-rows > li.fp-none { font-size: 13px; color: var(--muted); padding-top: 16px; padding-bottom: 16px; }
.fp-score { flex: none; font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fp-score small { font-size: 12px; font-weight: 400; color: var(--muted); }

/* nhãn trạng thái: chấm màu + chữ */
.fp-st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.fp-st::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--line-3); }
.fp-st.ok { color: var(--mint); } .fp-st.ok::before { background: var(--mint); }
.fp-st.warn { color: var(--sun); } .fp-st.warn::before { background: var(--sun); }
.fp-st.bad { color: var(--coral); } .fp-st.bad::before { background: var(--coral); }

/* biểu đồ điểm */
.chart-sum { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-sum b { font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.chart-sum span { font-size: 13px; color: var(--muted); }
.fp-chart { min-height: 180px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl line { stroke: var(--line); }
.chart .ylab, .chart .xlab, .chart .avg-lab { font-size: 11px; fill: var(--muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .area { fill: var(--primary); opacity: .08; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.chart .avg { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .pt-dot { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.chart .val { font-size: 12px; font-weight: 600; fill: var(--ink); font-family: var(--font); font-variant-numeric: tabular-nums; }
.fp-chart-empty { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.fp-chart-empty > .i { width: 20px; height: 20px; color: var(--muted); margin-top: 1px; }
.fp-chart-empty b { display: block; font-size: 14px; font-weight: 500; }
.fp-chart-empty span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

/* chuyên cần trong tháng */
.att-l { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 13px; color: var(--muted); }
.att-l b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.fp-att { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 12px 8px; margin-top: 12px; }
.fp-att div { display: grid; justify-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-att .fp-mk { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); font-size: 12px; font-weight: 600; }
.fp-att .fp-mk .i { width: 14px; height: 14px; stroke-width: 2; }
.fp-att .fp-mk.no { background: var(--coral-soft); color: var(--coral); }
.fp-att .fp-mk.ex { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- đầu trang Lịch học / Bài tập ---------- */
.fp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.fp-head .sub { margin-top: 4px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-head-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 4px; }
.week-nav .icon-btn { border-color: var(--line); }
.week-nav .icon-btn .i { width: 16px; height: 16px; }
.fp-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.fp-filters .seg .n { margin-left: 2px; font-variant-numeric: tabular-nums; }

/* Lịch học: danh sách theo tuần */
.fp-lesson .date { width: 72px; line-height: 1.35; }
.fp-lesson .date b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.fp-lesson.today { background: var(--primary-soft); }
.fp-rows > li.fp-lesson.today.click:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface-2)); }
.fp-lesson .acts { display: flex; align-items: center; gap: 12px; flex: none; }
.fp-lesson .acts .btn .cnt { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-lesson .acts .btn-primary .cnt { color: inherit; }

/* Lịch học: lịch tháng (dùng .mcal chung, chip yên tĩnh hơn) */
.fam-mcal { height: auto; margin-bottom: 16px; }
.fam-mcal .mcal-head div { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.fam-mcal .mcal-grid { grid-template-rows: none; grid-auto-rows: minmax(96px, auto); }
.fam-mcal .mday { cursor: pointer; }
.fam-mcal .mday.sel { background: var(--primary-soft); }
.fam-mcal .mnum { cursor: inherit; font-weight: 500; }
.fam-mcal .mday.today .mnum { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.fam-mcal .mchip { background: var(--surface-2); border-left: 2px solid var(--c); box-shadow: inset 0 0 0 1px var(--line); }
.fam-mcal .mchip:hover { transform: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.fam-mcal .mchip b { font-weight: 600; color: var(--ink-2); }
.fam-mcal .mchip span { font-weight: 500; }
.fam-mcal .mchip .t-dot { width: 6px; height: 6px; margin-right: 1px; }
.fam-mcal .mchip .fp-mk { flex: none; margin-left: auto; font-style: normal; font-size: 11px; color: var(--mint); display: inline-flex; }
.fam-mcal .mchip .fp-mk + .fp-mk { margin-left: 2px; color: var(--muted); }
.fam-mcal .mchip .fp-mk.no { color: var(--coral); }
.fam-mcal .mchip .fp-mk .i { width: 12px; height: 12px; stroke-width: 2.2; }
.fp-day .fp-lesson .date b { font-size: 14px; }

/* chi tiết buổi học (hộp thoại) */
.fp-lm { display: grid; gap: 16px; }
.fp-lm-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fp-lm-meta span { display: inline-flex; align-items: center; gap: 6px; }
.fp-lm-meta .i { width: 14px; height: 14px; color: var(--muted); }
.fp-lm-st { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fp-lm-st:empty { display: none; }
.fp-lm-title { font-weight: 500; }
.lm-lbl { font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 6px; }
.lm-mats { display: grid; gap: 6px; }
.mat-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .15s, border-color .15s; }
.mat-link .i { width: 16px; height: 16px; color: var(--muted); }
.mat-link:hover { background: var(--surface-2); border-color: var(--line-2); }
.mat-link:focus-visible { outline: none; box-shadow: var(--ring); }
.fp-note { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.fp-note .lm-lbl { margin-bottom: 4px; }
.fp-note p { font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.fp-file { display: flex; align-items: center; gap: 8px; }
.fp-file .i { color: var(--muted); }
.fp-ans summary { cursor: pointer; font-weight: 500; color: var(--primary-2); }

/* ---------- Bài tập về nhà ---------- */
.fp-hw .date { line-height: 1.35; }
.fp-hw .date small { display: block; font-size: 12px; }
.fp-hw .fp-hw-st { flex: none; display: flex; justify-content: flex-end; min-width: 72px; }
.fp-hw .fp-hw-act { flex: none; }
.fp-hw .fp-hw-act .btn { pointer-events: none; }
.fp-hw.open { background: var(--surface-2); }
.fp-hw-none { font-size: 13px; color: var(--muted); white-space: nowrap; }
.fp-rows > li.fp-hw-detail { display: block; padding: 4px 20px 20px 76px; border-top: 0; background: var(--surface-2); }
.fp-hw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.fp-submit { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.fp-submit .lm-lbl { margin-bottom: 0; }
.fp-up { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sub-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-thumb { position: relative; width: 76px; }
.sub-thumb a { display: block; }
.sub-thumb img, .sub-thumb .sub-pdf { width: 76px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.sub-thumb.marked img { border: 2px solid var(--primary); }
.sub-thumb button { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink); color: var(--surface);
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.sub-thumb button .i { width: 12px; height: 12px; stroke-width: 2.4; }
.sub-thumb button:hover { background: var(--danger); color: var(--surface); }
.sub-thumbs.staged .sub-thumb img, .sub-thumbs.staged .sub-pdf { outline: 2px dashed color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* ---------- màn vừa ---------- */
@media (max-width: 1100px) {
  .fp-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- điện thoại ---------- */
@media (max-width: 860px) {
  .fp-tabs { display: none; }
  .fp-bar { height: 56px; padding: 0 16px; gap: 8px; }
  .brand-sub { display: none; }
  .fp-actions { gap: 6px; }
  .kid-switch { padding: 0 4px; gap: 4px; }
  .kid-switch .nm { display: none; }
  main.fp { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .fp h1 { font-size: 24px; }
  .fam-tabbar:not([hidden]) { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .fam-tabbar button { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; font: inherit; font-size: 11px; font-weight: 500;
    color: var(--muted); cursor: pointer; }
  .fam-tabbar button .i { width: 20px; height: 20px; }
  .fam-tabbar button.on { color: var(--primary-2); }
  .fam-tabbar .n { margin-left: 4px; font-size: 11px; }
  .fam-tabbar button.on .n { color: inherit; }

  .fp-kid { flex-direction: column; align-items: stretch; gap: 16px; }
  .fp-teachers { padding: 4px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); gap: 0; }
  .fp-teacher { justify-content: space-between; padding: 8px 0; }
  .fp-teacher + .fp-teacher { border-top: 1px solid var(--line); }
  .fp-teacher small, .fp-teacher b { text-align: left; }
  .fp-next { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 16px; }
  .fp-next .acts { grid-column: 1 / -1; justify-content: stretch; }
  .fp-next .acts .btn { flex: 1; }
  .fp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fp-stats .stat { padding: 16px; }
  .fp-stats .stat .num { font-size: 24px; }
  .fp-card > .card-head { padding: 14px 16px; }
  .fp-body { padding: 16px; }
  .fp-rows > li { padding: 12px 16px; }
  .fp-foot { padding: 12px 16px; }

  .fp-head { flex-direction: column; align-items: stretch; margin-bottom: 16px; }
  .fp-head-r { justify-content: space-between; }
  .fp-filters .seg { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .fp-filters .seg::-webkit-scrollbar { display: none; }
  .fp-filters .seg button { flex: 1 0 auto; justify-content: center; padding: 0 8px; gap: 4px; white-space: nowrap; }

  /* dòng buổi học / bài tập: hai tầng trên điện thoại */
  .fp-rows > li.fp-lesson, .fp-rows > li.fp-hw { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "d w" "d s"; column-gap: 12px; row-gap: 8px; align-items: start; }
  .fp-lesson .date, .fp-hw .date { grid-area: d; width: auto; }
  .fp-lesson .who, .fp-hw .who { grid-area: w; }
  .fp-lesson .acts { grid-area: s; flex-wrap: wrap; gap: 8px 12px; }
  .fp-hw { grid-template-areas: "d w" "d s"; }
  .fp-rows > li.fp-hw { grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "d w w" "d s a"; }
  .fp-hw .fp-hw-st { grid-area: s; justify-content: flex-start; align-self: center; min-width: 0; }
  .fp-hw .fp-hw-act { grid-area: a; }
  .fp-rows > li.fp-hw-detail { padding: 4px 16px 16px; }
  .fp-hw-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  .fam-mcal .mcal-grid { grid-auto-rows: minmax(52px, auto); }
  .fam-mcal .mday.today .mnum { box-shadow: none; }
}
@media (max-width: 600px) {
  .fp-kid .classes { flex-direction: column; gap: 4px; }
}
@media (max-width: 380px) {
  .fp-stats .stat { padding: 14px; }
  .fp-stats .stat .num { font-size: 22px; }
}
.fp-chev { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--muted); }
.fp-chev .i { width: 16px; height: 16px; transition: transform .15s; }
.fp-hw.open .fp-chev .i { transform: rotate(180deg); }

/* không còn tiêu đề lớn */
.fp-head { align-items: center; }
.fp-head .sub { margin-top: 0; }

/* ===== nhận xét tháng, xin nghỉ, học bù, giới thiệu bạn, kiểm tra thử ===== */
.fp-report { margin-bottom: 16px; border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 6%, var(--surface)), var(--surface) 70%); }
.fp-report-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fp-report-h .lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--primary); }
.fp-report-h .lbl svg, .fp-report-h .lbl .i { width: 16px; height: 16px; }
.fp-report-h small { color: var(--muted); }
.fp-report-t { margin-top: 10px; white-space: pre-line; line-height: 1.65; }
.fp-report-more { margin-top: 12px; }
.fp-report-more summary { cursor: pointer; color: var(--muted); }
.fp-report-old { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); white-space: pre-line; font-size: 14px; line-height: 1.6; }
.fp-abs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.fp-abs > svg, .fp-abs > .i { width: 16px; height: 16px; color: var(--primary); flex: none; }
.fp-abs span { flex: 1 1 200px; }
.fp-abs-btn { align-self: flex-start; }
.fp-refer { margin-top: 16px; }
.fp-refer .lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.fp-refer .lbl svg, .fp-refer .lbl .i { width: 16px; height: 16px; color: var(--primary); }
.fp-refer-link { display: flex; gap: 8px; margin-top: 10px; }
.fp-refer-link .input { flex: 1; min-width: 0; font-size: 13px; }
.fp-qz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.fp-qz-head h2 { margin: 0; font-size: 20px; }
.fp-qz-list { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 18px; }
.fp-qz-list > li { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.fp-qz-list > li.no { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.fp-qz-q { font-weight: 600; line-height: 1.55; }
.fp-qz-ch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.fp-qz-ch > button, .fp-qz-ch > div { display: flex; align-items: flex-start; gap: 8px; padding: 11px 12px; min-height: 46px; border-radius: 12px; text-align: left;
  background: var(--surface-2); border: 1.5px solid transparent; font: inherit; color: var(--ink); }
.fp-qz-ch > button { cursor: pointer; }
.fp-qz-ch > button:hover { border-color: var(--line-3, var(--line)); }
.fp-qz-ch > button.on { border-color: var(--primary); background: var(--primary-soft); }
.fp-qz-ch > div.right { border-color: var(--primary); background: var(--primary-soft); }
.fp-qz-ch > div.wrong { border-color: var(--danger); background: var(--coral-soft); }
.fp-qz-ch b { flex: none; }
@media (max-width: 600px) { .fp-qz-ch { grid-template-columns: minmax(0, 1fr); } }
.fp-qz-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
@media (max-width: 860px) { .fp-qz-foot { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); } }
.fp-qz-res { margin-top: 6px; }
.fp-qz-score { display: flex; align-items: baseline; gap: 8px; }
.fp-qz-score b { font-size: 40px; font-weight: 800; color: var(--primary); }
.fp-qz-score span { color: var(--muted); }
.fp-qz-skills { display: grid; gap: 12px; margin-top: 12px; }
.fp-qz-skills .progress { margin-top: 6px; height: 7px; }
.fp-qz-skills b.bad { color: var(--danger); }
.fp-qz-skills .progress.hot > div { background: linear-gradient(90deg, #F59E0B, #EF4444); }
