:root{
  --ophtho-shell-bg:#ffffff;
  --ophtho-shell-ink:#17202a;
  --ophtho-shell-muted:#667085;
  --ophtho-shell-line:#d8e0e7;
  --ophtho-shell-accent:#1f5f74;
  --ophtho-shell-good:#26734d;
  --ophtho-shell-bad:#b42318;
  --ophtho-shell-shadow:0 14px 34px rgba(22,34,51,.14);
}
.ophtho-shell{
  position:fixed;
  left:12px;
  right:12px;
  bottom:12px;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:48px;
  padding:7px 8px;
  border:1px solid var(--ophtho-shell-line);
  border-radius:8px;
  background:rgba(255,255,255,.94);
  color:var(--ophtho-shell-ink);
  box-shadow:var(--ophtho-shell-shadow);
  backdrop-filter:blur(12px);
  font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif;
}
.ophtho-shell-left,.ophtho-shell-right{display:flex;align-items:center;gap:6px;min-width:0}
.ophtho-shell-title{font-weight:850;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:34vw}
.ophtho-btn{
  appearance:none;
  border:1px solid var(--ophtho-shell-line);
  border-radius:7px;
  background:#fff;
  color:var(--ophtho-shell-ink);
  height:34px;
  padding:0 10px;
  font-size:12.5px;
  font-weight:760;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  white-space:nowrap;
}
.ophtho-btn:hover{border-color:#aebfca;background:#f8fafb}
.ophtho-btn.primary{background:var(--ophtho-shell-accent);border-color:var(--ophtho-shell-accent);color:#fff}
.ophtho-btn.ghost{background:#f8fafb;color:var(--ophtho-shell-muted)}
.ophtho-btn.warn{color:var(--ophtho-shell-bad)}
.ophtho-auth-label{font-size:12px;color:var(--ophtho-shell-muted);max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ophtho-note-btn{
  appearance:none;
  border:1px solid var(--ophtho-shell-line);
  border-radius:999px;
  background:#fff;
  color:var(--ophtho-shell-accent);
  height:26px;
  padding:0 9px;
  margin-left:8px;
  font-size:11.5px;
  font-weight:800;
  cursor:pointer;
  vertical-align:middle;
}
.ophtho-note-btn.has-note{background:#e8f2f5;border-color:#9ec7d4}
.ophtho-note-anchor{position:relative}
.ophtho-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:10000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(15,23,42,.42);
}
.ophtho-modal-backdrop.open{display:flex}
.ophtho-modal{
  width:min(620px,100%);
  max-height:min(680px,92vh);
  display:flex;
  flex-direction:column;
  border:1px solid var(--ophtho-shell-line);
  border-radius:8px;
  background:#fff;
  color:var(--ophtho-shell-ink);
  box-shadow:0 24px 80px rgba(15,23,42,.26);
  font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif;
}
.ophtho-modal-head,.ophtho-modal-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--ophtho-shell-line);
}
.ophtho-modal-foot{border-top:1px solid var(--ophtho-shell-line);border-bottom:0}
.ophtho-modal-title{font-size:15px;font-weight:850;line-height:1.35}
.ophtho-modal-sub{font-size:12px;color:var(--ophtho-shell-muted);margin-top:2px}
.ophtho-note-text{
  width:100%;
  min-height:240px;
  resize:vertical;
  border:0;
  outline:0;
  padding:14px;
  color:var(--ophtho-shell-ink);
  background:#fff;
  line-height:1.6;
  font:15px/1.6 'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif;
}
.ophtho-save-state{font-size:12px;color:var(--ophtho-shell-muted)}
.ophtho-page-mode .book>header.cover,
.ophtho-page-mode .book>.note,
.ophtho-page-mode footer{display:none!important}
.ophtho-page-mode main{padding-top:16px!important}
.ophtho-page-section{display:block}
.ophtho-page-mode .ophtho-page-section{display:none}
.ophtho-page-mode .ophtho-page-section.active{display:block}
.ophtho-pagebar{
  position:fixed;
  left:50%;
  bottom:72px;
  transform:translateX(-50%);
  z-index:9998;
  display:none;
  align-items:center;
  gap:8px;
  padding:7px 8px;
  border:1px solid var(--ophtho-shell-line);
  border-radius:8px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--ophtho-shell-shadow);
  backdrop-filter:blur(12px);
  color:var(--ophtho-shell-ink);
  font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif;
}
.ophtho-page-mode .ophtho-pagebar{display:flex}
.ophtho-page-count{min-width:66px;text-align:center;font-size:12.5px;color:var(--ophtho-shell-muted);font-variant-numeric:tabular-nums}
.ophtho-wrong-wrap{max-width:960px;margin:0 auto;padding:26px 16px 120px;color:var(--ophtho-shell-ink);font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif}
.ophtho-wrong-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-end;margin-bottom:16px}
.ophtho-wrong-head h1{font-size:24px;margin:0 0 4px}
.ophtho-wrong-head p{margin:0;color:var(--ophtho-shell-muted);font-size:13.5px}
.ophtho-wrong-tools{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 18px}
.ophtho-wrong-tools input,.ophtho-wrong-tools select{
  height:38px;
  border:1px solid var(--ophtho-shell-line);
  border-radius:7px;
  padding:0 10px;
  background:#fff;
  color:var(--ophtho-shell-ink);
  font-size:13px;
}
.ophtho-wrong-card{
  border:1px solid var(--ophtho-shell-line);
  border-radius:8px;
  background:#fff;
  padding:14px 16px;
  margin:10px 0;
  box-shadow:0 1px 0 rgba(22,34,51,.04);
}
.ophtho-wrong-meta{font-size:12px;color:var(--ophtho-shell-muted);margin-bottom:6px}
.ophtho-wrong-stem{font-size:15px;font-weight:800;line-height:1.5;margin-bottom:8px}
.ophtho-wrong-opts{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:7px;font-size:13.5px}
.ophtho-wrong-opts li{margin:0}
.ophtho-wrong-choice{
  width:100%;
  min-height:40px;
  border:1px solid var(--ophtho-shell-line);
  border-radius:7px;
  background:#fff;
  color:var(--ophtho-shell-ink);
  padding:8px 10px;
  display:grid;
  grid-template-columns:26px minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  text-align:left;
  cursor:pointer;
  font:inherit;
}
.ophtho-wrong-choice:hover{border-color:#aebfca;background:#f8fafb}
.ophtho-wrong-choice-num{
  width:24px;
  height:24px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#edf3f6;
  color:var(--ophtho-shell-accent);
  font-size:12px;
  font-weight:850;
}
.ophtho-wrong-choice-text{line-height:1.45;min-width:0}
.ophtho-wrong-choice.prev{border-color:#c5d3dc;background:#f8fafb}
.ophtho-wrong-choice.selected.wrong{border-color:#e3ada8;background:#fff7f6}
.ophtho-wrong-choice.selected.correct{border-color:#9fd0b5;background:#f2fbf5}
.ophtho-wrong-choice.selected.wrong .ophtho-wrong-choice-num{background:#fde8e6;color:var(--ophtho-shell-bad)}
.ophtho-wrong-choice.selected.correct .ophtho-wrong-choice-num{background:#dcf4e5;color:var(--ophtho-shell-good)}
.ophtho-wrong-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  background:#eef3f6;
  color:var(--ophtho-shell-muted);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.ophtho-wrong-feedback{
  margin-top:10px;
  border-radius:7px;
  padding:9px 10px;
  font-size:13px;
  font-weight:800;
}
.ophtho-wrong-feedback[hidden]{display:none}
.ophtho-wrong-feedback.is-wrong{background:#fff7f6;color:var(--ophtho-shell-bad);border:1px solid #f2c7c2}
.ophtho-wrong-feedback.is-correct{background:#f2fbf5;color:var(--ophtho-shell-good);border:1px solid #b9dec8}
.ophtho-wrong-exp{
  margin-top:10px;
  border-top:1px solid var(--ophtho-shell-line);
  padding-top:10px;
  color:var(--ophtho-shell-muted);
  font-size:13px;
  line-height:1.55;
}
.ophtho-wrong-exp summary{cursor:pointer;color:var(--ophtho-shell-accent);font-weight:850}
.ophtho-wrong-exp div{margin-top:8px}
.ophtho-wrong-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;align-items:center}
.ophtho-wrong-tries{font-size:12px;color:var(--ophtho-shell-muted);margin-right:auto}
/* 답을 보고 펼친 카드는 보기를 다시 못 고르게 한다(재풀이 기록 오염 방지). */
.ophtho-wrong-card[data-wrong-revealed="peek"] .ophtho-wrong-choice{cursor:default}
.ophtho-wrong-card[data-wrong-revealed="peek"] .ophtho-wrong-choice:hover{border-color:#d7e0e6;background:#fff}
.ophtho-empty{
  border:1px dashed var(--ophtho-shell-line);
  border-radius:8px;
  padding:28px 16px;
  color:var(--ophtho-shell-muted);
  text-align:center;
  background:#fff;
}
@media(max-width:680px){
  .ophtho-shell{left:8px;right:8px;bottom:8px;flex-wrap:wrap;align-items:stretch}
  .ophtho-shell-left,.ophtho-shell-right{width:100%;justify-content:space-between}
  .ophtho-shell-title{max-width:58vw}
  .ophtho-auth-label{max-width:42vw}
  .ophtho-btn{height:32px;padding:0 8px;font-size:12px}
  .ophtho-pagebar{bottom:102px;width:calc(100% - 18px);justify-content:space-between}
  .ophtho-wrong-head{display:block}
  .ophtho-wrong-choice{grid-template-columns:24px minmax(0,1fr);align-items:start}
  .ophtho-wrong-badge{grid-column:2;justify-self:start}
  .ophtho-wrong-actions{display:grid}
}

body.ophtho-auth-required.ophtho-locked > :not(#ophtho-auth-gate):not(script):not(style){display:none!important}
.pill.preview,
[data-progress-pct].preview{background:#e8f4ec!important;color:#247044!important;border-color:#b9dcc6!important}
.pill.locked{background:#f3f0ea;color:#786f61;border:1px solid #ded7ca}
.ophtho-preview-notice{
  margin:20px 0 24px;
  padding:18px 20px;
  border:1px solid #d9c6a8;
  border-radius:16px;
  background:#fffaf1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  color:#3d3428;
}
.ophtho-preview-notice>div{display:grid;gap:5px}
.ophtho-preview-notice strong{font-size:16px}
.ophtho-preview-notice span{font-size:13px;color:#716657;line-height:1.55}
.ophtho-preview-notice.compact{margin:0 0 22px;border-radius:0;border-width:0 0 1px;padding:14px 24px}
@media(max-width:700px){
  .ophtho-preview-notice{align-items:flex-start;flex-direction:column;padding:16px}
  .ophtho-preview-notice .ophtho-btn{width:100%}
}
.ophtho-auth-gate{
  position:fixed;
  inset:0;
  z-index:10020;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:#f4f6f8;
  color:var(--ophtho-shell-ink);
  font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif;
}
.ophtho-auth-gate[hidden]{display:none!important}
.ophtho-auth-card{
  width:min(460px,100%);
  border:1px solid var(--ophtho-shell-line);
  border-radius:8px;
  background:#fff;
  padding:24px;
  box-shadow:var(--ophtho-shell-shadow);
}
.ophtho-auth-kicker{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--ophtho-shell-accent);font-weight:850}
.ophtho-auth-card h1{font-size:25px;line-height:1.22;margin:8px 0 8px;letter-spacing:0}
.ophtho-auth-card p{margin:0 0 18px;color:var(--ophtho-shell-muted);font-size:13.5px;line-height:1.5}
.ophtho-auth-card .ophtho-btn{width:100%;height:42px;font-size:14px}
/* 세션 확인이 네트워크 때문에 실패했을 때 본문을 가리는 대신 한 줄로만 알린다. */
.ophtho-offline-note{
  position:sticky;
  top:0;
  z-index:9998;
  padding:7px 14px;
  border-bottom:1px solid #e4dcc9;
  background:#fdf8ec;
  color:#6b5a34;
  font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif;
  font-size:12.5px;
  text-align:center;
}


/* Personalized study home, mypage, progress, bookmarks, and flashcards. */
.ophtho-continue-hint{max-width:960px;margin:14px auto 18px;border:1px solid #d8cdb8;border-radius:8px;background:#fffdf8;padding:10px 12px;display:flex;justify-content:space-between;gap:12px;align-items:center;color:#4f4638;font-size:13px}.ophtho-continue-hint span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ophtho-qtools{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;margin:-2px 0 8px}.ophtho-mark-btn,.ophtho-card-btn{appearance:none;border:1px solid #ded7c8;border-radius:999px;background:#fffdf8;color:#5a5043;min-height:28px;padding:0 9px;font-size:12px;font-weight:800;cursor:pointer}.ophtho-mark-btn:hover,.ophtho-card-btn:hover{border-color:#b5803f;background:#fbf6ea}.ophtho-mark-btn.active,#ophtho-bookmark-chapter.active{border-color:#0b6b5b;background:#e7f4f0;color:#0b6b5b}.ophtho-note-anchor .ophtho-mark-btn,.ophtho-note-anchor .ophtho-card-btn{margin-left:6px;vertical-align:middle}.ophtho-toast{position:fixed;left:50%;bottom:78px;transform:translate(-50%,12px);z-index:10050;border:1px solid #d8cdb8;border-radius:8px;background:#23211c;color:#fffdf8;padding:10px 13px;font-size:13px;font-weight:800;opacity:0;transition:.2s ease}.ophtho-toast.show{opacity:1;transform:translate(-50%,0)}
.ophtho-nl-consent{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:9000;display:flex;align-items:center;gap:14px;flex-wrap:wrap;max-width:calc(100vw - 24px);background:#fffdf8;border:1px solid #e2ddd0;border-radius:12px;box-shadow:0 12px 34px rgba(60,45,20,.2);padding:12px 16px}
.ophtho-nl-consent .nl-msg{font-size:13.5px;color:#2c261d;font-weight:600}
.ophtho-nl-consent .nl-acts{display:flex;gap:8px}
.ophtho-nl-consent .ophtho-btn{height:34px;padding:0 14px;font-size:13px}
.ophtho-nl-toggle{display:flex;align-items:center;gap:8px;margin:12px 0 0;font-size:13px;color:#5a5043;font-weight:600;cursor:pointer}
.ophtho-nl-toggle input{width:16px;height:16px;accent-color:#8a5a2b;cursor:pointer}
@media(max-width:560px){.ophtho-nl-consent{left:12px;right:12px;transform:none;bottom:12px;flex-direction:column;align-items:flex-start;gap:10px}.ophtho-nl-consent .nl-acts{width:100%}.ophtho-nl-consent .nl-acts .ophtho-btn{flex:1}}
.ophtho-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}.ophtho-section-head h2{margin:0;font-size:18px;letter-spacing:0}.ophtho-section-head a{font-size:12.5px;color:#8a5a2b;text-decoration:none;font-weight:850}.ophtho-section-head select{height:34px;border:1px solid #e2ddd0;border-radius:8px;background:#fffdf8;color:#23211c;padding:0 10px;font-size:12.5px}
.ophtho-my-body{margin:0;background:#f6f4ee;color:#23211c;font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif;line-height:1.62}.ophtho-my-nav a,.ophtho-my-nav button{height:34px;border:1px solid #e2ddd0;border-radius:8px;background:#fffdf8;color:#23211c;display:inline-flex;align-items:center;padding:0 11px;text-decoration:none;font-size:12.5px;font-weight:850;cursor:pointer}.ophtho-my-nav a:hover,.ophtho-my-nav button:hover{border-color:#b5803f;background:#fbf6ea}.ophtho-empty-panel{border:1px solid #e2ddd0;border-radius:8px;background:#fbf8f1;padding:22px}.ophtho-empty-panel h2{margin:0 0 6px;font-size:20px}.ophtho-empty-panel p{margin:0 0 12px;color:#6b665c}.ophtho-my-section{border:1px solid #e2ddd0;border-radius:8px;background:#fffdf8;padding:16px}.ophtho-sticky-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.ophtho-sticky{border:1px solid #e1d3a8;border-radius:8px;background:#fff7c8;padding:14px;min-height:150px;box-shadow:0 8px 16px rgba(80,62,12,.08)}.ophtho-note-meta{font-size:11.5px;color:#806b22;font-weight:850;margin-bottom:8px}.ophtho-sticky p{margin:0;color:#2c261d;font-size:13.5px;white-space:pre-wrap}.ophtho-note-actions,.ophtho-line-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.ophtho-note-actions a,.ophtho-note-actions button,.ophtho-line-actions a,.ophtho-line-actions button,.ophtho-flash-actions button{border:1px solid #d8cdb8;border-radius:7px;background:#fffdf8;color:#5a5043;min-height:30px;padding:0 9px;font-size:12px;font-weight:800;text-decoration:none;cursor:pointer}.ophtho-list{display:grid;gap:8px}.ophtho-line-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;border:1px solid #eee8d9;border-radius:8px;background:#fff;padding:12px}.ophtho-line-item span{display:block;color:#8a5a2b;font-size:11.5px;font-weight:900}.ophtho-line-item strong{display:block;font-size:14px;line-height:1.35;margin-top:2px}.ophtho-line-item em{display:block;font-style:normal;color:#6b665c;font-size:12px;margin-top:3px}.ophtho-card-review-list{display:grid;gap:8px}.ophtho-flash-item{border:1px solid #eee8d9;border-radius:8px;background:#fff;padding:12px}.ophtho-flash-item summary{cursor:pointer;list-style:none}.ophtho-flash-item summary::-webkit-details-marker{display:none}.ophtho-flash-item summary span{display:block;font-size:11.5px;color:#8a5a2b;font-weight:900}.ophtho-flash-item summary strong{display:block;margin-top:3px;font-size:14px}.ophtho-flash-item p{margin:10px 0 0;white-space:pre-wrap;color:#4f4638;font-size:13px}.ophtho-flash-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.ophtho-card-list{display:grid;gap:10px;max-height:68vh;overflow:auto;padding-right:3px}.ophtho-card-candidate{border:1px solid #eee8d9;border-radius:8px;background:#fff;padding:12px}.ophtho-card-front{font-weight:900;color:#23211c}.ophtho-card-back{margin:8px 0 10px;color:#5f5649;font-size:13px;white-space:pre-wrap}.ophtho-modal.wide{width:min(820px,calc(100vw - 28px))}.ophtho-wrong-head-actions{display:flex;gap:8px;flex-wrap:wrap}.ophtho-empty{border:1px dashed #d8cdb8;border-radius:8px;background:#fffdf8;padding:16px;color:#6b665c;text-align:center;font-size:13px}
@media(max-width:900px){.ophtho-sticky-grid{grid-template-columns:repeat(2,1fr)}.ophtho-line-item{grid-template-columns:1fr}.ophtho-line-actions{justify-content:flex-start}}@media(max-width:560px){.ophtho-continue-hint{margin-left:12px;margin-right:12px}.ophtho-continue-hint span{white-space:normal}.ophtho-shell{gap:8px}.ophtho-qtools{justify-content:flex-start}.ophtho-subject-grid,.ophtho-sticky-grid{grid-template-columns:1fr}.ophtho-line-actions a,.ophtho-line-actions button,.ophtho-note-actions a,.ophtho-note-actions button,.ophtho-flash-actions button{flex:1 1 auto;justify-content:center}.ophtho-toast{bottom:92px;width:calc(100vw - 32px);text-align:center}}


/* Study hub tabs and material feed. */
.study-tabs{display:flex;gap:8px;align-items:center;overflow-x:auto;margin:0 0 16px;padding:0 0 2px;scrollbar-width:thin}.study-tabs a{height:38px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e2ddd0;border-radius:8px;background:#fffdf8;color:#23211c;text-decoration:none;padding:0 13px;font-size:13px;font-weight:850;white-space:nowrap}.study-tabs a:hover{border-color:#b5803f;background:#fbf6ea}.study-tabs a.active{border-color:#8a5a2b;background:#f0ead9;color:#8a5a2b}.ophtho-my-tabs{position:sticky;top:0;z-index:30;background:linear-gradient(180deg,#fffdf8 70%,rgba(255,253,248,.86));padding-top:4px;padding-bottom:8px;margin-top:-6px}.ophtho-auto-actions a,.ophtho-auto-actions button{height:31px;border:1px solid #d8cdb8;border-radius:7px;background:#fffdf8;color:#5a5043;display:inline-flex;align-items:center;justify-content:center;padding:0 9px;font-size:12px;font-weight:850;text-decoration:none;white-space:nowrap;cursor:pointer}@media(max-width:760px){.study-tabs{margin-left:-2px;margin-right:-2px}.study-tabs a{height:36px;font-size:12.5px;padding:0 11px}}

/* Global content search. */
.ophtho-search-modal{width:min(760px,100%)}
.ophtho-search-body{padding:14px;overflow:auto}
.ophtho-search-input{width:100%;height:44px;border:1px solid var(--ophtho-shell-line);border-radius:8px;background:#fff;color:var(--ophtho-shell-ink);padding:0 13px;font-size:15px;font-family:'Pretendard','Noto Sans CJK KR','Apple SD Gothic Neo',system-ui,sans-serif}
.ophtho-search-input:focus{outline:2px solid rgba(31,95,116,.18);border-color:var(--ophtho-shell-accent)}
.ophtho-search-status{min-height:22px;margin:8px 0 10px;color:var(--ophtho-shell-muted);font-size:12.5px;font-weight:760}
.ophtho-search-results{display:grid;gap:8px;max-height:min(58vh,520px);overflow:auto;padding-right:2px}
.ophtho-search-result{display:grid;gap:4px;border:1px solid var(--ophtho-shell-line);border-radius:8px;background:#fff;color:var(--ophtho-shell-ink);padding:11px 12px;text-decoration:none}
.ophtho-search-result:hover{border-color:#aebfca;background:#f8fafb}
.ophtho-search-result span{color:var(--ophtho-shell-accent);font-size:11.5px;font-weight:900;letter-spacing:.02em}
.ophtho-search-result strong{font-size:14.5px;line-height:1.35;letter-spacing:0;overflow-wrap:anywhere}
.ophtho-search-result p{margin:0;color:var(--ophtho-shell-muted);font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.ophtho-search-result mark{background:#fff1bc;color:inherit;border-radius:3px;padding:0 1px}
@media(max-width:680px){.ophtho-search-backdrop{align-items:flex-start;padding:10px}.ophtho-search-modal{max-height:calc(100vh - 20px)}.ophtho-search-body{padding:12px}.ophtho-search-results{max-height:calc(100vh - 190px)}}

/* ===== refined 마이페이지 (warm paper, de-carded) — overrides above ===== */
.ophtho-my-body{background:#f6f4ee}






.ophtho-my-nav a,.ophtho-my-nav button{height:34px;border:1px solid #e2ddd0;border-radius:8px;background:#fff;color:#5a5043;padding:0 11px;font-size:12.5px;font-weight:600}
.ophtho-my-nav a:hover,.ophtho-my-nav button:hover{border-color:#b5803f;background:#f3eede}


/* tabs -> quiet underline */
.study-tabs{gap:4px;border-bottom:1px solid #e2ddd0;margin:0 0 20px;padding:0}
.ophtho-my-tabs{position:sticky;top:0;z-index:30;background:#fffdf8;padding:2px 0 0;margin-top:0}
.study-tabs a{height:38px;border:0;border-radius:0;background:none;color:#6b665c;padding:0 12px;font-size:13.5px;font-weight:560;border-bottom:2px solid transparent;margin-bottom:-1px}
.study-tabs a:hover{background:none;border-color:transparent;color:#23211c}
.study-tabs a.active{background:none;border-color:#8a5a2b;color:#8a5a2b;font-weight:700}

/* slim profile */
.ophtho-my-profile{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 22px}
.ophtho-profile-id{display:flex;gap:8px;align-items:center}
.ophtho-profile-id input{height:36px;width:min(280px,56vw);border:1px solid #e2ddd0;border-radius:8px;background:#fff;padding:0 11px;font:inherit;font-size:14px}
.ophtho-profile-id input:focus{outline:2px solid rgba(138,90,43,.16);border-color:#8a5a2b}
.ophtho-profile-meta{display:flex;align-items:center;gap:14px;color:#6b665c;font-size:12.5px;font-weight:500}
.ophtho-profile-meta span{color:#23211c;font-weight:680}
.ophtho-profile-meta em{font-style:normal;color:#9a9384}

/* sections -> borderless, divider + whitespace */

.ophtho-my-section{border:0;border-radius:0;background:none;padding:0;margin:0 0 30px}
/* one panel at a time */
#ophtho-my-page [data-panel][hidden]{display:none}
#ophtho-my-page [data-panel]{margin-bottom:0;scroll-margin-top:56px}
.ophtho-section-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid #efe9da}
.ophtho-section-head h2{font-size:15px;font-weight:730;letter-spacing:-.01em}
.ophtho-section-head>span{color:#9a9384;font-size:12.5px;font-weight:600}
.ophtho-section-head select{height:32px;border:1px solid #e2ddd0;border-radius:7px;background:#fff;color:#23211c;font-size:12.5px;font-weight:500}

/* 오늘의 복습 rows */
.ophtho-review-rows{display:flex;flex-direction:column}
.ophtho-review-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:11px 2px;text-decoration:none;color:#23211c;border-bottom:1px solid #efe9da}
.ophtho-review-row:hover{background:#f3eede}
.ophtho-review-row .tag{font-size:11px;font-weight:700;color:#8a5a2b;background:#f0ead9;border-radius:999px;padding:2px 9px;white-space:nowrap}
.ophtho-review-row .ttl{min-width:0;font-size:14px;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ophtho-review-row .mt{color:#9a9384;font-size:12px;white-space:nowrap}

/* notes / bookmarks / flashcards -> clean rows (de-card) */
.ophtho-note-list,.ophtho-list,.ophtho-card-review-list{display:flex;flex-direction:column}
.ophtho-sticky-grid{display:flex;flex-direction:column;gap:0}
.ophtho-sticky{border:0;border-bottom:1px solid #efe9da;border-left:2px solid #e3cf90;border-radius:0;background:none;padding:11px 0 11px 12px;min-height:0;box-shadow:none}
.ophtho-sticky p{font-size:14px;color:#3a352b}
.ophtho-note-meta{color:#9a9384;font-size:11.5px;font-weight:600;margin-bottom:4px}
.ophtho-line-item{border:0;border-bottom:1px solid #efe9da;border-radius:0;background:none;padding:11px 2px;grid-template-columns:minmax(0,1fr) auto}
.ophtho-line-item span{color:#8a5a2b;font-size:11px;font-weight:700}
.ophtho-line-item strong{font-size:14px;font-weight:600}
.ophtho-line-item em{color:#9a9384;font-size:12px}
.ophtho-flash-item{border:0;border-bottom:1px solid #efe9da;border-radius:0;background:none;padding:11px 0}
.ophtho-flash-item summary strong{font-weight:600}
.ophtho-flash-item summary span{color:#9a9384;font-weight:600}
/* flashcard back — 정답 강조 + 문장 불릿으로 가독성 */
.ophtho-flash-back{margin:10px 0 2px}
.ophtho-flash-back .fc-answer{font-weight:700;color:#0b6b5b;background:#eef6f0;border-left:3px solid #0b6b5b;border-radius:0 6px 6px 0;padding:7px 11px;font-size:13px;line-height:1.5;margin:0 0 9px}
.ophtho-flash-back ul.fc-exp{margin:0;padding-left:18px;color:#4f4638;font-size:13px;line-height:1.7}
.ophtho-flash-back ul.fc-exp li{margin:4px 0}
.ophtho-flash-back ul.fc-exp li::marker{color:#b5803f}
.ophtho-flash-back p.fc-exp{margin:0;color:#4f4638;font-size:13px;line-height:1.7;white-space:pre-wrap}
.ophtho-flash-back .fc-answer+ul.fc-exp,.ophtho-flash-back .fc-answer+p.fc-exp{margin-top:2px}

/* quiet action buttons */
.ophtho-note-actions a,.ophtho-note-actions button,.ophtho-line-actions a,.ophtho-line-actions button,.ophtho-flash-actions button{border:1px solid #e2ddd0;background:#fff;color:#6b665c;font-weight:560;min-height:28px;border-radius:7px}
.ophtho-note-actions,.ophtho-line-actions,.ophtho-flash-actions{margin-top:8px}

/* empty */
.ophtho-empty{border:1px dashed #e2ddd0;background:none;color:#9a9384;padding:18px;border-radius:8px}

@media(max-width:620px){
  
  
  
  .ophtho-my-profile{align-items:flex-start;flex-direction:column}
  .ophtho-review-row{grid-template-columns:auto minmax(0,1fr)}
  .ophtho-review-row .mt{display:none}
}

/* ===== highlights & annotations (형광펜·텍스트 메모) ===== */
mark.ophtho-hl{background:#fdf0a3;color:inherit;border-radius:2px;padding:0 1px;cursor:pointer;-webkit-box-decoration-break:clone;box-decoration-break:clone}
mark.ophtho-hl-yellow{background:#fdf0a3}
mark.ophtho-hl-green{background:#c7ecc2}
mark.ophtho-hl-pink{background:#fbccdb}
mark.ophtho-hl.has-note{box-shadow:inset 0 -2px 0 rgba(138,90,43,.6)}
.ophtho-anno-pop{position:absolute;z-index:10040;display:none;align-items:center;gap:5px;padding:6px 8px;border:1px solid #d8cdb8;border-radius:999px;background:#fffdf8;box-shadow:0 8px 26px rgba(60,45,20,.22)}
.ophtho-anno-pop.open{display:flex}
.ophtho-hlswatch{appearance:none;width:22px;height:22px;border-radius:999px;border:1px solid rgba(0,0,0,.12);cursor:pointer;padding:0}
.ophtho-hlswatch.yellow{background:#fdf0a3}
.ophtho-hlswatch.green{background:#c7ecc2}
.ophtho-hlswatch.pink{background:#fbccdb}
.ophtho-hlswatch.on{outline:2px solid #8a5a2b;outline-offset:1px}
.ophtho-anno-memobtn{appearance:none;cursor:pointer;font:inherit;font-size:12.5px;font-weight:700;border:0;border-left:1px solid #e2ddd0;background:none;color:#8a5a2b;padding:0 6px 0 10px;margin-left:2px}
/* 드래그 가능한 메모 카드 (여러 개 열어두고 스크롤) */
.ophtho-note-card{position:absolute;z-index:60;width:266px;background:#fffdf8;border:1px solid #e2ddd0;border-radius:11px;box-shadow:0 12px 34px rgba(60,45,20,.20);display:flex;flex-direction:column;overflow:hidden}
.ophtho-note-card.dragging{opacity:.94;box-shadow:0 18px 44px rgba(60,45,20,.3)}
.ophtho-note-card.flash{animation:ophtho-note-flash .65s ease}
@keyframes ophtho-note-flash{0%,100%{box-shadow:0 12px 34px rgba(60,45,20,.2)}45%{box-shadow:0 0 0 3px #b5803f,0 12px 34px rgba(60,45,20,.2)}}
.ophtho-note-card-head{display:flex;align-items:center;gap:7px;padding:8px 8px 8px 11px;background:#f6f0e4;border-bottom:1px solid #ece2cf;cursor:grab;touch-action:none;user-select:none}
.ophtho-note-card-head:active{cursor:grabbing}
.ophtho-note-card-dot{width:11px;height:11px;border-radius:999px;flex:none;border:1px solid rgba(0,0,0,.1)}
.ophtho-note-card-dot.ophtho-hl-yellow{background:#fdf0a3}.ophtho-note-card-dot.ophtho-hl-green{background:#c7ecc2}.ophtho-note-card-dot.ophtho-hl-pink{background:#fbccdb}
.ophtho-note-card-quote{flex:1;min-width:0;font-size:11.5px;color:#8a5a2b;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ophtho-note-card-x{border:0;background:none;color:#9a9384;font-size:19px;line-height:1;cursor:pointer;padding:0 3px}
.ophtho-note-card-x:hover{color:#23211c}
.ophtho-note-card-text{border:0;resize:vertical;min-height:88px;max-height:340px;padding:11px;font:inherit;font-size:13.5px;line-height:1.6;color:#2c261d;background:#fffdf8;outline:none}
.ophtho-note-card-foot{display:flex;align-items:center;gap:8px;padding:7px 10px;border-top:1px solid #ece2cf}
.ophtho-note-card-colors{display:flex;gap:5px;flex:1}
.ophtho-note-card-colors .ophtho-hlswatch{width:19px;height:19px}
.ophtho-note-card-del{border:1px solid #e2ddd0;background:#fff;border-radius:7px;color:#a3453a;font-size:11.5px;font-weight:750;padding:4px 10px;cursor:pointer}
.ophtho-note-card-del:hover{background:#fbeeec;border-color:#e3ada8}
.ophtho-anno-colors{display:flex;gap:10px;margin:0 0 12px}
.ophtho-anno-row .hl{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;vertical-align:middle}
.ophtho-anno-row .hl.yellow{background:#fdf0a3}.ophtho-anno-row .hl.green{background:#c7ecc2}.ophtho-anno-row .hl.pink{background:#fbccdb}
/* mobile: drop the long email from the cramped topbar (avatar stays) */
@media(max-width:720px){.topbar .who b{display:none}.topbar .who{padding:0 2px 0 4px}.topbar{gap:8px}.topbar .navlink{padding:6px 7px}}

/* ===== issue reporting (제보) ===== */
.ophtho-report-btn{appearance:none;cursor:pointer;font:inherit;font-size:11.5px;font-weight:800;border:1px solid #e3c9bd;border-radius:999px;background:#fff;color:#a05a3c;padding:3px 10px;white-space:nowrap;line-height:1.5}
.ophtho-report-btn:hover{border-color:#c98c6e;background:#fdf3ee}
.ophtho-report-btn.has-report{background:#b4552f;border-color:#b4552f;color:#fff}
.ophtho-report-btn.fig{display:inline-flex;margin-top:8px}
.ophtho-report-btn.chapter{display:inline-flex;margin-top:14px}
.ophtho-report-actions{display:flex;gap:8px;align-items:center}


/* ===================== AI에게 질문 위젯 ===================== */
.ophtho-ask-fab{position:fixed;right:18px;bottom:18px;z-index:9500;display:inline-flex;align-items:center;gap:8px;height:50px;padding:0 18px 0 15px;border:1px solid #d8cdb8;border-radius:999px;background:#8a5a2b;color:#fffdf8;font-size:14px;font-weight:850;cursor:pointer;box-shadow:0 12px 30px rgba(60,45,20,.28);transition:transform .12s ease,box-shadow .12s ease}
.ophtho-ask-fab:hover{transform:translateY(-2px);box-shadow:0 16px 36px rgba(60,45,20,.34)}
.ophtho-ask-fab .ico{font-size:19px;line-height:1}
.ophtho-ask-fab.hidden{display:none}
@media(max-width:560px){.ophtho-ask-fab .lbl{display:none}.ophtho-ask-fab{padding:0;width:52px;height:52px;justify-content:center}}

.ophtho-ask-panel{position:fixed;right:18px;bottom:18px;z-index:9600;display:none;flex-direction:column;width:min(400px,calc(100vw - 24px));height:min(640px,calc(100vh - 32px));background:#fffdf8;border:1px solid #e2ddd0;border-radius:16px;box-shadow:0 22px 60px rgba(60,45,20,.32);overflow:hidden}
.ophtho-ask-panel.open{display:flex;animation:askpop .16s ease}
@keyframes askpop{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.ophtho-ask-panel .ask-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #ece5d6;background:linear-gradient(180deg,#fbf6ea,#fffdf8)}
.ophtho-ask-panel .ask-title{font-size:14.5px;font-weight:850;color:#23211c;display:flex;align-items:center;gap:7px}
.ophtho-ask-panel .ask-title .dot{font-size:16px}
.ophtho-ask-panel .ask-x{appearance:none;border:none;background:transparent;color:#8a7f6b;font-size:15px;cursor:pointer;padding:4px 6px;border-radius:8px}
.ophtho-ask-panel .ask-x:hover{background:#f0ead9;color:#5a5043}

.ophtho-ask-panel .ask-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:12px;background:#fdfaf2}
.ophtho-ask-panel .ask-msg{display:flex;max-width:100%}
.ophtho-ask-panel .ask-msg.me{justify-content:flex-end}
.ophtho-ask-panel .ask-bubble{max-width:88%;border-radius:14px;padding:10px 12px;font-size:13.5px;line-height:1.62;box-shadow:0 2px 8px rgba(60,45,20,.06)}
.ophtho-ask-panel .ask-msg.me .ask-bubble{background:#8a5a2b;color:#fffdf8;border-bottom-right-radius:5px}
.ophtho-ask-panel .ask-msg.bot .ask-bubble{background:#fffdf8;color:#2c281f;border:1px solid #e7e0d0;border-bottom-left-radius:5px}
.ophtho-ask-panel .ask-text p{margin:0 0 7px}
.ophtho-ask-panel .ask-text p:last-child{margin-bottom:0}
.ophtho-ask-panel .ask-text strong{font-weight:850}
.ophtho-ask-panel .ask-badge{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:850;padding:2px 8px;border-radius:999px;margin-bottom:7px}
.ophtho-ask-panel .ask-badge.grounded{background:#e7f4f0;color:#0b6b5b}
.ophtho-ask-panel .ask-badge.general{background:#eef2f7;color:#3a5673}
.ophtho-ask-panel .ask-badge.limited{background:#f3edda;color:#8a5a2b}
.ophtho-ask-panel .ask-badge.error{background:#fbeceb;color:#b42318}

.ophtho-ask-panel .ask-refs{margin-top:9px;padding-top:9px;border-top:1px dashed #e0d8c6;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.ophtho-ask-panel .ask-refs-lbl{font-size:11px;font-weight:850;color:#9a8f79}
.ophtho-ask-panel .ask-ref-chip{display:inline-flex;align-items:center;font-size:11.5px;font-weight:800;text-decoration:none;color:#0b6b5b;background:#e7f4f0;border:1px solid #c6e4dc;border-radius:999px;padding:3px 9px}
.ophtho-ask-panel .ask-ref-chip:hover{background:#d7ede7;border-color:#0b6b5b}

.ophtho-ask-panel .ask-suggests{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.ophtho-ask-panel .ask-suggest{appearance:none;text-align:left;font-size:12.5px;font-weight:800;color:#5a5043;background:#fffdf8;border:1px solid #e2ddd0;border-radius:999px;padding:7px 12px;cursor:pointer;max-width:100%}
.ophtho-ask-panel .ask-suggest:hover{border-color:#b5803f;background:#fbf6ea;color:#8a5a2b}

.ophtho-ask-panel .ask-typing{display:flex;gap:4px;padding:3px 2px}
.ophtho-ask-panel .ask-typing span{width:7px;height:7px;border-radius:50%;background:#c3b79e;animation:askblink 1s infinite}
.ophtho-ask-panel .ask-typing span:nth-child(2){animation-delay:.18s}
.ophtho-ask-panel .ask-typing span:nth-child(3){animation-delay:.36s}
@keyframes askblink{0%,60%,100%{opacity:.3}30%{opacity:1}}

.ophtho-ask-panel .ask-input{display:flex;gap:8px;align-items:flex-end;padding:10px 12px;border-top:1px solid #ece5d6;background:#fffdf8}
.ophtho-ask-panel .ask-input textarea{flex:1;resize:none;border:1px solid #ded7c8;border-radius:12px;padding:9px 11px;font:inherit;font-size:13.5px;line-height:1.5;color:#23211c;background:#fdfaf2;max-height:120px;overflow-y:auto}
.ophtho-ask-panel .ask-input textarea:focus{outline:none;border-color:#b5803f;background:#fffdf8}
.ophtho-ask-panel .ask-send{flex:none;width:40px;height:40px;border:none;border-radius:12px;background:#8a5a2b;color:#fffdf8;font-size:16px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.ophtho-ask-panel .ask-send:hover{background:#754b22}
.ophtho-ask-panel .ask-send:disabled{opacity:.5;cursor:default}
.ophtho-ask-panel .ask-foot{padding:8px 14px;font-size:10.5px;color:#9a8f79;background:#fffdf8;border-top:1px solid #f0ead9;text-align:center}

/* ===================== 이미지 라이트박스 (클릭 확대) ===================== */
.ophtho-zoomable{cursor:zoom-in}
body.ophtho-lb-open{overflow:hidden}
.ophtho-lightbox{position:fixed;inset:0;z-index:10060;display:none;flex-direction:column;background:rgba(20,16,10,.9);backdrop-filter:blur(3px)}
.ophtho-lightbox.open{display:flex;animation:lbfade .15s ease}
@keyframes lbfade{from{opacity:0}to{opacity:1}}
.ophtho-lightbox .lb-bar{position:absolute;top:0;right:0;left:0;display:flex;justify-content:flex-end;gap:8px;padding:12px 14px;z-index:2}
.ophtho-lightbox .lb-btn{appearance:none;width:40px;height:40px;border:1px solid rgba(255,255,255,.25);border-radius:10px;background:rgba(0,0,0,.35);color:#fff;font-size:18px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.ophtho-lightbox .lb-btn:hover{background:rgba(255,255,255,.18)}
.ophtho-lightbox .lb-x{margin-left:6px}
.ophtho-lightbox .lb-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}
.ophtho-lightbox .lb-img{max-width:94vw;max-height:86vh;object-fit:contain;transform-origin:center center;transition:transform .08s ease-out;cursor:zoom-in;user-select:none;-webkit-user-drag:none;box-shadow:0 10px 40px rgba(0,0,0,.5);border-radius:4px;background:#fff}
.ophtho-lightbox.zoomed .lb-img{transition:none}
.ophtho-lightbox .lb-cap{flex:none;max-height:18vh;overflow:auto;padding:10px 16px 16px;color:#f3ece0;font-size:13px;line-height:1.5;text-align:center;background:linear-gradient(180deg,transparent,rgba(0,0,0,.35))}
.ophtho-lightbox .lb-cap:empty{display:none}
@media(max-width:560px){.ophtho-lightbox .lb-img{max-width:98vw;max-height:80vh}.ophtho-lightbox .lb-btn{width:44px;height:44px}}
/* Auth/sync state is intentionally visible: local storage is not the server. */
.ophtho-sync-status{font-size:.78rem;color:#667085;white-space:nowrap}
.ophtho-sync-status[data-state="syncing"]{color:#946200}
.ophtho-sync-status[data-state="synced"]{color:#067647}
.ophtho-sync-status[data-state="error"]{color:#b42318}
.ophtho-sync-status[data-state="offline"]{color:#946200}
.ophtho-lock-page{max-width:42rem;margin:12vh auto;padding:2rem;font-family:system-ui,-apple-system,sans-serif;line-height:1.65}
