:root { color-scheme: dark; }
[hidden] { display: none !important; }
.study-nav { gap: 18px; }
.study-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.study-nav .login-control { background: var(--paper); color: var(--ink); }
.study-shell { padding-block: 38px 80px; }
.study-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.study-head h1 { font-size: clamp(30px, 4.5vw, 54px); line-height: 1.2; letter-spacing: -.05em; margin: 10px 0 14px; }
.study-head p { margin: 0; color: #b7c4c0; max-width: 650px; }
.study-head .eyebrow { color: var(--accent); font-size: 11px; }
.study-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.study-tabs a { display: flex; gap: 8px; align-items: center; min-height: 46px; border: 1px solid var(--line); padding: 10px 17px; border-radius: 12px; color: var(--muted); font-weight: 750; }
.study-tabs a small { font-size: 11px; font-weight: 500; }
.study-tabs a[aria-current=page] { color: var(--ink); background: var(--accent); border-color: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #ffaf8f; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }
.study-btn { min-height: 46px; padding: 11px 18px; border: 1px solid #7a8c85; border-radius: 10px; background: transparent; color: var(--paper); font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.study-btn.primary { background: var(--accent); color: #192022; border-color: var(--accent); }
.study-btn.google { background: white; color: #26312e; border-color: white; }
.study-btn:hover { border-color: var(--accent); }
.study-tools { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { min-height: 44px; border: 1px solid var(--line); border-radius: 30px; padding: 9px 15px; background: transparent; color: #b7c4c0; }
.chip[aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: #ff714f0d; }
.chip small { opacity: .7; margin-left: 6px; }
.study-input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #50635b; border-radius: 10px; color: var(--paper); background: #202b28; }
textarea.study-input { min-height: 150px; resize: vertical; }
.study-input::placeholder { color: #9ba9a3; }
.study-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.lesson-tile, .study-panel { border: 1px solid var(--line); border-radius: 18px; background: #202a27; }
.lesson-tile { padding: 24px; display: flex; flex-direction: column; align-items: start; gap: 14px; }
.lesson-tile h2 { font-size: 25px; line-height: 1.4; letter-spacing: -.04em; margin: 0; }
.lesson-tile p { margin: 0; color: #bdcac4; font-size: 15px; }
.lesson-tile .study-btn { margin-top: auto; }
.lesson-meta { color: var(--accent); font-size: 12px; font-weight: 750; }
.study-panel { padding: clamp(20px, 3vw, 36px); margin-bottom: 20px; }
.study-panel h2 { margin: 0 0 15px; font-size: 24px; letter-spacing: -.035em; }
.study-panel .hint { color: var(--muted); font-size: 14px; line-height: 1.7; }
.review-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(250px,.6fr); gap: 22px; }
.review-layout .study-panel { margin: 0; }
.flash { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 32px; min-height: 250px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; margin-block: 20px; }
.flash h3 { font-size: clamp(25px, 4vw, 44px); line-height: 1.4; margin: 0 0 16px; letter-spacing: -.04em; }
.flash p { margin: 5px 0; }
.flash .hint { color: #5b6964; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz { margin-top: 24px; }
.quiz button { display: block; width: 100%; text-align: left; margin-bottom: 10px; }
.quiz .correct { border-color: #89cda6; color: #afe5c3; }
.quiz .wrong { border-color: #ff9f91; }
.feedback-line { margin: 16px 0; color: #afe5c3; }
.form-grid { display: grid; gap: 20px; max-width: 760px; }
.form-grid label { display: grid; gap: 8px; font-weight: 700; }
.form-grid label small { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-grid .check { display: flex; align-items: start; gap: 10px; font-size: 14px; font-weight: 500; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; }
.private-label { background: #91c4a219; color: #afe5c3; padding: 7px 11px; display: inline-flex; border-radius: 8px; font-size: 12px; }
.empty { padding: 30px; background: #ffffff05; border: 1px dashed #51645c; border-radius: 14px; color: var(--muted); }
.empty h2, .empty h3 { color: var(--paper); margin-top: 0; }
.empty p { margin: 8px 0 20px; }
.post-list { display: grid; gap: 12px; margin-top: 20px; }
.post-row { padding: 22px; border: 1px solid var(--line); border-radius: 12px; display: block; background: #202a27; }
.post-row:hover { border-color: var(--accent); }
.post-row h3 { margin: 8px 0 10px; font-size: 20px; }
.post-row p { color: var(--muted); font-size: 13px; margin: 0; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.status-tag { font-size: 12px; color: var(--accent); }
.success { padding: 22px; border: 1px solid #79b992; border-radius: 14px; background: #79b99215; }
.success h2 { margin: 0 0 12px; }
.notice { color: var(--muted); padding: 16px 0; font-size: 13px; }
#global-status { min-height: 22px; color: #ffbdac; margin: 0 0 16px; }
dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid #596e62; border-radius: 20px; background: #202a27; color: var(--paper); padding: 30px; }
dialog::backdrop { background: #07100bcc; }
dialog h2 { margin: 0 0 14px; font-size: 26px; }
dialog p { color: var(--muted); line-height: 1.7; }
.dialog-close { float: right; border: 0; padding: 5px 8px; background: transparent; color: var(--paper); font-size: 22px; min-width: 44px; min-height: 44px; }
.honeypot { position: absolute; left: -9999px; }
.staff-item { padding-block: 20px; border-top: 1px solid var(--line); }
@media(max-width:760px) {
  .study-nav { gap: 10px; }
  .study-nav a:not(.login-control) { display: none; }
  .study-nav .login-control { display: inline-flex; min-height: 44px; font-size: 12px; padding: 8px 12px; }
  .study-shell { padding-block: 28px 60px; }
  .study-head { display: block; }
  .study-tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .study-tabs a { justify-content: center; padding: 10px; }
  .study-tabs .staff-tab { grid-column: 1 / -1; }
  .study-grid, .review-layout, .study-tools { grid-template-columns: 1fr; }
  .lesson-tile { padding: 22px; }
  .study-head h1 { font-size: 32px; }
  .flash { padding: 24px 15px; }
  .chips { gap: 7px; }
  .chip { font-size: 13px; padding-inline: 11px; }
}
