/* Focused PDF Reader — desktop-first, touch-friendly. Emerald/gold house
   palette on a deep "midnight" green, like the Quran Online Mentor reader. */
:root {
  --midnight: #0a201b;
  --midnight-2: #0e2a23;
  --ivory: #fffdfa;
  --ivory-dim: rgba(255, 253, 250, 0.62);
  --ivory-faint: rgba(255, 253, 250, 0.42);
  --gold: #c9a227;
  --emerald: #0b5d3b;
  --line: rgba(255, 253, 250, 0.13);
  --panel: rgba(255, 255, 255, 0.05);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--midnight);
  color: var(--ivory);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: default; }
[hidden] { display: none !important; }

/* ============================ WELCOME ============================ */
#welcome {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 600px at 50% -10%, #14532d55, transparent),
              linear-gradient(160deg, var(--midnight) 0%, var(--midnight-2) 60%, #123528 100%);
  padding: 20px; overflow-y: auto;
}
.welcome-card { text-align: center; max-width: 640px; width: 100%; }
.logo-mark { font-size: 58px; line-height: 1; }
.welcome-card h1 {
  margin: 10px 0 6px; font-size: 34px; font-weight: 800; letter-spacing: 0.2px;
}
.welcome-sub { color: var(--ivory-dim); font-size: 15px; line-height: 1.55; margin: 0 0 22px; }
.big-open {
  background: linear-gradient(135deg, #dcb93f, var(--gold));
  color: #231a02; border: none; border-radius: 999px;
  font-size: 18px; font-weight: 800; padding: 15px 34px;
  box-shadow: 0 10px 30px rgba(201, 162, 39, 0.35);
}
.big-open:hover { filter: brightness(1.08); }
.drop-hint { color: var(--ivory-dim); font-size: 13.5px; line-height: 1.7; margin: 18px 0 0; }
.keys-hint { color: var(--ivory-faint); font-size: 12.5px; }
.welcome-error {
  margin: 16px auto 0; max-width: 480px; color: #ffb4a2; background: rgba(224, 49, 49, 0.14);
  border: 1px solid rgba(224, 49, 49, 0.45); border-radius: 12px; padding: 10px 14px; font-size: 13.5px;
}
#recentWrap { margin: 22px auto 0; max-width: 480px; text-align: left; }
.recent-title { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; margin: 0 0 8px; }
.recent-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line); color: var(--ivory);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px;
}
.recent-item:hover { background: rgba(255, 255, 255, 0.1); }
.recent-item .r-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.recent-item .r-meta { color: var(--ivory-faint); font-size: 12px; white-space: nowrap; }
.welcome-foot { color: var(--ivory-faint); font-size: 12px; margin: 26px 0 0; }

/* ============================ READER FRAME ============================ */
#reader { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--midnight); }
.titlebar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.title-text { flex: 1; min-width: 0; }
.doc-title { margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { margin: 1px 0 0; font-size: 12px; color: var(--ivory-dim); }
.prep { font-size: 12px; color: var(--ivory-dim); font-weight: 600; white-space: nowrap; }
.title-btn {
  flex: 0 0 auto; background: var(--panel); color: var(--ivory); border: 1px solid rgba(255,253,250,0.25);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; min-height: 40px;
}
.title-btn:hover { background: rgba(255,255,255,0.12); }

/* Tabs */
#tabbar {
  display: flex; align-items: stretch; gap: 4px; padding: 5px 10px 0;
  border-bottom: 1px solid var(--line); flex: 0 0 auto; overflow-x: auto; scrollbar-width: none;
}
#tabbar::-webkit-scrollbar { display: none; }
#tabs { display: flex; gap: 4px; align-items: stretch; }
.doc-tab {
  display: flex; align-items: center; gap: 8px; max-width: 230px;
  background: rgba(255,255,255,0.04); color: var(--ivory-dim);
  border: 1px solid var(--line); border-bottom: none; border-radius: 10px 10px 0 0;
  padding: 8px 8px 8px 13px; font-size: 13px; font-weight: 600; min-height: 40px;
}
.doc-tab.active { background: rgba(201,162,39,0.16); color: var(--ivory); border-color: rgba(201,162,39,0.5); }
.doc-tab .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-tab .t-close {
  background: none; border: none; color: inherit; font-size: 13px; line-height: 1;
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
}
.doc-tab .t-close:hover { background: rgba(255,255,255,0.18); }
#btnNewTab {
  background: none; border: 1px dashed rgba(255,253,250,0.3); color: var(--ivory-dim);
  border-radius: 10px; width: 40px; min-height: 40px; font-size: 17px; align-self: center;
}
#btnNewTab:hover { color: var(--ivory); border-color: var(--gold); }

/* Ribbon */
.ribbon {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px 4px;
  padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--panel); flex: 0 0 auto;
}
.rib {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 48px; height: 50px; padding: 3px 7px; border-radius: 12px;
  border: 1px solid rgba(255,253,250,0.25); background: transparent; color: var(--ivory);
}
.rib:hover { background: rgba(255,255,255,0.1); }
.rib.active { background: var(--gold); color: #231a02; border-color: var(--gold); }
.rib.gold-outline { border-color: rgba(201,162,39,0.75); color: var(--gold); }
.rib.gold-outline:hover { background: var(--gold); color: #231a02; }
.rib-ic { font-size: 17px; line-height: 1; }
.rib-lb { font-size: 9px; font-weight: 800; letter-spacing: 0.4px; white-space: nowrap; line-height: 1; }
.rib-sep { width: 1px; align-self: stretch; margin: 3px 3px; background: rgba(255,255,255,0.15); flex: 0 0 auto; }

/* Sub-bars (find / draw / read / help) */
.findbar, .drawbar, .readbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.07); flex: 0 0 auto;
}
.helpbar {
  padding: 9px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.07);
  font-size: 13px; line-height: 1.6; color: rgba(255,253,250,0.85); flex: 0 0 auto;
}
.helpbar strong { color: var(--gold); }
#findInput {
  flex: 1; min-width: 140px; border-radius: 999px; border: 1px solid rgba(255,253,250,0.3);
  background: var(--midnight); color: var(--ivory); padding: 9px 16px; font-size: 14px; outline: none; min-height: 40px;
}
#findInput:focus { border-color: var(--gold); }
#findInput::placeholder { color: var(--ivory-faint); }
.find-info { font-size: 13px; color: rgba(255,253,250,0.75); min-width: 100px; text-align: center; }
.pill {
  border-radius: 999px; border: 1px solid rgba(255,253,250,0.3); background: transparent; color: var(--ivory);
  padding: 0 15px; height: 40px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px;
}
.pill:hover { background: rgba(255,255,255,0.1); }
.pill.active { background: var(--gold); color: #231a02; border-color: var(--gold); }
.pill.gold { background: var(--gold); color: #231a02; border-color: var(--gold); }
.pill.gold:hover { filter: brightness(1.1); }
.pill.danger { border-color: rgba(224,49,49,0.6); color: #ffb4a2; }
.round {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid rgba(255,253,250,0.3); background: transparent; color: var(--ivory); font-size: 15px; flex: 0 0 auto;
}
.round:hover { background: rgba(255,255,255,0.1); }
.round.sm { width: 30px; height: 30px; font-size: 13px; }
.bar-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.15); }
.color-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); padding: 0; }
.color-dot.active { border-color: var(--ivory); }
.draw-opt { font-size: 13px; font-weight: 600; color: var(--ivory-dim); display: inline-flex; align-items: center; gap: 6px; }
.draw-opt select {
  background: var(--midnight); color: var(--ivory); border: 1px solid rgba(255,253,250,0.3);
  border-radius: 8px; padding: 7px 8px; font-size: 13px; min-height: 36px;
}
.draw-opt input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }
.draw-note { font-size: 12px; color: var(--ivory-faint); }
.read-title { font-weight: 800; font-size: 13.5px; }

/* Main area + sidebar */
#mainArea { flex: 1; min-height: 0; display: flex; position: relative; }
#sidebar {
  width: 196px; flex: 0 0 auto; border-right: 1px solid var(--line); background: var(--midnight-2);
  display: flex; flex-direction: column; min-height: 0;
}
.side-head { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.side-tab {
  flex: 1; background: transparent; border: 1px solid rgba(255,253,250,0.25); color: var(--ivory-dim);
  border-radius: 9px; padding: 8px 4px; font-size: 12.5px; font-weight: 700; min-height: 38px;
}
.side-tab.active { background: var(--gold); color: #231a02; border-color: var(--gold); }
.side-close { background: none; border: none; color: var(--ivory-dim); font-size: 15px; width: 34px; height: 38px; }
#thumbList, #outlineList { flex: 1; overflow-y: auto; padding: 10px; }
.thumb {
  display: block; width: 100%; background: none; border: 2px solid transparent; border-radius: 10px;
  padding: 5px; margin-bottom: 8px; color: var(--ivory-dim); text-align: center;
}
.thumb img { width: 100%; display: block; border-radius: 5px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.thumb .th-num { font-size: 11.5px; font-weight: 700; margin-top: 4px; display: block; }
.thumb.active { border-color: var(--gold); color: var(--gold); }
.outline-item {
  display: block; width: 100%; text-align: left; background: none; border: none; color: var(--ivory);
  font-size: 13.5px; padding: 9px 8px; border-radius: 8px; line-height: 1.4;
}
.outline-item:hover { background: rgba(255,255,255,0.08); }
.outline-empty { color: var(--ivory-faint); font-size: 13px; padding: 10px 6px; line-height: 1.6; }

/* Stage */
#stage { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; background: radial-gradient(900px 500px at 50% 0%, #14532d33, transparent), var(--midnight); }
#flipWrap { position: absolute; inset: 0; overflow: auto; }
#scrollContent { min-width: 100%; min-height: 100%; width: max-content; display: flex; }
#sizer { margin: auto; position: relative; flex: 0 0 auto; }
#rotator { position: absolute; }
#mount { position: absolute; inset: 0; }
#annoSvg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 10; }
#textLayer { position: absolute; inset: 0; z-index: 11; overflow: hidden; }
#textLayer span {
  position: absolute; color: transparent; white-space: pre; transform-origin: 0 0;
  line-height: 1; cursor: text; user-select: text; -webkit-user-select: text;
}
#textLayer span::selection { background: rgba(201, 162, 39, 0.45); }
#noteInput {
  position: absolute; z-index: 20; width: 200px; border: 2px solid var(--gold); border-radius: 9px;
  background: #fff; color: #063d24; padding: 6px 9px; font-size: 15px; font-weight: 600; outline: none;
}
#statusOverlay {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none;
}
#statusOverlay p {
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 20px; font-size: 14.5px; color: rgba(255,253,250,0.88); margin: 0;
}
#scrollWrap { position: absolute; inset: 0; overflow-y: auto; overflow-x: auto; padding: 18px 0 30px; }
.page-block { position: relative; margin: 0 auto 18px; box-shadow: 0 6px 30px rgba(0,0,0,0.5); background: #fff; }
.page-block img { display: block; width: 100%; height: 100%; }
.page-block .pb-num {
  position: absolute; right: 8px; bottom: 6px; background: rgba(10,32,27,0.75); color: var(--ivory);
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; pointer-events: none;
}
.page-block .pb-text { position: absolute; inset: 0; overflow: hidden; }
.page-block .pb-text span { position: absolute; color: transparent; white-space: pre; transform-origin: 0 0; line-height: 1; user-select: text; -webkit-user-select: text; }
.page-block .pb-text span::selection { background: rgba(201, 162, 39, 0.45); }

#marqueeOverlay { position: absolute; inset: 0; z-index: 15; cursor: crosshair; touch-action: none; }
#marqueeRect { position: absolute; border: 2px solid var(--gold); background: rgba(201,162,39,0.16); }
#lens {
  position: fixed; z-index: 95; border-radius: 50%; border: 3px solid var(--gold);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55); overflow: hidden; pointer-events: none; background: #fff;
}
#lensImg { position: absolute; max-width: none; }
#lensControls {
  position: absolute; right: 12px; bottom: 12px; z-index: 25; display: flex; align-items: center; gap: 6px;
  background: rgba(10,32,27,0.92); border: 1px solid rgba(255,253,250,0.25); border-radius: 999px; padding: 6px 10px;
}
.lc-label { font-size: 12px; font-weight: 700; color: var(--ivory-dim); }

/* Reading modes (page-surface filters) */
body[data-readmode="night"] .filterable { filter: invert(1) hue-rotate(180deg); }
body[data-readmode="sepia"] .filterable { filter: sepia(0.55) brightness(0.96) contrast(0.96); }

/* Bottom bar */
.bottombar {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 14px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel);
}
.bb-group { display: flex; align-items: center; gap: 7px; }
#pageLabel { font-size: 14px; font-weight: 700; min-width: 86px; text-align: center; white-space: nowrap; }
#pageLabel .dim { color: var(--ivory-dim); font-weight: 600; }
#jumpInput {
  width: 62px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,253,250,0.3);
  background: var(--midnight); color: var(--ivory); text-align: center; font-size: 14px; outline: none;
}
#jumpInput:focus { border-color: var(--gold); }
#jumpInput::placeholder { color: var(--ivory-faint); font-size: 12.5px; }
#zoomPct { font-size: 13.5px; font-weight: 700; min-width: 48px; text-align: center; }
#zoomPreset {
  background: var(--midnight); color: var(--ivory); border: 1px solid rgba(255,253,250,0.3);
  border-radius: 9px; padding: 8px 6px; font-size: 13px; min-height: 38px;
}
#zoomSlider { width: 130px; accent-color: var(--gold); }
.keys-strip { flex: 0 0 auto; margin: 0; text-align: center; font-size: 11px; color: var(--ivory-faint); padding: 4px 10px 6px; }

/* Drop overlay */
#dropOverlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(10, 32, 27, 0.82);
  display: grid; place-items: center; pointer-events: none;
}
.drop-box {
  border: 3px dashed var(--gold); border-radius: 22px; padding: 44px 60px;
  font-size: 22px; font-weight: 800; color: var(--gold); background: rgba(201,162,39,0.08);
}

/* Narrow screens (phones): sidebar floats over the stage */
@media (max-width: 760px) {
  .welcome-card h1 { font-size: 27px; }
  #sidebar { position: absolute; z-index: 40; top: 0; bottom: 0; left: 0; box-shadow: 12px 0 30px rgba(0,0,0,0.45); }
  #zoomSlider { width: 74px; }
  #pageLabel { min-width: 70px; font-size: 13px; }
  .keys-strip { display: none; }
  .rib { min-width: 44px; height: 48px; }
}

/* ============================ EXTRAS ============================ */
#stickyLayer { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.sticky-pin {
  position: absolute; pointer-events: auto; transform: translate(-30%, -85%);
  background: #ffe066; border: 1px solid #d9a406; border-radius: 8px 8px 8px 2px;
  font-size: 15px; line-height: 1; padding: 4px 5px; box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}
.sticky-pin:hover { background: #ffdf5e; }
#gridOverlay {
  position: absolute; inset: 0; z-index: 9; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.33% - 1px), rgba(201,162,39,0.55) 33.33%, transparent calc(33.33% + 1px)),
    linear-gradient(to right, transparent calc(66.66% - 1px), rgba(201,162,39,0.55) 66.66%, transparent calc(66.66% + 1px)),
    linear-gradient(to bottom, transparent calc(33.33% - 1px), rgba(201,162,39,0.55) 33.33%, transparent calc(33.33% + 1px)),
    linear-gradient(to bottom, transparent calc(66.66% - 1px), rgba(201,162,39,0.55) 66.66%, transparent calc(66.66% + 1px)),
    linear-gradient(to right, rgba(255,253,250,0.13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,253,250,0.13) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 10% 10%, 10% 10%;
}
#rulerTop {
  position: absolute; top: 0; left: 0; right: 0; height: 22px; z-index: 26; pointer-events: none;
  background: rgba(10,32,27,0.9); border-bottom: 1px solid var(--line); overflow: hidden;
}
#rulerLeft {
  position: absolute; top: 0; left: 0; bottom: 0; width: 22px; z-index: 26; pointer-events: none;
  background: rgba(10,32,27,0.9); border-right: 1px solid var(--line); overflow: hidden;
}
.ruler-tick { position: absolute; background: rgba(255,253,250,0.5); }
.ruler-num { position: absolute; font-size: 9px; color: var(--ivory-dim); font-weight: 700; }

/* Split / compare pane */
#splitPane {
  width: 44%; min-width: 260px; flex: 0 0 auto; border-left: 2px solid rgba(201,162,39,0.45);
  background: var(--midnight-2); display: flex; flex-direction: column; min-height: 0;
}
.split-head { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.split-head select {
  flex: 1; min-width: 0; background: var(--midnight); color: var(--ivory);
  border: 1px solid rgba(255,253,250,0.3); border-radius: 9px; padding: 9px; font-size: 13.5px; min-height: 40px;
}
.split-body { flex: 1; min-height: 0; overflow: auto; display: flex; padding: 14px; }
.split-body img { margin: auto; max-width: 100%; box-shadow: 0 6px 30px rgba(0,0,0,0.5); background: #fff; }
.split-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; border-top: 1px solid var(--line); }
#splitLabel { font-size: 13.5px; font-weight: 700; min-width: 64px; text-align: center; }
.split-name { margin: 0; padding: 0 10px 8px; font-size: 12px; color: var(--ivory-dim); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Focus (distraction-free) mode */
#reader.focus .ribbon, #reader.focus #tabbar, #reader.focus .bottombar,
#reader.focus .keys-strip, #reader.focus .titlebar, #reader.focus #extrasBar,
#reader.focus #findBar, #reader.focus .drawbar, #reader.focus .readbar, #reader.focus .helpbar { display: none !important; }
#btnExitFocus {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 120;
  background: rgba(10,32,27,0.92); color: var(--ivory); border: 1px solid rgba(201,162,39,0.6);
  border-radius: 999px; padding: 10px 20px; font-size: 13.5px; font-weight: 700;
}

/* Modal */
#modalOverlay {
  position: fixed; inset: 0; z-index: 150; background: rgba(4, 14, 11, 0.72);
  display: grid; place-items: center; padding: 16px;
}
#modalCard {
  background: var(--midnight-2); border: 1px solid rgba(201,162,39,0.4); border-radius: 18px;
  width: min(680px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 8px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 19px; }
#modalBody { padding: 6px 18px 18px; overflow-y: auto; font-size: 14.5px; line-height: 1.55; }
#modalBody p { margin: 8px 0; }
.m-note { color: var(--ivory-dim); font-size: 13px; }
.m-warn { color: #ffd8a8; font-size: 13px; }
.m-input, .m-textarea, .m-select {
  width: 100%; background: var(--midnight); color: var(--ivory);
  border: 1px solid rgba(255,253,250,0.3); border-radius: 12px;
  padding: 11px 14px; font-size: 14.5px; outline: none; font-family: inherit;
}
.m-input:focus, .m-textarea:focus { border-color: var(--gold); }
.m-textarea { min-height: 110px; resize: vertical; }
.m-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.m-row .m-input { flex: 1; width: auto; }
.m-btn {
  background: var(--gold); color: #231a02; border: none; border-radius: 999px;
  padding: 11px 20px; font-size: 14px; font-weight: 800; min-height: 42px;
}
.m-btn:hover { filter: brightness(1.08); }
.m-btn.ghost { background: transparent; color: var(--ivory); border: 1px solid rgba(255,253,250,0.35); }
.m-btn.danger { background: transparent; color: #ffb4a2; border: 1px solid rgba(224,49,49,0.55); }
.m-list { margin: 8px 0; }
.m-item {
  display: flex; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; margin-bottom: 8px;
}
.m-item .grow { flex: 1; min-width: 0; }
.m-item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item .s { font-size: 12.5px; color: var(--ivory-dim); }
.m-big { font-size: 22px; font-weight: 800; color: var(--gold); }
.sig-pad { background: #fff; border-radius: 12px; width: 100%; touch-action: none; cursor: crosshair; }
.kbd-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.kbd-row label { flex: 1; }
.kbd-row input {
  width: 58px; text-align: center; background: var(--midnight); color: var(--ivory);
  border: 1px solid rgba(255,253,250,0.3); border-radius: 9px; padding: 9px; font-size: 15px; font-weight: 700;
}
.dict-word { font-size: 20px; font-weight: 800; color: var(--gold); }
.dict-ur { font-size: 19px; direction: rtl; text-align: right; font-weight: 700; }
canvas.hw-pad { background: #fff; border-radius: 12px; width: 100%; touch-action: none; cursor: crosshair; }
