/* The HTML hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

/**
 * IELTS Pro — Student panel styles.
 * Scoped under .ieltspro-panel. Self-contained (no framework, no dependency).
 */

.ieltspro-panel,
.ieltspro-panel * { box-sizing: border-box; }

.ieltspro-panel {
	--ip-navy: #0f2747;
	--ip-navy-700: #143358;
	--ip-bg: #f4f6fb;
	--ip-card: #ffffff;
	--ip-border: #e2e8f0;
	--ip-text: #1e293b;
	--ip-muted: #64748b;
	--ip-accent: #2563eb;
	--ip-radius: 14px;
	--ip-shadow: 0 1px 2px rgba(15,39,71,0.04), 0 8px 24px rgba(15,39,71,0.06);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ip-text);
	min-height: 100vh;
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
}

.ieltspro-panel__shell { min-height: 100vh; }

.ieltspro-topbar {
	display: flex; align-items: center; gap: 20px;
	background: var(--ip-card); border-bottom: 1px solid var(--ip-border);
	padding: 12px 24px; position: sticky; top: 0; z-index: 20;
}
.ieltspro-topbar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ip-navy); }
.ieltspro-topbar__brand-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--ip-navy); color: #fff; }
.ieltspro-topbar__brand-text strong { display: block; font-size: 15px; line-height: 1.1; }
.ieltspro-topbar__brand-text small { color: var(--ip-muted); font-size: 12px; }
.ieltspro-topbar__nav { margin: 0 auto; }
.ieltspro-topbar__nav-toggle { display: none; align-items: center; gap: 6px; background: var(--ip-bg); border: 1px solid var(--ip-border); border-radius: 10px; padding: 8px 12px; cursor: pointer; color: var(--ip-text); }
.ieltspro-topbar__tabs { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ieltspro-tab-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; text-decoration: none; color: var(--ip-muted); font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.ieltspro-tab-link:hover { color: var(--ip-navy); background: var(--ip-bg); }
.ieltspro-tab-link.is-active { color: #fff; background: var(--ip-navy); }
.ieltspro-topbar__user { display: flex; align-items: center; gap: 8px; }
.ieltspro-topbar__identity { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ip-text); padding: 4px 6px; border-radius: 10px; }
.ieltspro-topbar__identity:hover { background: var(--ip-bg); }
.ieltspro-topbar__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--ip-bg); }
.ieltspro-topbar__identity-text strong { display: block; font-size: 14px; line-height: 1.1; }
.ieltspro-topbar__identity-text small { color: var(--ip-muted); font-size: 12px; }
.ieltspro-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; color: var(--ip-muted); text-decoration: none; border: 1px solid transparent; }
.ieltspro-iconbtn:hover { background: var(--ip-bg); color: var(--ip-navy); border-color: var(--ip-border); }

.ieltspro-panel__main { max-width: 1040px; margin: 0 auto; padding: 28px 24px 64px; }

.ieltspro-section-head { margin-bottom: 20px; }
.ieltspro-section-head--split { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ieltspro-h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; color: var(--ip-navy); }
.ieltspro-h2 { font-size: 17px; font-weight: 700; margin: 0; color: var(--ip-navy); display: inline-flex; align-items: center; gap: 8px; }
.ieltspro-lead { color: var(--ip-muted); margin: 0; max-width: 62ch; }
.ieltspro-muted { color: var(--ip-muted); }

.ieltspro-card { background: var(--ip-card); border: 1px solid var(--ip-border); border-radius: var(--ip-radius); box-shadow: var(--ip-shadow); padding: 22px; }
.ieltspro-card__head { margin-bottom: 14px; }
.ieltspro-card__head--split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.ieltspro-module { margin-bottom: 28px; }
.ieltspro-module__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ieltspro-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ieltspro-paper-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s, border-color .12s; }
.ieltspro-paper-card:hover { transform: translateY(-2px); border-color: #cbd5e1; box-shadow: 0 6px 18px rgba(15,39,71,0.1); }
.ieltspro-paper-card__top { display: flex; align-items: center; justify-content: space-between; }
.ieltspro-paper-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--ip-bg); color: var(--ip-navy); }
.ieltspro-paper-card__title { font-size: 15px; font-weight: 700; margin: 0; }
.ieltspro-paper-card__hint { font-size: 13px; color: var(--ip-muted); margin: 0; }
.ieltspro-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ip-bg); color: var(--ip-navy); }
.ieltspro-pill--mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; }

.ieltspro-chips { display: flex; gap: 12px; }
.ieltspro-chip { background: var(--ip-card); border: 1px solid var(--ip-border); border-radius: 12px; padding: 10px 16px; text-align: center; min-width: 92px; box-shadow: var(--ip-shadow); }
.ieltspro-chip strong { display: block; font-size: 20px; color: var(--ip-navy); }
.ieltspro-chip small { color: var(--ip-muted); font-size: 12px; }

.ieltspro-classcard__head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.ieltspro-classcard__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ip-navy); color: #fff; flex: 0 0 auto; }
.ieltspro-classcard__form { display: flex; gap: 10px; flex-wrap: wrap; }
.ieltspro-input { flex: 1; min-width: 200px; padding: 11px 14px; border: 1px solid var(--ip-border); border-radius: 10px; font-size: 15px; color: var(--ip-text); background: #fff; }
.ieltspro-input:focus { outline: none; border-color: var(--ip-accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.ieltspro-resolve-result { margin-top: 16px; }
.ieltspro-resolve-result__card { border-radius: 10px; padding: 14px 16px; border: 1px solid var(--ip-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ieltspro-resolve-result__card.is-ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.ieltspro-resolve-result__card.is-error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

.ieltspro-tablewrap { overflow-x: auto; }
.ieltspro-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ieltspro-table th, .ieltspro-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--ip-border)!important; vertical-align: middle; }
.ieltspro-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ip-muted); }
.ieltspro-table__exam { display: block; font-weight: 600; }
.ieltspro-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ieltspro-badge--pass { background: #dcfce7; color: #166534; }
.ieltspro-badge--fail { background: #fee2e2; color: #b91c1c; }
.ieltspro-badge--borderline { background: #fef3c7; color: #92400e; }
.ieltspro-badge--not_graded { background: #e2e8f0; color: #475569; }
.ieltspro-badge--in_progress { background: #dbeafe; color: #1d4ed8; }

.ieltspro-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--ip-border); font-size: 12px; color: var(--ip-muted); }
.ieltspro-legend li { display: flex; align-items: center; gap: 8px; }
.ieltspro-legend .ieltspro-badge { width: 16px; height: 16px; padding: 0; border-radius: 50%; }

.ieltspro-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.ieltspro-pager__status { font-size: 13px; color: var(--ip-muted); }
.ieltspro-perpage { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ip-muted); }
.ieltspro-perpage select { border: 1px solid var(--ip-border); border-radius: 8px; }

.ieltspro-empty { text-align: center; color: var(--ip-muted); }
.ieltspro-empty h2, .ieltspro-empty h3 { color: var(--ip-navy); margin: 12px 0 6px; }
.ieltspro-empty--inset { padding: 36px 20px; }

.ieltspro-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.ieltspro-btn--primary { background: var(--ip-navy); color: #fff; }
.ieltspro-btn--primary:hover { background: var(--ip-navy-700); color: #fff; }
.ieltspro-btn--ghost { background: #fff; border-color: var(--ip-border); color: var(--ip-text); }
.ieltspro-btn--ghost:hover { background: var(--ip-bg); color: var(--ip-text);}
.ieltspro-btn--block { width: 100%; }
.ieltspro-btn[disabled] { opacity: .6; cursor: default; }
.ieltspro-link { color: var(--ip-accent); text-decoration: none; font-weight: 600; background: none; border: none; cursor: pointer; font-size: inherit; padding: 0; }
.ieltspro-link:hover { text-decoration: underline; }

.ieltspro-profile__section { margin-bottom: 18px; }
.ieltspro-profile__section .ieltspro-h2 { display: block; margin-bottom: 12px; }
.ieltspro-avatar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ieltspro-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--ip-bg); border: 1px solid var(--ip-border); }
.ieltspro-avatar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ieltspro-field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ieltspro-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.ieltspro-label { display: block; font-size: 13px; font-weight: 600; color: var(--ip-text); }
.ieltspro-label .ieltspro-input { margin-top: 6px; width: 100%; }
.ieltspro-profile__status { margin-bottom: 16px; border-radius: 10px; padding: 12px 16px; font-weight: 600; }
.ieltspro-profile__status.is-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.ieltspro-profile__status.is-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ieltspro-profile__back { margin-top: 8px; }

.ieltspro-route__wrap { max-width: 560px; margin: 80px auto; padding: 0 20px; }
.ieltspro-route__card { text-align: center; }
.ieltspro-route__title { color: var(--ip-navy); margin: 14px 0 8px; }
.ieltspro-route__body { color: var(--ip-muted); margin: 0 0 20px; }

@media ( max-width: 782px ) {
	/* Header: logo + profile + logout stay inline on one sticky row */
	.ieltspro-topbar { flex-wrap: nowrap; gap: 12px; padding: 10px 14px; }
	.ieltspro-topbar__brand-icon { width: 34px; height: 34px; }
	.ieltspro-topbar__identity-text { display: none; }
	.ieltspro-topbar__avatar { width: 34px; height: 34px; }
	.ieltspro-topbar__identity { padding: 2px; }
	.ieltspro-topbar__user { margin-left: auto; gap: 2px; }
	.ieltspro-iconbtn { width: 38px; height: 38px; }

	/* Tabs become a fixed app-style bottom navigation bar */
	.ieltspro-topbar__nav { display: contents; }
	.ieltspro-topbar__nav-toggle { display: none; }
	.ieltspro-topbar__tabs {
		display: flex; flex-direction: row; gap: 2px; align-items: stretch;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		margin: 0; padding: 6px 6px calc( 6px + env( safe-area-inset-bottom ) );
		background: var(--ip-card); border-top: 1px solid var(--ip-border);
		box-shadow: 0 -2px 14px rgba( 15, 39, 71, .08 );
	}
	.ieltspro-topbar__tabs li { flex: 1 1 0; min-width: 0; }
	.ieltspro-tab-link {
		flex-direction: column; gap: 3px; justify-content: center;
		width: 100%; padding: 6px 4px; border-radius: 12px;
		font-size: 11px; line-height: 1.1;
	}
	.ieltspro-tab-link span { font-size: 11px; }
	.ieltspro-tab-link:hover { background: transparent; }
	.ieltspro-tab-link.is-active { color: var(--ip-accent); background: transparent; }

	/* Leave room for the fixed bottom bar */
	.ieltspro-panel__main { padding: 18px 16px calc( 84px + env( safe-area-inset-bottom ) ); }

	.ieltspro-table thead { display: none; }
	.ieltspro-table, .ieltspro-table tbody, .ieltspro-table tr, .ieltspro-table td { display: block; width: 100%; }
	.ieltspro-table tr { border: 1px solid var(--ip-border); border-radius: 10px; margin-bottom: 12px; padding: 6px 12px; }
	.ieltspro-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ip-border); padding: 10px 0; }
	.ieltspro-table tr td:last-child { border-bottom: none; }
	.ieltspro-table td::before { content: attr(data-label); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ip-muted); font-weight: 600; }
}

/* Membership banner (Phase 8) */
.ieltspro-membership-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; border-left: 3px solid var(--ip-accent); }
.ieltspro-membership-banner__icon { display: inline-flex; color: var(--ip-accent); }
.ieltspro-membership-banner__text { font-weight: 600; color: var(--ip-navy); }

/* Practice — filters inline with the title */
.ieltspro-section-head--filters { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ieltspro-section-head--filters .ieltspro-section-head__text { min-width: 0; }
.ieltspro-practice-filters { display: flex; gap: 12px; flex-shrink: 0; }
.ieltspro-practice-filter { display: flex; flex-direction: column; gap: 4px; }
.ieltspro-practice-filter span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ip-muted, #5b6b82); }
.ieltspro-practice-filter select { padding: 8px 30px 8px 12px; border: 1px solid var(--ip-border, #e3e8f0); border-radius: 9px; color: var(--ip-navy, #0f2747); font-size: 14px; font-weight: 500; cursor: pointer; min-width: 130px; }
.ieltspro-practice-filter select:focus { outline: none; border-color: var(--ip-accent, #2563eb); box-shadow: 0 0 0 3px rgba( 37, 99, 235, .12 ); }

/* Paid / owned pills + buy affordances */
.ieltspro-pill--paid { background: #0f2747; color: #fff; }
.ieltspro-pill--owned { background: #dcfce7; color: #15803d; }
.ieltspro-paper-card__price { margin: 8px 0 12px; font-size: 18px; font-weight: 700; color: var(--ip-navy, #0f2747); }
.ieltspro-paper-card__price del { color: var(--ip-muted, #9aa7b8); font-weight: 500; font-size: 14px; margin-right: 6px; }
.ieltspro-paper-card__buy { margin-top: auto; }
.ieltspro-paper-card--paid { display: flex; flex-direction: column; }

@media ( max-width: 640px ) {
	.ieltspro-section-head--filters { align-items: stretch; }
	.ieltspro-practice-filters { width: 100%; }
	.ieltspro-practice-filter { flex: 1; }
	.ieltspro-practice-filter select { width: 100%; min-width: 0; }
}

/* Confirmation modal (e.g. re-take warning) */
.ieltspro-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba( 15, 39, 71, .5 ); }
.ieltspro-modal[hidden] { display: none; }
.ieltspro-modal__box { width: 100%; max-width: 420px; background: var( --ip-card, #fff ); border-radius: 14px; padding: 26px; box-shadow: 0 24px 60px rgba( 15, 39, 71, .32 ); }
.ieltspro-modal__title { margin: 0 0 10px; font-size: 20px; color: var( --ip-navy, #0f2747 ); }
.ieltspro-modal__body { margin: 0 0 22px; color: var( --ip-muted, #5b6b82 ); line-height: 1.6; }
.ieltspro-modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Practice — "View all" toggle button */
.ieltspro-viewall { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--ip-border); border-radius: 999px; background: #fff; color: var(--ip-navy-700); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.ieltspro-viewall:hover, .ieltspro-viewall:focus { background: var(--ip-text); border-color: var(--ip-text); }
.ieltspro-viewall:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba( 37, 99, 235, .15 ); }

table, td, th {
    border: none!important;
}