/* OET preparation pages (student/oet*.html, teacher/oet-marking.html). */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', Arial, sans-serif;
  background: linear-gradient(180deg, var(--primary-color, #66ccff) 0%, var(--secondary-color, #ff99cb) 100%);
  color: #1f2937; min-height: 100vh;
}
.page-container { min-height: 100vh; display: flex; flex-direction: column; }
.header {
  background: #fff; padding: 14px 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex; justify-content: space-between; align-items: center; position: relative; gap: 12px;
}
.logo img { height: 40px; }
.header-center { position: absolute; left: 50%; transform: translateX(-50%); }
@media (max-width: 760px) { .header-center { display: none; } }
.main-content { flex: 1; display: flex; justify-content: center; padding: 24px 16px 60px; }
.container { background: #fff; padding: 28px; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.1); width: 100%; max-width: 1080px; height: fit-content; }
@media (max-width: 600px) { .container { padding: 18px 14px; } .main-content { padding: 12px 8px 40px; } }
h1.oet-title { font-size: 26px; margin-bottom: 4px; }
.muted { color: #6b7280; }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d1d5db; background: #fff; color: #1f2937;
  padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn:hover { background: #f9fafb; }
.btn.primary { background: #0b6ea8; border-color: #0b6ea8; color: #fff; }
.btn.primary:hover { background: #095d8e; }
.btn.pink { background: #ec4899; border-color: #ec4899; color: #fff; }
.btn.green { background: #047857; border-color: #047857; color: #fff; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 10px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 8px 16px; font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit; color: #374151; }
.seg button.on { background: #0b6ea8; color: #fff; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid #eef0f3; margin: 20px 0; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 10px 14px; font-weight: 600; font-size: 14px; color: #6b7280; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; font-family: inherit; }
.tabs button.on { color: #0b6ea8; border-bottom-color: #0b6ea8; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; background: #fff; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card .sub { color: #6b7280; font-size: 13px; margin-bottom: 10px; }
.card.soft { background: #f9fafb; }
.stat-big { font-size: 30px; font-weight: 800; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef2f7; color: #374151; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.info { background: #e0f2fe; color: #075985; }
.grade { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 8px; color: #fff; font-weight: 800; }

.part-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #f1f3f5; flex-wrap: wrap; }
.part-row:first-of-type { border-top: none; }
.part-row .name { font-weight: 600; min-width: 160px; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #f1f3f5; vertical-align: top; }
table.list th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 700px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid #eef0f3; padding: 6px 0; }
  table.list td { display: block; border: none; padding: 3px 4px; }
}

/* Test runner */
.runbar { position: sticky; top: 0; z-index: 20; background: #0f172a; color: #fff; border-radius: 12px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.runbar .timer { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 800; }
.runbar .status { font-size: 14px; opacity: .9; }
.runbar .btn { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; }
.runbar .btn.primary { background: #ec4899; border-color: #ec4899; }
.section { border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.section.current { border-color: #0b6ea8; box-shadow: 0 0 0 3px rgba(11,110,168,.12); }
.section h2 { font-size: 18px; margin-bottom: 6px; }
.instr { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 8px 0 14px; }
.notes h4 { font-size: 14px; margin: 14px 0 6px; color: #0b6ea8; }
.note-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 4px 0; line-height: 2; }
.qnum { display: inline-block; min-width: 26px; height: 22px; line-height: 22px; text-align: center; border-radius: 6px; background: #0b6ea8; color: #fff; font-size: 12px; font-weight: 700; }
input.ans { border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 8px; font-size: 15px; min-width: 150px; font-family: inherit; }
input.ans:focus { outline: 2px solid #0b6ea8; border-color: #0b6ea8; }
input.ans.right, .opt.right { border-color: #16a34a; background: #f0fdf4; }
input.ans.wrong, .opt.wrong { border-color: #dc2626; background: #fef2f2; }
.fix { font-size: 13px; color: #166534; font-weight: 600; }
.q { margin: 14px 0; }
.q .stem { font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #e5e7eb; border-radius: 8px; padding: 9px 12px; margin: 6px 0; cursor: pointer; }
.opt input { margin-top: 3px; }
.explain { font-size: 13.5px; background: #f9fafb; border-left: 3px solid #0b6ea8; padding: 8px 12px; margin-top: 8px; border-radius: 4px; }
.transcript { font-size: 14px; line-height: 1.6; background: #f9fafb; border-radius: 10px; padding: 12px 14px; margin-top: 12px; max-height: 360px; overflow: auto; }
.transcript b { color: #0b6ea8; }
.transcript mark { background: #fde68a; padding: 0 2px; border-radius: 3px; }
.textbox { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; font-size: 14.5px; line-height: 1.6; background: #fff; }
.textbox h3 { font-size: 15px; margin-bottom: 6px; }
.textbox table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 13.5px; }
.textbox th, .textbox td { border: 1px solid #e5e7eb; padding: 5px 7px; text-align: left; vertical-align: top; }
.textbox ul { padding-left: 20px; }
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.split > .sticky { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split > .sticky { position: static; max-height: none; } }
.article p { margin: 0 0 12px; line-height: 1.7; }
.article .pnum { color: #9ca3af; font-size: 12px; font-weight: 700; margin-right: 6px; }

.result-hero { text-align: center; padding: 22px; border-radius: 14px; background: #f8fafc; border: 1px solid #e5e7eb; margin-bottom: 18px; }
.result-hero .score { font-size: 46px; font-weight: 800; }

.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow: auto; }
.modal { background: #fff; border-radius: 14px; max-width: 760px; width: 100%; padding: 22px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h2 { font-size: 20px; margin-bottom: 6px; }
.cardbox { border: 2px solid #0b6ea8; border-radius: 12px; padding: 16px 18px; margin: 12px 0; }
.cardbox.patient { border-color: #ec4899; }
.cardbox .label { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #0b6ea8; margin-bottom: 6px; }
.cardbox.patient .label { color: #be185d; }
.cardbox ul { padding-left: 20px; margin-top: 6px; }
.cardbox li { margin: 4px 0; }

/* Writing */
.wsplit { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .wsplit { grid-template-columns: 1fr; } }
.casenotes { border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; font-size: 14px; line-height: 1.55; background: #fffdf7; }
.casenotes h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #92400e; margin: 12px 0 4px; }
.casenotes ul { padding-left: 18px; }
textarea.letter { width: 100%; min-height: 480px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 14px; font-size: 15px; line-height: 1.6; font-family: Georgia, 'Times New Roman', serif; resize: vertical; }
textarea.letter:disabled { background: #f8fafc; }
.letter-view { white-space: pre-wrap; font-family: Georgia, 'Times New Roman', serif; font-size: 15px; line-height: 1.6; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; background: #fafafa; }
.crit { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1f3f5; }
.crit .help { grid-column: 1 / -1; font-size: 12.5px; color: #6b7280; }
.crit select { padding: 6px 8px; border-radius: 6px; border: 1px solid #cbd5e1; font-size: 14px; }

/* Course guide (js/data/oet/guide-*.js via OET.guideHtml / OET.tipsHtml) */
.g-section { line-height: 1.65; font-size: 15px; }
.g-title { font-size: 22px; margin: 4px 0 12px; }
.g-title i { color: #ec4899; }
.g-h { font-size: 17px; margin: 20px 0 6px; color: #0b6ea8; }
.g-p { margin: 8px 0; }
.g-list { padding-left: 22px; margin: 8px 0; }
.g-list li { margin: 4px 0; }
.g-tablewrap { overflow-x: auto; margin: 10px 0; }
.g-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.g-table th, .g-table td { border: 1px solid #e5e7eb; padding: 7px 9px; text-align: left; vertical-align: top; }
.g-table th { background: #f0f9ff; }
.g-tip, .g-warn { display: flex; gap: 10px; border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 14.5px; }
.g-tip { background: #ecfdf5; border: 1px solid #a7f3d0; } .g-tip i { color: #047857; margin-top: 4px; }
.g-warn { background: #fff7ed; border: 1px solid #fed7aa; } .g-warn i { color: #c2410c; margin-top: 4px; }
.g-phrases { border: 1px dashed #93c5fd; border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: #f8fbff; }
.g-phrases-t { font-weight: 700; font-size: 14px; color: #0b6ea8; margin-bottom: 4px; }
.g-phrases ul { padding-left: 20px; } .g-phrases li { margin: 3px 0; font-style: italic; }
.g-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; font-size: 14px; }
.g-compare > div { border-radius: 8px; padding: 8px 12px; }
.g-compare span { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.g-bad { background: #fef2f2; border: 1px solid #fecaca; } .g-bad span { color: #b91c1c; }
.g-good { background: #f0fdf4; border: 1px solid #bbf7d0; } .g-good span { color: #047857; }
.g-why { grid-column: 1 / -1; color: #4b5563; font-size: 13.5px; }
@media (max-width: 640px) { .g-compare { grid-template-columns: 1fr; } }
.g-tipsbox { border: 1px solid #a7f3d0; background: #ecfdf5; border-radius: 10px; padding: 8px 14px; margin: 0 0 14px; font-size: 14.5px; }
.g-tipsbox summary { cursor: pointer; font-weight: 700; color: #047857; }
.g-tipsbox ul { padding-left: 20px; margin: 8px 0 4px; } .g-tipsbox li { margin: 4px 0; }
.g-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.g-nav button { text-align: left; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; padding: 12px 14px; cursor: pointer; font-family: inherit; }
.g-nav button.on { border-color: #0b6ea8; box-shadow: 0 0 0 3px rgba(11,110,168,.12); }
.g-nav b { display: block; font-size: 14.5px; } .g-nav span { font-size: 12.5px; color: #6b7280; }
.g-nav i { color: #ec4899; margin-right: 6px; }
