/* ผลของฉัน — /exam-bank/my-results (ออกแบบใหม่ ๘ ต.ค. ๒๕๖๙ · .mr-*)
   แนวเดียวกับ /exam-bank/sets และ /exam-bank/grammar · ตัวแปรสีจาก shell.css (--eb-*)
   สี = ระดับคะแนน: เขียว ≥๗๕ · คราม ๖๐–๗๔ · อำพัน ๔๐–๕๙ · แดง <๔๐ */
.mr-shell { max-width: 880px; }
.mr-head { margin: .4rem 0 1.1rem; }
.mr-head h1 { margin: 0; font-size: clamp(1.5rem, 4.4vw, 2rem); font-weight: 800; color: var(--eb-ink); letter-spacing: -.01em; }
.mr-head h1 span { color: var(--eb-primary); }
.mr-head p { margin: .3rem 0 0; font-size: .9rem; color: var(--eb-ink-soft); line-height: 1.6; }
.mr-loading { text-align: center; color: var(--eb-ink-soft); padding: 3rem 1rem; }
.mr-loading i { color: var(--eb-primary); margin-right: .3rem; }

.tone-good { --tone: #059669; --tone-soft: #d1fae5; }
.tone-ok   { --tone: #4f46e5; --tone-soft: #e0e7ff; }
.tone-fair { --tone: #b45309; --tone-soft: #fef3c7; }
.tone-low  { --tone: #dc2626; --tone-soft: #fee2e2; }

/* ── หน้าว่าง (ยังไม่เข้าระบบ / ยังไม่มีผล / โหลดพลาด) ── */
.mr-empty { display: flex; gap: 1.1rem; align-items: flex-start; background: #fff; border: 1px solid var(--eb-line); border-radius: 18px; padding: 1.3rem 1.3rem 1.4rem; }
.mr-empty-icon { flex: none; width: 3.2rem; height: 3.2rem; border-radius: 14px; display: grid; place-items: center;
	background: var(--eb-primary-wash); color: var(--eb-primary); font-size: 1.35rem; }
.mr-empty.is-error .mr-empty-icon { background: #fef2f2; color: #dc2626; }
.mr-empty-body { flex: 1; min-width: 0; }
.mr-empty h2 { margin: .1rem 0 .3rem; font-size: 1.15rem; font-weight: 800; color: var(--eb-ink); }
.mr-empty p { margin: 0; font-size: .9rem; color: var(--eb-ink-soft); line-height: 1.6; }
.mr-benefits { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.mr-benefits li { font-size: .86rem; font-weight: 700; color: var(--eb-ink); }
.mr-benefits i { color: var(--eb-emerald); margin-right: .2rem; }
.mr-empty-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.mr-btn { font: inherit; font-size: .92rem; font-weight: 800; text-decoration: none; border-radius: 12px; padding: .7rem 1.1rem;
	display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; }
.mr-btn-primary { background: var(--eb-primary); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.25); }
.mr-btn-primary:hover { background: var(--eb-primary-dim); }
.mr-btn-ghost { background: #fff; border-color: var(--eb-line); color: var(--eb-ink-soft); }
.mr-btn-ghost:hover { border-color: var(--eb-primary); color: var(--eb-primary); }

.mr-label { margin: 1.6rem 0 .55rem; font-size: .8rem; font-weight: 800; color: var(--eb-ink-soft); letter-spacing: .02em; }
.mr-apps { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.mr-app { display: flex; align-items: center; gap: .7rem; text-decoration: none; background: #fff; border: 1px solid var(--eb-line);
	border-radius: 14px; padding: .7rem .85rem; min-height: 56px; transition: border-color .15s, transform .15s; }
.mr-app:hover { border-color: var(--eb-primary); transform: translateY(-1px); }
.mr-app-icon { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 10px; display: grid; place-items: center; background: var(--eb-surface-2); color: var(--eb-primary); }
.mr-app-body { flex: 1; min-width: 0; }
.mr-app-body b { display: block; font-size: .95rem; color: var(--eb-ink); }
.mr-app-body small { display: block; font-size: .78rem; color: var(--eb-ink-soft); }
.mr-app-go { color: #94a3b8; font-size: .8rem; }

/* ── สรุปตัวเลข ── */
.mr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; }
.mr-stat { background: #fff; border: 1px solid var(--eb-line); border-radius: 14px; padding: .7rem .8rem; min-width: 0; }
.mr-stat dt { font-size: .76rem; font-weight: 700; color: var(--eb-ink-soft); }
.mr-stat dd { margin: .1rem 0 0; font-size: 1.5rem; font-weight: 800; color: var(--tone, var(--eb-ink)); line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mr-stat dd small { font-size: .8rem; font-weight: 700; color: var(--eb-ink-soft); margin-left: .15rem; }

/* ── ตัวกรอง (segmented) ── */
.mr-filter { display: flex; max-width: 100%; overflow-x: auto; background: var(--eb-surface-2); border: 1px solid var(--eb-line);
	border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 1.1rem; scrollbar-width: none; }
.mr-filter::-webkit-scrollbar { display: none; }
.mr-filter button { flex: 1 0 auto; font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; white-space: nowrap;
	border: 0; background: transparent; color: var(--eb-ink-soft); border-radius: 9px; padding: .45rem .75rem; }
.mr-filter button span { font-size: .76rem; color: #94a3b8; margin-left: .15rem; }
.mr-filter button:hover { color: var(--eb-primary); }
.mr-filter button.is-active { background: #fff; color: var(--eb-primary); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.mr-filter button.is-active span { color: var(--eb-primary); }

/* ── รายการ จัดกลุ่มรายเดือน ── */
.mr-month + .mr-month { margin-top: 1.1rem; }
.mr-month h3 { margin: 0 0 .45rem; font-size: .85rem; font-weight: 800; color: var(--eb-ink); }
.mr-month h3 span { font-weight: 600; color: var(--eb-ink-soft); margin-left: .3rem; font-size: .78rem; }
.mr-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--eb-line); border-radius: 16px; overflow: hidden; }
.mr-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; }
.mr-row + .mr-row { border-top: 1px solid var(--eb-surface-2); }
.mr-pct { flex: none; width: 3.6rem; height: 2.6rem; border-radius: 10px; display: inline-flex; align-items: baseline; justify-content: center; padding-top: .55rem; box-sizing: border-box;
	background: var(--tone-soft); color: var(--tone); font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.mr-pct small { font-size: .68rem; margin-left: .05rem; }
.mr-row-body { flex: 1; min-width: 0; }
.mr-row-body b { display: block; font-size: .93rem; color: var(--eb-ink); line-height: 1.4; }
.mr-row-body b i { color: #94a3b8; font-size: .82rem; margin-right: .15rem; }
.mr-row-body small { display: block; font-size: .78rem; color: var(--eb-ink-soft); }
.mr-grade { flex: none; font-size: .74rem; font-weight: 800; padding: .2rem .6rem; border-radius: 999px; background: var(--eb-primary-wash); color: var(--eb-primary-dim); white-space: nowrap; }
.mr-again { flex: none; display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-size: .8rem; font-weight: 700;
	color: var(--eb-ink-soft); border: 1px solid var(--eb-line); border-radius: 999px; padding: .35rem .7rem; transition: border-color .15s, color .15s; }
.mr-again:hover { border-color: var(--eb-primary); color: var(--eb-primary); }

.mr-btn:focus-visible, .mr-app:focus-visible, .mr-filter button:focus-visible, .mr-again:focus-visible {
	outline: 3px solid rgba(99,102,241,.35); outline-offset: 2px; }

@media (max-width: 600px) {
	.mr-stats { gap: .35rem; }
	.mr-stat { padding: .5rem .45rem; text-align: center; border-radius: 12px; }
	.mr-stat dt { font-size: .7rem; }
	.mr-stat dd { font-size: 1.1rem; }
	.mr-stat dd small { font-size: .68rem; margin-left: .1rem; }
	.mr-row-body b i { display: none; }
	.mr-empty { flex-direction: column; gap: .8rem; padding: 1.1rem; }
	.mr-empty-actions .mr-btn { flex: 1 1 auto; }
	.mr-filter { flex-wrap: wrap; overflow: visible; }
	.mr-filter button { padding: .45rem .55rem; }
	.mr-row { gap: .55rem; padding: .65rem .7rem; }
	.mr-pct { width: 3.1rem; font-size: 1rem; }
	.mr-row-body b { font-size: .9rem; }
	.mr-again { width: 2.3rem; height: 2.3rem; padding: 0; justify-content: center; }
	.mr-again span { display: none; }
}
