:root{
  --bg:#F3EEE4;
  --paper:#FBF7EF;
  --ink:#1F2937;
  --muted:#4B5563;
  --accent:#B56A2A;
  --radius:20px;
  --shadow: 0 18px 45px rgba(30,20,10,.18);
  --paper-shadow: 0 12px 28px rgba(30,20,10,.14);
  --border: 1px solid rgba(60,40,20,.10);
  --control-h: 84px;
  --maxw: 1100px;
}

[data-theme="dark"]{
  --ink:#E5E7EB;
  --muted:#9CA3AF;
  --border: 1px solid rgba(255,255,255,.08);
}


.reader-shell{
  width:min(var(--maxw), 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(251,247,239,.84));
  border: var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 22px;
  position:relative;
  overflow:hidden;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(6px);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.reader-focus{ overflow: hidden; }
body.reader-focus .row.g-4 > .col-lg-8 > *:not(#reader){ display: none !important; }
body.reader-focus .row.g-4 > .col-lg-4{ display: none !important; }
body.reader-focus #reader{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  z-index: 3000;
}
body.reader-focus #reader .header{ display: none; }
body.reader-focus #reader .mini-stats,
body.reader-focus #reader .progress-wrap,
body.reader-focus #reader .hint{
  display: none;
}
body.reader-focus #reader .content{
  flex: 1;
  justify-content: center;
}
body.reader-focus #reader .paper-card{
  background: transparent;
  box-shadow: none;
  border: none;
}

[data-theme="dark"] .reader-shell{
  background: #111;
}
[data-theme="dark"] .reader-shell .paper-card{
  border-color: rgba(255,255,255,.08);
}

#reader.focus-mode,
#reader.reader-fullscreen{
  background-image: url('/static/images/okuyorumback.png');
  background-size: cover;
  background-position: center;
}

.reader-shell::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(circle at 20% 0%, rgba(181,106,42,.08), transparent 45%),
              radial-gradient(circle at 80% 20%, rgba(150,83,33,.06), transparent 40%);
  opacity: .55;
  pointer-events:none;
}

.reader-shell > *{
  position:relative;
  z-index:1;
}

.reader-shell.reader-hidden{
  display: none;
}

.reader-shell .header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding: 6px 6px 14px;
  flex-wrap: wrap;
}

.reader-shell .title-wrap{ min-width:0; }
.reader-shell .title{
  font-size: 26px;
  font-weight: 800;
  line-height:1.15;
  letter-spacing: -0.3px;
  margin: 2px 0 8px;
  white-space:normal;
  overflow:hidden;
  text-overflow:ellipsis;
  word-break: break-word;
  max-width: 760px;
}
.reader-shell .meta{
  display:flex;
  background: #F9FAFB;
  color: var(--muted);
  font-size: 14px;
  flex-wrap:wrap;
}
.reader-shell .pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: rgba(255,255,255,.55);
  border: var(--border);
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(30,20,10,.07);
  white-space:nowrap;
}

.reader-shell .actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex:0 0 auto;
}
.reader-shell .btn{
  border: var(--border);
  background: rgba(255,255,255,.65);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
  box-shadow: 0 8px 18px rgba(30,20,10,.08);
}
.reader-shell .btn:focus{ outline: 3px solid rgba(181,106,42,.25); outline-offset:2px; }
.reader-shell .btn.primary{
  background: linear-gradient(180deg, rgba(181,106,42,.95), rgba(150,83,33,.95));
  color: #fff;
  border: 1px solid rgba(150,83,33,.6);
  box-shadow: 0 14px 24px rgba(150,83,33,.22);
}
.reader-shell .btn.ghost{ background: rgba(255,255,255,.5); }
.reader-shell .btn svg{
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.reader-shell .content{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.reader-shell .paper-card{
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--paper-shadow);
  padding: 22px;
  position:relative;
  overflow:hidden;
  min-height: 260px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.reader-shell .paper-card::before{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: .06;
  pointer-events:none;
  mix-blend-mode:multiply;
  z-index: 1;
}
.reader-shell .paper-card::after{
  content:"";
  position:absolute; inset:12px;
  border-radius: calc(var(--radius) - 10px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(60,40,20,.12);
  pointer-events:none;
  z-index: 1;
}

.reader-shell .word-zone{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding: 16px 12px 10px;
  text-align:center;
  flex:1;
  background: #F9FAFB;
  border-radius: 18px;
  border: 1px solid rgba(17,24,39,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

[data-theme="dark"] .reader-shell .word-zone{
  background: #0B0F14;
  border-color: rgba(255,255,255,.12);
  box-shadow: none;
}

.reader-shell .orp-line{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  user-select: none;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 5vw, 86px);
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.02;
}

.reader-shell .orp-line .pre{ justify-self:end; color: #b56a2a; }
.reader-shell .orp-line .orp{
  justify-self:center;
  padding: 0 .06em;
  color: var(--ink);
  text-shadow: none;
}
.reader-shell .orp-line .suf{
  justify-self:start;
  color: var(--ink);
}
.reader-shell .orp-line .suf .suf-char{ color: #b56a2a; }
.reader-shell .orp-line .suf .suf-punct{ color: var(--ink); }
[data-theme="dark"] .reader-shell .orp-line .pre,
[data-theme="dark"] .reader-shell .orp-line .suf .suf-char{
  color: #f2c089;
}
[data-theme="dark"] .reader-shell .orp-line .suf .suf-punct{
  color: var(--ink);
}

.reader-shell .block-rest{
  margin-top: 8px;
  text-align:center;
  font-size: 18px;
  color: rgba(43,42,39,.72);
}
.reader-shell .hint{
  font-size: 13px;
  color: var(--muted);
  opacity:.85;
}

.reader-shell .mini-stats{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  color: var(--muted);
  font-size: 13px;
  opacity: .92;
  padding-bottom: 6px;
  flex-wrap:wrap;
}
.reader-shell .mini-stats span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,.6);
  border: var(--border);
  border-radius: 999px;
  padding: 8px 12px;
}

.reader-shell .progress-wrap{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 2px 8px 0;
}
.reader-shell .bar{
  position:relative;
  height: 10px;
  border-radius:999px;
  background: rgba(60,40,20,.10);
  overflow:hidden;
  flex:1;
  border: 1px solid rgba(60,40,20,.10);
}
.reader-shell .bar > i{
  display:block;
  height:100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(181,106,42,.85), rgba(150,83,33,.85));
  border-radius:999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.reader-shell .pct{
  min-width:52px;
  text-align:right;
  font-weight:800;
  color: var(--muted);
}

.reader-shell .reader-hint{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(43,42,39,.75);
  background: rgba(255,255,255,.6);
  border: var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.reader-shell .controls{
  height: var(--control-h);
  background: rgba(255,255,255,.55);
  border: var(--border);
  border-radius: 999px;
  box-shadow: 0 12px 22px rgba(30,20,10,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 14px;
  gap:14px;
  flex-wrap: wrap;
  height: auto;
}

.reader-shell .cluster{ display:flex; align-items:center; gap:10px; }
.reader-shell .font-quick{
  background: rgba(255,255,255,.7);
  border: var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  gap:8px;
  box-shadow: 0 8px 16px rgba(30,20,10,.08);
}
.reader-shell .font-quick .font-val{
  min-width: 52px;
  text-align:center;
  font-weight: 800;
  color: var(--ink);
  font-size: 13px;
}
.reader-shell .icon-btn.small{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
}
.reader-shell .icon-btn{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(150,83,33,.35);
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 20px rgba(30,20,10,.12);
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size: 20px;
  color: #3b2c1a;
}
.reader-shell .icon-btn svg{
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.reader-shell .icon-btn:focus{ outline: 3px solid rgba(181,106,42,.25); outline-offset:2px; }
.reader-shell .icon-btn.primary{
  width: 62px;
  height: 62px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 45%),
              linear-gradient(180deg, rgba(181,106,42,.95), rgba(150,83,33,.95));
  color: #fff;
  border: 1px solid rgba(150,83,33,.60);
  box-shadow: 0 18px 28px rgba(150,83,33,.25);
  font-size: 22px;
}

.reader-shell .icon-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 24px rgba(30,20,10,.16);
}
.reader-shell .kbd{
  font-size: 12px;
  color: rgba(43,42,39,.75);
  background: rgba(255,255,255,.6);
  border: var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  user-select:none;
}

.source-panel{
  margin-top: 12px;
  background: rgba(255,255,255,.75);
  border: var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(30,20,10,.10);
  display:none;
  overflow:hidden;
}
.source-panel.open{ display:block; }
.source-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(60,40,20,.10);
  background: rgba(255,255,255,.6);
}
.source-body{
  padding: 12px 14px;
  max-height: 220px;
  overflow:auto;
  line-height:1.6;
  color: var(--muted);
}
.source-word{ padding: 0 2px; border-radius: 6px; }
.source-word.active{ background: rgba(181,106,42,.18); color: var(--ink); font-weight: 700; }
.source-word.note{ position: relative; }
.source-word.note::after{
  content:"";
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  margin-left:4px;
  background: rgba(181,106,42,.9);
  transform: translateY(-1px);
}
.source-word.note-quote{
  background: #fff3a0;
  border-radius: 6px;
}
.source-word.note-quote::after{ background: rgba(181,106,42,.9); }
.source-word.note-personal::after{ background: rgba(80,120,160,.9); }

.article-quote{
  background: #fff3a0;
  border-radius: 6px;
  padding: 0 2px;
  box-shadow: inset 0 -1px 0 rgba(181,106,42,.25);
}
.article-quote-has-note{ cursor: pointer; }

.backdrop{
  position:fixed; inset:0;
  background: rgba(20,14,8,.35);
  display:none;
  z-index:1990;
}
.backdrop.open{ display:block; }
.drawer{
  position:fixed;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width:min(680px, calc(100% - 24px));
  max-height: 80svh;
  background: var(--paper);
  border: var(--border);
  border-radius: 18px;
  box-shadow: 0 -22px 40px rgba(30,20,10,.25);
  z-index:2000;
  transition: opacity .2s ease, transform .2s ease;
  overflow:hidden;
  opacity: 0;
  pointer-events: none;
}
.drawer.open{ opacity: 1; pointer-events: auto; }
.drawer::before{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: .05;
  pointer-events:none;
  mix-blend-mode:multiply;
}
.drawer-head{
  position:relative;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom: 1px solid rgba(60,40,20,.10);
  z-index:1;
}
.drawer-title{ font-weight: 900; letter-spacing:-.2px; }
.drawer-body{
  position:relative;
  padding: 16px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px 18px;
  z-index:1;
  max-height: calc(80svh - 110px);
  overflow: auto;
}
.field{
  background: rgba(255,255,255,.6);
  border: var(--border);
  border-radius: 16px;
  padding: 12px;
}
.label{
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
input[type="range"]{ width:100%; }
input[type="number"]{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(60,40,20,.18);
  background: rgba(255,255,255,.85);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.seg{
  display:flex;
  gap:8px;
}
.seg button{
  flex:1;
  border: var(--border);
  border-radius: 12px;
  padding: 10px 10px;
  background: rgba(255,255,255,.75);
  font-weight: 900;
  cursor:pointer;
}
.seg button.active{
  background: linear-gradient(180deg, rgba(181,106,42,.95), rgba(150,83,33,.95));
  color:#fff;
  border-color: rgba(150,83,33,.60);
}
.row{
  grid-column: 1 / -1;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.chip{
  border: var(--border);
  background: rgba(255,255,255,.75);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  cursor:pointer;
  user-select:none;
}
.toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.switch{
  width: 46px; height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(60,40,20,.18);
  background: rgba(60,40,20,.12);
  position:relative;
  cursor:pointer;
  flex: 0 0 auto;
}
.switch i{
  width: 22px; height: 22px;
  background: rgba(255,255,255,.95);
  border-radius: 999px;
  position:absolute; top:2px; left:2px;
  transition: left .14s ease;
  box-shadow: 0 6px 12px rgba(30,20,10,.18);
}
.switch.on{
  background: rgba(181,106,42,.35);
  border-color: rgba(181,106,42,.45);
}
.switch.on i{ left: 22px; }

.popup{
  position: fixed;
  left:50%;
  top: 18%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  max-height: calc(100svh - 32px);
  background: var(--paper);
  border: var(--border);
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(30,20,10,.24);
  z-index: 2010;
  display:none;
  overflow:hidden;
}
.reader-shell #dictPopup{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  transform: none;
  border-radius: 20px;
}
.reader-shell #notePopup.popup-full{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  transform: none;
  border-radius: 20px;
}
.reader-shell #dictPopup .popup-body{
  max-height: calc(100% - 64px);
  height: calc(100% - 64px);
}
.reader-shell #notePopup.popup-full .popup-body{
  max-height: calc(100% - 64px);
  height: calc(100% - 64px);
}
.reader-shell #dictPopup .popup-head{
  position: sticky;
  top: 0;
  z-index: 2;
}
.reader-shell #notePopup.popup-full .popup-head{
  position: sticky;
  top: 0;
  z-index: 2;
}
.popup.popup-anchored{
  transform: none;
}
.popup.popup-inline{
  position: absolute;
  z-index: 50;
}

.soft-card#articleCard{
  position: relative;
}
.popup.open{ display:block; }
.popup-head{
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom: 1px solid rgba(60,40,20,.10);
  background: rgba(255,255,255,.6);
  gap:10px;
}
.popup-title{
  font-weight: 950;
  letter-spacing:-.2px;
  display:flex;
  align-items:center;
  gap:10px;
}
.popup-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}
.icon-action{
  border: 1px solid rgba(150,83,33,.35);
  background: rgba(255,255,255,.85);
  color: #3b2c1a;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size: 16px;
}
.icon-action.mini{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
}
.popup-body{
  padding: 14px;
  color: var(--ink);
  line-height:1.4;
  max-height: calc(100svh - 140px);
  overflow: auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}
#notesExportText{
  width:100%;
  border: var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: 13px;
  height: 240px;
  max-height: 240px;
  resize: none;
  overflow: auto;
}
.notes-dump{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  flex:1;
  min-height: 0;
  height: 100%;
}
.notes-dump-list{
  border: var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.8);
  height: 100%;
  max-height: none;
  overflow: auto;
  min-height: 0;
}
.notes-dump-detail{
  border: var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,.9);
  height: 100%;
  max-height: none;
  display:grid;
  grid-template-rows: 1fr 1fr;
  gap:10px;
  overflow: hidden;
  min-height: 0;
}
.notes-dump-title{ font-weight: 900; font-size: 14px; color: var(--ink); }
.notes-dump-meta{ font-size: 12px; color: var(--muted); line-height: 1.4; }
.notes-dump-quote{
  font-style: italic;
  color: var(--ink);
}
.notes-dump-quote span{ quotes: "\201C" "\201D"; }
.notes-dump-quote span:before{ content: open-quote; }
.notes-dump-quote span:after{ content: close-quote; }
.notes-dump-personal{ color: var(--ink); }
.notes-section{ margin-bottom: 10px; }
.notes-section{
  border: 1px solid rgba(60,40,20,.08);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.75);
}
.notes-row{
  width:100%;
  display:grid;
  grid-template-columns: auto 1fr auto auto;
  gap:6px;
  align-items:center;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 6px 10px;
  cursor:pointer;
  text-align:left;
}
.notes-row:focus-visible{
  outline: 2px solid rgba(181,106,42,.35);
  outline-offset: 2px;
}
.notes-row + .notes-row{ margin-top:0; border-top: 1px solid rgba(60,40,20,.06); }
.notes-row.selection{ border-color: rgba(181,106,42,.35); }
.notes-row.manual{ border-color: rgba(80,120,160,.35); }
.notes-row-badge{
  font-size: 10px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(181,106,42,.15);
  color: #7a421c;
}
.notes-row-text{
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notes-row-input{
  font-size: 13px;
  color: var(--ink);
  border: none;
  background: transparent;
  padding: 2px 4px;
  border-radius: 6px;
  width: 100%;
}
.notes-row-input:focus{
  outline: 2px solid rgba(181,106,42,.25);
  background: rgba(255,255,255,.9);
}
.notes-row-meta{
  font-size: 11px;
  color: var(--muted);
}
.notes-row-actions{
  display:flex;
  gap:4px;
}
.notes-row.deleted{
  opacity: .55;
  text-decoration: line-through;
}
.notes-dump-input{
  width:100%;
  border: var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.95);
  color: var(--ink);
  font-size: 13px;
  height: 100%;
  resize: none;
  min-height: 0;
}
.notes-dump-input[readonly]{
  background: rgba(250,248,240,.9);
  color: #5a5147;
}
.notes-dump-input#notesDumpTitle{
  font-weight: 900;
}
.notes-dump-detail .notes-dump-input#notesDumpTitle,
.notes-dump-detail #notesDumpMeta{
  display:none;
}
#notesDumpQuote{
  font-style: italic;
}
#notesDumpQuote::before,
#notesDumpQuote::after{
  content: '';
}
#notesExportText{
  height: 220px;
  max-height: 220px;
  overflow: auto;
  resize: none;
}
.popup-body{
  max-height: calc(100svh - 140px);
  overflow: auto;
}
.notes-dump-input#notesDumpQuote{
  font-style: italic;
}
.notes-dump-export textarea{ max-height: 320px; }

@media (max-width: 760px){
  .notes-dump{ grid-template-columns: 1fr; }
}
.note-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom: 0;
}
.note-status{
  font-size: 12px;
  color: var(--muted);
}

.article-context-menu{
  position: fixed;
  left: 0;
  top: 0;
  transform: none;
  background: #fffdf4;
  border: 1px solid rgba(188,154,40,.35);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(120,90,10,.2);
  z-index: 4020;
  display: none;
  padding: 6px;
  min-width: 180px;
}
.article-context-menu.open{ display: block; }
.article-context-menu button{
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  border-radius: 8px;
  font-weight: 700;
  color: #3b2c1a;
  cursor: pointer;
}
.article-context-menu button:hover{
  background: rgba(181,106,42,.12);
}

.postit{
  background: #fff5b1;
  border: 1px solid rgba(188,154,40,.45);
  box-shadow: 0 18px 36px rgba(120,90,10,.28);
}
.postit.postit-anchored{
  transform: none;
}
.postit .popup-head{
  background: rgba(255,235,140,.9);
}
.postit-title{
  font-weight: 900;
  margin-bottom: 6px;
}
.postit-body{
  white-space: pre-wrap;
  line-height: 1.45;
}
.note-edit{
  display:grid;
  gap:8px;
  margin-bottom: 12px;
}
.note-label{ font-size: 12px; font-weight: 800; color: var(--muted); }
.note-edit input{
  width:100%;
  border: var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
}
.note-edit textarea{
  width:100%;
  border: var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
}
.note-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.note-empty{ color: var(--muted); font-size: 13px; padding: 6px 2px; }
.note-item{
  border: var(--border);
  background: rgba(255,255,255,.75);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 8px 16px rgba(30,20,10,.08);
}
.note-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom: 6px;
}
.note-title{
  font-weight: 900;
  font-size: 13px;
  color: var(--ink);
}
.note-context{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.note-quote,
.note-personal{
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}
.note-badge{
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}
.note-badge-selection{ background: rgba(181,106,42,.15); color: #7a421c; border: 1px solid rgba(181,106,42,.3); }
.note-badge-manual{ background: rgba(80,120,160,.15); color: #334455; border: 1px solid rgba(80,120,160,.3); }
.note-time{ font-size: 11px; color: var(--muted); }
.note-text{ font-size: 14px; color: var(--ink); line-height: 1.35; }
.note-item .note-actions{ justify-content: flex-end; margin-top: 8px; }
.close-x{
  border: var(--border);
  background: rgba(255,255,255,.8);
  border-radius: 12px;
  width: 36px;
  height: 36px;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-weight: 950;
}

@media (max-width: 760px){
  .reader-shell{ padding: 14px; border-radius: 22px; }
  .reader-shell .header{ flex-direction:column; align-items:stretch; }
  .reader-shell .title{ max-width:100%; font-size:22px; }
  .reader-shell .actions{ justify-content:flex-end; }
  .reader-shell .paper-card{ min-height: 240px; }
  .drawer-body{ grid-template-columns: 1fr; }
  .reader-shell .controls{ height: auto; padding: 10px; gap:8px; }
  .reader-shell .cluster{ flex-wrap: nowrap; gap:6px; }
  .reader-shell .cluster:last-child{ flex-wrap: wrap; justify-content:center; }
  .reader-shell .font-quick{ padding: 4px 8px; gap:6px; }
  .reader-shell .font-quick .font-val{ min-width: 44px; font-size: 12px; }
  .reader-shell .icon-btn{ width: 36px; height: 36px; font-size: 14px; }
  .reader-shell .icon-btn.small{ width: 30px; height: 30px; font-size: 12px; }
  .reader-shell .icon-btn.primary{ width: 48px; height: 48px; font-size: 18px; }
  .reader-shell .kbd{ width: 100%; text-align: center; }
  .reader-shell .font-quick{ width: 100%; justify-content: center; }
}

@media (max-width: 520px){
  .reader-shell .meta{ gap:8px; font-size: 12px; }
  .reader-shell .pill{ padding: 6px 10px; }
  .reader-shell .actions{ width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .reader-shell .icon-btn{ width: 40px; height: 40px; font-size: 16px; }
  .reader-shell .icon-btn.primary{ width: 52px; height: 52px; font-size: 20px; }
  .reader-shell .controls{ border-radius: 20px; }
}
