/* ==========================================================================
   IELTSPlus application UI — design system v1 (2026-10)
   Plain CSS, no build step. All classes are prefixed `ip-`.
   Responsive behaviour uses container queries:
     - `ip-app`  : the whole application frame (navigation modes)
     - `ip-main` : the content column (page layouts)
     - unnamed   : any `.ip-cq` / `.ip-tablewrap` box (components)
   Breakpoints (container width): phone < 640 · tablet 640–1023 ·
   compact desktop 1024–1279 (icon rail) · desktop ≥ 1280.
   ========================================================================== */

:root {
  /* Brand */
  --ip-navy-950: #0B1638;
  --ip-navy-900: #13214D;
  --ip-navy-700: #24376F;
  --ip-blue-700: #2340B0;
  --ip-blue-600: #2D4FD0;
  --ip-blue-200: #C3CFFA;
  --ip-blue-100: #DFE6FD;
  --ip-blue-50:  #EFF3FF;
  --ip-orange-500: #F08A24;   /* accent: logo, indicators, never text on white */
  --ip-orange-700: #9A4A06;   /* orange text on light backgrounds (5.6:1) */
  --ip-orange-100: #FFE3C4;
  --ip-orange-50:  #FFF5EA;
  /* Feedback */
  --ip-green-700: #11704F;
  --ip-green-200: #B5DFCB;
  --ip-green-50:  #E8F6EF;
  --ip-red-700: #B42318;
  --ip-red-200: #F4C1BB;
  --ip-red-50:  #FDEEEC;
  /* Neutrals */
  --ip-ink:   #111A33;
  --ip-ink-2: #3A4560;
  --ip-ink-3: #5A6580;        /* secondary text, ≥ 5.4:1 on bg */
  --ip-ink-4: #8A93A8;        /* decorative only, never body text */
  --ip-line:        #DCE1EB;
  --ip-line-strong: #C3CAD8;
  --ip-bg:        #F3F5F9;
  --ip-surface:   #FFFFFF;
  --ip-surface-2: #F7F9FC;
  --ip-disabled-bg: #E7EAF1;
  --ip-disabled-fg: #646D82;
  --ip-focus: #2D4FD0;
  /* Type */
  --ip-font: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ip-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  /* Shape */
  --ip-r-sm: 6px;
  --ip-r: 8px;
  --ip-r-lg: 12px;
  --ip-shadow-1: 0 1px 2px rgba(17, 26, 51, .06);
  --ip-shadow-2: 0 12px 32px rgba(11, 22, 56, .18);
  /* Control height (44 on phone / coarse pointers) */
  --ip-ctl: 40px;
}

@media (pointer: coarse) { :root { --ip-ctl: 44px; } }

/* ---------- Base ---------- */
.ip-app {
  container: ip-app / inline-size;
  font-family: var(--ip-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ip-ink);
  background: var(--ip-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ip-app *, .ip-app *::before, .ip-app *::after { box-sizing: border-box; }
.ip-app h1, .ip-app h2, .ip-app h3, .ip-app h4, .ip-app p, .ip-app ul, .ip-app ol, .ip-app dl, .ip-app figure { margin: 0; }
.ip-app ul, .ip-app ol { padding: 0; }
.ip-app button, .ip-app input, .ip-app select, .ip-app textarea { font: inherit; color: inherit; }
:where(.ip-app) a { color: var(--ip-blue-600); text-underline-offset: 2px; }
:where(.ip-app) a:hover { color: var(--ip-blue-700); }
.ip-app :focus-visible { outline: 3px solid var(--ip-focus); outline-offset: 2px; }
.ip-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ip-mono { font-family: var(--ip-mono); font-size: .9em; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ip-num { font-variant-numeric: tabular-nums; }
.ip-muted { color: var(--ip-ink-3); }
.ip-small { font-size: 13.5px; }
.ip-strong { font-weight: 600; }
.ip-nowrap { white-space: nowrap; }

.ip-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ip-ic--sm { width: 16px; height: 16px; }
.ip-ic--lg { width: 24px; height: 24px; }
.ip-spin { animation: ip-spin .9s linear infinite; }
@keyframes ip-spin { to { transform: rotate(360deg); } }

/* ---------- Layout utilities ---------- */
.ip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ip-row--between { justify-content: space-between; }
.ip-stack { display: flex; flex-direction: column; gap: 16px; }
.ip-stack--sm { gap: 8px; }
.ip-stack--lg { gap: 24px; }
.ip-cq { container-type: inline-size; }
.ip-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.ip-grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@container ip-main (max-width: 860px) {
  .ip-grid2, .ip-grid-main-side { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* ==========================================================================
   App shell & navigation
   ========================================================================== */
.ip-shell {
  display: grid;
  min-height: 100%;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-areas: "side main";
}
.ip-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 14px 18px;
  background: var(--ip-navy-950);
  color: #fff;
}
.ip-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px;
  font-weight: 800; font-size: 24px; letter-spacing: -.03em; line-height: 1;
  text-decoration: none;
}
:where(.ip-app) a.ip-brand, :where(.ip-app) a.ip-brand:hover { color: inherit; }
.ip-brand__ielts { color: #fff; }
.ip-brand__plus { color: var(--ip-orange-500); }
.ip-brand__short { display: none; }
.ip-brand--light .ip-brand__ielts { color: var(--ip-navy-950); }
.ip-brand__tag { font-size: 12px; font-weight: 600; letter-spacing: 0; color: #AFC0EE; padding: 3px 7px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; }

.ip-nav { display: flex; flex-direction: column; gap: 2px; }
.ip-nav__link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 12px;
  border-radius: var(--ip-r);
  color: #C8D2F0; text-decoration: none; font-weight: 500; font-size: 15px;
}
:where(.ip-app) .ip-nav__link { color: #C8D2F0; }
:where(.ip-app) .ip-nav__link:hover { background: rgba(255,255,255,.07); color: #fff; }
:where(.ip-app) .ip-nav__link[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.ip-nav__link[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px;
  border-radius: 0 3px 3px 0; background: var(--ip-orange-500);
}
.ip-nav__label { flex: 1; min-width: 0; }
.ip-nav__count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--ip-orange-500); color: #2B1500; font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.ip-side__section { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #8494C4; padding: 0 12px; margin-top: 6px; }

.ip-account {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.12);
}
.ip-account__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ip-account__text { min-width: 0; }
.ip-account__name { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.ip-account__role { font-size: 13px; color: #AFBBE0; }
.ip-account__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ip-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--ip-orange-500); color: #2B1500;
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ip-sidebtn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 10px; border-radius: var(--ip-r);
  border: 1px solid rgba(255,255,255,.2); background: transparent;
  color: #E3E9FA; font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer;
}
:where(.ip-app) a.ip-sidebtn { color: #E3E9FA; }
:where(.ip-app) .ip-sidebtn:hover { background: rgba(255,255,255,.08); color: #fff; }
.ip-sidebtn__text { white-space: nowrap; }

.ip-main { grid-area: main; min-width: 0; padding: 28px 40px 56px; container: ip-main / inline-size; }
.ip-page { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.ip-page--narrow { max-width: 880px; }

/* Compact desktop: icon rail */
@container ip-app (min-width: 1024px) and (max-width: 1279px) {
  .ip-shell { grid-template-columns: 92px minmax(0, 1fr); }
  .ip-side { padding: 20px 8px 16px; gap: 18px; }
  .ip-brand { justify-content: center; padding: 0; font-size: 20px; }
  .ip-brand__ielts, .ip-brand__plus, .ip-brand__tag { display: none; }
  .ip-brand__short { display: inline; color: #fff; }
  .ip-brand__short b { color: var(--ip-orange-500); }
  .ip-side__section { display: none; }
  .ip-nav__link { flex-direction: column; justify-content: center; gap: 4px; min-height: 62px; padding: 8px 4px; font-size: 12px; text-align: center; line-height: 1.2; }
  .ip-nav__link[aria-current="page"]::before { left: -8px; }
  .ip-nav__count { position: absolute; top: 4px; right: 10px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .ip-account { align-items: center; padding: 12px 0 0; }
  .ip-account__text, .ip-sidebtn__text { display: none; }
  .ip-account__actions { flex-direction: column; }
  .ip-sidebtn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .ip-main { padding: 24px 28px 48px; }
}

/* Tablet: top bar + horizontal navigation */
@container ip-app (min-width: 640px) and (max-width: 1023px) {
  .ip-shell { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; grid-template-areas: "brand account" "nav nav" "main main"; }
  .ip-side { display: contents; }
  .ip-brand { grid-area: brand; background: var(--ip-navy-950); padding: 0 24px; min-height: 60px; font-size: 22px; }
  .ip-account { grid-area: account; background: var(--ip-navy-950); color: #fff; margin: 0; padding: 0 24px 0 12px; border: 0; flex-direction: row; align-items: center; gap: 12px; }
  .ip-account__role { display: none; }
  .ip-side__section { display: none; }
  .ip-nav { grid-area: nav; flex-direction: row; gap: 4px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--ip-line); overflow-x: auto; scrollbar-width: none; }
  :where(.ip-app) .ip-nav__link { color: var(--ip-ink-2); border-radius: 0; min-height: 52px; padding: 0 12px; gap: 8px; white-space: nowrap; }
  :where(.ip-app) .ip-nav__link:hover { background: var(--ip-surface-2); color: var(--ip-ink); }
  :where(.ip-app) .ip-nav__link[aria-current="page"] { background: transparent; color: var(--ip-navy-950); }
  .ip-nav__link[aria-current="page"]::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .ip-main { padding: 24px 24px 48px; }
}

/* Phone: top bar + bottom tab bar */
@container ip-app (max-width: 639px) {
  .ip-shell, .ip-guest { --ip-ctl: 44px; }
  .ip-shell { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; grid-template-areas: "brand account" "main main" "nav nav"; }
  .ip-side { display: contents; }
  .ip-brand { grid-area: brand; background: var(--ip-navy-950); padding: 0 16px; min-height: 56px; font-size: 21px; }
  .ip-brand__tag { display: none; }
  .ip-account { grid-area: account; background: var(--ip-navy-950); color: #fff; margin: 0; padding: 0 12px 0 8px; border: 0; flex-direction: row; align-items: center; gap: 8px; }
  .ip-account__text, .ip-sidebtn__text, .ip-sidebtn--site { display: none; }
  .ip-avatar { width: 32px; height: 32px; font-size: 13px; }
  .ip-sidebtn { width: 44px; height: 44px; padding: 0; justify-content: center; border-color: transparent; }
  .ip-side__section { display: none; }
  .ip-nav {
    grid-area: nav; position: sticky; bottom: 0; z-index: 20;
    flex-direction: row; gap: 0; padding: 4px 4px 6px;
    background: #fff; border-top: 1px solid var(--ip-line);
    box-shadow: 0 -4px 16px rgba(17, 26, 51, .06);
  }
  .ip-nav__link { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 6px 2px; font-size: 11.5px; line-height: 1.2; text-align: center; border-radius: var(--ip-r); }
  :where(.ip-app) .ip-nav__link { color: var(--ip-ink-3); }
  :where(.ip-app) .ip-nav__link:hover { background: var(--ip-surface-2); color: var(--ip-ink); }
  :where(.ip-app) .ip-nav__link[aria-current="page"] { background: var(--ip-blue-50); color: var(--ip-blue-700); }
  .ip-nav__link[aria-current="page"]::before { display: none; }
  .ip-nav__label { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ip-nav__count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .ip-main { padding: 16px 16px 28px; }
  .ip-shell--focus .ip-nav { display: none; }
  .ip-hide-phone { display: none !important; }
}
@container ip-app (min-width: 640px) { .ip-only-phone { display: none !important; } }

/* Guest (unauthenticated) shell */
.ip-guest { min-height: 100%; display: flex; flex-direction: column; }
.ip-guest__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 32px; min-height: 64px; background: #fff; border-bottom: 1px solid var(--ip-line); }
.ip-guest__bar .ip-brand { padding: 0; font-size: 23px; }
.ip-guest__main { flex: 1; padding: 40px 32px 56px; container: ip-main / inline-size; }
.ip-guest__foot { padding: 20px 32px; border-top: 1px solid var(--ip-line); font-size: 13.5px; color: var(--ip-ink-3); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; background: #fff; }
@container ip-app (max-width: 639px) {
  .ip-guest__bar { padding: 0 16px; min-height: 56px; }
  .ip-guest__main { padding: 24px 16px 32px; }
  .ip-guest__foot { padding: 16px; }
}

/* ==========================================================================
   Page header, sections, panels
   ========================================================================== */
.ip-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.ip-pagehead__text { min-width: 0; flex: 1 1 320px; }
.ip-pagehead__title { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; color: var(--ip-navy-950); overflow-wrap: anywhere; }
.ip-pagehead__sub { color: var(--ip-ink-3); margin-top: 6px; }
.ip-pagehead__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ip-back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; font-size: 14.5px; text-decoration: none; margin-bottom: 4px; }
@container ip-main (max-width: 600px) {
  .ip-pagehead__title { font-size: 23px; }
  .ip-pagehead__actions { width: 100%; }
  .ip-pagehead__actions > .ip-btn { flex: 1 1 auto; }
}

.ip-sectionhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.ip-h2 { font-size: 18px; line-height: 1.3; font-weight: 650; color: var(--ip-navy-950); display: flex; align-items: center; gap: 10px; }
.ip-h3 { font-size: 15.5px; line-height: 1.35; font-weight: 650; }
.ip-lead { color: var(--ip-ink-2); }

.ip-panel { background: var(--ip-surface); border: 1px solid var(--ip-line); border-radius: var(--ip-r-lg); min-width: 0; }
.ip-panel--accent { border-color: var(--ip-blue-200); background: #FAFBFF; }
.ip-panel--danger { border-color: var(--ip-red-200); }
.ip-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 20px; border-bottom: 1px solid var(--ip-line); }
.ip-panel__title { font-size: 16px; line-height: 1.35; font-weight: 650; display: flex; align-items: center; gap: 8px; color: var(--ip-navy-950); }
.ip-panel__desc { font-size: 13.5px; color: var(--ip-ink-3); }
.ip-panel__body { padding: 18px 20px; }
.ip-panel__body--flush { padding: 0; }
.ip-panel__foot { padding: 12px 20px; border-top: 1px solid var(--ip-line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
@container ip-main (max-width: 600px) {
  .ip-panel__head { padding: 12px 16px; }
  .ip-panel__body { padding: 16px; }
  .ip-panel__foot { padding: 12px 16px; }
}
.ip-count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--ip-surface-2); border: 1px solid var(--ip-line);
  font-size: 12.5px; font-weight: 600; color: var(--ip-ink-2);
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.ip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--ip-ctl); padding: 0 16px;
  border-radius: var(--ip-r); border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ip-btn--primary { background: var(--ip-blue-600); color: #fff; }
.ip-btn--primary:hover { background: var(--ip-blue-700); color: #fff; }
.ip-btn--secondary { background: #fff; border-color: var(--ip-line-strong); color: var(--ip-ink); }
.ip-btn--secondary:hover { background: var(--ip-surface-2); border-color: #9AA4BA; color: var(--ip-ink); }
.ip-btn--ghost { background: transparent; color: var(--ip-blue-600); padding: 0 10px; }
.ip-btn--ghost:hover { background: var(--ip-blue-50); color: var(--ip-blue-700); }
.ip-btn--danger { background: #fff; border-color: var(--ip-red-200); color: var(--ip-red-700); }
.ip-btn--danger:hover { background: var(--ip-red-50); color: var(--ip-red-700); }
.ip-btn--danger-solid { background: var(--ip-red-700); color: #fff; }
.ip-btn--danger-solid:hover { background: #8F1B12; color: #fff; }
.ip-btn--lg { min-height: 48px; padding: 0 22px; font-size: 15.5px; }
.ip-btn--sm { min-height: 32px; padding: 0 11px; font-size: 13.5px; }
.ip-btn--icon { width: var(--ip-ctl); padding: 0; }
.ip-btn--block { width: 100%; }
.ip-btn[disabled], .ip-btn[aria-disabled="true"],
.ip-btn[disabled]:hover, .ip-btn[aria-disabled="true"]:hover { background: var(--ip-disabled-bg); color: var(--ip-disabled-fg); border-color: transparent; cursor: not-allowed; }
.ip-btn[aria-busy="true"] { cursor: progress; }
.ip-btn--demo-hover.ip-btn--primary { background: var(--ip-blue-700); }
.ip-btn--demo-hover.ip-btn--secondary { background: var(--ip-surface-2); border-color: #9AA4BA; }
.ip-btn--demo-focus { outline: 3px solid var(--ip-focus); outline-offset: 2px; }
@container ip-app (max-width: 639px) { .ip-btn--sm { min-height: 40px; } }

/* ==========================================================================
   Forms
   ========================================================================== */
.ip-form { display: flex; flex-direction: column; gap: 16px; }
.ip-formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ip-formgrid__full { grid-column: 1 / -1; }
@container (max-width: 520px) { .ip-formgrid { grid-template-columns: minmax(0, 1fr); } }
.ip-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ip-label { font-size: 14px; font-weight: 600; color: var(--ip-ink); }
.ip-label__opt { font-weight: 400; color: var(--ip-ink-3); }
.ip-input, .ip-select, .ip-textarea {
  width: 100%; min-height: var(--ip-ctl); padding: 8px 12px;
  border: 1px solid var(--ip-line-strong); border-radius: var(--ip-r);
  background: #fff; font-size: 15px; line-height: 1.4;
}
.ip-input:hover, .ip-select:hover, .ip-textarea:hover { border-color: #9AA4BA; }
.ip-input:focus, .ip-select:focus, .ip-textarea:focus, .ip-input--demo-focus { outline: none; border-color: var(--ip-blue-600); box-shadow: 0 0 0 3px rgba(45, 79, 208, .28); }
.ip-input[aria-invalid="true"], .ip-select[aria-invalid="true"], .ip-textarea[aria-invalid="true"] { border-color: var(--ip-red-700); background: #FFFBFA; }
.ip-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .22); }
.ip-input[readonly], .ip-textarea[readonly] { background: var(--ip-surface-2); color: var(--ip-ink-2); }
.ip-input:disabled, .ip-select:disabled, .ip-textarea:disabled { background: #EEF0F5; color: var(--ip-disabled-fg); cursor: not-allowed; }
.ip-select {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6580' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.ip-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.ip-textarea--tall { min-height: 220px; }
.ip-help { font-size: 13px; color: var(--ip-ink-3); }
.ip-errtext { font-size: 13.5px; color: var(--ip-red-700); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.ip-errtext .ip-ic { margin-top: 1px; }
.ip-inputwrap { position: relative; flex: 1 1 260px; min-width: 0; }
.ip-inputwrap > .ip-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ip-ink-3); pointer-events: none; }
.ip-input--icon { padding-left: 40px; }
.ip-input--mono { font-family: var(--ip-mono); font-size: 14px; }
.ip-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ip-ink-3); font-weight: 600; pointer-events: none; }

.ip-check {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--ip-line); border-radius: var(--ip-r); background: var(--ip-surface-2);
  font-size: 14.5px; font-weight: 500; line-height: 1.45;
}
.ip-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ip-blue-600); cursor: pointer; }
.ip-check--plain { padding: 0; border: 0; background: transparent; }
.ip-check--invalid { border-color: var(--ip-red-700); background: #FFFBFA; }

.ip-searchbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.ip-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ip-chip {
  min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--ip-line-strong); background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--ip-ink-2);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
}
.ip-chip:hover { border-color: #9AA4BA; }
.ip-chip[aria-pressed="true"] { background: var(--ip-navy-950); border-color: var(--ip-navy-950); color: #fff; }
.ip-chip__n { font-variant-numeric: tabular-nums; opacity: .8; }
@container ip-app (max-width: 639px) { .ip-chip { min-height: 40px; } }

.ip-copy { display: flex; gap: 8px; align-items: stretch; }
.ip-copy__val { flex: 1; min-width: 0; padding: 9px 12px; background: var(--ip-surface-2); border: 1px solid var(--ip-line); border-radius: var(--ip-r); font-family: var(--ip-mono); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ip-copy__val--text { font-family: var(--ip-font); font-size: 14.5px; }

/* ==========================================================================
   Status, badges, alerts, banners
   ========================================================================== */
.ip-status {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.25; white-space: nowrap;
  border: 1px solid transparent; background: var(--ip-surface-2); color: var(--ip-ink-2);
}
.ip-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ip-status--paused   { background: var(--ip-orange-50); border-color: var(--ip-orange-100); color: var(--ip-orange-700); }
.ip-status--progress { background: var(--ip-blue-50); border-color: var(--ip-blue-100); color: var(--ip-blue-700); }
.ip-status--ready    { background: #fff; border-color: var(--ip-blue-200); color: var(--ip-blue-700); }
.ip-status--ready::before, .ip-status--review::before, .ip-status--payment::before { background: transparent; border: 2px solid currentColor; width: 8px; height: 8px; }
.ip-status--done     { background: var(--ip-green-50); border-color: var(--ip-green-200); color: var(--ip-green-700); }
.ip-status--review   { background: var(--ip-orange-50); border-color: var(--ip-orange-100); color: var(--ip-orange-700); }
.ip-status--payment  { background: var(--ip-orange-50); border-color: var(--ip-orange-100); color: var(--ip-orange-700); }
.ip-status--cancelled{ background: #EEF0F5; border-color: #E0E4EC; color: var(--ip-ink-3); }
.ip-status--danger   { background: var(--ip-red-50); border-color: var(--ip-red-200); color: var(--ip-red-700); }
.ip-status--neutral  { background: var(--ip-surface-2); border-color: var(--ip-line); color: var(--ip-ink-2); }

.ip-tag { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 1px 8px; border-radius: var(--ip-r-sm); background: #EDF0F6; color: var(--ip-ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ip-tag--outline { background: transparent; border: 1px solid var(--ip-line-strong); }

.ip-alert { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--ip-r); border: 1px solid; font-size: 14.5px; }
.ip-alert__body { flex: 1 1 260px; min-width: 0; display: flex; gap: 12px; align-items: flex-start; }
.ip-alert__body > .ip-ic { margin-top: 1px; }
.ip-alert__title { font-weight: 650; }
.ip-alert__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ip-alert--info    { background: var(--ip-blue-50);   border-color: var(--ip-blue-100);   color: var(--ip-ink); }
.ip-alert--info    .ip-alert__body > .ip-ic { color: var(--ip-blue-600); }
.ip-alert--warn    { background: var(--ip-orange-50); border-color: var(--ip-orange-100); color: var(--ip-ink); }
.ip-alert--warn    .ip-alert__body > .ip-ic { color: var(--ip-orange-700); }
.ip-alert--danger  { background: var(--ip-red-50);    border-color: var(--ip-red-200);    color: var(--ip-ink); }
.ip-alert--danger  .ip-alert__body > .ip-ic { color: var(--ip-red-700); }
.ip-alert--success { background: var(--ip-green-50);  border-color: var(--ip-green-200);  color: var(--ip-ink); }
.ip-alert--success .ip-alert__body > .ip-ic { color: var(--ip-green-700); }

.ip-netbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-radius: var(--ip-r); background: var(--ip-navy-900); color: #fff; font-size: 14px; }
.ip-netbar__text { flex: 1 1 240px; display: flex; gap: 10px; align-items: center; }

/* ==========================================================================
   Tabs, disclosure, pager
   ========================================================================== */
.ip-tabs { display: flex; gap: 4px; padding: 4px; background: #E7EBF3; border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.ip-tab {
  flex: 1 0 auto; min-height: 36px; padding: 0 14px; border: 0; background: transparent; border-radius: 7px;
  font-weight: 600; font-size: 14px; color: var(--ip-ink-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.ip-tab:hover { color: var(--ip-ink); background: rgba(255,255,255,.5); }
.ip-tab[aria-selected="true"] { background: #fff; color: var(--ip-navy-950); box-shadow: var(--ip-shadow-1); }
@container ip-app (max-width: 639px) { .ip-tab { min-height: 40px; padding: 0 10px; } }

.ip-tabs--line { background: transparent; padding: 0; gap: 0; border-bottom: 1px solid var(--ip-line); border-radius: 0; }
.ip-tabs--line .ip-tab { flex: 0 0 auto; border-radius: 0; min-height: 44px; position: relative; }
.ip-tabs--line .ip-tab:hover { background: var(--ip-surface-2); }
.ip-tabs--line .ip-tab[aria-selected="true"] { background: transparent; box-shadow: none; color: var(--ip-blue-700); }
.ip-tabs--line .ip-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ip-blue-600); }

.ip-disclosure { border: 1px solid var(--ip-line); border-radius: var(--ip-r); background: #fff; }
.ip-disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; font-weight: 600; font-size: 14.5px; }
.ip-disclosure > summary::-webkit-details-marker { display: none; }
.ip-disclosure > summary .ip-ic { transition: transform .15s; }
.ip-disclosure[open] > summary .ip-ic--chev { transform: rotate(90deg); }
.ip-disclosure__body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.ip-disclosure--danger > summary { color: var(--ip-red-700); }

.ip-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 12px 16px; border-top: 1px solid var(--ip-line); font-size: 13.5px; color: var(--ip-ink-3); }
.ip-pager__btns { display: flex; gap: 8px; }

/* ==========================================================================
   Tables → cards
   ========================================================================== */
.ip-tablewrap { container-type: inline-size; width: 100%; }
.ip-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ip-table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ip-ink-3); padding: 10px 16px; background: var(--ip-surface-2); border-bottom: 1px solid var(--ip-line); white-space: nowrap; }
.ip-table td { padding: 12px 16px; border-bottom: 1px solid var(--ip-line); vertical-align: middle; }
.ip-table tbody tr:last-child td { border-bottom: 0; }
.ip-table tbody tr:hover { background: #FAFBFD; }
.ip-table .ip-ta-right { text-align: right; }
.ip-table__actions { text-align: right; white-space: nowrap; }
.ip-table tr.is-selected td { background: var(--ip-blue-50); }
.ip-cell-main { font-weight: 600; overflow-wrap: anywhere; }
.ip-cell-sub { font-size: 13px; color: var(--ip-ink-3); overflow-wrap: anywhere; font-weight: 400; }
.ip-table--dense td { padding: 8px 16px; }
@container (max-width: 680px) {
  .ip-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ip-table--cards, .ip-table--cards tbody { display: block; width: 100%; }
  .ip-table--cards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--ip-line); }
  .ip-table--cards tbody tr:last-child { border-bottom: 0; }
  .ip-table--cards td { display: block; padding: 0; border: 0; flex: 1 1 100%; min-width: 0; order: 2; text-align: left; }
  .ip-table--cards td[data-label]::before { content: attr(data-label) ": "; color: var(--ip-ink-3); font-size: 13px; }
  .ip-table--cards td.ip-td-main { flex: 1 1 0; order: 0; }
  .ip-table--cards td.ip-td-status { flex: 0 0 auto; order: 1; }
  .ip-table--cards td.ip-td-status::before { display: none; }
  .ip-table--cards td.ip-td-lead { flex: 0 0 auto; order: 0; font-weight: 700; }
  .ip-table--cards td.ip-table__actions { order: 3; margin-top: 6px; text-align: left; white-space: normal; }
  .ip-table--cards td.ip-table__actions .ip-btn { width: 100%; }
  .ip-table--cards td.ip-table__actions .ip-row { flex-wrap: nowrap; }
  .ip-table--cards td.ip-table__actions .ip-row .ip-btn { flex: 1 1 0; width: auto; }
  .ip-table--cards td.ip-td-half { flex: 1 1 40%; }
}

/* ==========================================================================
   Feedback: empty, skeleton, save state, dialog
   ========================================================================== */
.ip-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border: 1px dashed var(--ip-line-strong); border-radius: var(--ip-r); background: var(--ip-surface-2); color: var(--ip-ink-2); }
.ip-empty--center { align-items: center; text-align: center; padding: 36px 20px; }
.ip-empty__icon { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--ip-line); display: inline-flex; align-items: center; justify-content: center; color: var(--ip-ink-3); }
.ip-empty__title { font-weight: 650; color: var(--ip-ink); }

.ip-skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #E7EBF3 0%, #F2F4F8 50%, #E7EBF3 100%); background-size: 200% 100%; animation: ip-shimmer 1.4s ease-in-out infinite; }
.ip-skel--title { height: 20px; width: 40%; }
.ip-skel--btn { height: 40px; width: 140px; border-radius: var(--ip-r); }
@keyframes ip-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.ip-save { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13.5px; font-weight: 600; }
.ip-save__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ip-save--idle   { color: var(--ip-ink-3); font-weight: 500; }
.ip-save--dirty  { color: var(--ip-orange-700); }
.ip-save--saving { color: var(--ip-ink-2); }
.ip-save--saved  { color: var(--ip-green-700); }
.ip-save--failed { color: var(--ip-red-700); }

.ip-actionbar {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 12px 20px; background: rgba(255,255,255,.97); border: 1px solid var(--ip-line); border-radius: var(--ip-r-lg);
  box-shadow: 0 -6px 20px rgba(17, 26, 51, .07);
}
.ip-actionbar__msg { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ip-actionbar__btns { display: flex; flex-wrap: wrap; gap: 8px; }
@container ip-main (max-width: 600px) {
  .ip-actionbar { margin: 0 -16px -28px; border-radius: 0; border-width: 1px 0 0; padding: 10px 16px 12px; }
  .ip-actionbar__btns { width: 100%; }
  .ip-actionbar__btns .ip-btn { flex: 1 1 0; }
}

.ip-scrim { background: rgba(11, 22, 56, .5); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ip-dialog { width: 100%; max-width: 460px; background: #fff; border-radius: 14px; box-shadow: var(--ip-shadow-2); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.ip-dialog__icon { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ip-orange-50); color: var(--ip-orange-700); }
.ip-dialog__title { font-size: 19px; font-weight: 700; color: var(--ip-navy-950); }
.ip-dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ==========================================================================
   Domain components
   ========================================================================== */
/* Key–value list */
.ip-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; font-size: 14.5px; }
.ip-kv dt { color: var(--ip-ink-3); }
.ip-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@container (max-width: 420px) {
  .ip-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ip-kv dt { font-size: 13px; margin-top: 8px; }
  .ip-kv dt:first-child { margin-top: 0; }
}

/* Attempt / order rows in the student dashboard */
.ip-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border-top: 1px solid var(--ip-line); }
.ip-item:first-child { border-top: 0; }
.ip-item__main { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ip-item__title { font-weight: 650; font-size: 16px; line-height: 1.35; color: var(--ip-navy-950); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ip-item__meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13.5px; color: var(--ip-ink-3); }
.ip-item__meta > span { display: inline-flex; align-items: center; gap: 5px; }
.ip-item__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@container ip-main (max-width: 600px) {
  .ip-item { padding: 14px 16px; }
  .ip-item__actions { width: 100%; }
  .ip-item__actions .ip-btn { flex: 1 1 auto; }
}

/* Resume feature */
.ip-resume { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 20px 22px; }
.ip-resume + .ip-resume { border-top: 1px solid var(--ip-blue-100); }
.ip-resume__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--ip-navy-950); color: var(--ip-orange-500); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ip-resume__main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ip-resume__title { font-size: 18px; font-weight: 700; color: var(--ip-navy-950); line-height: 1.3; }
.ip-resume__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@container ip-main (max-width: 600px) {
  .ip-resume { padding: 16px; }
  .ip-resume__icon { display: none; }
  .ip-resume__actions { width: 100%; align-items: stretch; }
}

/* Order → attempt lifecycle */
.ip-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; list-style: none; font-size: 13px; color: var(--ip-ink-3); }
.ip-flow li { display: inline-flex; align-items: center; gap: 6px; }
.ip-flow li + li::before { content: ""; width: 18px; height: 1px; background: var(--ip-line-strong); margin: 0 8px; }
.ip-flow__dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ip-line-strong); background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ip-flow__dot .ip-ic { width: 12px; height: 12px; stroke-width: 2.6; }
.ip-flow li.is-done { color: var(--ip-ink-2); }
.ip-flow li.is-done .ip-flow__dot { background: var(--ip-green-700); border-color: var(--ip-green-700); color: #fff; }
.ip-flow li.is-current { color: var(--ip-ink); font-weight: 600; }
.ip-flow li.is-current .ip-flow__dot { border: 5px solid var(--ip-orange-500); }

.ip-steps { list-style: none; display: flex; flex-direction: column; }
.ip-steps li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.ip-steps li:last-child { padding-bottom: 0; }
.ip-steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px; background: var(--ip-line); }
.ip-steps li.is-done:not(:last-child)::after { background: var(--ip-green-700); }
.ip-steps__dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ip-line-strong); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--ip-ink-3); font-size: 13px; font-weight: 700; }
.ip-steps li.is-done .ip-steps__dot { background: var(--ip-green-700); border-color: var(--ip-green-700); color: #fff; }
.ip-steps li.is-current .ip-steps__dot { border-color: var(--ip-orange-500); background: var(--ip-orange-50); color: var(--ip-orange-700); }
.ip-steps__title { font-weight: 600; padding-top: 3px; }
.ip-steps__desc { font-size: 13.5px; color: var(--ip-ink-3); }

/* Products (catalogue) */
.ip-product { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 18px 20px; border-top: 1px solid var(--ip-line); }
.ip-product:first-child { border-top: 0; }
.ip-product__main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ip-product__name { font-size: 17px; font-weight: 700; color: var(--ip-navy-950); }
.ip-product__price { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ip-navy-950); white-space: nowrap; }
.ip-product__price small { display: block; font-size: 13px; font-weight: 500; color: var(--ip-ink-3); }
.ip-product__buy { display: flex; align-items: center; gap: 20px; }
@container ip-main (max-width: 600px) {
  .ip-product { padding: 16px; }
  .ip-product__buy { width: 100%; justify-content: space-between; }
}

/* QR payment */
.ip-qr { width: 216px; aspect-ratio: 1; border: 1px solid var(--ip-line); border-radius: var(--ip-r-lg); background: #fff; display: flex; align-items: center; justify-content: center; padding: 14px; flex: none; }
.ip-qr img, .ip-qr svg { width: 100%; height: 100%; }
.ip-qr--unavailable { flex-direction: column; gap: 10px; text-align: center; padding: 18px; color: var(--ip-ink-2); font-size: 13.5px; font-weight: 600; background: repeating-linear-gradient(135deg, #F3F5F9 0 10px, #EAEDF3 10px 20px); border-style: dashed; border-color: var(--ip-line-strong); }
.ip-qr--unavailable .ip-ic { width: 32px; height: 32px; color: var(--ip-ink-3); }
.ip-paybox { display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: flex-start; }
.ip-paybox__steps { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
@container ip-main (max-width: 600px) { .ip-qr { width: 100%; max-width: 260px; margin: 0 auto; } }

/* Scores (results) */
.ip-scores { display: grid; grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr)); gap: 12px; }
.ip-score { padding: 16px; border: 1px solid var(--ip-line); border-radius: var(--ip-r-lg); background: #fff; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ip-score__label { font-size: 13.5px; font-weight: 600; color: var(--ip-ink-2); }
.ip-score__value { font-size: 28px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ip-navy-950); }
.ip-score__value small { font-size: 15px; font-weight: 500; color: var(--ip-ink-3); }
.ip-score__note { font-size: 13px; color: var(--ip-ink-3); }
.ip-score__band { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--ip-line); font-size: 13.5px; color: var(--ip-ink-2); display: flex; justify-content: space-between; gap: 8px; }
.ip-score__band b { font-variant-numeric: tabular-nums; color: var(--ip-navy-950); }
.ip-score--overall { background: var(--ip-navy-950); border-color: var(--ip-navy-950); color: #fff; }
.ip-score--overall .ip-score__label, .ip-score--overall .ip-score__note { color: #C8D2F0; }
.ip-score--overall .ip-score__value { color: #fff; font-size: 34px; }
.ip-score--pending .ip-score__value { font-size: 16px; line-height: 1.35; color: var(--ip-orange-700); font-weight: 650; }
.ip-score--overall.ip-score--pending .ip-score__value { color: #FFD3A6; }
@container ip-main (max-width: 900px) {
  .ip-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ip-score--overall { grid-column: 1 / -1; }
}

/* Essay / long text */
.ip-essay { white-space: pre-wrap; font-size: 15.5px; line-height: 1.7; padding: 14px 16px; background: var(--ip-surface-2); border: 1px solid var(--ip-line); border-radius: var(--ip-r); overflow-wrap: anywhere; }
.ip-essay--plain { background: #fff; }
.ip-feedback { padding: 14px 16px; border-radius: var(--ip-r); background: var(--ip-blue-50); border: 1px solid var(--ip-blue-100); white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }
.ip-wordcount { font-size: 13px; color: var(--ip-ink-3); font-variant-numeric: tabular-nums; }

/* Answer review marks */
.ip-mark { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.ip-mark__ic { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ip-mark__ic .ip-ic { width: 13px; height: 13px; stroke-width: 2.6; }
.ip-mark--ok { color: var(--ip-green-700); }
.ip-mark--ok .ip-mark__ic { background: var(--ip-green-700); color: #fff; }
.ip-mark--bad { color: var(--ip-red-700); }
.ip-mark--bad .ip-mark__ic { background: var(--ip-red-50); color: var(--ip-red-700); border: 1.5px solid var(--ip-red-700); }
.ip-mark--empty { color: var(--ip-ink-3); }
.ip-mark--empty .ip-mark__ic { border: 1.5px dashed var(--ip-ink-3); }
.ip-answer-empty { color: var(--ip-ink-3); font-style: italic; }

/* Assessment workspace */
.ip-assess-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; }
.ip-assess { display: flex; flex-direction: column; gap: 20px; }
.ip-assess__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.ip-pane { background: #fff; border: 1px solid var(--ip-line); border-radius: var(--ip-r-lg); display: flex; flex-direction: column; min-width: 0; }
.ip-pane__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 12px 18px; border-bottom: 1px solid var(--ip-line); }
.ip-pane__title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.ip-pane__body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ip-pane--edit { border-color: var(--ip-blue-200); }
.ip-pane--edit .ip-pane__head { background: #FAFBFF; border-radius: var(--ip-r-lg) var(--ip-r-lg) 0 0; }
.ip-assess-tabs { display: none; }
@container ip-main (max-width: 899px) {
  .ip-assess-tabs { display: flex; }
  .ip-assess__row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ip-tabpanel:not(.is-active) { display: none; }
}

/* Master–detail (admin queue) */
.ip-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.ip-only-narrow { display: none !important; }
@container ip-main (max-width: 979px) {
  .ip-split { grid-template-columns: minmax(0, 1fr); }
  .ip-split--detail .ip-split__list { display: none; }
  .ip-split--list .ip-split__detail { display: none; }
  .ip-only-narrow { display: inherit !important; }
  .ip-only-narrow.ip-btn, .ip-only-narrow.ip-back { display: inline-flex !important; }
}
.ip-qitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; text-align: left; padding: 14px 18px; border: 0; border-top: 1px solid var(--ip-line); background: #fff; cursor: pointer; position: relative; }
.ip-qitem:first-child { border-top: 0; }
.ip-qitem:hover { background: var(--ip-surface-2); }
.ip-qitem[aria-current="true"] { background: var(--ip-blue-50); box-shadow: inset 4px 0 0 var(--ip-blue-600); }
.ip-qitem__title { font-weight: 650; color: var(--ip-navy-950); }
.ip-qitem__sub { font-size: 13.5px; color: var(--ip-ink-3); overflow-wrap: anywhere; grid-column: 1 / 2; }
.ip-qitem__amount { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ip-qitem__right { grid-column: 2; grid-row: 2 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.ip-sensitive { border: 1px solid var(--ip-orange-100); background: var(--ip-orange-50); border-radius: var(--ip-r); padding: 12px 14px; display: flex; gap: 10px; font-size: 14px; }
.ip-sensitive > .ip-ic { color: var(--ip-orange-700); margin-top: 1px; }
.ip-divider { height: 1px; background: var(--ip-line); border: 0; margin: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ip-spin, .ip-skel { animation: none; }
  .ip-btn, .ip-disclosure > summary .ip-ic { transition: none; }
}

/* ==========================================================================
   Design-review annotations (prototype only; remove `ip-annot` in production)
   Marks UI that is a SUGGESTED addition, not current functionality.
   ========================================================================== */
.ip-annot [data-suggest] { position: relative; outline: 2px dashed var(--ip-orange-500); outline-offset: 3px; }
.ip-annot [data-suggest]::after {
  content: "Предложение · " attr(data-suggest);
  position: absolute; top: -13px; right: 8px; z-index: 6; pointer-events: none;
  padding: 2px 7px; border-radius: 4px; background: var(--ip-orange-500); color: #2B1500;
  font: 700 11px/1.4 var(--ip-font); white-space: nowrap; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis;
}

/* Review fixes: honour visibility semantics and component button colours. */
.ip-app [hidden] { display: none !important; }
dialog.ip-dialog:not([open]) { display: none; }
.ip-app .ip-btn--primary, .ip-app .ip-btn--danger-solid { color: #fff; }
/* Guest logos must not inherit the dark mobile account-navigation tile. */
.ip-guest__bar .ip-brand--light { background: transparent; padding: 0; color: var(--ip-navy-950); }

/* Student dashboard refinement: attempts first, quieter order details. */
.ip-student-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.ip-student-dashboard [aria-disabled="true"] { pointer-events: none; opacity: .55; }
.ip-student-dashboard .ip-item__main { flex-basis: 180px; }
.ip-student-dashboard .ip-resume__main { flex-basis: 200px; }
@container ip-main (max-width: 850px) {
  .ip-student-columns { grid-template-columns: minmax(0, 1fr); }
}
@container ip-app (max-width: 639px) {
  .ip-student-dashboard .ip-pagehead__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ip-student-dashboard .ip-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .ip-student-dashboard .ip-nav__link { width: 100%; }
  .ip-student-dashboard .ip-resume { gap: 12px; }
  .ip-student-dashboard .ip-panel__title { justify-content: space-between; width: 100%; }
  .ip-student-dashboard #h-resume { justify-content: flex-start; }
  .ip-student-dashboard #h-resume .ip-count { margin-left: auto; }
  .ip-student-dashboard .ip-table--cards td.ip-td-main { flex-basis: 100%; }
  .ip-student-dashboard .ip-table--cards td.ip-td-status { order: 2; }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions .ip-btn { width: auto; min-height: 44px; padding-left: 0; border-color: transparent; background: transparent; color: var(--ip-blue-700); }
}

/* Desktop workspace: stationary navigation and independently scrolling content. */
@container ip-app (min-width: 1024px) {
  .ip-shell { height: 100dvh; min-height: 0; overflow: hidden; grid-template-rows: minmax(0, 1fr); }
  .ip-side { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .ip-side > * { flex-shrink: 0; }
  .ip-main { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
}

/* Compact phone rows: information left, a generous action target right. */
@container ip-app (max-width: 639px) {
  .ip-student-dashboard .ip-table--cards tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 5px 12px;
    padding: 14px 0 14px 16px;
    align-items: start;
  }
  .ip-student-dashboard .ip-table--cards tbody td { grid-column: 1; order: initial; }
  .ip-student-dashboard .ip-table--cards td.ip-td-main { grid-row: 1; }
  .ip-student-dashboard .ip-table--cards td[data-label] { grid-row: 2; font-size: 13px; }
  .ip-student-dashboard .ip-table--cards td[data-label]::before { content: ''; }
  .ip-student-dashboard .ip-table--cards td.ip-td-status { grid-row: 3; }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions {
    grid-column: 2; grid-row: 1 / 4; margin: -14px 0; align-self: stretch;
    display: flex; border-left: 1px solid var(--ip-line);
  }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions .ip-btn {
    width: 100%; min-height: 56px; padding: 12px 6px; border: 0; border-radius: 0;
    background: var(--ip-blue-50); font-size: 13px; text-align: center;
  }
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item:has(.ip-item__actions) {
    display: grid; grid-template-columns: minmax(0, 1fr) 88px;
    gap: 12px; padding: 14px 0 14px 16px; align-items: stretch;
  }
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions {
    width: auto; margin: -14px 0; border-left: 1px solid var(--ip-line); display: flex;
  }
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions .ip-btn {
    width: 100%; min-height: 56px; padding: 12px 8px; border: 0; border-radius: 0;
    background: var(--ip-blue-50); font-size: 13px; white-space: normal; text-align: center;
  }
  .ip-student-dashboard .ip-td-status .ip-status,
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-status {
    max-width: 100%; white-space: normal; line-height: 1.35; height: auto;
  }
  .ip-student-dashboard .ip-table__actions .ip-btn:hover,
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions .ip-btn:hover { background: var(--ip-blue-100); }
}
@container ip-app (max-width: 639px) {
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions { align-items: stretch; }
}

/* Refined mobile action rails: quiet tint, directional cue, balanced spacing. */
@container ip-app (max-width: 639px) {
  .ip-student-dashboard .ip-table--cards tbody tr { gap: 5px 14px; padding-top: 16px; padding-bottom: 16px; }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions {
    margin: 0 8px 0 0; border: 0;
  }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions .ip-btn,
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions .ip-btn {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 9px; padding: 12px 6px; border-radius: 10px;
    background: #f0f4ff; color: #2340b0; font-weight: 600; line-height: 1.35;
    transition: background-color .15s ease, box-shadow .15s ease;
  }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions .ip-btn::after,
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions .ip-btn::after {
    content: ''; width: 22px; height: 22px; border-radius: 50%;
    background-color: #e0e8ff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none' stroke='%232340b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 11h9m-4-4 4 4-4 4'/%3E%3C/svg%3E");
    flex: none;
  }
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item:has(.ip-item__actions) { padding-top: 16px; padding-bottom: 16px; }
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions { margin: 0 8px 0 0; border: 0; }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions .ip-btn:hover,
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions .ip-btn:hover { background: #e3ebff; box-shadow: inset 0 0 0 1px #cbd8fa; }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions .ip-btn:active,
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item__actions .ip-btn:active { background: #d8e3ff; }
  .ip-student-dashboard .ip-cell-main { font-size: 15px; line-height: 1.4; }
  .ip-student-dashboard .ip-cell-sub { margin-top: 2px; }
  .ip-student-dashboard .ip-td-status .ip-status { margin-top: 3px; }
  .ip-student-dashboard .ip-panel { box-shadow: 0 2px 5px rgba(17,26,51,.025); }
}
@media (prefers-reduced-motion: reduce) {
  .ip-student-dashboard .ip-table__actions .ip-btn,
  .ip-student-dashboard .ip-item__actions .ip-btn { transition: none; }
}
@container ip-app (max-width: 639px) {
  .ip-student-dashboard .ip-table--cards tbody tr,
  .ip-student-dashboard section[aria-labelledby="h-orders"] .ip-item:has(.ip-item__actions) {
    grid-template-columns: minmax(0, 1fr) 96px;
  }
  .ip-student-dashboard .ip-table--cards td.ip-table__actions .ip-btn { white-space: normal; overflow-wrap: anywhere; }
}

/* Catalogue: fluid information column and consistent purchase actions. */
.ip-catalogue .ip-product__main { min-width: 0; }
.ip-catalogue .ip-product__main .ip-select { max-width: 420px; }
.ip-catalogue .ip-product__buy { min-width: 140px; }
.ip-catalogue-confirm { position: fixed; inset: 0; z-index: 100; background: #0b1638a6; display: grid; place-items: center; padding: 20px; }
.ip-catalogue-confirm > .ip-panel { width: min(100%, 480px); max-height: calc(100dvh - 40px); overflow-y: auto; box-shadow: 0 20px 60px #0003; border-top: 4px solid var(--ip-orange-500); }
@container ip-app (max-width: 639px) {
  .ip-catalogue .ip-product { display: grid; grid-template-columns: minmax(0, 1fr) clamp(88px, 25%, 110px); gap: 12px; padding: 16px; align-items: stretch; }
  .ip-catalogue .ip-product__buy { min-width: 0; justify-content: center; align-items: stretch; gap: 12px; }
  .ip-catalogue .ip-product__price { text-align: center; font-size: 17px; white-space: nowrap; }
  .ip-catalogue .ip-product__buy .ip-btn { width: 100%; white-space: normal; padding: 12px 8px; min-height: 64px; font-size: 13px; }
  .ip-catalogue .ip-product__name { font-size: 16px; }
  .ip-catalogue .ip-select { width: 100%; min-width: 0; font-size: 13px; }
  .ip-catalogue .ip-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@container ip-app (max-width: 639px) {
 .ip-catalogue .ip-product__buy { flex-direction: column; }
}

/* Order progress uses an aligned timeline when horizontal space is limited. */
.ip-order-page .ip-qr--unavailable { background: #eff3ff; border: 0; padding: 0; overflow: hidden; aspect-ratio: 260 / 220; }
.ip-order-page .ip-qr--unavailable img { display: block; object-fit: contain; }
@container ip-main (max-width: 900px) {
 .ip-order-page .ip-flow { flex-direction: column; align-items: stretch; gap: 0; }
 .ip-order-page .ip-flow li { position: relative; gap: 12px; min-height: 36px; padding: 7px 0; line-height: 1.4; }
 .ip-order-page .ip-flow li + li::before { position: absolute; left: 8px; top: -9px; width: 2px; height: 18px; margin: 0; background: var(--ip-line); }
 .ip-order-page .ip-flow__dot { position: relative; z-index: 1; }
}

/* Compact result summary: five comparable band scores at every width. */
.ip-results .ip-scores { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.ip-results .ip-score { padding: 12px; gap: 6px; }
.ip-results .ip-score--overall { grid-column: auto; }
.ip-results .ip-score__value, .ip-results .ip-score--overall .ip-score__value { font-size: 26px; }
.ip-results .ip-score__label abbr { text-decoration: none; }
.ip-results .ip-table td { overflow-wrap: anywhere; }
@container ip-app (max-width: 639px) {
 .ip-results .ip-scores { gap: 5px; }
 .ip-results .ip-score { padding: 10px 3px; text-align: center; border-radius: 8px; }
 .ip-results .ip-score__label { font-size: 12px; }
 .ip-results .ip-score__value, .ip-results .ip-score--overall .ip-score__value { font-size: 21px; }
 .ip-results .ip-score__note { font-size: 11px; white-space: nowrap; }
 .ip-results .ip-tabs--line { gap: 0; flex-wrap: wrap; }
 .ip-results .ip-tabs--line .ip-tab { flex: 1 1 40%; }
 .ip-results .ip-table--cards tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px 12px; padding: 12px 16px; }
 .ip-results .ip-table--cards td.ip-td-lead { grid-column: 1; grid-row: 1; }
 .ip-results .ip-table--cards td.ip-td-status { grid-column: 2; grid-row: 1; }
 .ip-results .ip-table--cards td.ip-td-half { grid-row: 2; }
 .ip-results .ip-table--cards td[data-label]::before { display: block; margin-bottom: 3px; font-size: 12px; }
}

/* Objective answer review: compact comparison rows on phones. */
@container ip-app (max-width: 639px) {
 .ip-results .ip-table--cards { display: table; table-layout: fixed; width: 100%; }
 .ip-results .ip-table--cards thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
 .ip-results .ip-table--cards tbody { display: table-row-group; }
 .ip-results .ip-table--cards tr { display: table-row; padding: 0; }
 .ip-results .ip-table--cards th { white-space: normal; font-size: 11px; line-height: 1.3; padding: 9px 6px; }
 .ip-results .ip-table--cards th:first-child { width: 30px !important; text-align: center; }
 .ip-results .ip-table--cards th:last-child { width: 36px !important; font-size: 0; }
 .ip-results .ip-table--cards td { display: table-cell; padding: 9px 6px; vertical-align: middle; border-bottom: 1px solid var(--ip-line); font-size: 13px; line-height: 1.4; }
 .ip-results .ip-table--cards td.ip-td-lead { text-align: center; font-size: 12px; color: var(--ip-ink-3); }
 .ip-results .ip-table--cards td[data-label]::before { content: none; display: none; }
 .ip-results .ip-table--cards td.ip-td-status { text-align: center; }
 .ip-results .ip-table--cards .ip-mark { font-size: 0; gap: 0; }
 .ip-results .ip-table--cards .ip-mark__ic { width: 18px; height: 18px; }
 .ip-results .ip-table--cards .ip-mark__ic .ip-ic { width: 13px; height: 13px; }
}

/* Profile uses consistent left alignment; actions and navigation remain centred. */
.ip-profile .ip-panel__body { text-align: left; }
.ip-profile input[readonly] { background: var(--ip-surface-2); color: var(--ip-ink-2); }
.ip-profile .ip-panel__head { align-items: center; }
.ip-profile .ip-formgrid { grid-template-columns: minmax(0,1fr); }
@container ip-app (max-width:639px) {
 .ip-profile .ip-nav { display: flex; }
 .ip-profile .ip-nav__link { flex: 1 1 0; }
 .ip-profile .ip-panel__body > .ip-row > .ip-btn { width: 100%; }
}

/* Consistent IELTS+ wordmark and compact password controls. */
.ip-brand { gap: 0; }
.ip-brand__short { font-size: 17px; letter-spacing: -.04em; }
.ip-password-control { position: relative; }
.ip-password-control .ip-input { padding-right: 46px; }
.ip-password-control .ip-btn { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); width: 40px; height: 36px; min-height: 36px; }
.ip-profile #password-change { gap: 12px; }
.ip-profile #password-change .ip-field { gap: 6px; }
@container ip-app (min-width: 1024px) {
 .ip-profile .ip-panel__body { padding: 16px 20px; gap: 12px; }
 .ip-profile .ip-panel__body > button[aria-controls="password-change"] { align-self: flex-start; }
 .ip-profile #password-change > button[type="submit"] { justify-self: start; width: fit-content; }
 .ip-profile #password-change .ip-help { font-size: 12.5px; line-height: 1.4; }
}

/* Assessment: scrollable work area and a separate, always-visible footer. */
.ip-teacher-assessment .ip-shell { height:100dvh; min-height:0; overflow:hidden; }
.ip-teacher-assessment .ip-main { display:flex; flex-direction:column; min-height:0; overflow:hidden; padding:0; scrollbar-gutter:auto; }
.ip-teacher-assessment .ip-page { flex:1; min-height:0; overflow-y:auto; width:100%; max-width:none; padding:24px 32px; gap:16px; }
.ip-teacher-assessment .ip-actionbar { position:static; flex:none; margin:0; border-radius:0; border-width:1px 0 0; background:#fff; box-shadow:none; padding:12px 24px max(12px,env(safe-area-inset-bottom)); }
.ip-teacher-assessment .ip-assess-tabs { display:flex; }
.ip-teacher-assessment .ip-tabpanel:not(.is-active) { display:none; }
.ip-teacher-assessment .ip-pane__head { padding:10px 14px; }
.ip-teacher-assessment .ip-pane__title { font-size:15px; line-height:1.4; flex-wrap:wrap; }
.ip-teacher-assessment .ip-pane__body { padding:14px; gap:8px; }
.ip-teacher-assessment .ip-essay { padding:0; border:0; border-radius:0; font-size:15px; line-height:1.55; }
.ip-teacher-assessment .ip-assess__row { gap:16px; }
.ip-teacher-assessment .ip-compare-tabs { display:none; }
.ip-teacher-assessment .ip-textarea { font-size:15px; line-height:1.55; }
.ip-teacher-assessment .ip-tab[aria-pressed="true"] { background:#fff; color:var(--ip-blue-700); box-shadow:0 1px 4px #111a3314; }
@container ip-main (max-width:899px) {
 .ip-teacher-assessment .ip-compare-tabs { display:flex; }
 .ip-teacher-assessment .ip-compare-tabs .ip-tab { flex:1; }
 .ip-teacher-assessment .ip-assess__row[aria-label^="Writing"] > .ip-pane:not(.is-compare-active) { display:none; }
 .ip-teacher-assessment .ip-page { padding:16px; }
 .ip-teacher-assessment .ip-actionbar { padding:10px 16px max(10px,env(safe-area-inset-bottom)); }
}
.ip-teacher-assessment .ip-page > * { flex-shrink:0; }

/* Staff work queue: age highlights apply only to work awaiting assessment. */
.ip-staff-works .ip-age { display:table; margin-top:5px; padding:2px 7px; border-radius:6px; font-size:12px; font-weight:600; white-space:nowrap; }
.ip-staff-works .ip-age--recent { background:#e9f5ed; color:#29633e; }
.ip-staff-works .ip-age--warn { background:#fff3c4; color:#795700; }
.ip-staff-works .ip-age--late { background:#fde8e7; color:#a42621; }
.ip-staff-works .ip-age--neutral { background:#f2f4f8; color:#59657b; }
.ip-staff-works .ip-cell-sub { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:320px; }
.ip-staff-works .ip-chips { gap:6px; }
@container ip-main (max-width:680px) {
 .ip-staff-works .ip-table--cards tr { display:grid; grid-template-columns:minmax(0,1fr) 96px; gap:5px 10px; padding:14px 16px; }
 .ip-staff-works .ip-table--cards td { order:initial; grid-column:1; }
 .ip-staff-works .ip-table--cards td.ip-td-main { grid-column:1 / -1; grid-row:1; }
 .ip-staff-works .ip-cell-sub { max-width:100%; }
 .ip-staff-works .ip-table--cards td.ip-work-test { grid-row:2; font-size:13px; }
 .ip-staff-works .ip-table--cards td.ip-work-date { grid-row:3; font-size:12px; color:var(--ip-ink-3); }
 .ip-staff-works .ip-table--cards td[data-label]::before { content:none; }
 .ip-staff-works .ip-table--cards td.ip-td-status { grid-row:4; }
 .ip-staff-works .ip-table--cards td.ip-table__actions { grid-column:2; grid-row:2 / 5; margin:0; align-self:center; }
 .ip-staff-works .ip-table__actions .ip-btn { min-height:44px; padding:8px; }
 .ip-staff-works .ip-chip { padding:6px 9px; font-size:12px; }
 .ip-staff-works .ip-panel__head { gap:6px; }
}

.ip-admin-orders .ip-order-tools .ip-chips { display:grid; grid-template-columns:repeat(4,max-content); gap:6px; }
.ip-admin-orders .ip-chip { justify-content:center; }
.ip-admin-orders .ip-panel__body { gap:14px !important; }
.ip-admin-orders .ip-kv { row-gap:8px; }
.ip-admin-orders .ip-split__detail.is-empty { display:none; }
.ip-admin-orders .ip-qitem__sub { overflow-wrap:anywhere; }
@container ip-main (max-width:979px) {
 .ip-admin-orders .ip-order-tools.is-detail { display:none; }
 .ip-admin-orders .ip-order-tools .ip-chips { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .ip-admin-orders .ip-chip { width:100%; border-radius:8px; padding:8px 6px; font-size:13px; }
 .ip-admin-orders .ip-kv { grid-template-columns:90px minmax(0,1fr); gap:8px 10px; }
 .ip-admin-orders .ip-kv dd { overflow-wrap:anywhere; }
 .ip-admin-orders .ip-page { gap:16px; }
}

/* Compact payment verification; preserve readable labels and touch targets. */
.ip-admin-orders .ip-form { gap:12px; }
.ip-admin-orders .ip-formgrid { gap:12px 16px; align-items:start; }
.ip-admin-orders .ip-field { gap:5px; }
.ip-admin-orders .ip-variant-choice { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; min-height:40px; }
.ip-admin-orders .ip-variant-choice strong { flex:1 1 120px; font-size:14px; line-height:1.4; }
.ip-admin-orders .ip-variant-choice .ip-btn { flex:0 0 auto; min-height:36px; padding:6px 12px; text-align:center; justify-content:center; border-color:#bdc9e3; background:#f4f6fc; color:#2949a4; }
.ip-admin-orders .ip-variant-choice .ip-btn:hover { background:#e9eefb; border-color:#8298ce; }
.ip-admin-orders .ip-form .ip-check { padding:10px 12px; }
@container ip-main (max-width:600px) {
 .ip-admin-orders .ip-variant-choice .ip-btn { min-height:44px; }
}

/* Student directory: one clear screen per task. */
.ip-students .ip-student-back { border:0; background:transparent; cursor:pointer; align-self:flex-start; padding:0; min-height:32px; }
.ip-students .ip-student-profile { width:100%; max-width:760px; }
.ip-students .ip-student-form { width:100%; max-width:620px; }
.ip-students .ip-panel__foot { justify-content:flex-start; }
.ip-students .ip-page { gap:18px; }
.ip-students .ip-cell-sub { max-width:380px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ip-students .ip-mobile-label { display:none; }
.ip-students .ip-kv dd { overflow-wrap:anywhere; }
.ip-students .ip-temp-row { display:flex; flex-wrap:wrap; gap:8px; }
.ip-students .ip-temp-row input { flex:1 1 220px; min-width:0; }
.ip-students .ip-form { gap:12px; }
@container ip-main (max-width:680px) {
 .ip-students .ip-table--cards tr { display:grid; grid-template-columns:minmax(0,1fr) 92px; gap:6px 12px; }
 .ip-students .ip-table--cards td { order:initial; grid-column:1; }
 .ip-students .ip-table--cards td.ip-td-main { grid-column:1 / -1; grid-row:1; }
 .ip-students .ip-table--cards td.ip-student-phone { grid-row:2; font-size:13px; }
 .ip-students .ip-table--cards td.ip-student-count { grid-row:3; font-size:13px; color:var(--ip-ink-3); }
 .ip-students .ip-table--cards td.ip-table__actions { grid-column:2; grid-row:2 / 4; margin:0; }
 .ip-students .ip-table__actions .ip-btn { min-height:44px; }
 .ip-students .ip-mobile-label { display:inline; }
 .ip-students .ip-cell-sub { max-width:100%; }
 .ip-students .ip-kv { grid-template-columns:110px minmax(0,1fr); }
}
.ip-students .ip-table { table-layout:fixed; width:100%; }
.ip-students .ip-table th:first-child { width:40%; }
.ip-students .ip-table th:nth-child(2) { width:25%; }
.ip-students .ip-table th:nth-child(3) { width:20%; }
.ip-students .ip-table th:last-child { width:15%; }
.ip-students .ip-table th { white-space:normal; }
.ip-students .ip-cell-sub { max-width:100%; }
.ip-students .ip-table td { overflow-wrap:anywhere; }
@container ip-app (max-width:1023px) {
 .ip-students .ip-shell { min-height:100dvh; }
}
.ip-students .ip-student-name { border:0; background:transparent; padding:4px 0; color:var(--ip-navy-950); font:inherit; font-weight:600; text-align:left; cursor:pointer; overflow-wrap:anywhere; }
.ip-students .ip-student-name:hover { color:var(--ip-blue-700); text-decoration:underline; }
.ip-students .ip-student-name:focus-visible { outline:2px solid var(--ip-blue-700); outline-offset:3px; border-radius:3px; }

/* Unified portal entrance: explanation left, account form right. */
.ip-auth-entry .ip-guest { min-height:100dvh; grid-template-rows:auto 1fr; }
.ip-auth-entry .ip-auth-layout { max-width:1120px; margin:0 auto; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,440px); grid-template-rows:auto 1fr; column-gap:clamp(32px,6vw,96px); row-gap:28px; align-items:start; }
.ip-auth-intro { grid-column:1; grid-row:1; }
.ip-auth-intro h1 { font-size:clamp(28px,3.3vw,42px); line-height:1.15; margin:12px 0; letter-spacing:-.025em; color:var(--ip-navy-950); }
.ip-auth-intro p { font-size:17px; line-height:1.55; color:var(--ip-ink-3); margin:0; max-width:440px; }
.ip-auth-eyebrow { color:var(--ip-blue-700); font-size:13px; font-weight:650; letter-spacing:.04em; }
.ip-auth-form { grid-column:2; grid-row:1 / 3; display:flex; flex-direction:column; gap:16px; min-width:0; }
.ip-auth-form .ip-pagehead__title { font-size:23px; }
.ip-auth-guide { grid-column:1; grid-row:2; }
.ip-auth-guide h2 { font-size:18px; margin:0 0 18px; }
.ip-auth-guide-steps { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:20px; }
.ip-auth-guide-steps li { display:flex; gap:12px; align-items:flex-start; }
.ip-auth-guide-steps li > span { display:flex; align-items:center; justify-content:center; width:28px; height:28px; flex:none; border-radius:50%; background:#e6ebfa; color:#2949a4; font-size:13px; font-weight:650; }
.ip-auth-guide-steps h3 { font-size:15px; margin:2px 0 5px; }
.ip-auth-guide-steps p { font-size:14px; line-height:1.55; color:var(--ip-ink-3); margin:0; }
.ip-auth-note { margin:22px 0 0; font-size:12px; line-height:1.5; color:var(--ip-ink-3); }
@container ip-app (max-width:799px) {
 .ip-auth-entry .ip-auth-layout { display:flex; flex-direction:column; max-width:480px; gap:24px; }
 .ip-auth-entry .ip-auth-intro { width:100%; text-align:center; }
 .ip-auth-entry .ip-auth-intro h1 { font-size:28px; margin:8px 0; }
 .ip-auth-entry .ip-auth-intro p { font-size:15px; }
 .ip-auth-entry .ip-auth-form { width:100%; gap:14px; }
 .ip-auth-entry .ip-auth-form > .ip-stack { text-align:center; }
 .ip-auth-entry .ip-auth-form .ip-pagehead__title { font-size:20px; }
 .ip-auth-entry .ip-auth-guide { width:100%; padding-top:8px; }
 .ip-auth-entry .ip-auth-guide h2 { text-align:center; }
 .ip-auth-entry .ip-auth-guide-steps { gap:16px; }
}

/* Registration keeps all required contacts within a compact, readable form. */
.ip-auth-entry .ip-auth-form { gap:12px; }
.ip-auth-entry .ip-auth-form .ip-panel__body { padding:18px 20px; }
.ip-auth-entry .ip-registration { gap:11px; }
.ip-auth-entry .ip-registration .ip-field { gap:4px; }
.ip-auth-entry .ip-registration .ip-help { font-size:12px; line-height:1.4; }
.ip-auth-entry .ip-guest__main { padding-top:28px; padding-bottom:28px; }
@container ip-app (max-width:799px) {
 .ip-auth-entry .ip-auth-form .ip-panel__body { padding:16px; }
 .ip-auth-entry .ip-registration .ip-input { min-height:44px; }
}
/* Keep the work queue inside tablet widths, including long email addresses. */
.ip-staff-works .ip-table { table-layout:fixed; width:100%; }
.ip-staff-works .ip-table th:first-child { width:32%; }
.ip-staff-works .ip-table th:nth-child(2) { width:14%; }
.ip-staff-works .ip-table th:nth-child(3) { width:21%; }
.ip-staff-works .ip-table th:nth-child(4) { width:20%; }
.ip-staff-works .ip-table th:last-child { width:13%; }
.ip-staff-works .ip-table th { white-space:normal; }
.ip-staff-works .ip-cell-sub { max-width:100%; }
.ip-staff-works .ip-table td { overflow-wrap:anywhere; }
.ip-staff-works .ip-table .ip-status { white-space:normal; }
.ip-staff-works .ip-table__actions .ip-btn { white-space:normal; }
@container ip-main (min-width:681px) and (max-width:900px) {
 .ip-staff-works .ip-table th:first-child { width:28%; }
 .ip-staff-works .ip-table th:nth-child(2) { width:14%; }
 .ip-staff-works .ip-table th:nth-child(3) { width:20%; }
 .ip-staff-works .ip-table th:nth-child(4) { width:21%; }
 .ip-staff-works .ip-table th:last-child { width:17%; }
 .ip-staff-works .ip-table__actions .ip-btn { white-space:nowrap; overflow-wrap:normal; padding:6px 8px; font-size:12px; }
}
