/* IA marking funnel: one question a screen. Used by /ia-marking (the first
   two screens) and by /mark-my-ia and /mark-my-ia/moderate in funnel mode
   (<html data-funnel>, set from ?f=1), where it also hides everything on
   those pages that is not the upload or the result. */

.fn-page { max-width: 760px; margin: 0 auto; padding: 28px 16px 56px; }
.fn-card { background: var(--paper-white); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink); padding: clamp(18px, 4vw, 34px); display: flex; flex-direction: column; gap: 18px; }
.fn-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-faint); }
.fn-dots { display: flex; gap: 6px; }
.fn-dots i { width: 22px; height: 6px; border-radius: 9px; background: var(--line-strong); }
.fn-dots i.on { background: var(--riso-green); }
.fn-back { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--ink-faint); cursor: pointer; text-decoration: none; }
.fn-back:hover { color: var(--ink); }
.fn-h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 6vw, 44px); line-height: 1.08; margin: 0; text-wrap: balance; }
.fn-lede { font-size: 16.5px; line-height: 1.5; color: var(--ink-dim); margin: 0; max-width: 60ch; }
.fn-mut { font-size: 14.5px; line-height: 1.5; color: var(--ink-faint); margin: 0; }
.fn-ask { font-size: 15px; font-weight: 700; margin: 0; }

.fn-opts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.fn-opt { text-align: left; background: var(--paper-white); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; text-decoration: none; transition: transform .1s, box-shadow .1s; }
.fn-opt:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--riso-pink); }
.fn-opt b { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.fn-opt .k { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.fn-opt .get { font-size: 14.5px; line-height: 1.45; color: var(--ink-dim); }
.fn-opt.a { background: color-mix(in srgb, var(--riso-pink) 26%, var(--paper-white)); }
.fn-opt.b { background: color-mix(in srgb, var(--riso-green) 24%, var(--paper-white)); }
.fn-subj { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.fn-subj .fn-opt { align-items: center; text-align: center; }
.fn-subj .fn-opt b { font-size: 21px; }
.fn-subj .fn-opt[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.fn-subj .fn-opt small { font-size: 12px; color: var(--ink-faint); }
.fn-opt:focus-visible, .fn-back:focus-visible, .fn-help a:focus-visible, .fn-help button:focus-visible, .fn-vid:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

.fn-vid { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 14px; text-align: center; font-size: 14px; color: var(--ink-faint); }
.fn-help { font-size: 14.5px; color: var(--ink-faint); text-align: center; margin: 0; }
.fn-help a, .fn-help button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-faint); text-decoration: underline; cursor: pointer; }
.fn-help .strong { font-weight: 700; color: var(--ink); }

/* base.css sets margin: 0 on everything, which pins a modal dialog to
   the top left: margin auto centres it in the viewport. */
.fn-dlg { margin: auto; max-height: calc(100vh - 48px); overflow: auto; border: 2px solid var(--ink); border-radius: 14px; box-shadow: 6px 6px 0 var(--ink); background: var(--paper-white); color: var(--ink); max-width: min(560px, calc(100vw - 32px)); padding: 22px; }
.fn-dlg::backdrop { background: rgba(26, 58, 42, .45); }
.fn-dlg h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 12px; }
.fn-dlg dt { font-weight: 700; margin-top: 12px; }
.fn-dlg dd { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-dim); }
.fn-dlg .fn-go { margin-top: 18px; }

.fn-go { background: var(--riso-pink); color: var(--on-brand); border: 2px solid var(--ink); border-radius: 12px; padding: 14px 18px; font: inherit; font-family: var(--font-display); font-weight: 800; font-size: 19px; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.fn-go:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.fn-go:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.fn-cost { font-size: 14px; color: var(--ink-faint); text-align: center; margin: 0; }
.fn-cost .fn-time { display: block; max-width: 52ch; margin: 8px auto 0; }

/* Folds on a result: one line a criterion, tap to read it. */
.fn-fold { border-top: 1px dashed var(--line-strong); margin-top: 10px; padding-top: 8px; }
.fn-fold > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--ink-dim); }
.fn-fold[open] > summary { margin-bottom: 6px; }

/* A class's drafts: the files waiting, then one row a script as each is marked. */
.fn-files, .fn-class { border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--paper-white); }
.fn-files { max-height: 230px; overflow: auto; }
.fn-files li, .fn-class li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.fn-files, .fn-class { list-style: none; margin: 0; padding: 0; }
.fn-files li:last-child, .fn-class li:last-child { border-bottom: 0; }
.fn-files .x { background: none; border: 0; font: inherit; color: var(--ink-faint); cursor: pointer; text-decoration: underline; font-size: 13px; }
.fn-class li.done { cursor: pointer; }
.fn-class li.done:hover { background: color-mix(in srgb, var(--riso-pink) 18%, transparent); }
.fn-class .nm { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-class .st { font-size: 14px; color: var(--ink-faint); white-space: nowrap; }
.fn-class .n { font-family: var(--font-display); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fn-class .bad { color: #b3261e; white-space: normal; text-align: right; }
.fn-class button.open { background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 0; color: var(--ink); text-align: left; }

/* Funnel mode on the two tool pages: only the upload and the result stay. */
html[data-funnel] .fn-hide, html:not([data-funnel]) .fn-only { display: none !important; }
html[data-funnel] main { max-width: 760px; margin: 0 auto; }
/* /mark-my-ia in funnel mode: the marketing, the account lines and the
   lists fold away; one screen shows at a time (fn-s-* on <main>, set by
   fnDraw). */
html[data-funnel] .ia-hero, html[data-funnel] .ia-steps, html[data-funnel] .ia-loop, html[data-funnel] .ia-section,
html[data-funnel] .ia-privacy, html[data-funnel] .ia-afterword, html[data-funnel] .newsletter-card,
html[data-funnel] #tool .ia-status, html[data-funnel] #backToPaper, html[data-funnel] .ia-redraft,
html[data-funnel] .ia-notes-box, html[data-funnel] #classCard, html[data-funnel] #sheetsCard,
html[data-funnel] #ready > details.ia-more, html[data-funnel] #views, html[data-funnel] #viewNote { display: none !important; }
html[data-funnel] #uploadCard.fn-has-subj .ia-subjects, html[data-funnel] #uploadCard.fn-has-subj #subjHint { display: none; }
html[data-funnel] main.fn-s-result #tool, html[data-funnel] main.fn-s-wrongCard #tool, html[data-funnel] main.fn-s-result #auth,
html[data-funnel] main.fn-s-class #uploadCard, html[data-funnel] main.fn-s-class #creditsBox { display: none; }
html[data-funnel] #auth #fnPend { margin-bottom: 16px; }
.fn-head { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 20px; }
.fn-head .fn-mut .ia-link b, .fn-head .fn-mut .mod-linkish b { color: var(--ink); }
#fnClassCard { display: flex; flex-direction: column; gap: 14px; }
#fnClassCard[hidden] { display: none; }
#fnBulk { display: flex; flex-direction: column; gap: 12px; }
#fnBulk[hidden] { display: none; }

@media (max-width: 520px) {
  .fn-page { padding: 16px 12px 40px; }
  .fn-card { box-shadow: 4px 4px 0 var(--ink); }
}
@media (prefers-reduced-motion: reduce) { .fn-opt, .fn-go { transition: none; } }

.fn-card [data-screen] { display: flex; flex-direction: column; gap: 16px; }
.fn-card [data-screen][hidden] { display: none; }

/* /mark-my-ia/moderate in funnel mode: the report first, the teacher's own
   marks folded under one tick inside it (#fnOwnBox). */
html[data-funnel] #reportCard > h2, html[data-funnel] #marksCard > h2 { display: none; }
html[data-funnel] #tool.fn-has-subj #subjects, html[data-funnel] #tool.fn-has-subj #marksCard > .mod-hint:first-of-type { display: none; }
html[data-funnel] #fnOwnBox .mod-card { border: 0; box-shadow: none; padding: 4px 0 0; margin: 0; background: none; }
html[data-funnel] #fnOwnBox .mod-card[hidden] { display: none; }
html[data-funnel] #auth.fn-wait #authOut, html[data-funnel] #auth:not(.fn-wait) #fnPendAlt { display: none; }
#fnOwnWrap { margin: 14px 0 4px; }
html[data-funnel] main.fn-s-result #mine, html[data-funnel] main.fn-s-progress #mine { display: none; }
.fn-nocred { margin: 0 0 16px; padding: 16px; border: 2px solid var(--riso-pink-deep, #b0306a); border-radius: 12px; background: var(--paper, #fff); }
.fn-nocred[hidden], .fn-paid[hidden] { display: none; }
.fn-nc-h { margin: 0 0 14px; font-size: 16px; line-height: 1.45; }
.fn-nc-s { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-faint); }
.fn-packs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .fn-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; } }
.fn-pack { position: relative; font: inherit; color: var(--ink); background: var(--riso-green, #3fb27f); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); padding: 12px 8px 10px; min-height: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.fn-pack:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.fn-pack:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.fn-pack:focus-visible { outline: 3px solid var(--riso-pink-deep, #b0306a); outline-offset: 2px; }
.fn-pack:disabled { opacity: .7; cursor: progress; }
.fn-pack b { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.fn-pack span { font-size: 14px; font-weight: 700; }
.fn-pack small { font-size: 12.5px; }
.fn-pack.best { background: var(--riso-pink, #f2a6c8); }
.fn-pack i { position: absolute; top: -10px; font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--ink); color: var(--paper, #fff); padding: 2px 7px; border-radius: 99px; }
.fn-paid { margin: 0 0 14px; padding: 12px 14px; border: 2px solid var(--riso-green-deep, #1f7a52); border-radius: 10px; font-size: 15.5px; }
@media (prefers-reduced-motion: reduce) { .fn-pack { transition: none; } }

/* /ia-marking/questions: the examples, then the questions as folds. */
.fn-q-h { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 4vw, 28px); margin: 10px 0 0; }
.fn-ex .fn-opt b { font-size: 20px; }
.fn-faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.fn-faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.fn-faq summary { cursor: pointer; font-weight: 700; font-size: 16.5px; }
.fn-faq summary:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
.fn-faq p { margin: 10px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-dim); max-width: 65ch; }
.fn-faq a { color: var(--ink); }
.fn-prose p { font-size: 15.5px; line-height: 1.6; color: var(--ink-dim); max-width: 68ch; margin: 0; }
.fn-prose a { color: var(--ink); }
.fn-ex .fn-opt .k { white-space: normal; }
