/* ============================================================
   barebones — /leaving-cert-points-calculator/
   Builds on seo-pages.css. A results-statement ledger on the
   left; a dark scoreboard with the LED dot-matrix total on the
   right. Counted rows carry an orange marker, dropped rows strike.
   ============================================================ */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pc-head { margin-bottom: 36px; }
.pc-head h1 { max-width: 16ch; }

.pc {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px;
  align-items: start; margin-bottom: 56px;
}

/* ---------- ledger ---------- */
.pc-sheet {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 10px clamp(14px, 2.4vw, 26px) 20px;
  box-shadow: 0 30px 60px -48px rgba(26, 21, 18, 0.6);
  min-width: 0;
}
.pc-sheet-head, .pc-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 128px 196px 86px 30px;
  gap: 12px; align-items: center;
}
.pc-sheet-head {
  padding: 14px 0 12px; border-bottom: 1.5px solid var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.pc-r { text-align: right; }

.pc-rows { list-style: none; margin: 0; padding: 0; }
.pc-row {
  position: relative;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  transition: background-color 0.2s;
}
.pc-n {
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  letter-spacing: 0.04em; color: var(--ink-2); opacity: 0.6;
}
.pc-row[data-state="counted"] .pc-n { color: var(--orange); opacity: 1; }
.pc-row[data-state="counted"]::before {
  content: ""; position: absolute; left: calc(-1 * clamp(14px, 2.4vw, 26px)); top: 50%;
  width: 4px; height: 22px; border-radius: 0 3px 3px 0; background: var(--orange);
  transform: translateY(-50%);
}

.pc-field select {
  width: 100%; appearance: none; -webkit-appearance: none;
  font: 600 16px/1.2 var(--font-body); color: var(--ink);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231a1512' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid transparent; border-radius: 10px;
  padding: 11px 32px 11px 12px; min-height: 44px; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  text-overflow: ellipsis;
}
.pc-field select:hover { border-color: var(--line); }
.pc-field select:focus-visible { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--ring); }
.pc-subject select:invalid, .pc-row:not([data-state]) .pc-subject select { color: var(--ink); }

.pc-grade { display: block; min-width: 0; }
.pc-rank {
  display: block; margin: 5px 2px 0; min-height: 0;
  font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pc-rank:empty { display: none; }
.pc-row[data-state="counted"] .pc-rank { color: var(--orange-700); }

.pc-level {
  border: 0; margin: 0; padding: 3px; min-width: 0;
  display: inline-flex; gap: 2px; background: var(--card); border-radius: 10px;
  justify-self: start;
}
.pc-level label { position: relative; cursor: pointer; }
.pc-level input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pc-level label > span:first-of-type {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--ink-2);
  transition: background-color 0.15s, color 0.15s;
}
.pc-level label:hover > span:first-of-type { color: var(--ink); }
.pc-level input:checked + span { background: var(--ink); color: var(--card-2); }
.pc-level input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.pc-level-na {
  font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 6px; background: none;
}

.pc-pts { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.pc-pts-num {
  font-family: var(--font-display); font-weight: 800; font-size: 24px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.pc-pts-note {
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px;
  white-space: nowrap;
}
.pc-row[data-state="counted"] .pc-pts-note { color: var(--orange-700); }
.pc-row[data-state="empty"] .pc-pts-num { color: var(--ink-2); opacity: 0.4; }
.pc-row[data-state="dropped"] .pc-pts-num,
.pc-row[data-state="duplicate"] .pc-pts-num {
  color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 2px;
  text-decoration-color: var(--orange);
}
.pc-row[data-state="dropped"], .pc-row[data-state="duplicate"] { background: color-mix(in srgb, var(--card) 55%, transparent); }

.pc-remove {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: none;
  font-size: 20px; line-height: 1; color: var(--ink-2); cursor: pointer;
  opacity: 0.5; transition: opacity 0.15s, background-color 0.15s;
}
.pc-remove:hover:not(:disabled) { opacity: 1; background: var(--card); color: var(--ink); }
.pc-remove:disabled { opacity: 0.15; cursor: default; }
.pc-remove:focus-visible { outline: 2px solid var(--orange); opacity: 1; }

.pc-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }
.pc-add { padding: 11px 18px; font-size: 15px; }
.pc-add:disabled { opacity: 0.4; pointer-events: none; }
.pc-reset {
  border: 0; background: none; cursor: pointer; padding: 8px 4px;
  font: 600 14px var(--font-body); color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px;
}
.pc-reset:hover { color: var(--ink); }
.pc-noscript { padding: 16px 0 0; color: var(--ink-2); }

/* ---------- scoreboard ---------- */
.pc-board {
  position: sticky; top: 96px;
  background: var(--ink); color: var(--card-2);
  border-radius: 22px; padding: 26px 26px 22px;
  overflow: hidden;
  isolation: isolate;
}
.pc-board::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.07; pointer-events: none;
  background-image: radial-gradient(circle, #fff 1.3px, transparent 1.5px); background-size: 16px 16px;
}
.pc-board-label {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6);
  margin: 0 0 18px;
}
.pc-board-label-sub { margin: 22px 0 10px; }
.pc-total { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; min-height: 96px; }
.pc-total .pix { flex: none; }
.pc-of {
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
  color: rgba(255, 255, 255, 0.45); line-height: 1; padding-bottom: 2px;
}

.pc-bar {
  display: flex; gap: 3px; height: 14px; margin-top: 22px;
  background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden;
}
.pc-seg { flex-grow: 0; flex-shrink: 0; background: var(--orange); border-radius: 2px; transition: flex-basis 0.35s cubic-bezier(.2, .8, .2, 1); }
.pc-seg:nth-child(even) { background: color-mix(in srgb, var(--orange) 78%, #fff); }
.pc-seg-bonus { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, 0.35) 4px 6px); }

.pc-breakdown ol { list-style: none; margin: 0; padding: 0; counter-reset: slot; }
.pc-breakdown li {
  counter-increment: slot;
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
  font-size: 15px; font-weight: 600;
}
.pc-breakdown li::before {
  content: counter(slot); flex: none; width: 16px;
  font-family: var(--font-display); font-weight: 800; font-size: 11px; color: var(--orange);
}
.pc-breakdown li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-breakdown li b { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-breakdown li i { font-style: normal; color: var(--orange); margin-left: 4px; font-size: 13px; }
.pc-breakdown .pc-slot-empty { color: rgba(255, 255, 255, 0.32); }
.pc-dropped { margin: 12px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.55); }
.pc-board-note { margin: 16px 0 0; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.5); }
.pc-board-note a { color: rgba(255, 255, 255, 0.78); text-decoration: underline; text-underline-offset: 2px; }
.pc-board-note a:hover { color: #fff; }
.pc-standout-line { margin: 0; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, 0.8); }
.pc-standout-line b { color: var(--orange); font-family: var(--font-display); font-weight: 800; }

.pc-source { margin: 0; font-size: 14px; color: var(--ink-2); }
.pc-stats-table td:nth-child(2) { font-family: var(--font-body); font-weight: 500; color: var(--ink-2); }
.pc-stats-table td:nth-child(3), .pc-stats-table td:nth-child(4), .pc-stats-table td:nth-child(5) { font-family: var(--font-display); font-weight: 700; }
.pc-mbar { display: none; }

/* ---------- explainer ---------- */
.pc-explain { margin-bottom: 72px; }
.pc-explain > .np-block:first-child { padding-top: 0; }
.pc-explain .np-block a { color: var(--orange-700); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

.pc-table-wrap { overflow-x: auto; margin: 6px 0 18px; }
.pc-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 360px; }
.pc-table th, .pc-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 16px; }
.pc-table thead th {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1.5px solid var(--ink);
}
.pc-table tbody th { font-family: var(--font-display); font-weight: 800; color: var(--orange); width: 64px; }
.pc-table td:nth-child(3), .pc-table td:nth-child(4) { font-family: var(--font-display); font-weight: 700; }
.pc-table tbody tr:hover { background: var(--card); }
.pc-extras li { font-size: 16px; }

.pc-faq details { border-bottom: 1px solid var(--line); }
.pc-faq details:first-of-type { border-top: 1px solid var(--line); }
.pc-faq summary {
  list-style: none; cursor: pointer; padding: 16px 36px 16px 0; position: relative;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.3;
}
.pc-faq summary::-webkit-details-marker { display: none; }
.pc-faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 600; color: var(--orange); transition: transform 0.2s;
}
.pc-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.pc-faq summary:hover { color: var(--orange-700); }
.pc-faq summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.pc-faq details p { margin: 0 0 18px; color: var(--ink-2); font-size: 16px; }
.pc-disclaimer { margin: 40px 0 0; font-size: 14px; color: var(--ink-2); max-width: 70ch; }
.pc-disclaimer a { text-decoration: underline; text-underline-offset: 3px; }

.nav-links a[aria-current] { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .pc { grid-template-columns: 1fr; }
  .pc-board { position: static; order: -1; }
  .pc-total { min-height: 0; }
}
@media (max-width: 720px) {
  .pc-sheet-head { display: none; }
  .pc-row {
    grid-template-columns: 22px auto minmax(0, 1fr) auto;
    grid-template-areas:
      "n subject subject pts"
      ". level grade remove";
    gap: 8px 8px; padding: 14px 0;
  }
  .pc-grade select { padding-right: 26px; background-position: right 9px center; font-size: 15px; }
  .pc-remove { justify-self: end; }
  .pc-n { grid-area: n; }
  .pc-subject { grid-area: subject; }
  .pc-level, .pc-level-na { grid-area: level; }
  .pc-grade { grid-area: grade; min-width: 0; }
  .pc-pts { grid-area: pts; min-width: 54px; }
  .pc-remove { grid-area: remove; }
  .pc-level label > span:first-of-type { width: 34px; }
  .pc-pts-num { font-size: 21px; }
  .pc-board { order: 0; }
  .pc-mbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; bottom: 12px; z-index: 5; margin-top: -8px;
    background: var(--ink); color: var(--card-2); border-radius: 14px;
    padding: 12px 18px; box-shadow: 0 16px 30px -12px rgba(26, 21, 18, 0.6);
    font-family: var(--font-display); font-weight: 700;
  }
  .pc-mbar-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
  .pc-mbar b { font-size: 24px; color: var(--orange); font-variant-numeric: tabular-nums; }
  .pc { gap: 18px; }
  .pc-sheet { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-seg, .pc-row, .pc-faq summary::after { transition: none; }
}
@media print {
  .pc-mbar, .pc-sheet-foot, .pc-remove { display: none; }
  .pc-board { position: static; }
}
