/* FINNMIN Learning Portal */
:root {
  /* finnmin logo: blue #376cda, deep indigo #131c66, mark gradient #21429b -> #1658cd */
  --navy: #131c66; --navy-2: #1e2a86; --navy-3: #2b3a9f;
  --blue: #376cda; --blue-d: #2a56b9; --blue-l: #edf2fd;
  --grad: linear-gradient(90deg, #131c66 0%, #21429b 40%, #376cda 100%);
  --ink: #161b3d; --ink-2: #3a4160; --muted: #66727f; --faint: #8b96a2;
  --line: #dde2e8; --line-2: #c8d0d9; --page: #f4f6fb; --white: #fff; --row: #f8f9fb;
  --ok: #1e7b4f; --ok-l: #e7f4ed; --bad: #b42318; --bad-l: #fcebea; --warn: #a15c07; --warn-l: #fdf3e2;
  --r: 4px;
  font-family: 'IBM Plex Sans', system-ui, 'Segoe UI', Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--ink); }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0 0 10px; }
.ic { flex-shrink: 0; vertical-align: -3px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .hidden { display: none !important; }
.mono { font-family: 'IBM Plex Mono', Consolas, monospace; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .spacer { flex: 1; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none !important; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line-2); line-height: 1.2; white-space: nowrap; }
.brand-mark-img { height: 34px; width: auto; display: block; }
.brand-strip { height: 3px; background: var(--grad); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--row); border-color: #b3bdc8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-l); border-color: #f0b8b3; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-link { border: 0; background: none; color: var(--blue); padding: 0 4px; height: auto; }
.btn-link:hover { background: none; text-decoration: underline; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-icon { border: 0; background: none; color: inherit; cursor: pointer; padding: 6px; border-radius: var(--r); display: inline-grid; place-items: center; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field > label, .label { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.req::after { content: ' *'; color: var(--bad); }
.hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], textarea, select {
  font: inherit; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink); width: 100%; outline: none; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(55, 108, 218, .18); }
.radio-row { display: flex; gap: 22px; flex-wrap: wrap; padding: 4px 0; }
.radio-row label, .check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 14px; }
.check { margin-bottom: 10px; }
input[type=radio], input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; margin: 2px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }

/* ---------- notices, tags ---------- */
.notice { display: flex; gap: 10px; padding: 10px 14px; border: 1px solid; border-left-width: 4px; border-radius: var(--r); margin-bottom: 16px; font-size: 13.5px; background: #fff; }
.notice .ic { margin-top: 2px; }
.notice-info { border-color: #c9d8f6; border-left-color: var(--blue); background: #f3f7fe; color: #1e3a8a; }
.notice-warn { border-color: #f0d5a8; border-left-color: #d98e04; background: #fffaf0; color: #7a4a06; }
.notice-error { border-color: #f1bfba; border-left-color: var(--bad); background: #fff6f5; color: #8a1c12; }
.notice-ok { border-color: #b8dcc8; border-left-color: var(--ok); background: #f4faf6; color: #155d3b; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 12px; font-weight: 500; background: #eef1f4; color: var(--ink-2); border: 1px solid #dde2e8; white-space: nowrap; }
.tag.ok { background: var(--ok-l); color: var(--ok); border-color: #c5e3d2; }
.tag.bad { background: var(--bad-l); color: var(--bad); border-color: #f3c7c2; }
.tag.warn { background: var(--warn-l); color: var(--warn); border-color: #f1d9ae; }
.tag.info { background: var(--blue-l); color: var(--blue-d); border-color: #cddbf7; }
.tag.muted { color: var(--muted); }

/* ---------- panels & tables ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.panel + .panel { margin-top: 20px; }
.panel-head { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 52px; }
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--row); display: flex; gap: 10px; align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); background: var(--row); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .ic { color: var(--faint); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 20px; }
.kv > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.kv > div:last-child { border-right: 0; }
.kv .k { font-size: 12.5px; color: var(--muted); }
.kv .v { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kv .v small { font-size: 13px; color: var(--muted); font-weight: 400; }
.subtabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 20px; gap: 2px; overflow-x: auto; }
.subtabs a, .subtabs button { padding: 10px 16px; font: inherit; font-weight: 500; color: var(--muted); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none !important; }
.subtabs .on { color: var(--blue); border-bottom-color: var(--blue); }
.subtabs .n { color: var(--faint); font-weight: 400; margin-left: 4px; }
.scorebar { height: 6px; background: #e8ecf0; border-radius: 3px; overflow: hidden; min-width: 80px; }
.scorebar-fill { height: 100%; } .scorebar-fill.ok { background: var(--ok); } .scorebar-fill.low { background: var(--bad); }
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 4px 0 12px; }
.form-section { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.form-section:first-child { padding-top: 4px; }
.form-section:last-of-type { border-bottom: 0; }
.form-section .fs-title h3 { margin-bottom: 4px; }
.form-section .fs-title p { font-size: 12.5px; color: var(--muted); }

/* ---------- sign in ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--page); }
.auth-top { background: #fff; border-bottom: 1px solid var(--line); border-top: 3px solid; border-image: var(--grad) 1; }
.auth-top .wrap { max-width: 1100px; margin: auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.auth-top .help { color: var(--muted); font-size: 13px; }
.auth-center { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px 40px; }
.auth-col { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.auth-card-head { padding: 22px 28px 0; }
.auth-card-head h1 { font-size: 20px; }
.auth-card-head p { color: var(--muted); margin: 4px 0 0; }
.auth-card-body { padding: 22px 28px 26px; }
.auth-aside { margin-top: 16px; padding: 14px 18px; border: 1px solid var(--line); background: #fff; border-radius: var(--r); font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; }
.auth-aside .ic { color: var(--blue); margin-top: 2px; }
.auth-foot { border-top: 1px solid var(--line); background: #fff; }
.auth-foot .wrap { max-width: 1100px; margin: auto; padding: 14px 24px; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 60px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--blue); background: none; border: 0; cursor: pointer; }
.pw-rules { list-style: none; padding: 0; margin: -6px 0 16px; font-size: 12.5px; color: var(--muted); display: grid; gap: 3px; }
.pw-rules li::before { content: '○'; margin-right: 6px; }
.pw-rules li.ok { color: var(--ok); } .pw-rules li.ok::before { content: '●'; }

/* ---------- portal (learner) ---------- */
.portal-header { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); border-top: 3px solid; border-image: var(--grad) 1; position: sticky; top: 0; z-index: 30; }
.portal-header .wrap { max-width: 1140px; margin: auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 36px; }
.portal-nav { display: flex; gap: 2px; flex: 1; height: 100%; }
.portal-nav a { color: var(--ink-2); padding: 0 14px; display: flex; align-items: center; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; }
.portal-nav a:hover { color: var(--blue); }
.portal-nav a.on { color: var(--blue); border-bottom-color: var(--blue); }
.usermenu { position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; padding: 4px 6px; border-radius: var(--r); }
.usermenu-btn:hover { background: var(--blue-l); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #21429b, #376cda); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.usermenu-pop { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(12, 35, 64, .14); min-width: 230px; z-index: 40; overflow: hidden; }
.usermenu-pop.open { display: block; }
.um-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; color: var(--ink); }
.um-head span { font-size: 12.5px; color: var(--muted); }
.usermenu-pop a, .usermenu-pop button { display: flex; gap: 9px; align-items: center; width: 100%; padding: 10px 14px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; text-align: left; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--row); }
.page-band { background: #fff; border-bottom: 1px solid var(--line); }
.page-band .wrap { max-width: 1140px; margin: auto; padding: 20px 24px 0; }
.page-band .crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.page-band h1 { margin-bottom: 4px; }
.page-band .sub { color: var(--muted); margin: 0 0 14px; }
.page-band .subtabs { margin: 0; border: 0; }
.page { max-width: 1140px; margin: 0 auto; padding: 24px 24px 60px; }

.alist { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.aitem { display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.aitem:last-child { border-bottom: 0; }
.datebox { width: 64px; border: 1px solid var(--line-2); border-radius: var(--r); text-align: center; overflow: hidden; background: #fff; }
.datebox .m { background: var(--blue); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .8px; padding: 2px 0; text-transform: uppercase; }
.datebox .d { font-size: 22px; font-weight: 600; padding: 2px 0 0; line-height: 1.2; }
.datebox .y { font-size: 11px; color: var(--muted); padding-bottom: 3px; }
.datebox.any .d { font-size: 12px; padding: 8px 0 9px; font-weight: 600; color: var(--ink-2); }
.aitem h3 { font-size: 15.5px; margin-bottom: 3px; }
.aitem .desc { color: var(--muted); font-size: 13px; margin-bottom: 6px; max-width: 680px; }
.ameta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; color: var(--ink-2); }
.ameta span { display: inline-flex; gap: 5px; align-items: center; }
.ameta .ic { color: var(--faint); }
.aact { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 150px; }
.ascore { text-align: right; }
.ascore b { font-size: 20px; font-weight: 600; }
.ascore span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- admin console ---------- */
body.console { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c8d0f0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side > .brand { padding: 0 20px; height: 64px; border-bottom: 1px solid rgba(255,255,255,.1); color: #fff; }
.side .brand-logo { height: 26px; }
.side .brand-sub { color: #a9b6e8; border-left-color: rgba(255,255,255,.2); }
.side nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.side-group { font-size: 11px; text-transform: uppercase; letter-spacing: .9px; color: #7f95ad; padding: 18px 20px 6px; font-weight: 600; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 8px 20px; color: #c8d0f0; text-decoration: none; border-left: 3px solid transparent; font-weight: 500; }
.side nav a:hover { background: var(--navy-2); color: #fff; }
.side nav a.on { background: rgba(55,108,218,.28); color: #fff; border-left-color: #6f98ee; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user .su-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-user .su-t b { color: #fff; font-weight: 500; font-size: 13px; }
.side-user .su-t span { font-size: 11.5px; color: #8ea3ba; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user a, .side-user button { color: #9fb3c8; background: none; border: 0; cursor: pointer; padding: 5px; border-radius: var(--r); display: grid; }
.side-user a:hover, .side-user button:hover { background: var(--navy-2); color: #fff; }
.console-main { min-width: 0; display: flex; flex-direction: column; }
.console-top { height: 52px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.menu-toggle { display: none; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs .sep { color: var(--line-2); }
.crumbs span:last-child { color: var(--ink); font-weight: 500; }
.console-body { padding: 24px 28px 60px; max-width: 1280px; width: 100%; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title p { color: var(--muted); margin: 4px 0 0; }
.dropzone { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 22px; text-align: center; background: var(--row); cursor: pointer; color: var(--ink-2); }
.dropzone:hover, .dropzone.over { border-color: var(--blue); background: var(--blue-l); }
.dropzone input { display: none; }
.dropzone .ic { color: var(--blue); margin-bottom: 6px; }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(19, 28, 102, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 6px; width: 100%; max-width: 460px; box-shadow: 0 16px 48px rgba(19,28,102,.28); border-top: 3px solid; border-image: var(--grad) 1; }
.modal.wide { max-width: 640px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; } .modal-body p { color: var(--ink-2); }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--row); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; top: 18px; right: 18px; display: flex; gap: 9px; align-items: center; background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--ok); padding: 11px 16px; border-radius: var(--r); z-index: 200; box-shadow: 0 8px 24px rgba(12,35,64,.15); max-width: 420px; }
.toast .ic { color: var(--ok); }
.toast.err { border-left-color: var(--bad); } .toast.err .ic { color: var(--bad); }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- answer review ---------- */
.rq { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.rq:last-child { border-bottom: 0; }
.rq-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.rq-no { font-weight: 600; color: var(--navy); }
.rq-topic { font-size: 12px; color: var(--muted); }
.rq-text { font-weight: 500; margin-bottom: 10px; white-space: pre-wrap; }
.rq-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rq-opts li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.rq-opts .ol { font-weight: 600; color: var(--muted); width: 16px; }
.rq-opts li.right { border-color: #9fd1b5; background: var(--ok-l); }
.rq-opts li.wrong { border-color: #efb2ab; background: var(--bad-l); }
.rq-mark { margin-left: auto; font-size: 12px; font-weight: 500; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
li.right .rq-mark { color: var(--ok); } li.wrong .rq-mark { color: var(--bad); }
.rq-exp { margin-top: 10px; font-size: 13px; color: var(--ink-2); background: var(--row); border-left: 3px solid var(--line-2); padding: 8px 12px; }

/* ---------- exam ---------- */
body.exam-mode { background: #fff; }
.ex-top { background: #fff; color: var(--ink); height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); border-top: 3px solid; border-image: var(--grad) 1; }
.ex-title { flex: 1; min-width: 0; }
.ex-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ex-title span { font-size: 12px; color: var(--muted); }
.ex-timer { background: var(--navy); color: #fff; border-radius: var(--r); padding: 4px 12px; text-align: center; min-width: 118px; }
.ex-timer small { display: block; font-size: 10.5px; color: #a9b6e8; text-transform: uppercase; letter-spacing: .6px; }
.ex-timer b { font-family: 'IBM Plex Mono', Consolas, monospace; font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.ex-timer.low { background: var(--bad); } .ex-timer.low small { color: #fde8e6; }
.ex-warn { display: inline-flex; gap: 6px; align-items: center; background: #fff3d6; color: #7a4a06; padding: 4px 10px; border-radius: var(--r); font-size: 12.5px; font-weight: 500; }
.ex-body { display: grid; grid-template-columns: 1fr 320px; height: calc(100vh - 58px); }
.ex-main { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.ex-qhead { padding: 12px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; background: var(--row); }
.ex-qhead b { font-size: 15px; color: var(--navy); }
.ex-qhead .marks { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.ex-q { flex: 1; overflow-y: auto; padding: 24px 28px; }
.ex-qtext { font-size: 16.5px; line-height: 1.6; margin-bottom: 22px; white-space: pre-wrap; max-width: 860px; }
.ex-opts { display: grid; gap: 10px; max-width: 860px; }
.ex-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; user-select: none; font-size: 15px; }
.ex-opt:hover { background: var(--row); }
.ex-opt .rb { width: 18px; height: 18px; border: 2px solid #8b96a2; border-radius: 50%; flex-shrink: 0; margin-top: 2px; position: relative; }
.ex-opt .ol { font-weight: 600; color: var(--muted); min-width: 16px; }
.ex-opt.sel { border-color: var(--blue); background: var(--blue-l); }
.ex-opt.sel .rb { border-color: var(--blue); }
.ex-opt.sel .rb::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--blue); }
.ex-actions { border-top: 1px solid var(--line); padding: 12px 28px; display: flex; gap: 8px; flex-wrap: wrap; background: #fff; }
.ex-actions .btn-mark { background: #6b3fa0; border-color: #6b3fa0; color: #fff; }
.ex-actions .btn-mark:hover { background: #59338a; }
.ex-side { display: flex; flex-direction: column; min-height: 0; background: var(--row); }
.ex-cand { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.ex-cand .avatar { width: 40px; height: 40px; font-size: 14px; }
.ex-cand b { display: block; } .ex-cand span { font-size: 12px; color: var(--muted); }
.ex-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.ex-legend div { display: flex; align-items: center; gap: 7px; }
.pal-scroll { flex: 1; overflow-y: auto; padding: 14px 18px; }
.pal-scroll h3 { font-size: 13px; margin-bottom: 10px; color: var(--ink-2); }
.pal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pb { height: 36px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; position: relative; }
.pb.nv { background: #fff; color: var(--ink-2); }
.pb.na { background: #d9483b; border-color: #d9483b; color: #fff; }
.pb.an { background: #1e7b4f; border-color: #1e7b4f; color: #fff; }
.pb.mr { background: #6b3fa0; border-color: #6b3fa0; color: #fff; border-radius: 50%; }
.pb.ma { background: #6b3fa0; border-color: #6b3fa0; color: #fff; border-radius: 50%; }
.pb.ma::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: #1e7b4f; border: 2px solid #fff; }
.pb.cur { outline: 2px solid var(--navy); outline-offset: 2px; }
.ex-legend .pb { width: 26px; height: 24px; font-size: 11px; cursor: default; flex-shrink: 0; display: grid; place-items: center; }
.ex-side-foot { padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; }
.ex-instr { max-width: 860px; margin: 0 auto; padding: 28px 24px 60px; }
.ex-instr ol { padding-left: 20px; margin: 0; display: grid; gap: 8px; color: var(--ink-2); }
.ex-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); margin: 18px 0 22px; }
.ex-facts div { padding: 12px 16px; border-right: 1px solid var(--line); }
.ex-facts div:last-child { border-right: 0; }
.ex-facts small { display: block; color: var(--muted); font-size: 12px; }
.ex-facts b { font-size: 15px; font-weight: 600; }

@media (max-width: 960px) {
  body.console { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.side-open .side { transform: none; }
  .menu-toggle { display: inline-grid; }
  .console-top { padding: 0 16px; } .console-body { padding: 20px 16px 48px; }
  .ex-body { grid-template-columns: 1fr; height: auto; }
  .ex-main { border-right: 0; } .ex-q { overflow: visible; }
  .ex-side { border-top: 1px solid var(--line); }
  .form-section { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 720px) {
  .portal-header .wrap { gap: 14px; padding: 0 16px; } .portal-nav { display: none; } .usermenu-btn .un { display: none; }
  .page-band .wrap, .page { padding-left: 16px; padding-right: 16px; }
  .aitem { grid-template-columns: 52px 1fr; } .datebox { width: 52px; }
  .aact { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; min-width: 0; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ex-top { gap: 10px; padding: 0 12px; } .ex-q, .ex-qhead, .ex-actions { padding-left: 16px; padding-right: 16px; }
  .auth-top .help { display: none; }
}

/* ---------- loading skeletons ---------- */
.sk { background: linear-gradient(90deg, #e9edf1 0%, #f4f6f8 40%, #e9edf1 80%); background-size: 300% 100%; animation: sk 1.3s ease-in-out infinite; border-radius: var(--r); }
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-block { height: 90px; margin: 18px 0; }
@keyframes sk { from { background-position: 100% 0 } to { background-position: 0 0 } }
.boot { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.boot .sk-side { border-radius: 0; background: var(--navy); animation: none; }
.boot .sk-main { display: flex; flex-direction: column; }
.boot .sk-main > .sk { border-radius: 0; background: #fff; animation: none; border-bottom: 1px solid var(--line); }
.boot .sk-pad { padding: 24px 28px; }
@media (max-width: 960px) { .boot { grid-template-columns: 1fr; } .boot .sk-side { display: none; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ---------- brand touches ---------- */
.auth-card { border-top: 3px solid var(--blue); }
.page-band h1, .page-title h1 { color: var(--navy); }
.kv .v { color: var(--navy); }
.ex-top #saving { color: var(--muted) !important; }
@media (max-width: 720px) { .brand-sub { display: none; } .brand-logo { height: 26px; } }

/* ---------- sections & case passages ---------- */
.rq-section { padding: 10px 20px; background: var(--blue-l); color: var(--navy); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .5px; }
.case-box { border-bottom: 1px solid var(--line); background: #fbfcfe; }
.case-box summary { cursor: pointer; padding: 12px 20px; font-weight: 600; color: var(--blue-d); }
.passage { padding: 4px 20px 16px; font-size: 14.5px; line-height: 1.7; color: var(--ink-2); max-width: 820px; }
.passage h4 { margin: 14px 0 4px; font-size: 14px; color: var(--navy); }
.passage p { margin: 0 0 10px; }
.ex-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); flex: 1; min-height: 0; }
.ex-passage { border-right: 1px solid var(--line); overflow-y: auto; background: #fbfcfe; }
.ex-passage .ph { position: sticky; top: 0; background: #fbfcfe; padding: 14px 24px 8px; border-bottom: 1px solid var(--line); }
.ex-passage .ph small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
.ex-passage .ph b { color: var(--navy); }
.ex-passage .passage { padding: 14px 24px 24px; }
.sec-label { grid-column: 1 / -1; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; margin: 6px 0 2px; }
.sec-label:first-child { margin-top: 0; }
.pattern-table td, .pattern-table th { padding: 8px 14px; }
@media (max-width: 960px) { .ex-split { grid-template-columns: 1fr; } .ex-passage { border-right: 0; border-bottom: 1px solid var(--line); max-height: 45vh; } }

.ex-split.solo { grid-template-columns: 1fr; }
.ex-split > .ex-q { overflow-y: auto; }

/* ---------- instructions page: content scrolls, consent bar stays at the bottom ---------- */
.instr-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.instr-page > .ex-top { flex-shrink: 0; }
.instr-scroll { flex: 1; overflow-y: auto; background: var(--page); }
.instr-scroll .ex-instr { padding-bottom: 32px; }
.instr-h { font-size: 15px; margin: 24px 0 10px; color: var(--navy); }
.instr-list { padding-left: 20px; margin: 0; display: grid; gap: 10px; color: var(--ink-2); line-height: 1.6; }
.instr-foot { flex-shrink: 0; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(19, 28, 102, .08); }
.instr-foot-in { max-width: 860px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 20px; }
.agree-box { flex: 1; display: flex; gap: 14px; align-items: center; padding: 12px 16px; border: 2px solid #b9cdf3; background: var(--blue-l); border-radius: 6px; cursor: pointer; transition: border-color .15s, background .15s; }
.agree-box input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; cursor: pointer; }
.agree-box b { display: block; color: var(--navy); font-size: 14.5px; }
.agree-box small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.agree-box:hover { border-color: var(--blue); }
.agree-box:has(input:checked) { border-color: var(--ok); background: var(--ok-l); }
.agree-box:has(input:checked) small { color: var(--ok); }
.agree-box:has(input:disabled) { opacity: .7; cursor: not-allowed; }
.agree-box.nudge { animation: nudge .45s ease; border-color: var(--warn); }
@keyframes nudge { 0%, 100% { transform: translateX(0) } 20%, 60% { transform: translateX(-6px) } 40%, 80% { transform: translateX(6px) } }
.instr-go { flex-shrink: 0; }
.instr-go .btn-lg { height: 46px; padding: 0 24px; }
#beginWrap { display: inline-block; }
@media (max-width: 720px) {
  .instr-foot-in { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px; }
  .instr-go .btn { width: 100%; }
  #beginWrap { display: block; }
}
@media (prefers-reduced-motion: reduce) { .agree-box.nudge { animation: none; } }
@media (max-width: 720px) { .pattern-table th, .pattern-table td { padding: 8px 8px; font-size: 13px; } .pattern-table th:nth-child(3), .pattern-table td:nth-child(3) { display: none; } .instr-scroll .ex-instr { padding: 20px 16px 24px; } }

/* ---------- admin question bank: test-style questions and case studies ---------- */
.rq-off { opacity: .6; }
.case-card { border-bottom: 1px solid var(--line); }
.case-card:last-child { border-bottom: 0; }
.case-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
.case-card > summary::-webkit-details-marker { display: none; }
.case-card > summary:hover { background: var(--row); }
.case-card[open] > summary { background: var(--blue-l); border-bottom: 1px solid var(--line); }
.cc-no { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.cc-title { flex: 1; font-weight: 600; color: var(--navy); }
.cc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cc-passage { border-right: 1px solid var(--line); background: #fbfcfe; padding: 14px 4px 14px 20px; max-height: 70vh; overflow-y: auto; position: sticky; top: 52px; }
.cc-passage .passage { padding: 0 16px 0 0; }
.cc-qs { min-width: 0; }
@media (max-width: 960px) { .cc-body { grid-template-columns: 1fr; } .cc-passage { position: static; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--line); } }
