/* GrindSpot — Study section (/study). Scoped under .st so nothing leaks into other pages. */
.st { --ink: #0B2D5C; --teal: #12A8A0; --teal-dk: #0E8A83; --teal-txt: #0E9C95; --body: #16324F; --grey: #5B6B7F;
      --cloud: #EEF5F9; --line: #DCE6EE; background: #fff; color: var(--body); font-family: 'Inter', sans-serif; }
.st h1, .st h2, .st h3 { font-family: 'Poppins', sans-serif; color: var(--ink); margin: 0; letter-spacing: -0.3px; }
.st .st-wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }
.st a { color: var(--teal-dk); }
.st .st-preview { background: #FFF7E6; border-bottom: 1px solid #F3D9A4; color: #7A5300; font-size: 0.85rem; padding: 0.55rem 16px; text-align: center; }

/* hub */
.st-hero { background: var(--cloud); position: relative; overflow: hidden; }
.st-hero::before { content: ""; position: absolute; right: -120px; top: -140px; width: 380px; height: 380px; border-radius: 50%; background: rgba(18,168,160,0.14); }
.st-hero .st-wrap { position: relative; padding-top: 2.6rem; padding-bottom: 2.2rem; }
.st-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.1; max-width: 760px; }
.st-hero .st-sub { font: 600 1.05rem 'Poppins', sans-serif; color: var(--teal-txt); margin: 0.5rem 0 1.2rem; }
.st-search { display: flex; max-width: 620px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 0.35rem 0.35rem 0.35rem 1.1rem; }
.st-search:focus-within { border-color: var(--teal); }
.st-search input { flex: 1; border: 0; outline: 0; font: 500 0.98rem 'Inter', sans-serif; min-width: 0; background: transparent; }
.st-cycles { display: flex; gap: 0.5rem; margin-top: 1.4rem; flex-wrap: wrap; }
.st-cycle { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 0.45rem 1.1rem; font: 600 0.9rem 'Poppins', sans-serif; color: var(--ink); text-decoration: none; }
.st-cycle.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.st-section-title { font-size: 1.15rem; margin: 2rem 0 0.9rem; }
.st-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.8rem; }
.st-subj { display: flex; align-items: center; gap: 0.75rem; border: 1.5px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem; background: #fff; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.st-subj:hover { border-color: var(--teal); box-shadow: 0 6px 18px rgba(11,45,92,0.08); }
.st-subj .st-ic { width: 52px; height: 52px; flex-shrink: 0; transition: transform .2s; }
.st-subj .st-ic img { width: 100%; height: 100%; display: block; }
.st-subj:hover .st-ic { transform: rotate(-8deg) scale(1.08); }
.st-subj b { display: block; font: 600 0.95rem 'Poppins', sans-serif; line-height: 1.25; }
.st-subj small { color: var(--grey); font-size: 0.78rem; }
.st-none { color: var(--grey); font-size: 0.9rem; }
.st-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2.4rem 0 3rem; }
.st-how > div { background: var(--cloud); border-radius: 16px; padding: 1.2rem; }
.st-how h3 { font-size: 1rem; margin: 0 0 0.3rem; }
.st-how p { margin: 0; font-size: 0.88rem; color: var(--grey); }
@media (max-width: 760px) { .st-how { grid-template-columns: 1fr; } }

/* subject page */
.st-crumbs { font-size: 0.82rem; color: var(--grey); padding: 1.1rem 0 0; }
.st-crumbs a { color: var(--grey); }
.st-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2rem; padding: 0.6rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.st-head h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 800; }
.st-head h1 { display: flex; align-items: center; gap: 0.8rem; }
.st-head h1 .st-h-ic { width: 72px; height: 72px; flex-shrink: 0; }
.st-head h1 .st-h-ic img { width: 100%; height: 100%; display: block; }
@media (max-width: 600px) { .st-head h1 .st-h-ic { width: 54px; height: 54px; } }
.st-head p { margin: 0.25rem 0 0; color: var(--grey); }
.st-levels { display: flex; gap: 0.4rem; margin-left: auto; flex-wrap: wrap; }
.st-lvl { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 0.35rem 0.95rem; font: 600 0.84rem 'Inter', sans-serif; color: var(--ink); cursor: pointer; }
.st-lvl.on { border-color: var(--teal); background: #E3F6F4; color: var(--teal-dk); }
.st-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; padding: 1.6rem 0 3rem; }
.st-layout > * { min-width: 0; }
@media (max-width: 920px) { .st-layout { grid-template-columns: 1fr; } }
.st-card { border: 1.5px solid var(--line); border-radius: 16px; padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; background: #fff; }
.st-card h2 { font-size: 1.1rem; margin-bottom: 0.7rem; }
.st-card p { margin: 0 0 0.5rem; font-size: 0.9rem; }
.st-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.st-link { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--cloud); border-radius: 10px; padding: 0.55rem 0.85rem; font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.st-note { font-size: 0.84rem; color: var(--grey); background: var(--cloud); border-radius: 10px; padding: 0.6rem 0.8rem; margin-top: 0.6rem; }
.st-table-wrap { overflow-x: auto; }
.st table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.st th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey); padding: 0.4rem 0.5rem; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.st td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.st td.st-year { font-weight: 700; color: var(--ink); white-space: nowrap; }
.st td a { text-decoration: none; font-weight: 600; }
.st .st-file { display: block; margin-bottom: 0.2rem; }
.st .st-ga { font-size: 0.76rem; font-weight: 500; color: var(--grey); margin-left: 0.3rem; }
.st .st-dash { color: #b8c4cf; }
.st-more { margin-top: 0.7rem; background: none; border: 0; color: var(--teal-dk); font: 600 0.88rem 'Inter', sans-serif; cursor: pointer; padding: 0; }
.st-side .st-card h2 { margin-bottom: 0.4rem; }
.st-tutor { display: flex; gap: 0.7rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.st-tutor:last-of-type { border-bottom: 0; }
.st-av { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 0.95rem 'Poppins', sans-serif; color: #fff; flex-shrink: 0; overflow: hidden; }
.st-av img { width: 100%; height: 100%; object-fit: cover; }
.st-tutor b { display: block; font-size: 0.9rem; color: var(--ink); }
.st-tutor small { color: var(--grey); font-size: 0.78rem; }
.st-pill { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border-radius: 999px; padding: 0.6rem 1.2rem; font: 600 0.88rem 'Poppins', sans-serif; text-decoration: none; border: 0; cursor: pointer; background: var(--teal); color: #fff !important; }
.st-pill.st-block { width: 100%; margin-top: 0.8rem; }
.st-cta { background: var(--ink); color: #fff; border-radius: 16px; padding: 1.2rem; }
.st-cta h3 { color: #fff; font-size: 1.05rem; }
.st-cta p { color: #D6E4F0; font-size: 0.88rem; margin: 0.4rem 0 0.9rem; }
.st [hidden] { display: none !important; }

.st-credit { font-size: 0.72rem; color: var(--grey); margin: -1.8rem 0 2.4rem; }

/* "My study materials" links */
.st-crumbs { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; align-items: center; }
.st-mine { margin-left: auto; font-weight: 600; color: var(--teal-dk) !important; text-decoration: none; }
.st-cycle-mine { order: 9; margin-left: auto; background: #E3F6F4; border-color: #E3F6F4; color: var(--teal-dk); }
.st .sv-open-row td { background: #F4FAFD; }

/* viewer opened under a row (public/js/study-viewer.js) */
.sv { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.sv-head { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.9rem 0.6rem 1.1rem; background: var(--ink); color: #fff; }
.sv-title { font: 600 0.95rem 'Poppins', sans-serif; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-x { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
.sv-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; padding: 0.6rem 0.9rem; background: var(--cloud); border-bottom: 1px solid var(--line); }
.sv-tools, .sv-acts { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.sv-t { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 0.35rem 0.7rem; font: 600 0.82rem 'Inter', sans-serif; cursor: pointer; min-width: 2.1rem; }
.sv-t.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.sv-sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; }
.sv-sw.on { box-shadow: 0 0 0 2.5px var(--ink); }
.sv-a { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 0.38rem 0.9rem; font: 600 0.82rem 'Inter', sans-serif; cursor: pointer; }
.sv-a:hover { border-color: var(--teal); }
.sv-a-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.sv-a-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.sv-a:disabled { opacity: 0.6; cursor: wait; }
.sv-hint { padding: 0.5rem 1rem; font-size: 0.85rem; background: #FFF7E6; color: #7A5300; border-bottom: 1px solid #F3D9A4; }
.sv-hint.err { background: #FDECEC; color: #991b1b; border-color: #fecaca; }
.sv-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; background: var(--line); }
.sv-body.sv-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .sv-body.sv-split { grid-template-columns: minmax(0, 1fr); } }
.sv-pane { position: relative; height: min(78vh, 900px); background: #e9eef3; }
.sv-scroll { position: absolute; inset: 0; overflow: auto; }
.sv-msg { padding: 2rem; text-align: center; color: var(--grey); }
.sv-media { padding: 1.5rem; display: flex; justify-content: center; background: #fff; }
.sv-media audio { width: min(560px, 100%); }
.sv-media video { max-width: 100%; max-height: 70vh; }
.sv-print { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; }

/* My study materials (/study/my) */
.st-empty { text-align: center; padding: 2.4rem 1.3rem; margin-top: 1.6rem; }
.st-empty .st-pill { margin-top: 0.6rem; }
.st-my { margin-top: 0.2rem; }
.st-my-paper { display: flex; gap: 0.75rem; align-items: center; }
.st-my-ic { width: 42px; height: 42px; flex-shrink: 0; }
.st-my-ic img { width: 100%; height: 100%; display: block; }
.st-my-open { font-weight: 600; color: var(--ink) !important; }
.st-my-paper small { display: block; color: var(--grey); font-size: 0.78rem; margin-top: 0.15rem; }
.st-tag { display: inline-block; background: #E3F6F4; color: var(--teal-dk); font-weight: 700; font-size: 0.7rem; border-radius: 999px; padding: 0.05rem 0.5rem; }
.st-my-shared { font-size: 0.85rem; }
.st-my-acts-in { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; justify-content: flex-end; }
th.st-my-acts { text-align: right; }
.st-share { display: inline-flex; gap: 0.3rem; align-items: center; margin: 0; }
.st-share select { border: 1.5px solid var(--line); border-radius: 999px; padding: 0.35rem 0.6rem; font: 500 0.82rem 'Inter', sans-serif; max-width: 220px; background: #fff; }
.st-del { display: inline; margin: 0; }
@media (max-width: 760px) { .st-my-acts-in { justify-content: flex-start; } }
.sv-native { width: 100%; height: 100%; border: 0; display: block; }

/* pop-up viewer */
html.sv-lock { overflow: hidden; }
.sv-modal { --ink: #0B2D5C; --teal: #12A8A0; --teal-dk: #0E8A83; --grey: #5B6B7F; --cloud: #EEF5F9; --line: #DCE6EE;
             font-family: 'Inter', sans-serif; position: fixed; inset: 0; z-index: 100000; background: rgba(11,45,92,0.55); display: flex; align-items: center; justify-content: center; padding: 5vh 5vw; }
.sv.sv-pop { position: relative; width: min(1180px, 100%); height: 100%; margin: 0; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.sv-pop .sv-body { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.sv-pop .sv-pane { height: 100%; }
.sv-pop .sv-media { flex: 1; align-items: center; }
@media (max-width: 600px) { .sv-modal { padding: 0; } .sv.sv-pop { border-radius: 0; border: 0; } }
.sv-invite { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; padding: 0.6rem 1rem;
             background: #E3F6F4; color: var(--ink, #0B2D5C); font-size: 0.88rem; font-weight: 600; border-bottom: 1px solid #BFE7E3; }
.sv-invite .sv-a { text-decoration: none; }
.sv-invite .sv-a-ink { color: #fff !important; }

/* "Unsaved writing" question, inside the pop-up */
.sv-confirm { position: absolute; inset: 0; z-index: 5; background: rgba(11,45,92,0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sv-confirm-box { background: #fff; border-radius: 16px; padding: 1.5rem 1.4rem 1.2rem; width: min(420px, 100%); text-align: center; box-shadow: 0 16px 50px rgba(0,0,0,0.3); }
.sv-confirm-box h3 { font: 700 1.15rem 'Poppins', sans-serif; color: var(--ink); margin: 0 0 0.4rem; }
.sv-confirm-box p { font-size: 0.9rem; color: #16324F; margin: 0 0 1.1rem; }
.sv-confirm-btns { display: flex; flex-direction: column; gap: 0.5rem; }
.sv-confirm-btns .sv-a { padding: 0.6rem 1rem; font-size: 0.9rem; }
.sv-confirm-btns .sv-keep { border: 0; background: none; color: var(--grey); }
.sv-sw[hidden] { display: none; }

/* Free study resources (Scoilnet, TG4) */
.st-free { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.7rem; }
.st-free-item { display: block; background: var(--cloud); border-radius: 12px; padding: 0.8rem 1rem; text-decoration: none; color: var(--body) !important; border: 1.5px solid transparent; }
.st-free-item:hover { border-color: var(--teal); }
.st-free-item b { display: block; color: var(--teal-dk); font-size: 0.95rem; margin-bottom: 0.2rem; }
.st-free-item span { font-size: 0.84rem; color: var(--grey); line-height: 1.45; }
.st-my-files { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin-top: 0.35rem; }
.st-my-files a { font-size: 0.85rem; font-weight: 600; }
/* "Stuck on a past paper?" — tutors in the main column of a Study subject page */
.st-help { border-color: var(--teal); background: linear-gradient(180deg, #F2FBFA 0%, #fff 60%); }
.st-help-lead { margin: 0.35rem 0 0.8rem; color: var(--body); }
.st-help-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
.st-help-tutor { display: flex; gap: 0.8rem; align-items: center; padding: 0.75rem 0.9rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; color: var(--body) !important; }
.st-help-tutor:hover { border-color: var(--teal); }
.st-help-who { flex: 1; min-width: 0; }
.st-help-who b { display: block; color: var(--ink); font-size: 0.95rem; }
.st-help-who small { display: block; color: var(--grey); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-help-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; align-items: center; margin-top: 0.25rem; font-size: 0.8rem; color: var(--grey); }
.st-help-rate { font-weight: 700; color: var(--teal-txt); }
.st-help-chip { background: var(--cloud); color: var(--ink); border-radius: 999px; padding: 0.1rem 0.5rem; font-weight: 600; font-size: 0.74rem; }
.st-help-go { flex-shrink: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 0.45rem 0.9rem; font: 600 0.8rem 'Poppins', sans-serif; }
.st-help-why { list-style: none; padding: 0; margin: 0.9rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.85rem; }
.st-help-why li::before { content: "✓"; color: var(--teal); font-weight: 700; margin-right: 0.35rem; }
.st-help-acts { display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; align-items: center; margin-top: 1rem; }
.st-help-alt { font-size: 0.88rem; font-weight: 600; }
@media (max-width: 600px) { .st-help-go { display: none; } .st-help-acts .st-pill { width: 100%; } }
