/* Digital SAT interface styles.
 * Ported verbatim from the verified standalone module
 * (Digital_SAT_Structure_Reference/test1-module1-reading-writing.html, commit a4e8d16).
 * Loaded ONLY by the SAT layout, which does not include the site chrome - these
 * rules style html/body directly and would otherwise collide with TOEFL/IELTS.
 */
  :root{
    --sage: #7c9473;
    --sage-dark: #5f7657;
    --sage-light: #a9c19c;
    --ink: #1f2b23;
    --paper: #fbfaf7;
    --card: #ffffff;
    --border: #d9ddd4;
    --muted: #6b756a;
    --accent: #c98a3a;
    --danger: #b5482f;
    --focus: #2f6fb0;
    font-size: 16px;
  }
  *{ box-sizing: border-box; }
  html,body{ margin:0; padding:0; height:100%; background:var(--paper); color:var(--ink);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif; }
  button{ font-family:inherit; cursor:pointer; }
  .hidden{ display:none !important; }

  /* ===== Instructions Screen ===== */
  #screen-instructions{ min-height:100vh; display:flex; flex-direction:column; }
  .instr-header{ background:var(--sage); color:#fff; padding:22px 40px; }
  .instr-header h1{ margin:0; font-size:1.4rem; font-weight:600; }
  .instr-body{ flex:1; max-width:780px; margin:0 auto; padding:40px 24px 24px; width:100%; }
  .instr-body h2{ font-size:1.6rem; margin-bottom:4px; }
  .instr-sub{ color:var(--muted); margin-bottom:28px; }
  .instr-section{ border-top:1px solid var(--border); padding:20px 0; }
  .instr-section h3{ margin:0 0 8px; font-size:1.05rem; color:var(--sage-dark); }
  .instr-section p{ margin:0; line-height:1.55; color:#33392f; }
  .instr-footer{ display:flex; justify-content:space-between; align-items:center; padding:20px 40px;
    border-top:1px solid var(--border); background:#fff; }
  .btn{ border:none; border-radius:6px; padding:11px 26px; font-size:0.95rem; font-weight:600; }
  .btn-primary{ background:var(--sage-dark); color:#fff; }
  .btn-primary:hover{ background:#4d6046; }
  .btn-secondary{ background:#eceee9; color:var(--ink); }
  .btn-secondary:hover{ background:#dfe2da; }
  .btn:disabled{ opacity:0.45; cursor:not-allowed; }
  .trademark-footer{ font-size:0.72rem; color:#8b9186; text-align:center; padding:14px 24px 26px; max-width:780px; margin:0 auto; line-height:1.5; }

  /* ===== Test Screen ===== */
  #screen-test{ display:none; height:100vh; flex-direction:column; }
  #screen-test.active{ display:flex; }

  .test-header{ background:var(--sage); color:#fff; display:flex; align-items:center;
    justify-content:space-between; padding:10px 24px; flex-shrink:0; min-height:58px; }
  .th-left{ min-width:220px; }
  .th-left .module-title{ font-weight:600; font-size:0.95rem; }
  .directions-dd{ background:none; border:none; color:#eaf1e6; font-size:0.78rem; padding:2px 0;
    text-decoration:underline; text-underline-offset:2px; }
  .th-center{ display:flex; align-items:center; gap:10px; }
  .timer-display{ font-size:1.15rem; font-weight:700; letter-spacing:0.5px; min-width:64px; text-align:center; }
  .timer-hide-btn{ background:rgba(255,255,255,0.18); border:1px solid rgba(255,255,255,0.5); color:#fff;
    border-radius:5px; padding:4px 12px; font-size:0.72rem; font-weight:600; }
  .timer-hidden-label{ font-size:0.85rem; font-style:italic; opacity:0.85; }
  .th-right{ display:flex; align-items:center; gap:16px; min-width:220px; justify-content:flex-end; }
  .icon-btn{ background:none; border:none; color:#fff; opacity:0.9; font-size:1.05rem; padding:4px; }
  .icon-btn:hover{ opacity:1; }
  .hl-label{ font-size:0.8rem; }

  #directions-banner{ background:#eef2ea; border-bottom:1px solid var(--border); padding:12px 24px;
    font-size:0.85rem; color:#3c4436; display:none; }
  #directions-banner.show{ display:block; }

  .test-main{ flex:1; display:flex; overflow:hidden; min-height:0; }
  .pane{ overflow-y:auto; padding:28px 30px; background:var(--paper); }
  .pane-left{ border-right:1px solid var(--border); }
  .pane-left .passage-domain{ font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em;
    color:var(--sage-dark); font-weight:700; margin-bottom:10px; }
  .pane-left .passage-text{ font-size:1.02rem; line-height:1.75; color:#22281f; }
  .pane-left .passage-text p{ margin:0 0 14px; }
  .pane-left .passage-text em{ background:#fff2c9; font-style:normal; padding:0 1px; border-radius:2px; }
  .text-block-label{ font-size:0.78rem; font-weight:700; color:var(--sage-dark); margin:16px 0 6px; }
  .text-block-label:first-child{ margin-top:0; }

  .divider{ width:10px; flex-shrink:0; background:#eceee9; border-left:1px solid var(--border);
    border-right:1px solid var(--border); cursor:col-resize; display:flex; align-items:center; justify-content:center;
    color:#9ba498; font-size:0.7rem; user-select:none; }
  .divider:hover{ background:#e0e4da; }
  .divider::before{ content:"⟷"; }

  .pane-right{ display:flex; flex-direction:column; }
  .qcard-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; flex-wrap:wrap; gap:10px; }
  .qcard-topleft{ display:flex; align-items:center; gap:12px; }
  .qnum-badge{ background:var(--ink); color:#fff; font-weight:700; font-size:0.95rem;
    width:30px; height:30px; border-radius:4px; display:flex; align-items:center; justify-content:center; }
  .mfr-toggle{ display:flex; align-items:center; gap:6px; background:none; border:1px solid var(--border);
    border-radius:5px; padding:6px 12px; font-size:0.82rem; color:#3c4436; }
  .mfr-toggle .flag-icon{ font-size:0.95rem; }
  .mfr-toggle.active{ background:#fdf1e2; border-color:var(--accent); color:#7a5119; }
  .eliminator-toggle{ display:flex; align-items:center; gap:6px; background:none; border:1px solid var(--border);
    border-radius:5px; padding:6px 12px; font-size:0.82rem; color:#3c4436; font-weight:600; }
  .eliminator-toggle.active{ background:#e7edf7; border-color:var(--focus); color:#1c4a78; }
  .eliminator-icon{ font-size:0.85rem; letter-spacing:-0.5px; text-decoration:line-through; }

  .qcard-domain{ font-size:0.72rem; text-transform:uppercase; letter-spacing:0.05em; color:var(--muted); margin-bottom:6px; }
  .qcard-question{ font-size:1.02rem; line-height:1.6; margin-bottom:20px; color:#1c221a; }

  .options{ display:flex; flex-direction:column; gap:10px; }
  .option{ display:flex; align-items:center; gap:12px; border:1.5px solid var(--border); border-radius:8px;
    padding:12px 14px; background:#fff; position:relative; }
  .option:hover{ border-color:var(--sage); }
  .option.selected{ border-color:var(--sage-dark); background:#eef4ea; box-shadow:0 0 0 1px var(--sage-dark) inset; }
  .option.eliminated{ opacity:0.5; }
  .option.eliminated .option-text{ text-decoration:line-through; }
  .opt-letter{ flex-shrink:0; width:28px; height:28px; border-radius:50%; border:1.5px solid #8b9186;
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.85rem; color:#3c4436;
    background:#fff; cursor:pointer; }
  .option.selected .opt-letter{ background:var(--sage-dark); border-color:var(--sage-dark); color:#fff; }
  .opt-letter.eliminator-mode{ border-style:dashed; border-color:var(--focus); color:var(--focus); }
  .option-text{ flex:1; cursor:pointer; font-size:0.96rem; line-height:1.5; }
  .undo-eliminate{ font-size:0.7rem; color:var(--focus); background:none; border:none; text-decoration:underline; flex-shrink:0; }

  .chart-wrap{ margin:14px 0 6px; background:#fff; border:1px solid var(--border); border-radius:8px; padding:14px; }
  .chart-caption{ font-size:0.78rem; color:var(--muted); margin-top:8px; }
  .chart-legend{ display:flex; gap:16px; margin-top:8px; flex-wrap:wrap; }
  .chart-legend-item{ display:flex; align-items:center; gap:6px; font-size:0.78rem; color:#3c4436; }
  .legend-swatch{ width:14px; height:4px; border-radius:2px; display:inline-block; }

  .test-footer{ background:var(--sage); color:#fff; display:flex; align-items:center; justify-content:space-between;
    padding:12px 24px; flex-shrink:0; }
  .footer-name{ font-size:0.88rem; font-weight:600; min-width:180px; }
  .nav-btn{ background:rgba(255,255,255,0.14); border:1px solid rgba(255,255,255,0.55); color:#fff; border-radius:6px;
    padding:9px 18px; font-size:0.88rem; font-weight:600; display:flex; align-items:center; gap:8px; }
  .nav-btn:hover{ background:rgba(255,255,255,0.24); }
  .next-btn{ background:#fff; color:var(--sage-dark); border-radius:6px; padding:10px 26px; font-size:0.9rem;
    font-weight:700; border:none; min-width:100px; }
  .next-btn:hover{ background:#eef2ea; }
  .footer-right{ min-width:180px; display:flex; justify-content:flex-end; }

  /* ===== Navigator Modal ===== */
  .modal-overlay{ position:fixed; inset:0; background:rgba(20,24,18,0.5); display:none; align-items:center;
    justify-content:center; z-index:50; padding:20px; }
  .modal-overlay.show{ display:flex; }
  .modal-box{ background:#fff; border-radius:10px; max-width:640px; width:100%; max-height:85vh; overflow-y:auto;
    padding:24px 26px; }
  .modal-box h2{ margin:0 0 4px; font-size:1.1rem; }
  .modal-box .modal-sub{ color:var(--muted); font-size:0.82rem; margin-bottom:18px; }
  .nav-legend{ display:flex; gap:22px; flex-wrap:wrap; margin-bottom:18px; padding:12px 14px; background:#f4f5f0;
    border-radius:8px; font-size:0.8rem; }
  .nav-legend-item{ display:flex; align-items:center; gap:6px; color:#3c4436; }
  .legend-box{ width:20px; height:20px; border-radius:4px; border:1.5px solid #8b9186; display:flex;
    align-items:center; justify-content:center; font-size:0.7rem; }
  .legend-box.dashed{ border-style:dashed; }
  .nav-grid{ display:grid; grid-template-columns:repeat(9, 1fr); gap:8px; margin-bottom:20px; }
  .nav-cell{ position:relative; aspect-ratio:1; border:1.5px solid #8b9186; border-radius:5px; background:#fff;
    font-weight:600; font-size:0.85rem; display:flex; align-items:center; justify-content:center; color:#22281f; }
  .nav-cell:hover{ border-color:var(--sage-dark); }
  .nav-cell.answered{ background:#eef4ea; border-color:var(--sage-dark); }
  .nav-cell.unanswered{ border-style:dashed; }
  .nav-cell.current{ outline:2px solid var(--focus); text-decoration:underline; }
  .nav-cell .pin{ position:absolute; top:-11px; left:50%; transform:translateX(-50%); font-size:0.8rem; }
  .nav-cell .flag{ position:absolute; top:-6px; right:-6px; font-size:0.7rem; }
  .modal-actions{ display:flex; justify-content:space-between; gap:10px; }

  /* ===== Review Screen ===== */
  #screen-review{ display:none; min-height:100vh; flex-direction:column; }
  #screen-review.active{ display:flex; }
  .review-header{ background:var(--sage); color:#fff; padding:18px 30px; }
  .review-header h1{ margin:0; font-size:1.15rem; }
  .review-body{ flex:1; max-width:820px; margin:0 auto; padding:26px 20px; width:100%; }
  .review-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:10px; margin:18px 0 26px; }
  .review-item{ border:1px solid var(--border); border-radius:8px; padding:10px 12px; background:#fff;
    display:flex; align-items:center; justify-content:space-between; font-size:0.85rem; }
  .review-item .rq-status{ font-size:0.7rem; padding:2px 8px; border-radius:10px; font-weight:700; }
  .status-answered{ background:#eaf3e6; color:#3d6b34; }
  .status-unanswered{ background:#fbe9e4; color:#a24525; }
  .status-review{ background:#fdf1e2; color:#8a5a17; }
  .review-actions{ display:flex; justify-content:flex-end; gap:12px; padding-top:14px; border-top:1px solid var(--border); }

  /* ===== Results Screen ===== */
  #screen-results{ display:none; min-height:100vh; flex-direction:column; background:var(--paper); }
  #screen-results.active{ display:flex; }
  .results-header{ background:var(--sage-dark); color:#fff; padding:34px 30px; text-align:center; }
  .results-header .score-big{ font-size:3rem; font-weight:800; margin:6px 0; }
  .results-header .score-sub{ font-size:0.95rem; opacity:0.9; }
  .results-body{ flex:1; max-width:880px; margin:0 auto; padding:30px 20px 50px; width:100%; }
  .domain-summary{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:30px; }
  .domain-card{ background:#fff; border:1px solid var(--border); border-radius:10px; padding:16px; }
  .domain-card .dname{ font-size:0.76rem; text-transform:uppercase; color:var(--muted); font-weight:700; margin-bottom:6px; }
  .domain-card .dscore{ font-size:1.5rem; font-weight:800; color:var(--sage-dark); }
  .qa-row{ display:flex; align-items:flex-start; gap:14px; padding:14px 0; border-bottom:1px solid var(--border); }
  .qa-badge{ width:30px; height:30px; border-radius:50%; flex-shrink:0; display:flex; align-items:center;
    justify-content:center; font-weight:700; font-size:0.85rem; color:#fff; }
  .qa-badge.correct{ background:#3d8b4a; }
  .qa-badge.incorrect{ background:var(--danger); }
  .qa-content{ flex:1; }
  .qa-content .qa-q{ font-size:0.92rem; margin-bottom:6px; color:#22281f; }
  .qa-content .qa-answers{ font-size:0.82rem; color:var(--muted); }
  .qa-content .qa-answers b{ color:#22281f; }
  .results-actions{ padding-top:20px; text-align:center; }

  ::selection{ background:#cfe0c6; }

/* ---------------------------------------------------------------------------
 * Platform-port additions. Everything above is the standalone module's CSS,
 * unmodified. The standalone had no link-styled buttons: .btn sets padding but
 * no display, which is fine for <button> (inline-block by default) and breaks
 * for <a>, whose vertical padding does not expand the line box - the button
 * then overlaps the text above it.
 * ------------------------------------------------------------------------- */
a.btn{ display:inline-block; text-decoration:none; margin-top:12px; }
.instr-section p + a.btn{ margin-top:14px; }

/* ---------------------------------------------------------------------------
 * Math-module additions, lifted from test1-module1-math.html. All new class
 * names - nothing above is modified. The two rules the Math page RE-tunes
 * (.th-right min-width, .pane-left .passage-text font-size) are scoped to
 * .is-math so the Reading & Writing modules keep their own values.
 * ------------------------------------------------------------------------- */

/* grid-in entry */
.gridin-wrap{ margin-top:4px; }
.gridin-label{ font-size:0.78rem; color:var(--muted); margin-bottom:8px; }
.gridin-input{ width:180px; font-size:1.3rem; font-weight:700; text-align:center; padding:12px 10px;
  border:2px solid #8b9186; border-radius:8px; color:var(--ink); background:#fff; }
.gridin-input:focus{ outline:none; border-color:var(--focus); box-shadow:0 0 0 3px rgba(47,111,176,0.15); }
.gridin-hint{ font-size:0.75rem; color:var(--muted); margin-top:10px; max-width:340px; line-height:1.5; }
.qa-badge.gridin-tag{ background:#5f7657; }

/* reference sheet */
.ref-btn{ background:rgba(255,255,255,0.18); border:1px solid rgba(255,255,255,0.5); color:#fff;
  border-radius:5px; padding:5px 12px; font-size:0.76rem; font-weight:600; }
.ref-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px 24px; }
.ref-item{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:6px; }
.ref-item svg{ height:56px; }
.ref-formula{ font-size:0.85rem; color:#22281f; }
.ref-note{ font-size:0.78rem; color:var(--muted); border-top:1px solid var(--border); margin-top:18px; padding-top:12px; line-height:1.6; }

/* the Math header carries one extra button, and its prompts run slightly larger */
.is-math .th-right{ min-width:260px; }
.is-math .pane-left .passage-text{ font-size:1.05rem; }

/* =====================================================================
   HIGHLIGHTS AND NOTES  (added 2026-08-15)

   Kept in the candidate's own browser, never submitted and never marked.
   Class names here are part of the same contract as the rest of this file:
   sat-contract.mjs asserts every one of them exists.
   ===================================================================== */

/* A highlighted run of passage text. <mark> carries a UA background, so it is
   reset explicitly rather than inherited. */
.sat-hl{
  background:#ffe9a8;
  color:inherit;
  padding:0;
  border-radius:2px;
  cursor:pointer;
  box-shadow:inset 0 -1px 0 #e0bf62;
}
.sat-hl:hover{ background:#ffd978; }

/* While highlight mode is armed the passage takes a text cursor, so it is
   obvious that selecting will do something. */
.pane-left.hl-armed{ cursor:text; }
.pane-left.hl-armed .passage-text{ background:#fffdf5; }

/* The header toggles use .active, matching .btn-mfr and .btn-eliminator. */
.icon-btn.active{
  background:var(--sage,#7c9473);
  border-color:var(--sage,#7c9473);
  color:#fff;
}

/* A small dot on the notes button when the current question already has one. */
.icon-btn.has-note{ position:relative; }
.icon-btn.has-note::after{
  content:"";
  position:absolute;
  top:3px; right:3px;
  width:6px; height:6px;
  border-radius:50%;
  background:#b5482f;
}

/* Note panel: hidden by default, revealed with .show like the other panels. */
.note-panel{
  display:none;
  margin-top:14px;
  border:1px solid var(--border,#d8d8cf);
  border-radius:8px;
  background:#fffdf5;
  padding:10px 12px 12px;
}
.note-panel.show{ display:block; }
.note-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:6px;
}
.note-title{ font-size:0.82rem; font-weight:600; color:#3c4436; }
.note-close{
  border:0;
  background:transparent;
  font-size:1.1rem;
  line-height:1;
  cursor:pointer;
  color:var(--muted,#6b756a);
}
.note-close:hover{ color:#b5482f; }
.note-text{
  width:100%;
  min-height:104px;
  resize:vertical;
  font:inherit;
  font-size:0.9rem;
  padding:8px;
  border:1px solid var(--border,#d8d8cf);
  border-radius:6px;
  background:#fff;
  color:inherit;
}
.note-text:focus{ outline:2px solid var(--sage,#7c9473); outline-offset:1px; }
.note-hint{ margin-top:6px; font-size:0.72rem; color:var(--muted,#6b756a); min-height:1em; }

/* =====================================================================
   WAY BACK OUT  (added 2026-08-16)

   The SAT pages render through layouts/sat.blade.php, a standalone shell with
   no site header, so without this there is no link back to the rest of the
   site. Rendered on the listing, detail and review pages; suppressed on the
   module runner, which is a timed exam.

   display is set explicitly: .btn in this file sets padding but no display,
   which is the trap that already required the a.btn fix above.
   ===================================================================== */
.sat-site-footer{
  text-align:center;
  padding:18px 16px 28px;
}
.sat-backlink{
  display:inline-block;
  padding:8px 16px;
  font-size:0.85rem;
  font-weight:600;
  text-decoration:none;
  color:#3c4436;
  background:#fff;
  border:1px solid var(--border,#d8d8cf);
  border-radius:999px;
}
.sat-backlink:hover{
  background:var(--sage,#7c9473);
  color:#fff;
  border-color:var(--sage,#7c9473);
}
