/* ===================== shared bits ===================== */
.pr-userbox { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.pr-userbox strong { font-weight: 600; }
.pr-linkbtn { border: 1.5px solid rgba(0,0,0,.18); background: #fff; border-radius: 999px; padding: 7px 14px; font: 600 13px var(--font-body); cursor: pointer; color: #000; text-decoration: none; }
.pr-linkbtn:hover { border-color: var(--red); color: var(--red); }
.pr-btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 20px; background: #000; color: #fff; font: 700 14px var(--font-body); cursor: pointer; text-decoration: none; text-align: center; }
.pr-btn:hover:not(:disabled) { background: var(--red); }
.pr-btn:disabled { opacity: .55; cursor: not-allowed; }
.pr-btn.ghost { background: #fff; color: #000; border: 1.5px solid rgba(0,0,0,.18); }
.pr-btn.ghost:hover:not(:disabled) { background: #fff; border-color: var(--red); color: var(--red); }
.pr-btn.pink { background: var(--pink); color: #000; }
.pr-btn.pink:hover:not(:disabled) { background: #ffb3cb; color: #000; }
.pr-msg { margin: 10px 0 0; font-size: 13.5px; font-weight: 600; }
.pr-msg.bad { color: var(--red); } .pr-msg.good { color: #1f7a52; }
[hidden] { display: none !important; }

/* ===================== landing ===================== */
.pr-hero { background: radial-gradient(circle at 20% 0%, #3a1c2b 0%, #000 55%); color: #fff; padding: 64px 20px 56px; text-align: center; }
.pr-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); margin: 0 0 12px; }
.pr-hero h1 em { color: var(--pink); font-style: italic; }
.pr-hero p { max-width: 620px; margin: 0 auto; color: rgba(255,255,255,.8); font-size: 17px; line-height: 1.55; }
.pr-wrap { max-width: 1040px; margin: 0 auto; padding: 36px 20px 64px; }
.pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.pr-panel { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.05); }
.pr-panel h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.pr-panel .sub { margin: 0 0 18px; color: rgba(0,0,0,.6); font-size: 14px; line-height: 1.5; }
.pr-field { margin-bottom: 14px; }
.pr-field label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: rgba(0,0,0,.65); }
.pr-field input { width: 100%; height: 44px; padding: 0 12px; border: 1.5px solid rgba(0,0,0,.15); border-radius: 8px; font: 15px var(--font-body); }
.pr-field input:focus { outline: none; border-color: var(--red); }
.pr-cards { display: grid; gap: 14px; }
.pr-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: #fff; }
.pr-card h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 18px; }
.pr-card p { margin: 0; font-size: 13.5px; color: rgba(0,0,0,.6); line-height: 1.45; }
.pr-card .meta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pr-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 600 11.5px var(--font-body); background: #f1f1f1; color: #444; }
.pr-tag.price { background: var(--pink); color: #000; } .pr-tag.ok { background: #dff3e8; color: #1f7a52; } .pr-tag.soon { background: #fff3cd; color: #8a6100; }
.pr-card .act { flex: none; }
.pr-welcome h2 { margin-bottom: 4px; }

/* ===================== registration popup extras ===================== */
.pr-plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px; border: 1.5px solid rgba(0,0,0,.12); border-radius: 10px; cursor: pointer; }
.pr-plan:has(input:checked) { border-color: var(--red); background: #fff6f8; }
.pr-plan input { width: 18px; height: 18px; accent-color: var(--red); }
.pr-plan .name { flex: 1; font-weight: 600; font-size: 14.5px; }
.pr-plan .name small { display: block; font-weight: 400; color: rgba(0,0,0,.55); margin-top: 2px; }
.pr-plan .cost { font-weight: 700; }

/* ===================== workspace ===================== */
.pr-app { display: grid; grid-template-columns: 250px 1fr; height: calc(100vh - var(--nav-height) - 60px); min-height: 560px; background: #f4f5f7; }
.pr-nav { overflow-y: auto; background: #fff; border-right: 1px solid var(--border); padding: 14px 10px 24px; }
.pr-nav h2 { font-family: var(--font-display); font-size: 15px; margin: 4px 8px 10px; }
.pr-nav .progress { margin: 0 8px 12px; font-size: 12px; color: rgba(0,0,0,.55); }
.pr-nav .bar { height: 6px; background: #eee; border-radius: 99px; margin: 6px 0 0; overflow: hidden; } .pr-nav .bar i { display: block; height: 100%; background: var(--red); }
.pr-topic { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: 500 13.5px var(--font-body); color: #111; }
.pr-topic:hover:not(:disabled) { background: #f3f3f3; }
.pr-topic.active { background: #000; color: #fff; }
.pr-topic .no { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #eee; font: 700 12px var(--font-body); color: #333; }
.pr-topic.active .no { background: var(--pink); color: #000; }
.pr-topic.solved .no { background: #1f7a52; color: #fff; }
.pr-topic .tick { flex: none; color: #1f7a52; font-weight: 800; font-size: 15px; }
.pr-topic.active .tick { color: var(--pink); }
.pr-topic .t { flex: 1; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pr-topic:disabled { opacity: .4; cursor: default; }
.pr-main { display: flex; flex-direction: column; min-width: 0; padding: 14px; gap: 12px; overflow: hidden; }
.pr-question { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; flex: none; max-height: 42%; overflow-y: auto; }
.pr-question .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pr-question h1 { font-family: var(--font-display); font-size: 19px; margin: 0; }
.pr-question .q { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.pr-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.pr-toolbar .pr-btn { padding: 9px 16px; font-size: 13.5px; }
.pr-toolbar .grow { flex: 1; }
.pr-feedback { margin-top: 10px; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; }
.pr-feedback.good { background: #dff3e8; color: #17613f; } .pr-feedback.bad { background: #fde8ea; color: #9b1c2c; } .pr-feedback.info { background: #eef2ff; color: #2a3a8f; }
.pr-solution { margin-top: 10px; padding: 12px 14px; border: 1px dashed rgba(0,0,0,.25); border-radius: 8px; background: #fffdf5; font-size: 13.5px; line-height: 1.5; }
.pr-solution code { display: block; margin: 4px 0 8px; padding: 6px 10px; background: #fff; border: 1px solid #eee; border-radius: 6px; font: 13px var(--font-body); overflow-x: auto; white-space: pre; }
.pr-solution b { font-weight: 700; }
.pr-sheetwrap { flex: 1; min-height: 280px; min-width: 0; }
.pr-empty { display: grid; place-items: center; text-align: center; padding: 40px 20px; color: rgba(0,0,0,.6); }
.pr-empty h2 { font-family: var(--font-display); color: #000; margin-bottom: 6px; }

/* ===================== the spreadsheet ===================== */
.ss { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 260px; background: #fff; border: 1px solid #c9ced6; border-radius: 10px; overflow: hidden; font-family: "Calibri", "Carlito", sans-serif; font-size: 13.5px; }
.ss-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #f4f5f7; border-bottom: 1px solid #d3d7de; }
.ss-name { width: 92px; text-align: center; border: 1px solid #c9ced6; border-radius: 6px; padding: 5px 4px; background: #fff; font: 600 13px "Calibri", "Carlito", sans-serif; color: #222; }
.ss-fx { color: #6b7280; font-style: italic; font-weight: 700; padding: 0 2px; }
.ss-formula { flex: 1; min-width: 0; border: 1px solid #c9ced6; border-radius: 6px; padding: 6px 9px; font: 14px "Calibri", "Carlito", sans-serif; background: #fff; }
.ss-formula:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.18); }
.ss.editing .ss-formula { border-color: #1a73e8; }
.ss-scroll { flex: 1; overflow: auto; position: relative; background: #fff; }
.ss-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; user-select: none; -webkit-user-select: none; }
.ss-grid th { position: sticky; top: 0; z-index: 2; height: 24px; background: #eceef1; color: #4b5563; font-weight: 600; font-size: 12.5px; border-right: 1px solid #d3d7de; border-bottom: 1px solid #d3d7de; text-align: center; }
.ss-grid th.ss-rh { top: auto; left: 0; z-index: 1; width: 44px; }
.ss-grid th.ss-corner { left: 0; z-index: 3; }
.ss-grid td { position: relative; height: 24px; padding: 0 6px; border-right: 1px solid #e4e7ec; border-bottom: 1px solid #e4e7ec; white-space: pre; cursor: cell; background: #fff; }
.ss-grid td .v { overflow: hidden; text-overflow: clip; line-height: 23px; }
.ss-grid td.num .v { text-align: right; } .ss-grid td.bool .v, .ss-grid td.err .v { text-align: center; }
.ss-grid td.err { color: #b42318; }
.ss-grid td.hdr { font-weight: 700; background: #f3f4f6; }
.ss-grid td.ans { background: #ffeea0; }
.ss-grid td.sel { background: #e4eefe; }
.ss-grid td.ans.sel { background: #ffe680; }
.ss-grid td.active { background: #fff; outline: 2px solid #1a73e8; outline-offset: -2px; z-index: 1; }
.ss-grid td.ans.active { background: #ffe680; }
.ss-grid td.ok { background: #d9f6e3 !important; outline: 2px solid #16a34a; outline-offset: -2px; }
.ss-grid td.wrong { background: #fde2e4 !important; outline: 2px solid #dc2626; outline-offset: -2px; }
.ss-grid td.fillpreview { outline: 1px dashed #1a73e8; outline-offset: -1px; }
.ss-grid th.ss-colsel, .ss-grid th.ss-rowsel { background: #d0e0fb; color: #123a8c; }
.ss-fill { position: absolute; right: -4px; bottom: -4px; width: 9px; height: 9px; background: #1a73e8; border: 1px solid #fff; cursor: crosshair; z-index: 4; }
.ss-sink { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

/* ===================== small screens ===================== */
@media (max-width: 900px) {
  .pr-grid { grid-template-columns: 1fr; }
  .pr-card { flex-direction: column; align-items: stretch; } .pr-card .act .pr-btn { width: 100%; }
  .pr-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 0; }
  .pr-nav { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 10px; border-right: 0; border-bottom: 1px solid var(--border); align-items: center; }
  .pr-nav h2, .pr-nav .progress { display: none; }
  .pr-topic { flex: none; width: auto; padding: 6px 10px 6px 6px; border: 1px solid #e3e3e3; border-radius: 999px; }
  .pr-topic .t { display: none; }
  .pr-topic.active .t { display: block; max-width: 160px; white-space: nowrap; -webkit-line-clamp: 1; }
  .pr-main { padding: 10px; overflow: visible; }
  .pr-question { max-height: none; }
  .pr-sheetwrap { min-height: 420px; }
  .pr-toolbar .pr-btn { flex: 1 1 auto; min-height: 42px; }
  .pr-userbox .name { display: none; }
}
