/*
 * study.css - the study-habit features (owner, 2026-11-18): the dashboard
 * cards (_study_cards.html), the planner (portal_plan.html), the public
 * question of the day (page_question_of_the_day.html) and the admin
 * questions page; and, same day, the help desk (hd-: portal_help*.html,
 * admin_help*.html; since 2026-11-28 also a notes buyer's store_help*.html
 * and the reply banner on store_library.html) and refer a friend (rf-:
 * portal_invite.html).
 * Loaded after learn.css / portal.css and reuses their
 * colour tokens (--g, --g-soft, --line, --muted ...) where they exist,
 * with the same values as fallbacks for the public page.
 * Phone first: everything is one column and every button is at least a
 * fingertip high (learn.css .ln-btn already is).
 */

/* --- the card shell ------------------------------------------------------ */
.st-card {
    background: #fff;
    border: 1px solid var(--line, #dfe7e2);
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 18px;
    box-shadow: var(--sh-sm, 0 1px 2px rgba(0, 60, 0, 0.05));
}
.st-card h2 { margin: 0 0 6px; font-size: 1.08rem; color: var(--g-dark, #003d06); }
.st-card h3 { margin: 16px 0 6px; font-size: 1rem; }
.st-card p { margin: 6px 0; }
/* Title on the left, a badge (streak, paper) on the right. */
.st-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
/* On the public info pages, .info h2 adds a large top margin; not inside a card. */
.info .st-card h2 { margin: 0 0 6px; }
.st-muted { color: var(--muted, #6b7772); font-size: 0.88rem; }
.st-more { margin-top: 10px; font-size: 0.92rem; }
.st-foot { margin-top: 12px; }
.st-msg { min-height: 1.2em; font-size: 0.9rem; color: var(--g-dark, #003d06); }
/* No message yet: take no room, so a card does not end in a blank strip. */
.st-msg:empty { min-height: 0; margin: 0; }
.st-list { margin: 8px 0 4px; padding-left: 22px; }
/* Each topic a comfortable tap target on a phone; chip and title on one line. */
.st-list li { margin: 4px 0; padding: 4px 0; line-height: 1.4; }
.st-list a { text-decoration: none; }
.st-list a:hover { text-decoration: underline; }
.st-list .ln-code { align-self: auto; vertical-align: 1px; margin-right: 4px; }
/* An honest warning (a plan too heavy for the time left). */
.st-warn { background: #fff4e5; border-left: 4px solid #b34700; padding: 10px 12px; border-radius: 8px; color: #5c2a00; }

/* The streak badge and the paper tag. */
.st-streak { font-weight: 700; color: #b34700; white-space: nowrap; }
.st-tag {
    font-size: 0.78rem; color: var(--g, #006400); background: var(--g-soft, #eaf4ea);
    border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

/* --- question of the day (dashboard card and public page) ---------------- */
/* pre-line keeps the line breaks a question was written with. */
.qd-stem { white-space: pre-line; font-weight: 600; margin: 8px 0 12px; }
.qd-options { display: grid; gap: 8px; }
.qd-opt {
    text-align: left; width: 100%;
    padding: 12px 14px; min-height: 48px;
    border: 1px solid var(--line, #dfe7e2); border-radius: 10px;
    background: #fff; color: inherit; font: inherit; cursor: pointer;
}
.qd-opt:hover:not(:disabled) { border-color: var(--g, #006400); background: var(--g-soft, #eaf4ea); }
.qd-opt:disabled { cursor: default; }
/* After answering: the right answer green, a wrong choice red. */
.qd-opt.is-right { border-color: #1b7f1b; background: #e7f6e7; }
.qd-opt.is-wrong { border-color: #b3261e; background: #fdecea; }
.qd-result { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--g-soft, #eaf4ea); }
.qd-verdict { font-weight: 700; margin: 0 0 6px; }
.qd-explain { white-space: pre-line; }

/* The public page's "Create a free account" button: _info_base.html colours
   every .info link green, which would put green text on the green button. */
.info a.btn, .info a.btn:hover { color: #fff; }

/* --- results day ---------------------------------------------------------- */
.st-results { border-color: var(--g, #006400); }
.st-results-form summary { cursor: pointer; font-weight: 600; color: var(--g, #006400); margin: 6px 0; }
.st-result { border: 1px solid var(--line, #dfe7e2); border-radius: 10px; margin: 10px 0; padding: 8px 12px; }
.st-result legend { padding: 0 4px; font-weight: 600; }
/* Big tap targets for the two choices. */
.st-result label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; min-height: 40px; }

/* --- notifications card: one state shown at a time (push_notify.js) ------ */
.st-push [data-show] { display: none; }
.st-push[data-state="off"] [data-show="off"],
.st-push[data-state="on"] [data-show="on"],
.st-push[data-state="blocked"] [data-show="blocked"],
.st-push[data-state="ios-install"] [data-show="ios-install"],
.st-push[data-state="unsupported"] [data-show="unsupported"] { display: block; }

/* --- the planner ---------------------------------------------------------- */
.pl-form fieldset { border: 1px solid var(--line, #dfe7e2); border-radius: 10px; margin: 12px 0; padding: 10px 12px; }
.pl-form legend { font-weight: 600; padding: 0 4px; }
/* One paper per row: tick box, code chip, title - lined up on a phone, and
   the whole row is the tap target (it is a label). */
.pl-paper {
    display: grid; grid-template-columns: 22px auto 1fr; align-items: center;
    gap: 10px; min-height: 44px; padding: 4px 0; cursor: pointer;
}
.pl-paper input { width: 20px; height: 20px; margin: 0; accent-color: var(--g, #006400); }
/* learn.css pins the chip to the top (align-self: flex-start); centre it here. */
.pl-paper .ln-code { margin: 0; align-self: center; justify-self: start; }
.pl-form select { width: 100%; min-height: 44px; font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line, #dfe7e2); }
.pl-week { border-top: 1px solid var(--line, #dfe7e2); padding: 10px 0; }
.pl-week h3 { margin: 0 0 4px; font-size: 0.95rem; }
.pl-papers { display: grid; gap: 8px; margin: 10px 0; }
.pl-papers .ln-bar { margin: 4px 0; }

/* --- home page: "What you get" (_account_benefits.html) ------------------ */
/* Phone first: the two columns stack; side by side from 720px (below). */
.ab { margin: 8px 0 26px; }
.ab h2 { font-size: 1.3rem; color: #064e06; margin: 0 0 12px; text-align: center; }
.ab-grid { display: grid; gap: 14px; }
.ab-col {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 18px 16px;
    display: flex; flex-direction: column;
}
.ab-col h3 { margin: 0; font-size: 1.1rem; color: #006400; }
/* The paid column stands out: a green edge and a soft green wash. */
.ab-paid { border: 2px solid #006400; background: linear-gradient(160deg, #ffffff 0%, #eef7ee 100%); }
.ab-sub { margin: 4px 0 10px; color: #4a5568; font-size: 0.9rem; }
/* A tick before each line instead of a bullet. */
.ab-list { list-style: none; margin: 0 0 16px; padding: 0; flex: 1; }
.ab-list li { position: relative; padding: 6px 0 6px 26px; color: #2d3748; font-size: 0.95rem; line-height: 1.45; }
.ab-list li::before { content: "\2713"; position: absolute; left: 4px; top: 6px; color: #006400; font-weight: 800; }
/* Full-width, fingertip-high buttons on a phone. */
.ab-btn {
    display: block; text-align: center; text-decoration: none;
    padding: 13px 18px; min-height: 48px; border-radius: 10px;
    font-weight: 700; color: #006400; background: #fff; border: 2px solid #006400;
}
.ab-btn:hover { background: #eef7ee; color: #004d00; }
.ab-btn-paid { background: linear-gradient(135deg, #006e00 0%, #005107 100%); color: #fff; border-color: transparent; }
.ab-btn-paid:hover { color: #fff; background: #004d00; }

/* --- admin questions page ------------------------------------------------- */
.aq-options { display: grid; gap: 6px; }
.aq-option { display: flex; gap: 8px; align-items: center; }
.aq-option input[type="text"] { flex: 1; }
.aq-right { color: #1b7f1b; font-weight: 700; }
.aq-copy { width: 100%; min-height: 220px; font-family: inherit; font-size: 0.9rem; }

/* --- dashboard: the help and invite links (end of _study_cards.html) ------ */
.st-links { display: grid; gap: 0 14px; }
/* A whole card is the link: a big tap target on a phone. */
.st-link { display: block; text-decoration: none; color: inherit; }
.st-link strong { display: block; color: var(--g-dark, #003d06); margin-bottom: 2px; }
.st-link:hover { border-color: #006400; }

/* --- help desk (help_desk.py) --------------------------------------------- */
/* "You have a reply" on the dashboard: the first thing they see. */
.hd-reply-card {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px;
    text-decoration: none; color: var(--g-dark, #003d06);
    border: 2px solid #006400; background: #eef7ee;
}
.hd-jump { display: block; text-align: center; margin: 0 0 14px; }
/* The student's list: each question a full-width row. */
.hd-list { list-style: none; margin: 0; padding: 0; }
.hd-list li + li { border-top: 1px solid var(--line, #dfe7e2); }
.hd-list a { display: block; padding: 12px 2px; min-height: 48px; text-decoration: none; color: inherit; }
.hd-subject { display: block; font-weight: 600; color: var(--g-dark, #003d06); overflow-wrap: anywhere; }
.hd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; }
/* Status pills. Student side: amber = waiting on us, green = we replied,
   grey = sorted. Admin side (hd-admin-): red = needs a reply, amber =
   waiting on the student, green = resolved. */
.hd-status { padding: 2px 9px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.hd-open, .hd-admin-answered { background: #fff4e0; color: #8a5a00; }
.hd-answered, .hd-admin-resolved { background: #e3f3e3; color: #1b6b1b; }
.hd-resolved { background: #eef1ef; color: #55615b; }
.hd-admin-open { background: #fde8e8; color: #a61b1b; }
.hd-new { background: #006400; color: #fff; padding: 2px 9px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
/* The "what is it about" choice: one big tappable row each on a phone. */
.hd-cats { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.hd-cats legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
/* ".ln-form" in front: learn.css makes every .ln-form label a block and
   every .ln-form input 100% wide - right for text boxes, wrong for a radio
   button, which then sits on its own line above its words. */
.ln-form .hd-cat {
    display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 10px 12px;
    border: 1px solid var(--line, #dfe7e2); border-radius: 10px; cursor: pointer;
    font-size: 0.95rem; font-weight: 500;
}
.ln-form .hd-cat input { flex: none; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: #006400; }
.ln-form .hd-cat:has(input:checked) { border-color: #006400; background: #eef7ee; }
/* A paid-plan choice for a free account: visibly there, not choosable. */
.ln-form .hd-locked { cursor: not-allowed; color: var(--muted, #6b7772); background: #f7f8f7; }
.hd-lock-note { display: block; font-size: 0.78rem; font-weight: 600; color: #8a5a00; }
.hd-upsell { margin: 0 0 6px; font-size: 0.9rem; }
.hd-form select, .hd-form textarea, .hd-form input[type="text"] { width: 100%; box-sizing: border-box; }
.hd-title { margin-bottom: 4px; overflow-wrap: anywhere; }
/* The conversation, chat style: the reader's own messages on the right. */
.hd-thread { display: grid; gap: 10px; margin: 14px 0 18px; }
.hd-msg { max-width: 92%; padding: 12px 14px; border-radius: 12px; }
.hd-from-student { justify-self: end; background: #fff; border: 1px solid var(--line, #dfe7e2); }
.hd-from-admin { justify-self: start; background: #eef7ee; border: 1px solid #cfe5cf; }
/* On the admin page the admin is the reader, so the sides swap. */
.hd-admin-view .hd-from-student { justify-self: start; }
.hd-admin-view .hd-from-admin { justify-self: end; }
.hd-who { margin-bottom: 4px; font-size: 0.82rem; font-weight: 600; }
/* Text exactly as typed: line breaks kept, long words wrapped (auto-escaped, never HTML). */
.hd-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.hd-sorted { margin-top: 10px; }
/* The reply box's label is the card's first line: no extra gap above it. */
#reply .ln-form label { margin-top: 0; }
/* A notes buyer's help pages (store_help*.html, 2026-11-28) sit in the shop
   layout, where learn.css is not loaded, so .ln-form gives the fields no
   look of their own: they get the shop's field look here. Text left-aligned
   because the shop's style.css centres every text input. */
.hd-buyer .hd-form select, .hd-buyer .hd-form textarea, .hd-buyer .hd-form input[type="text"] {
    padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 8px;
    font: inherit; text-align: left; margin: 0 0 16px; background: #fff;
}
/* Send (ask and reply): full width on a phone, a fingertip high (the shop's
   .btn already is). "This is sorted" is in its own .hd-sorted form, so it
   keeps its own width. */
.hd-buyer .hd-form button { width: 100%; }
.hd-buyer h2 { font-size: 1.1rem; margin: 0 0 10px; }
/* "Back to My downloads" above the buyer's help pages. */
.hd-back { margin: 0 0 12px; }

/* --- refer a friend (referrals.py) ---------------------------------------- */
.rf-lead { margin: 0 0 6px; font-size: 1.25rem; font-weight: 800; color: #006400; }
/* The link box: large enough to read and tap on a phone. */
.rf-link {
    width: 100%; box-sizing: border-box; margin: 8px 0 12px; padding: 12px;
    font-size: 1rem; border: 1px solid var(--line, #dfe7e2); border-radius: 10px; background: #f7faf8;
}
/* One full-width button per row on a phone. */
.rf-buttons { display: grid; gap: 8px; }
.rf-buttons .ln-btn { width: 100%; justify-content: center; text-align: center; box-sizing: border-box; }
/* .ln-btn sets a display, which would beat the hidden attribute. */
.rf-buttons [hidden] { display: none; }
/* The numbers: two across on a phone, four on wider screens. */
.rf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rf-stats div { padding: 12px; border-radius: 10px; background: #f7faf8; }
.rf-stats strong { display: block; font-size: 1.5rem; color: #006400; }
.rf-stats span { font-size: 0.85rem; color: var(--muted, #6b7772); }

/* Wider screens: roomier cards; the home page's two benefit columns side by
   side; the dashboard links, help topics and invite buttons in a row. */
@media (min-width: 720px) {
    .st-card { padding: 20px 22px; }
    .ab-grid { grid-template-columns: 1fr 1fr; }
    .ab h2 { font-size: 1.5rem; }
    .st-links { grid-template-columns: 1fr 1fr; }
    .hd-cats { grid-template-columns: 1fr 1fr; }
    .hd-jump { display: inline-block; }
    .rf-buttons { grid-template-columns: repeat(3, max-content); }
    .rf-buttons .ln-btn { width: auto; }
    .rf-stats { grid-template-columns: repeat(4, 1fr); }
}
