﻿/*
 * ================================================================
 * STYLES â€” á‹á‹²á‰µ áŠ£áŒ‹áŠ•áŠ•á‰µ áŠ¥áŠ•áŠ­áŒ‹áˆˆáŒ½
 * ================================================================
 *
 * ALL COLOURS ARE IN THE :root section at the top.
 * Change a colour there and it updates everywhere.
 *
 * SECTIONS IN THIS FILE:
 *   1. Reset & Variables
 *   2. Cover / Splash Page
 *   3. App Shell & Top Bar
 *   4. Side Drawer
 *   5. Reader â€” White Book Pages
 *   6. Lock Screen
 *   7. Toast Notification
 *   8. Responsive (mobile)
 *
 * ================================================================
 */

/* ================================================================
   1. RESET & VARIABLES
   ================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* â”€â”€ Cover colours â”€â”€ */
  --cover-bg-top:    #1a2736;
  --cover-bg-mid:    #2d4458;
  --cover-bg-btm:    #0f161e;
  --cover-glow:      rgba(70,110,150,0.55);
  --cover-sep:       rgba(90,138,176,0.6);
  --title-color:     #ffffff;
  --title-glow:      rgba(140,190,255,0.85);
  --plaque-bg-top:   #6a8fac;
  --plaque-bg-mid:   #5a7a96;
  --plaque-bg-btm:   #4e6e88;
  --plaque-border:   #8ab0cc;
  --plaque-text:     #5c0808;
  --credit-color:    rgba(220,235,248,0.85);

  /* â”€â”€ Reader / book page colours â”€â”€ */
  --page-bg:         #ffffff;
  --page-text:       #111111;
  --page-head:       #000000;
  --page-rule:       #222222;
  --page-muted:      #555555;
  --page-indent:     2.2em;

  /* â”€â”€ App chrome (dark bar) â”€â”€ */
  --chrome-bg:       #1b2a38;
  --chrome-text:     #b8ccd8;
  --chrome-border:   rgba(90,138,176,0.2);

  /* â”€â”€ Accent colours â”€â”€ */
  --red:             #7a0e0e;
  --red-hover:       #9a1818;
  --blue:            #3a5570;

  /* â”€â”€ Phone safe areas â”€â”€ */
  --safe-top:        env(safe-area-inset-top);
  --safe-bottom:     env(safe-area-inset-bottom);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--cover-bg-btm);
}

body {
  font-family: "Noto Serif Ethiopic", "Ethiopic", Georgia, serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}


/* ================================================================
   2. COVER / SPLASH PAGE
   ================================================================ */

#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  transition: opacity 0.7s ease;
  background: #080c12;
}

/* Full-bleed cross photo */
.sp-fullcover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Dark gradient â€” heavy top & bottom, clear window in the middle for the cross */
.sp-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(5,10,18,0.88)  0%,
      rgba(5,10,18,0.35) 28%,
      rgba(5,10,18,0.10) 45%,
      rgba(5,10,18,0.10) 58%,
      rgba(5,10,18,0.70) 78%,
      rgba(5,10,18,0.97) 100%
    );
}

/* Top ornament band */
.sp-top-badge {
  position: relative;
  z-index: 10;
  padding-top: calc(2.2rem + var(--safe-top));
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.sp-ornament {
  font-size: 0.55rem;
  color: rgba(212,175,55,0.7);
  letter-spacing: 0.5em;
}

.sp-series {
  font-size: 0.58rem;
  color: rgba(220,235,248,0.35);
  letter-spacing: 0.18em;
  font-family: Georgia, "Times New Roman", serif;
}

/* Center title block */
.sp-center {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.sp-rule-gold {
  width: min(78%, 240px);
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212,175,55,0.5) 15%,
    rgba(212,175,55,1)   50%,
    rgba(212,175,55,0.5) 85%,
    transparent 100%
  );
  margin: 0.15rem 0;
}

.sp-main-title {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 22px rgba(212,175,55,0.55),
    0 0 50px rgba(212,175,55,0.25),
    0 2px 6px rgba(0,0,0,0.9);
}

.sp-sub-title {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 400;
  color: rgba(255,255,255,0.82);
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 10px rgba(0,0,0,0.9);
}

.sp-author {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: clamp(0.68rem, 2.1vw, 0.88rem);
  color: rgba(212,175,55,0.7);
  letter-spacing: 0.1em;
  margin-top: 0.1rem;
}

/* Scrolling ticker */
.sp-ticker-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  overflow: hidden;
  padding: 0.45rem 0;
  border-top: 1px solid rgba(212,175,55,0.18);
  border-bottom: 1px solid rgba(212,175,55,0.18);
}
.sp-ticker {
  display: inline-flex;
  white-space: nowrap;
  animation: sp-scroll 28s linear infinite;
}
.sp-ticker span {
  font-family: 'Noto Serif Ethiopic', Georgia, serif;
  font-size: clamp(0.78rem, 2.2vw, 0.95rem);
  color: rgba(212,175,55,0.8);
  letter-spacing: 0.04em;
  padding: 0 1rem;
}
@keyframes sp-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Bottom button area */
.sp-cover-btn-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: calc(2.8rem + var(--safe-bottom, 0px));
}

/* Enter button â€” crimson with gold border */
.sp-btn {
  padding: 0.9rem 3rem;
  background: linear-gradient(160deg, #8B0000 0%, #5c0000 100%);
  color: #fff;
  border: 1px solid rgba(212,175,55,0.55);
  cursor: pointer;
  font-family: "Noto Serif Ethiopic", serif;
  font-size: clamp(0.88rem, 2.8vw, 1rem);
  border-radius: 2px;
  letter-spacing: 0.06em;
  box-shadow:
    0 4px 22px rgba(139,0,0,0.55),
    0 0 0 1px rgba(212,175,55,0.15),
    inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.15s, box-shadow 0.2s;
}
.sp-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(139,0,0,0.65),
    0 0 0 1px rgba(212,175,55,0.4);
}
.sp-btn:active {
  transform: scale(0.97) translateY(0);
}

.sp-btn-outline {
  background: transparent;
  border: 1px solid rgba(212,175,55,0.55);
  box-shadow:
    0 4px 18px rgba(0,0,0,0.4),
    0 0 0 1px rgba(212,175,55,0.1),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
.sp-btn-outline:hover {
  background: rgba(255,255,255,0.06);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.5),
    0 0 0 1px rgba(212,175,55,0.4);
}

.sp-btn-browse {
  background: none;
  border: none;
  color: rgba(220,235,248,0.45);
  font-size: 0.82rem;
  font-family: "Noto Serif Ethiopic", serif;
  cursor: pointer;
  letter-spacing: 0.04em;
  padding: 0.3rem 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.sp-btn-browse:hover { color: rgba(220,235,248,0.8); }

.sp-year {
  font-size: 0.52rem;
  color: rgba(220,235,248,0.18);
  letter-spacing: 0.12em;
  font-family: Georgia, serif;
}


/* ================================================================
   3. APP SHELL & TOP BAR
   ================================================================ */

#app {
  display: none;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  background: var(--page-bg);
}

/* Top navigation bar */
.topbar {
  display: flex;
  align-items: center;
  background: var(--chrome-bg);
  padding: 0.65rem 1rem;
  padding-top: calc(0.65rem + var(--safe-top));
  flex-shrink: 0;
  gap: 0.75rem;
  border-bottom: 1px solid var(--chrome-border);
}

.tb-menu {
  width: 36px; height: 36px;
  border-radius: 4px;
  background: rgba(90,138,176,0.1);
  border: 1px solid rgba(90,138,176,0.2);
  color: var(--chrome-text);
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.tb-title {
  flex: 1;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--chrome-text);
  line-height: 1.3;
}
.tb-title small {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: rgba(184,204,216,0.35);
  letter-spacing: 0.05em;
}

.tb-lock {
  width: 30px; height: 30px;
  border-radius: 4px;
  background: rgba(122,14,14,0.18);
  border: 1px solid rgba(122,14,14,0.28);
  color: rgba(220,160,160,0.7);
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Install banner */
#install-bar {
  display: none;
  background: var(--red);
  color: #fff;
  padding: 0.7rem 1rem;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.ib-text  { flex: 1; font-size: 0.78rem; line-height: 1.4; }
.ib-btn   { padding: 0.35rem 0.8rem; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 2px; cursor: pointer; font-size: 0.72rem; font-family: inherit; flex-shrink: 0; }
.ib-close { background: none; border: none; color: rgba(255,255,255,0.45); font-size: 1.1rem; cursor: pointer; padding: 0; line-height: 1; }

.body-wrap { display: flex; flex: 1; overflow: hidden; position: relative; }

/* â”€â”€ Search bar â”€â”€ */
#search-bar {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f0ebe0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}
#srch-input {
  flex: 1;
  padding: 6px 12px;
  border: 1.5px solid #ccc;
  border-radius: 20px;
  font-size: 0.82rem;
  font-family: "Noto Serif Ethiopic", serif;
  outline: none;
  background: #fff;
  -webkit-appearance: none;
}
#srch-input:focus { border-color: var(--blue); }
.srch-count {
  font-size: 0.65rem;
  color: #888;
  flex-shrink: 0;
  min-width: 3.5rem;
  text-align: center;
  font-family: Georgia, serif;
}
.srch-close {
  background: none; border: none;
  font-size: 1.1rem; cursor: pointer;
  color: #888; padding: 2px 4px; line-height: 1;
}
.srch-close:hover { color: var(--red); }

/* Search button in topbar */
.tb-search {
  width: 32px; height: 32px;
  border-radius: 4px;
  background: rgba(90,138,176,0.1);
  border: 1px solid rgba(90,138,176,0.2);
  color: var(--chrome-text);
  cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tb-search:hover  { background: rgba(90,138,176,0.22); }
.tb-search.active { background: rgba(90,138,176,0.4); color: #fff; }

/* â”€â”€ Search results panel â”€â”€ */
#srch-panel {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 200;
  background: #fff;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.srch-sec-head {
  padding: 0.5rem 1.25rem 0.3rem;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(70,50,30,0.5);
  background: #f7f4ef;
  border-bottom: 1px solid rgba(200,185,165,0.3);
  position: sticky;
  top: 0;
}
.srch-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  transition: background 0.1s;
}
.srch-item:hover { background: #f7f3ea; }
.srch-item-text {
  font-size: 0.82rem;
  color: #3a2a18;
  line-height: 1.75;
  font-family: "Noto Serif Ethiopic", serif;
}
.srch-hit-preview {
  background: #FFE066;
  border-radius: 2px;
  padding: 0 1px;
  font-weight: 700;
}
.srch-empty, .srch-more {
  padding: 2rem 1.25rem;
  text-align: center;
  color: #999;
  font-size: 0.78rem;
  font-family: "Noto Serif Ethiopic", serif;
  line-height: 1.8;
}
.srch-more { padding: 0.75rem; font-size: 0.68rem; color: #aaa; }

/* â”€â”€ In-page match flash â”€â”€ */
.search-flash {
  background: #FFE066;
  border-radius: 2px;
  padding: 0 1px;
  transition: background 1.2s ease;
}
.search-flash.fade { background: transparent; }


/* ================================================================
   4. SIDE DRAWER
   ================================================================ */

#drawer {
  position: fixed;
  top: 0; left: -280px; bottom: 0;
  z-index: 500;
  width: 280px;
  background: #f7f4ef;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
#drawer.open {
  left: 0;
  box-shadow: 4px 0 20px rgba(0,0,0,0.22);
}

#overlay {
  position: fixed;
  inset: 0;
  z-index: 499;
  background: rgba(10,18,26,0.55);
  display: none;
}
#overlay.show { display: block; }

.dr-head {
  background: var(--chrome-bg);
  padding: 1rem 1.25rem;
  padding-top: calc(1rem + var(--safe-top));
  flex-shrink: 0;
}
.dr-book-title { font-size: 0.85rem; font-weight: 700; color: var(--chrome-text); line-height: 1.4; }
.dr-book-sub   { font-size: 0.6rem; color: rgba(184,204,216,0.3); letter-spacing: 0.05em; margin-top: 0.1rem; }

.dr-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 1rem; }

/* Drawer tabs */
.dr-tabs {
  display: flex;
  gap: 4px;
  margin-top: 0.7rem;
}
.dr-tab {
  flex: 1;
  padding: 0.4rem 0.5rem;
  background: rgba(90,138,176,0.08);
  border: 1px solid rgba(90,138,176,0.18);
  color: rgba(184,204,216,0.5);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.68rem;
  font-family: "Noto Serif Ethiopic", serif;
  transition: background 0.15s, color 0.15s;
}
.dr-tab.active {
  background: rgba(90,138,176,0.3);
  border-color: #5a8ab0;
  color: #fff;
}
.dr-tab:hover { background: rgba(90,138,176,0.2); color: #cde; }

/* Highlights pane items */
.hl-pane-empty {
  padding: 1.5rem 1.25rem;
  font-size: 0.75rem;
  color: rgba(70,50,30,0.35);
  text-align: center;
  font-family: "Noto Serif Ethiopic", serif;
  line-height: 1.8;
}
.hl-sec-head {
  padding: 0.6rem 1.25rem 0.2rem;
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(70,50,30,0.4);
  border-bottom: 1px solid rgba(200,185,165,0.3);
  margin-top: 0.4rem;
}
.hl-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(200,185,165,0.12);
  transition: background 0.1s;
}
.hl-item:hover { background: #f0ebe0; }
.hl-swatch {
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 0.25rem;
  border: 1px solid rgba(0,0,0,0.1);
}
.hl-item-body { flex: 1; min-width: 0; }
.hl-item-text {
  font-size: 0.74rem;
  color: #3a2a18;
  line-height: 1.5;
  font-family: "Noto Serif Ethiopic", serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hl-item-meta {
  font-size: 0.56rem;
  color: rgba(70,50,30,0.4);
  margin-top: 1px;
}
.hl-item-del {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(180,80,80,0.4);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}
.hl-item-del:hover { color: rgba(180,80,80,0.9); }

.dr-group-head {
  padding: 0.7rem 1.25rem 0.3rem;
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(70,50,30,0.4);
  border-bottom: 1px solid rgba(200,185,165,0.3);
  margin-top: 0.25rem;
}

.dr-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1.25rem;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 0.78rem;
  color: #4a3a28;
  line-height: 1.4;
  transition: background 0.1s;
}
.dr-btn:active  { background: #ede5d5; }
.dr-btn.active  { background: #f0ebe0; border-left-color: var(--red); color: #1a0a00; font-weight: 700; }
.dr-btn.locked  { color: #9a8a78; }

.dr-free-badge {
  margin-left: auto;
  font-size: 0.5rem;
  padding: 1px 5px;
  background: #e8ddc0;
  color: #7a5a10;
  border-radius: 2px;
  flex-shrink: 0;
}


/* ================================================================
   5. READER â€” WHITE BOOK PAGES
   ================================================================ */

#reader {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--page-bg);
}

.page-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: calc(4rem + var(--safe-bottom));
}

/* Double-rule header â€” matches printed book interior */
.page-top  { padding: 1.25rem 1.75rem 0; }
.page-rule-top {
  border-top:    2.5px solid var(--page-rule);
  border-bottom: 1px solid var(--page-rule);
  padding: 0.5rem 0;
}

/* Chapter / section title */
.ch-title {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  font-weight: 900;
  color: var(--page-head);
  text-align: center;
  padding: 0.75rem 0 0.4rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.ch-sub {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 0.88rem;
  color: var(--page-muted);
  text-align: center;
  padding-bottom: 0.75rem;
}

/* Body area â€” extra left padding creates the number gutter */
.page-body { padding: 1.5rem 1.75rem 1.5rem 3.8rem; }

/* Subheadings within body */
.sub-head {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 700;
  color: var(--page-head);
  margin: 1.75rem 0 0.5rem;
  line-height: 1.4;
}

/* Body paragraphs â€” left border acts as the rule; gutter holds the number */
.para {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: clamp(0.93rem, 2.3vw, 1.01rem);
  line-height: 2;
  color: var(--page-text);
  text-align: justify;
  text-indent: var(--page-indent);
  margin-bottom: 0.6rem;
  position: relative;
  padding-left: 0.85rem;
  border-left: 4px solid rgba(30,60,100,0.55);
  transition: border-left-color 0.2s;
  -webkit-user-select: text;
  user-select: text;
}
.para:hover       { border-left-color: rgba(30,60,100,0.85); }
.para.no-indent   { text-indent: 0; }
.para.tapped      { background: rgba(58,85,112,0.04); border-radius: 0 3px 3px 0; }

/* Number sits in the gutter â€” to the LEFT of the border */
.para-num {
  position: absolute;
  left: -3.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  text-align: right;
  padding-right: 1rem;     /* gap between number and the border line */
  font-size: 0.6rem;
  font-family: Georgia, serif;
  font-weight: 700;
  color: #1e3c64;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: color 0.15s;
}
.para-num:hover      { color: #0a1f40; }
.para-num.bookmarked { color: #D4AF37; }

/* Paragraph count shown in section footer */
.page-count {
  text-align: center;
  font-size: 0.58rem;
  color: rgba(0,0,0,0.18);
  margin-top: 0.4rem;
  font-family: Georgia, serif;
  letter-spacing: 0.06em;
}

/* Highlight color popup */
#hl-popup {
  position: fixed;
  z-index: 8000;
  display: none;
  align-items: center;
  gap: 7px;
  background: rgba(12,20,30,0.96);
  border: 1px solid rgba(90,138,176,0.28);
  border-radius: 30px;
  padding: 7px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  pointer-events: all;
}
#hl-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(12,20,30,0.96);
}
.hlp-clr {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.hlp-clr:hover { transform: scale(1.3); border-color: rgba(255,255,255,0.8); }

/* Per-paragraph copy button â€” shows on hover */
.copy-btn {
  display: none;
  position: absolute;
  right: 0; top: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.58rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}
.para:hover .copy-btn,
.para.tapped .copy-btn { display: flex; }

/* Double-rule footer */
.page-bottom { padding: 0 1.75rem 1rem; }
.page-rule-btm {
  border-top:    1px solid var(--page-rule);
  border-bottom: 2.5px solid var(--page-rule);
  padding: 0.35rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--page-muted);
  font-family: "Noto Serif Ethiopic", serif;
}


/* ================================================================
   6. LOCK SCREEN
   ================================================================ */

.lock-outer {
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--page-bg);
}

.lock-box {
  max-width: 420px;
  width: 100%;
  background: #fff;
  border-top: 4px solid var(--red);
  padding: 2rem 1.75rem;
  text-align: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.lk-icon  { font-size: 2rem; color: var(--red); margin-bottom: 1rem; }
.lk-title {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 1.15rem; font-weight: 700;
  color: var(--red); margin-bottom: 0.6rem;
}
.lk-desc  { font-size: 0.82rem; color: #666; line-height: 1.8; margin-bottom: 1.25rem; }
.lk-price {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 2rem; font-weight: 700; color: #111; margin-bottom: 0.15rem;
}
.lk-price-note { font-size: 0.7rem; color: #888; margin-bottom: 1.25rem; }

.lk-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1.5px solid #ccc;
  border-radius: 2px;
  font-size: 1rem;
  text-align: center;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lk-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(122,14,14,0.08); }

.lk-err { font-size: 0.78rem; color: var(--red); margin-bottom: 0.5rem; display: none; }

.lk-unlock {
  width: 100%;
  padding: 0.82rem;
  margin-bottom: 0.6rem;
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: "Noto Serif Ethiopic", serif;
  border-radius: 2px;
  letter-spacing: 0.03em;
}
.lk-unlock:active { background: var(--red-hover); }

.lk-buy {
  display: block;
  width: 100%;
  padding: 0.82rem;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  font-size: 0.9rem;
  font-family: "Noto Serif Ethiopic", serif;
  text-align: center;
  cursor: pointer;
}
.lk-buy:hover { opacity: 0.88; }

.lk-sep {
  font-size: 0.72rem;
  color: #bbb;
  text-align: center;
  margin: 0.5rem 0;
  font-family: Georgia, serif;
}

.lk-fine { font-size: 0.62rem; color: #aaa; margin-top: 1rem; line-height: 1.6; }


/* ================================================================
   7. TOAST NOTIFICATION
   ================================================================ */

#toast {
  position: fixed;
  bottom: calc(1.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,22,30,0.9);
  color: #b8ccd8;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: 0.75rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}


/* ================================================================
   8. RESPONSIVE â€” phones, tablets, desktops
   ================================================================ */

/* â”€â”€ Very small phones (â‰¤ 380px) â”€â”€ */
@media (max-width: 380px) {
  .page-top,
  .page-bottom { padding-left: 0.75rem; padding-right: 0.75rem; }
  .page-body   { padding-left: 2.6rem; padding-right: 0.75rem; }
  .sp-main-title { font-size: clamp(1.8rem, 10vw, 2.5rem); }
  /* Stack audio bar to two rows on tiny screens */
  #audio-bar   { gap: 3px; padding: 4px 8px; }
  .aud-spd     { padding: 2px 5px; font-size: 0.6rem; }
}

/* â”€â”€ Normal phones (â‰¤ 480px) â”€â”€ */
@media (max-width: 480px) {
  .page-top,
  .page-bottom { padding-left: 1rem; padding-right: 1rem; }
  .page-body   { padding-left: 2.8rem; padding-right: 1rem; }
}

/* â”€â”€ Tablets (â‰¥ 600px) â”€â”€ */
@media (min-width: 600px) {
  #drawer      { width: 320px; left: -320px; }
  .page-wrap   { max-width: 720px; }
  .page-body   { font-size: 1.05rem; line-height: 1.9; }
  .topbar      { padding: 0.75rem 1.5rem; padding-top: calc(0.75rem + var(--safe-top)); }
}

/* â”€â”€ Laptops / desktops (â‰¥ 1024px) â”€â”€ */
@media (min-width: 1024px) {
  #drawer      { width: 360px; left: -360px; }
  .page-wrap   { max-width: 780px; }
  .page-body   { font-size: 1.1rem; line-height: 2; padding: 1.5rem 3rem 1.5rem 4.5rem; }
  .para-num    { left: -4rem; width: 3.2rem; font-size: 0.65rem; }
  .topbar      { padding: 0.8rem 2rem; padding-top: calc(0.8rem + var(--safe-top)); }
  #audio-bar   { padding: 6px 2rem; gap: 6px; }
  #annot-bar   { padding: 6px 2rem; gap: 8px; }
  #search-bar  { padding: 8px 2rem; }
  .sp-main-title { font-size: clamp(2.8rem, 5vw, 4.5rem); }
}

/* â”€â”€ Landscape on phones â”€â”€ */
@media (max-height: 500px) and (orientation: landscape) {
  .sp-top-badge   { padding-top: 1rem; }
  .sp-center      { gap: 0.3rem; }
  .sp-rule-gold   { margin: 0.2rem 0; }
  .sp-cover-btn-wrap { padding-bottom: 0.5rem; }
  #audio-bar      { padding: 3px 10px; }
  .aud-btn        { width: 28px; height: 26px; font-size: 0.8rem; }
  #annot-bar      { padding: 3px 10px; }
}

.book-img {
  display: block;
  max-width: 100%;
  margin: 1.2rem auto;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

/* â”€â”€ Table of Contents â”€â”€ */
.toc-line, .toc-chapter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
  font-family: inherit;
}
.toc-chapter {
  font-weight: 700;
  margin-top: 12px;
  font-size: 1.02em;
}
.toc-title {
  flex-shrink: 0;
  max-width: 80%;
}
.toc-dots {
  flex: 1;
  border-bottom: 1px dotted currentColor;
  margin: 0 4px 3px;
  min-width: 12px;
}
.toc-page {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Clickable TOC entries */
.toc-link {
  cursor: pointer;
}
.toc-link:hover {
  opacity: 0.75;
}
.toc-chapter.toc-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Full-cover splash */
.sp-fullcover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.sp-cover-btn-wrap {
  position: relative;
  z-index: 10;
  padding-bottom: calc(2.5rem + var(--safe-bottom, 0px));
}

/* ================================================================
   9. AUDIO READER BAR
   ================================================================ */

#audio-bar {
  display: none;            /* shown via JS after entering app */
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #12202e;
  border-bottom: 1px solid rgba(90,138,176,0.15);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.aud-btn {
  width: 32px; height: 30px;
  background: rgba(90,138,176,0.12);
  border: 1px solid rgba(90,138,176,0.22);
  color: #b8ccd8;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.aud-btn:hover  { background: rgba(90,138,176,0.28); }
.aud-btn.playing { background: rgba(50,180,100,0.25); border-color: rgba(50,180,100,0.5); color: #7ef0a8; }

.aud-spd {
  padding: 3px 7px;
  background: rgba(90,138,176,0.08);
  border: 1px solid rgba(90,138,176,0.18);
  color: rgba(184,204,216,0.6);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.65rem;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.aud-spd.active {
  background: rgba(90,138,176,0.35);
  border-color: #5a8ab0;
  color: #fff;
}
.aud-spd:hover { background: rgba(90,138,176,0.22); color: #d0e4f0; }

.aud-sep {
  width: 1px; height: 20px;
  background: rgba(90,138,176,0.2);
  margin: 0 3px;
  flex-shrink: 0;
}

.aud-status {
  font-size: 0.62rem;
  color: rgba(184,204,216,0.45);
  flex-shrink: 0;
  white-space: nowrap;
  font-family: "Noto Serif Ethiopic", serif;
  margin-left: 2px;
}
.aud-status.reading { color: #7ef0a8; }

/* Paragraph currently being read aloud */
.tts-reading {
  background: rgba(255,220,80,0.15) !important;
  border-left: 3px solid #FFD84D !important;
  border-radius: 0 3px 3px 0;
  transition: background 0.3s;
}


/* ================================================================
   10. ANNOTATION TOOLBAR
   ================================================================ */

#annot-bar {
  display: none;           /* shown only in chapters via JS */
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #1b2a38;
  border-bottom: 1px solid rgba(90,138,176,0.18);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.an-sep {
  width: 1px;
  height: 20px;
  background: rgba(90,138,176,0.25);
  margin: 0 3px;
  flex-shrink: 0;
}

.an-btn {
  padding: 5px 10px;
  background: rgba(90,138,176,0.1);
  border: 1px solid rgba(90,138,176,0.2);
  color: #b8ccd8;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.an-btn:hover  { background: rgba(90,138,176,0.22); }
.an-btn.active {
  background: rgba(90,138,176,0.45);
  border-color: #5a8ab0;
  color: #fff;
}
.an-clear { color: #e07070; border-color: rgba(200,80,80,0.3); }
.an-clear:hover { background: rgba(200,80,80,0.15); }

.an-clr {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.an-clr:hover  { transform: scale(1.2); }
.an-clr.active { border-color: #fff; transform: scale(1.15); }

/* Highlighted text */
.hl-mark {
  border-radius: 2px;
  padding: 0 1px;
  cursor: pointer;
}

/* ================================================================
   10. PAGE-TURN ANIMATION
   ================================================================ */

#reader {
  perspective: 1400px;
}

@keyframes pageTurnOut {
  0%   { transform: rotateY(0deg)   translateX(0);     opacity: 1;  }
  60%  { transform: rotateY(-70deg) translateX(-8%);   opacity: 0.4;}
  100% { transform: rotateY(-90deg) translateX(-10%);  opacity: 0;  }
}

@keyframes pageTurnIn {
  0%   { transform: rotateY(90deg)  translateX(10%);   opacity: 0;  }
  40%  { transform: rotateY(20deg)  translateX(3%);    opacity: 0.6;}
  100% { transform: rotateY(0deg)   translateX(0);     opacity: 1;  }
}

.page-turn-out {
  animation: pageTurnOut 0.22s ease-in forwards;
  transform-origin: left center;
  pointer-events: none;
  backface-visibility: hidden;
}

.page-turn-in {
  animation: pageTurnIn 0.3s ease-out forwards;
  transform-origin: left center;
  backface-visibility: hidden;
}


/* ================================================================
   AUTH SCREEN
   ================================================================ */

#auth-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: calc(1rem + var(--safe-top));
  overflow-y: auto;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(160deg, #0f161e 0%, #1e2d3c 40%, #0f161e 100%);
  z-index: -1;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 10px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  margin: auto;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo-title {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 1.9rem;
  font-weight: 900;
  color: #1e2d3c;
  line-height: 1.1;
}
.auth-logo-sub {
  font-size: 0.75rem;
  color: #c8a96e;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.1rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid #eee;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.6rem;
  font-size: 0.92rem;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  font-family: Georgia, serif;
}
.auth-tab.active {
  color: #1e2d3c;
  border-bottom-color: #c8a96e;
  font-weight: 600;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-field { display: flex; flex-direction: column; gap: 0.3rem; }
.auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #444;
  font-family: Georgia, serif;
  letter-spacing: 0.02em;
}
.auth-hint { font-weight: 400; color: #999; font-size: 0.78rem; }

.auth-field input,
.auth-field select {
  padding: 0.72rem 0.9rem;
  border: 1.5px solid #ddd;
  border-radius: 5px;
  font-size: 0.97rem;
  font-family: Georgia, serif;
  color: #111;
  background: #fafafa;
  transition: border-color 0.15s;
  -webkit-user-select: text;
  user-select: text;
}
.auth-field input:focus {
  outline: none;
  border-color: #c8a96e;
  background: #fff;
}

.auth-error {
  display: none;
  background: #fff0f0;
  border: 1px solid #f5c6c6;
  border-radius: 4px;
  color: #7a0e0e;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  font-family: Georgia, serif;
}
.auth-error.show { display: block; }

.auth-submit {
  padding: 0.82rem;
  background: linear-gradient(160deg, #1e2d3c 0%, #2d4458 100%);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-family: "Noto Serif Ethiopic", serif;
  cursor: pointer;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
  transition: opacity 0.15s;
}
.auth-submit:hover   { opacity: 0.88; }
.auth-submit:disabled{ opacity: 0.55; cursor: not-allowed; }

.auth-back {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.82rem;
  text-align: center;
  cursor: pointer;
  padding: 0.8rem 0 0;
  font-family: Georgia, serif;
}
.auth-back:hover { color: #555; }

.auth-forgot-link {
  background: none;
  border: none;
  color: #c8a96e;
  font-size: 0.78rem;
  font-family: Georgia, serif;
  cursor: pointer;
  padding: 0;
  text-align: right;
  align-self: flex-end;
  margin-top: 0.1rem;
}
.auth-forgot-link:hover { text-decoration: underline; }

/* Password eye toggle */
.auth-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-pass-wrap input {
  flex: 1;
  padding-right: 2.4rem !important;
}
.auth-eye {
  position: absolute;
  right: 0.55rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem;
  color: rgba(255,255,255,0.45);
}
.auth-eye:hover { color: rgba(255,255,255,0.85); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #bbb;
  font-size: 0.78rem;
  font-family: Georgia, serif;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

#google-signin-btn { display: flex; justify-content: center; min-height: 44px; }

.auth-success {
  background: #f0fff4;
  border: 1px solid #b2dfdb;
  border-radius: 4px;
  color: #1a5c3a;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  font-family: Georgia, serif;
}

.auth-panel-desc {
  font-size: 0.88rem;
  color: #555;
  font-family: Georgia, serif;
  margin: 0 0 0.25rem;
}


/* ================================================================
   STORE SCREEN
   ================================================================ */

#store-screen {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  flex-direction: column;
  background: #f4ede0;
}

/* Store header bar */
.store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  padding-top: calc(0.9rem + var(--safe-top));
  background: #1e2d3c;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 2px solid #c8a96e;
}

.store-logo {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.store-logo-ti {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.02em;
}
.store-logo-en {
  font-size: 0.75rem;
  color: #c8a96e;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: Georgia, serif;
}

.store-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.store-user-name {
  font-size: 0.82rem;
  color: #a0b4c8;
  font-family: Georgia, serif;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.store-signout {
  background: none;
  border: 1px solid rgba(160,180,200,0.35);
  color: #a0b4c8;
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: color 0.15s, border-color 0.15s;
}
.store-signout:hover { color: #fff; border-color: rgba(200,169,110,0.6); }

/* Scrollable book area */
.store-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 3rem;
  padding-bottom: calc(3rem + var(--safe-bottom));
}

.store-section-head {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: #8a7055;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(139,112,85,0.25);
}

/* Book grid â€” 1 column on mobile, 2+ on larger screens */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Individual book card */
.book-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.15s;
}
.book-card:hover {
  box-shadow: 0 6px 28px rgba(0,0,0,0.18);
  transform: translateY(-2px);
}

.book-cover-wrap {
  position: relative;
  background: #1e2d3c;
  aspect-ratio: 3/4;
  overflow: hidden;
  flex-shrink: 0;
}
.book-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.book-owned-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: #2a7a3b;
  color: #fff;
  font-size: 0.68rem;
  padding: 0.22rem 0.55rem;
  border-radius: 3px;
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
}

.book-info {
  padding: 1rem 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.book-title {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e2d3c;
  line-height: 1.3;
}

.book-author {
  font-size: 0.78rem;
  color: #8a7055;
  font-family: Georgia, serif;
  letter-spacing: 0.04em;
}

.book-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.book-tag {
  font-size: 0.68rem;
  background: #f4ede0;
  color: #8a7055;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  font-family: Georgia, serif;
}

.book-desc {
  font-family: "Noto Serif Ethiopic", serif;
  font-size: 0.84rem;
  color: #555;
  line-height: 1.6;
  flex: 1;
}

.book-rating-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  color: #8a7055;
  font-family: Georgia, serif;
  font-size: 0.75rem;
}

.book-stars,
.book-review-stars {
  color: #d4a030;
  letter-spacing: 0.08em;
}

.book-rating-text {
  font-weight: 700;
  color: #1e2d3c;
}

.book-rating-count {
  color: #8a7055;
}

.book-author-profile {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid #efe4d2;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbf7f0 0%, #f7f0e3 100%);
}

.book-author-photo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(180,140,80,0.35);
}

.book-author-copy {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.book-author-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9b7b4e;
  font-family: Georgia, serif;
}

.book-author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e2d3c;
}

.book-author-role {
  font-size: 0.74rem;
  color: #7b6244;
  font-family: Georgia, serif;
}

.book-author-bio {
  font-size: 0.79rem;
  line-height: 1.6;
  color: #5d5246;
}

.book-reviews-block {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: #faf6ef;
  border: 1px solid #efe5d8;
}

.book-reviews-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.book-reviews-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e2d3c;
}

.book-reviews-sub,
.book-review-hint {
  font-size: 0.72rem;
  color: #8a7055;
  font-family: Georgia, serif;
}

.book-review-toggle,
.book-review-submit {
  background: #1e2d3c;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-size: 0.76rem;
  font-family: Georgia, serif;
}

.book-review-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.book-review-label {
  font-size: 0.72rem;
  color: #7c6342;
  font-family: Georgia, serif;
}

.book-rating-picker {
  display: flex;
  gap: 0.2rem;
}

.book-rate-star {
  background: transparent;
  border: none;
  color: #c49a38;
  font-size: 1.2rem;
  cursor: pointer;
}

.book-review-input,
.book-review-textarea,
.sc-tags-input {
  width: 100%;
  border: 1px solid rgba(120,95,60,0.18);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-family: "Noto Serif Ethiopic", Georgia, serif;
  font-size: 0.84rem;
  background: #fff;
  color: #2b2b2b;
}

.book-review-textarea {
  resize: vertical;
}

.book-review-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.book-review-error {
  color: #a42525;
  font-size: 0.74rem;
}

.book-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.book-review-card {
  padding: 0.75rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #efe5d8;
}

.book-review-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.28rem;
}

.book-reviewer,
.book-review-title-line {
  color: #1e2d3c;
  font-weight: 700;
  font-size: 0.8rem;
}

.book-review-body,
.book-review-empty {
  color: #5d5246;
  font-size: 0.8rem;
  line-height: 1.55;
}

/* Reviews show/hide */
.book-review-list .review-hidden { display: none; }
.book-review-list.reviews-expanded .review-hidden { display: block; }
.book-reviews-show-all {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  background: none;
  border: 1px solid rgba(212,175,55,0.35);
  color: rgba(212,175,55,0.9);
  font-size: 0.8rem;
  font-family: Georgia, serif;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}
.book-reviews-show-all:hover { background: rgba(212,175,55,0.08); }

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0e8dc;
}

.book-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e2d3c;
  font-family: Georgia, serif;
}

.book-btn {
  padding: 0.55rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: "Noto Serif Ethiopic", serif;
  letter-spacing: 0.03em;
  transition: opacity 0.15s, transform 0.1s;
}
.book-btn:hover   { opacity: 0.88; transform: translateY(-1px); }
.book-btn:active  { transform: scale(0.97); }
.book-btn:disabled{ opacity: 0.5; cursor: not-allowed; transform: none; }

.book-btn-buy {
  background: linear-gradient(160deg, #8B0000 0%, #5c0000 100%);
  color: #fff;
  box-shadow: 0 3px 12px rgba(139,0,0,0.35);
}

.book-btn-read {
  background: linear-gradient(160deg, #1e6640 0%, #145030 100%);
  color: #fff;
  box-shadow: 0 3px 12px rgba(30,102,64,0.35);
}

/* Store loading spinner */
.store-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: #8a7055;
  font-family: Georgia, serif;
  font-size: 0.9rem;
}

/* â”€â”€ Topbar home button â”€â”€ */
.tb-home {
  background: none;
  border: none;
  color: var(--chrome-text);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
  line-height: 1;
}
.tb-home:hover { background: rgba(255,255,255,0.08); }

/* Home label under icon */
.tb-home-label {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-top: 1px;
  color: var(--chrome-text);
  font-family: Georgia, serif;
}




/* ================================================================
   COMMUNITY / SHARING SCREEN â€” Full Responsive Redesign
   ================================================================ */

/* Book card button group */
.book-btn-group { display:flex; gap:0.4rem; flex-wrap:wrap; justify-content:flex-end; }
.book-btn-browse { background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.15); color:#c8b890; }
.book-btn-browse:hover { background:rgba(255,255,255,0.12); }

/* Community button in store header */
.store-community-btn {
  background: rgba(180,140,80,0.18);
  border: 1px solid rgba(180,140,80,0.4);
  color: #d4a853;
  font-family: Georgia, serif;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.store-community-btn:hover { background: rgba(180,140,80,0.32); }

/* Screen shell */
#sharing-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0d1117;
}

/* Sticky topbar */
.sc-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: rgba(13,17,23,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(180,140,80,0.18);
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sc-topbar-brand { display:flex; align-items:center; }
.sc-brand-ti { font-family:'Noto Serif Ethiopic',Georgia,serif; font-size:0.95rem; font-weight:700; color:#d4a853; }
.sc-brand-sep { color:#5a4a30; margin:0 0.35rem; }
.sc-brand-en  { font-family:Georgia,serif; font-size:0.75rem; color:#a89070; letter-spacing:0.04em; }
.sc-topbar-actions { display:flex; align-items:center; gap:0.4rem; flex-wrap:wrap; }
.sc-back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.14);
  color: #a89070;
  font-size: 0.76rem;
  padding: 0.28rem 0.7rem;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.sc-back-btn:hover { border-color:rgba(212,168,83,0.45); color:#d4a853; }
.sc-user-chip { color:#d4b87a; font-size:0.78rem; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Hero */
.sc-hero {
  position: relative;
  width: 100%;
  min-height: 340px;
  max-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}
.sc-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.sc-hero-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(13,17,23,0.0)  0%,
    rgba(13,17,23,0.25) 45%,
    rgba(13,17,23,0.82) 80%,
    rgba(13,17,23,0.95) 100%);
}
.sc-hero-content {
  position: relative;
  z-index: 2;
  padding: 1rem 1.2rem 1.5rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.sc-hero-title {
  font-family: 'Noto Serif Ethiopic', Georgia, serif;
  font-size: clamp(1.05rem, 3vw, 1.55rem);
  font-weight: 700;
  color: #e8c870;
  margin: 0 0 0.45rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
}
.sc-hero-desc {
  font-family: 'Noto Serif Ethiopic', Georgia, serif;
  font-size: clamp(0.8rem, 2vw, 0.92rem);
  color: #e0d0b0;
  margin: 0 0 0.3rem;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}
.sc-hero-en {
  font-family: Georgia, serif;
  font-size: clamp(0.7rem, 1.6vw, 0.78rem);
  color: #9a8060;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
}

/* Main content */
.sc-main {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem 1rem 3rem;
  box-sizing: border-box;
  flex: 1;
}

/* Toolbar */
.sc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.sc-filters { display:flex; gap:0.3rem; flex-wrap:wrap; }
.sc-topics {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.sc-topic-pill,
.sc-inline-tag,
.sc-stat-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #b79e73;
  border-radius: 999px;
  padding: 0.28rem 0.72rem;
  font-size: 0.74rem;
  cursor: pointer;
}
.sc-topic-pill.active,
.sc-inline-tag:hover {
  background: rgba(180,140,80,0.18);
  border-color: rgba(180,140,80,0.35);
  color: #f0c46f;
}
.sc-topic-pill span { opacity: 0.75; }
.sc-filter {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: #9a8060;
  font-size: 0.77rem;
  padding: 0.28rem 0.65rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.sc-filter.active, .sc-filter:hover {
  background: rgba(180,140,80,0.18);
  border-color: rgba(180,140,80,0.45);
  color: #d4a853;
}
.sc-newpost-btn {
  background: #b8892a;
  border: none;
  color: #fff;
  font-family: Georgia, serif;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.42rem 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.sc-newpost-btn:hover { background: #d4a030; }

/* Compose panel */
.sc-compose {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(180,140,80,0.28);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.1rem;
  animation: scSlideIn 0.2s ease;
}
@keyframes scSlideIn {
  from { opacity:0; transform:translateY(-10px); }
  to   { opacity:1; transform:translateY(0); }
}
.sc-compose-header { display:flex; align-items:center; gap:0.65rem; margin-bottom:0.65rem; }
.sc-type-sel {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: #c8a060;
  font-size: 0.83rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}
.sc-textarea, .sc-reply-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 8px;
  color: #e8dcc8;
  font-family: 'Noto Serif Ethiopic', Georgia, serif;
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 0.6rem 0.75rem;
  resize: vertical;
  transition: border-color 0.15s;
}
.sc-tags-input {
  margin-top: 0.55rem;
  background: rgba(255,255,255,0.08);
  color: #e8dcc8;
  border-color: rgba(255,255,255,0.11);
}
.sc-tags-input::placeholder {
  color: #7e6b50;
}
.sc-textarea:focus, .sc-reply-textarea:focus { outline:none; border-color:rgba(180,140,80,0.5); }
.sc-reply-textarea { font-size:0.84rem; }
.sc-compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sc-charcount { color:#6a5840; font-size:0.7rem; }
.sc-cancel-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.13);
  color: #8a7055;
  font-size: 0.8rem;
  padding: 0.32rem 0.85rem;
  border-radius: 14px;
  cursor: pointer;
  margin-right: 0.35rem;
}
.sc-post-btn, .sc-reply-submit-btn {
  background: #b8892a;
  border: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 1.05rem;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.sc-post-btn:hover, .sc-reply-submit-btn:hover { background:#d4a030; }
.sc-post-btn:disabled, .sc-reply-submit-btn:disabled { opacity:0.5; cursor:default; }
.sc-post-err { color:#e07070; font-size:0.77rem; margin-top:0.3rem; min-height:1em; }

/* Guest prompt */
.sc-guest-prompt {
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(180,140,80,0.22);
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1.1rem;
  color: #9a8060;
  font-size: 0.86rem;
}
.sc-guest-btns { display:flex; justify-content:center; gap:0.55rem; margin-top:0.7rem; flex-wrap:wrap; }
.sc-guest-btns button {
  background: rgba(180,140,80,0.14);
  border: 1px solid rgba(180,140,80,0.32);
  color: #d4a853;
  font-size: 0.8rem;
  padding: 0.38rem 1rem;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.sc-guest-btns button:hover { background:rgba(180,140,80,0.26); }

/* Avatar */
.sc-avatar {
  width:36px; height:36px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:Georgia,serif; font-size:0.8rem; font-weight:700;
  color:#fff; flex-shrink:0; text-transform:uppercase; user-select:none;
}
.sc-reply-avatar { width:28px; height:28px; font-size:0.68rem; }
.sc-avatar-0{background:#b8892a;} .sc-avatar-1{background:#6b5b8a;}
.sc-avatar-2{background:#3d7a8a;} .sc-avatar-3{background:#8a4a35;}
.sc-avatar-4{background:#4a8a5a;} .sc-avatar-5{background:#7a5545;}
.sc-avatar-6{background:#355a8a;} .sc-avatar-7{background:#8a3a6a;}

/* Post card */
.sc-feed { display:flex; flex-direction:column; gap:0.7rem; }
.sc-post-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.sc-post-card:hover { border-color:rgba(180,140,80,0.22); }
.sc-post-card[data-type="question"] { border-left:3px solid #80b4f8; }
.sc-post-card[data-type="idea"]     { border-left:3px solid #e8c840; }
.sc-post-card[data-type="general"]  { border-left:3px solid #78d090; }
.sc-post-inner { padding:0.85rem 1rem 0.6rem; }
.sc-post-head {
  display:flex; align-items:flex-start; gap:0.6rem;
  margin-bottom:0.6rem; flex-wrap:wrap;
}
.sc-post-meta { display:flex; flex-direction:column; gap:0.15rem; flex:1; min-width:0; }
.sc-post-author { font-weight:700; color:#d4b87a; font-size:0.87rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sc-post-badge {
  display:inline-block; font-size:0.68rem;
  padding:0.1rem 0.48rem; border-radius:9px;
  font-weight:600; align-self:flex-start;
}
.sc-badge-question{background:rgba(100,160,255,0.14);color:#80b4f8;}
.sc-badge-idea    {background:rgba(255,220,80,0.14); color:#e8c840;}
.sc-badge-general {background:rgba(130,210,150,0.14);color:#78d090;}
.sc-post-time { color:#5a4a30; font-size:0.7rem; margin-left:auto; white-space:nowrap; align-self:flex-start; padding-top:2px; }
.sc-post-body {
  font-family:'Noto Serif Ethiopic',Georgia,serif;
  font-size:0.91rem; line-height:1.7; color:#ddd0b0;
  white-space:pre-wrap; word-break:break-word; margin-bottom:0.65rem;
}
.sc-repost-note {
  margin-bottom: 0.55rem;
  color: #aa8c5e;
  font-size: 0.73rem;
  font-family: Georgia, serif;
}
.sc-post-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}
.sc-inline-tag {
  padding: 0.2rem 0.58rem;
}
.sc-mention { color:#80b4f8; font-weight:600; }

/* Post actions */
.sc-post-actions {
  display:flex; align-items:center; gap:0.4rem;
  padding:0 1rem 0.65rem; flex-wrap:wrap;
}
.sc-replies-btn, .sc-reply-write-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.09);
  color: #8a7055;
  font-size: 0.76rem;
  padding: 0.26rem 0.7rem;
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display:inline-flex; align-items:center; gap:0.25rem;
}
.sc-replies-btn:hover, .sc-reply-write-btn:hover { border-color:rgba(180,140,80,0.38); color:#c8a060; }
.sc-replies-btn.open { background:rgba(180,140,80,0.1); border-color:rgba(180,140,80,0.35); color:#d4a853; }
.sc-replies-btn.active {
  background: rgba(140,35,35,0.22);
  border-color: rgba(220,90,90,0.35);
  color: #f2a5a5;
}

/* Replies */
.sc-replies {
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.18);
  padding: 0.75rem 1rem;
  display:flex; flex-direction:column; gap:0.65rem;
}
.sc-reply-card { display:flex; gap:0.55rem; align-items:flex-start; }
.sc-reply-body { flex:1; min-width:0; }
.sc-reply-author { font-size:0.78rem; font-weight:700; color:#c8a060; margin-bottom:0.18rem; }
.sc-reply-text {
  font-family:'Noto Serif Ethiopic',Georgia,serif;
  font-size:0.83rem; color:#c0b090; line-height:1.55; word-break:break-word;
}
.sc-reply-time { font-size:0.67rem; color:#5a4a30; margin-top:0.12rem; }

/* Reply form */
.sc-reply-form {
  margin-top:0.4rem;
  display:flex; flex-direction:column; gap:0.4rem;
  animation: scSlideIn 0.15s ease;
}
.sc-reply-form-btns { display:flex; justify-content:flex-end; gap:0.35rem; }
.sc-reply-cancel-btn {
  background:none; border:1px solid rgba(255,255,255,0.11);
  color:#7a6545; font-size:0.76rem;
  padding:0.26rem 0.65rem; border-radius:12px; cursor:pointer;
}

/* Loading / empty */
.sc-loading, .sc-empty {
  text-align:center; color:#7a6545;
  font-family:Georgia,serif; font-size:0.9rem; padding:3rem 1rem;
}

/* Responsive */
@media (max-width: 600px) {
  .store-header {
    padding: calc(0.75rem + var(--safe-top)) 0.85rem 0.75rem;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .store-user {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .store-scroll {
    padding: 1rem 0.8rem 2.25rem;
    padding-bottom: calc(2.25rem + var(--safe-bottom));
  }
  .store-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
  .book-card {
    border-radius: 12px;
  }
  .book-info {
    padding: 0.9rem 0.85rem 1rem;
  }
  .book-title {
    font-size: 0.98rem;
  }
  .book-rating-row {
    gap: 0.35rem 0.5rem;
  }
  .book-author-profile {
    grid-template-columns: 54px 1fr;
    gap: 0.65rem;
    padding: 0.72rem;
  }
  .book-author-photo {
    width: 54px;
    height: 54px;
  }
  .book-reviews-block {
    padding: 0.72rem;
  }
  .book-reviews-head {
    flex-direction: column;
    align-items: stretch;
  }
  .book-review-toggle,
  .book-review-submit {
    width: 100%;
    text-align: center;
  }
  .book-review-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .book-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }
  .book-price {
    font-size: 0.98rem;
  }
  .book-btn-group {
    width: 100%;
    justify-content: stretch;
  }
  .book-btn {
    width: 100%;
  }
  .sc-topbar { padding:0.45rem 0.75rem; }
  .sc-main   { padding:0.75rem 0.75rem 2.5rem; }
  .sc-hero-content { padding:0.9rem 0.75rem 1.2rem; }
  .sc-hero   { min-height:240px; max-height:360px; }
  .sc-topics {
    gap: 0.3rem;
  }
  .sc-topic-pill,
  .sc-inline-tag,
  .sc-stat-pill {
    font-size: 0.7rem;
    padding: 0.24rem 0.56rem;
  }
  .sc-compose {
    padding: 0.85rem;
  }
  .sc-compose-header {
    align-items: stretch;
    flex-direction: column;
  }
  .sc-type-sel {
    width: 100%;
  }
  .sc-compose-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .sc-compose-footer > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }
  .sc-cancel-btn {
    margin-right: 0;
  }
  .sc-filter { font-size:0.72rem; padding:0.24rem 0.52rem; }
  .sc-post-inner   { padding:0.7rem 0.75rem 0.5rem; }
  .sc-post-actions {
    padding:0 0.75rem 0.5rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sc-replies-btn,
  .sc-reply-write-btn,
  .sc-stat-pill {
    justify-content: center;
    width: 100%;
    text-align: center;
  }
  .sc-replies      { padding:0.6rem 0.75rem; }
  .sc-newpost-btn  { font-size:0.78rem; padding:0.38rem 0.85rem; }
}
@media (max-width: 420px) {
  .store-logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
  }
  .store-community-btn,
  .store-signout {
    width: 100%;
    text-align: center;
  }
  .book-rating-picker {
    flex-wrap: wrap;
  }
  .book-review-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .sc-post-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  .store-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
  .book-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }
  .book-btn-group {
    justify-content: stretch;
  }
  .book-btn {
    flex: 1;
  }
}
@media (min-width: 901px) {
  .sc-hero { min-height:460px; max-height:620px; }
  .sc-main { max-width: 860px; }
}

/* ================================================================
   SELL SCREEN
   ================================================================ */
#sell-screen, #admin-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0d1117;
}
.sell-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 1rem;
  background: rgba(13,17,23,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(180,140,80,0.18);
  gap: 0.5rem; flex-wrap: wrap;
}
.sell-brand { display:flex; align-items:center; gap:0.35rem; }
.sell-brand-ti  { font-family:'Noto Serif Ethiopic',Georgia,serif; font-size:0.95rem; font-weight:700; color:#d4a853; }
.sell-brand-sep { color:#5a4a30; }
.sell-brand-en  { font-family:Georgia,serif; font-size:0.75rem; color:#a89070; letter-spacing:0.04em; }

.sell-hero {
  position: relative;
  background: linear-gradient(135deg, #1a2540 0%, #0d1117 60%, #1a1a0d 100%);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(212,168,83,0.2);
}
.sell-hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(212,168,83,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.sell-hero-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.sell-hero-icon  { font-size: 3rem; margin-bottom: 0.5rem; }
.sell-hero-title { font-family:'Noto Serif Ethiopic',Georgia,serif; font-size:2rem; color:#d4a853; margin:0 0 0.3rem; }
.sell-hero-sub   { font-family:Georgia,serif; font-size:1rem; color:#c8a96e; margin:0 0 0.8rem; font-style:italic; }
.sell-hero-desc  { font-family:'Noto Serif Ethiopic',Georgia,serif; color:#c8bfaf; font-size:0.9rem; line-height:1.7; margin:0 0 0.4rem; }
.sell-hero-en    { color:#7a8090; font-size:0.8rem; font-style:italic; margin:0; }

.sell-main { max-width: 700px; margin: 0 auto; padding: 1.5rem 1rem 3rem; width: 100%; }

.sell-auth-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 12px; padding: 2rem; text-align: center; margin-bottom: 2rem;
  color: #c8bfaf;
}
.sell-auth-card p { margin: 0 0 0.5rem; }
.sell-auth-btns  { display:flex; gap:0.75rem; justify-content:center; flex-wrap:wrap; margin-top:1rem; }
.sell-signin-btn, .sell-signup-btn {
  padding: 0.55rem 1.2rem; border-radius: 8px; font-size: 0.9rem; cursor: pointer; border: none;
}
.sell-signin-btn { background: rgba(255,255,255,0.1); color:#d4b87a; border:1px solid rgba(212,168,83,0.3); }
.sell-signup-btn { background: #d4a853; color: #0d1117; font-weight: 700; }

.sell-steps {
  display: flex; align-items: center; gap: 0.3rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.sell-step-ind {
  padding: 0.35rem 0.8rem; border-radius: 20px; font-size: 0.8rem;
  background: rgba(255,255,255,0.06); color: #7a8090;
  border: 1px solid rgba(255,255,255,0.1);
}
.sell-step-ind.active { background: #d4a853; color: #0d1117; font-weight: 700; border-color: #d4a853; }
.sell-step-ind.done   { background: rgba(212,168,83,0.15); color: #d4b87a; border-color: rgba(212,168,83,0.3); }
.sell-step-arrow { color: #5a4a30; font-size: 1.2rem; }

.sell-step-panel { animation: fadeIn 0.2s ease; }
.sell-section-title {
  font-family:'Noto Serif Ethiopic',Georgia,serif;
  font-size:1.15rem; color:#d4a853; margin:0 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212,168,83,0.15);
}
.sell-step-desc { color:#a89070; font-size:0.88rem; margin:0 0 1rem; line-height:1.6; }

.sell-field { display:flex; flex-direction:column; gap:0.35rem; margin-bottom:1rem; }
.sell-field label { color:#c8bfaf; font-size:0.85rem; font-weight:600; }
.sell-optional { color:#5a4a30; font-weight:400; }
.sell-field input, .sell-field textarea, .sell-field select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 0.6rem 0.8rem;
  color: #e8e0d0; font-size:0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.sell-field input:focus, .sell-field textarea:focus, .sell-field select:focus {
  outline: none; border-color: rgba(212,168,83,0.5);
  background: rgba(255,255,255,0.07);
}
.sell-field select { cursor: pointer; }
.sell-field select option { background: #1a2030; }
.sell-hint { color:#5a6070; font-size:0.78rem; }
.sell-field-row { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }

.sell-chapter-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 1rem; margin-bottom: 1rem;
}
.sell-chapter-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}
.sell-ch-num    { color:#d4b87a; font-weight:700; font-size:0.85rem; }
.sell-free-label{ display:flex; align-items:center; gap:0.35rem; color:#a89070; font-size:0.82rem; cursor:pointer; }
.sell-remove-ch { background:none; border:none; color:#7a4040; cursor:pointer; font-size:0.82rem; margin-left:auto; }
.sell-remove-ch:hover { color:#c05050; }
.sell-ch-title {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 0.5rem 0.7rem;
  color: #e8e0d0; font-size:0.88rem; margin-bottom:0.6rem;
  font-family: inherit; box-sizing: border-box;
}
.sell-ch-content {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; padding: 0.5rem 0.7rem;
  color: #c8bfaf; font-size:0.85rem; resize: vertical;
  font-family: inherit; box-sizing: border-box; min-height:100px;
}
.sell-ch-title:focus, .sell-ch-content:focus {
  outline:none; border-color:rgba(212,168,83,0.4);
}
.sell-add-ch-btn {
  background: rgba(212,168,83,0.1); color:#d4b87a;
  border: 1px dashed rgba(212,168,83,0.35);
  border-radius: 8px; padding: 0.55rem 1.1rem;
  cursor: pointer; font-size:0.88rem; width:100%; margin-bottom:1rem;
  transition: background 0.2s;
}
.sell-add-ch-btn:hover { background: rgba(212,168,83,0.18); }

.sell-terms-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 10px; padding: 1.2rem; margin:1rem 0;
}
.sell-terms-box h3 { color:#d4a853; margin:0 0 0.8rem; font-size:0.95rem; }
.sell-terms-box ul { color:#a89070; font-size:0.85rem; line-height:2; padding-left:1.2rem; margin:0 0 1rem; }
.sell-agree-label { display:flex; align-items:flex-start; gap:0.5rem; color:#c8bfaf; font-size:0.88rem; cursor:pointer; }
.sell-agree-label input { margin-top:0.2rem; accent-color:#d4a853; }

.sell-preview-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 10px; padding: 1rem; margin-bottom:1rem;
}
.sell-preview-row { display:flex; gap:1rem; align-items:flex-start; }
.sell-preview-cover { width:80px; height:110px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.sell-preview-no-cover {
  width:80px; height:110px; border-radius:6px; flex-shrink:0;
  background:rgba(212,168,83,0.1); display:flex; align-items:center;
  justify-content:center; font-size:2rem;
}
.sell-preview-info  { flex:1; min-width:0; }
.sell-preview-title { font-family:'Noto Serif Ethiopic',Georgia,serif; color:#d4a853; font-size:1rem; font-weight:700; margin-bottom:0.2rem; }
.sell-preview-title-en { color:#a89070; font-size:0.82rem; margin-bottom:0.3rem; }
.sell-preview-author { color:#c8bfaf; font-size:0.82rem; margin-bottom:0.5rem; }
.sell-preview-meta  { display:flex; flex-wrap:wrap; gap:0.5rem; margin-bottom:0.5rem; }
.sell-preview-meta span {
  background: rgba(255,255,255,0.06); color:#a89070;
  font-size:0.75rem; padding:0.2rem 0.5rem; border-radius:4px;
}
.sell-preview-desc { color:#a89070; font-size:0.83rem; line-height:1.6; margin:0; }

.sell-err  { color:#e05050; font-size:0.83rem; min-height:1.2em; margin-bottom:0.5rem; }
.sell-nav-btns {
  display:flex; justify-content:space-between; align-items:center;
  gap:0.75rem; flex-wrap:wrap; margin-top:1.2rem;
}
.sell-back-btn {
  background:none; border:1px solid rgba(255,255,255,0.15);
  color:#a89070; padding:0.55rem 1.1rem; border-radius:8px;
  cursor:pointer; font-size:0.88rem;
}
.sell-back-btn:hover { border-color:rgba(255,255,255,0.3); color:#c8bfaf; }
.sell-next-btn {
  background:#d4a853; color:#0d1117; font-weight:700;
  border:none; padding:0.6rem 1.4rem; border-radius:8px;
  cursor:pointer; font-size:0.9rem;
}
.sell-next-btn:hover { background:#e0b860; }
.sell-submit-btn {
  background: linear-gradient(135deg,#d4a853,#b8892a);
  color:#0d1117; font-weight:700; border:none;
  padding:0.7rem 1.8rem; border-radius:8px;
  cursor:pointer; font-size:0.95rem;
}
.sell-submit-btn:disabled { opacity:0.6; cursor:default; }

.sell-success-card {
  text-align:center; padding:3rem 1.5rem;
  background:rgba(212,168,83,0.06);
  border:1px solid rgba(212,168,83,0.25);
  border-radius:14px;
}
.sell-success-icon {
  font-size:3.5rem; color:#d4a853; margin-bottom:1rem;
  width:80px; height:80px; border-radius:50%;
  background:rgba(212,168,83,0.15);
  display:inline-flex; align-items:center; justify-content:center;
}
.sell-success-card h2 { color:#d4a853; margin:0 0 1rem; }
.sell-success-card p  { color:#a89070; line-height:1.7; margin:0 0 0.5rem; }

.sell-my-submissions  { margin-top:2.5rem; border-top:1px solid rgba(255,255,255,0.08); padding-top:1.5rem; }
.sell-submission-item {
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px; padding:1rem; margin-bottom:0.75rem;
}
.sell-sub-title { color:#d4b87a; font-weight:700; margin-bottom:0.4rem; }
.sell-sub-meta  { display:flex; gap:0.6rem; flex-wrap:wrap; align-items:center; font-size:0.8rem; color:#7a8090; }
.sell-sub-status { padding:0.15rem 0.55rem; border-radius:4px; font-weight:700; font-size:0.75rem; }
.sell-sub-status-pending  { background:rgba(212,168,83,0.2); color:#d4b87a; }
.sell-sub-status-approved { background:rgba(80,200,80,0.2);  color:#80d080; }
.sell-sub-status-rejected { background:rgba(200,80,80,0.2);  color:#e08080; }
.sell-sub-note { color:#a89070; font-size:0.8rem; margin-top:0.4rem; font-style:italic; }

/* Store sell button */
.store-sell-btn { background: rgba(212,168,83,0.15) !important; border-color: rgba(212,168,83,0.4) !important; }
.store-sell-btn:hover { background: rgba(212,168,83,0.25) !important; }
.store-admin-btn {
  background: rgba(255,80,80,0.12); color:#e08080;
  border:1px solid rgba(255,80,80,0.25);
  padding:0.3rem 0.75rem; border-radius:6px;
  cursor:pointer; font-size:0.78rem;
}
.store-admin-btn:hover { background:rgba(255,80,80,0.2); }

/* Admin screen */
.sell-admin-tabs { display:flex; gap:0.5rem; margin-bottom:1.5rem; flex-wrap:wrap; }
.sell-admin-tab {
  padding:0.45rem 1rem; border-radius:8px; border:1px solid rgba(255,255,255,0.1);
  background:rgba(255,255,255,0.04); color:#7a8090; cursor:pointer; font-size:0.85rem;
}
.sell-admin-tab.active { background:#d4a853; color:#0d1117; font-weight:700; border-color:#d4a853; }
.admin-book-card {
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:12px; padding:1.2rem; margin-bottom:1rem;
}
.admin-book-header { display:flex; gap:1rem; align-items:flex-start; margin-bottom:0.8rem; }
.admin-book-thumb  { width:60px; height:85px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.admin-book-info   { flex:1; min-width:0; }
.admin-book-title  { color:#d4a853; font-weight:700; font-size:1rem; margin-bottom:0.2rem; }
.admin-book-title-en { color:#a89070; font-size:0.82rem; margin-bottom:0.3rem; }
.admin-book-meta   { color:#7a8090; font-size:0.78rem; margin-bottom:0.4rem; }
.admin-book-meta a { color:#d4b87a; }
.admin-book-desc   { color:#a89070; font-size:0.83rem; line-height:1.5; }
.admin-chapters-detail { margin-bottom:0.8rem; }
.admin-chapters-detail summary { color:#a89070; font-size:0.82rem; cursor:pointer; padding:0.3rem 0; }
.admin-chapter-preview { padding:0.5rem 0; border-top:1px solid rgba(255,255,255,0.06); }
.admin-chapter-preview strong { color:#c8bfaf; font-size:0.82rem; }
.admin-chapter-preview p { color:#7a8090; font-size:0.8rem; margin:0.3rem 0 0; line-height:1.5; }
.admin-book-actions { display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap; padding-top:0.8rem; border-top:1px solid rgba(255,255,255,0.06); }
.admin-note-input {
  flex:1; min-width:160px;
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
  border-radius:6px; padding:0.4rem 0.7rem; color:#c8bfaf; font-size:0.82rem;
  font-family:inherit;
}
.admin-note-input:focus { outline:none; border-color:rgba(212,168,83,0.4); }
.admin-approve-btn {
  background:rgba(80,200,80,0.15); color:#80d080;
  border:1px solid rgba(80,200,80,0.3);
  padding:0.4rem 1rem; border-radius:6px; cursor:pointer; font-size:0.85rem;
}
.admin-approve-btn:hover { background:rgba(80,200,80,0.25); }
.admin-reject-btn {
  background:rgba(200,80,80,0.15); color:#e08080;
  border:1px solid rgba(200,80,80,0.3);
  padding:0.4rem 1rem; border-radius:6px; cursor:pointer; font-size:0.85rem;
}
.admin-reject-btn:hover { background:rgba(200,80,80,0.25); }
.sc-empty { text-align:center; color:#5a6070; padding:2rem; font-size:0.9rem; }

@media (max-width: 500px) {
  .sell-field-row { grid-template-columns: 1fr; }
  .sell-nav-btns  { flex-direction: column-reverse; }
  .sell-back-btn, .sell-next-btn, .sell-submit-btn { width:100%; text-align:center; }
}


/* Post edit/delete */
.sc-edit-post-btn {
  background: none; border: 1px solid rgba(212,168,83,0.25);
  color: #a89070; padding: 0.25rem 0.6rem; border-radius: 6px;
  font-size: 0.78rem; cursor: pointer; margin-left: auto;
}
.sc-edit-post-btn:hover { border-color: rgba(212,168,83,0.5); color: #d4b87a; }
.sc-delete-post-btn {
  background: none; border: 1px solid rgba(200,80,80,0.25);
  color: #a07070; padding: 0.25rem 0.6rem; border-radius: 6px;
  font-size: 0.78rem; cursor: pointer;
}
.sc-delete-post-btn:hover { border-color: rgba(200,80,80,0.5); color: #e08080; }
.sc-edit-form { padding: 0.75rem 0 0.5rem; }
.sc-edit-textarea {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(212,168,83,0.3); border-radius: 8px;
  padding: 0.6rem 0.8rem; color: #e8e0d0; font-size: 0.9rem;
  font-family: inherit; resize: vertical; min-height: 80px;
  box-sizing: border-box; margin-bottom: 0.5rem;
}
.sc-edit-textarea:focus { outline: none; border-color: rgba(212,168,83,0.6); }
.sc-edit-form-btns { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.4rem; }
.sc-edit-save-btn {
  background: #d4a853; color: #0d1117; font-weight: 700;
  border: none; padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}
.sc-edit-save-btn:disabled { opacity: 0.6; cursor: default; }

/* Free book badge */
.book-free-badge {
  display:inline-block; background:rgba(80,200,80,0.18); color:#7de07d;
  border:1px solid rgba(80,200,80,0.3); border-radius:20px;
  padding:0.15rem 0.65rem; font-size:0.78rem; font-weight:700; letter-spacing:0.02em;
}

/* Contact Us store button */
.store-contact-btn {
  background:rgba(100,180,255,0.1) !important;
  border-color:rgba(100,180,255,0.3) !important;
  color:#80b4e0 !important;
}
.store-contact-btn:hover { background:rgba(100,180,255,0.2) !important; }

/* Contact Us full page */
#contact-screen {
  position:fixed; inset:0; z-index:800;
  background:#0d1117;
  flex-direction:column;
  overflow:hidden;
}
.contact-page-header {
  display:flex; align-items:center; gap:1rem;
  padding:1rem 1.5rem;
  border-bottom:1px solid rgba(255,255,255,0.08);
  flex-shrink:0;
}
.contact-page-back {
  background:none; border:1px solid rgba(212,168,83,0.3);
  color:#d4a853; padding:0.4rem 1rem; border-radius:8px;
  cursor:pointer; font-size:0.9rem; font-family:inherit;
}
.contact-page-back:hover { background:rgba(212,168,83,0.1); }
.contact-page-title {
  font-family:'Palatino Linotype',Georgia,serif;
  font-size:1.3rem; font-weight:700; color:#d4a853; margin:0;
}
.contact-page-scroll { flex:1; overflow-y:auto; }
.contact-page-body {
  max-width:560px; margin:0 auto;
  padding:2.5rem 1.5rem 5rem;
}

/* Social buttons */
.contact-socials {
  display:flex; gap:1rem; flex-wrap:wrap;
  margin-bottom:2rem;
}
.contact-social-btn {
  flex:1; min-width:130px;
  display:flex; align-items:center; justify-content:center; gap:0.55rem;
  padding:0.85rem 1rem; border-radius:12px;
  font-weight:700; font-size:0.95rem; text-decoration:none;
  border:2px solid transparent; transition:all 0.2s;
}
.contact-social-icon { width:20px; height:20px; flex-shrink:0; }
.contact-social-fb  { background:rgba(24,119,242,0.15); color:#4d90f0; border-color:rgba(24,119,242,0.3); }
.contact-social-fb:hover  { background:rgba(24,119,242,0.28); border-color:#1877f2; }
.contact-social-li  { background:rgba(10,102,194,0.15); color:#5ba0d0; border-color:rgba(10,102,194,0.3); }
.contact-social-li:hover  { background:rgba(10,102,194,0.28); border-color:#0a66c2; }
.contact-social-wa  { background:rgba(37,211,102,0.12); color:#4dd080; border-color:rgba(37,211,102,0.3); }
.contact-social-wa:hover  { background:rgba(37,211,102,0.24); border-color:#25d366; }

.contact-page-divider {
  text-align:center; color:#4a5060; font-size:0.85rem;
  margin:0 0 1.8rem; letter-spacing:0.05em;
}

/* Contact form (reused field styles) */
.contact-form-wrap .contact-field { margin-bottom:1rem; }
.contact-form-wrap .contact-field label {
  display:block; color:#a89070; font-size:0.82rem; margin-bottom:0.35rem;
}
.contact-form-wrap .contact-field input,
.contact-form-wrap .contact-field textarea {
  width:100%; background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.12); border-radius:8px;
  padding:0.65rem 0.9rem; color:#e8e0d0; font-size:0.95rem;
  font-family:inherit; box-sizing:border-box; resize:vertical;
}
.contact-form-wrap .contact-field input:focus,
.contact-form-wrap .contact-field textarea:focus {
  outline:none; border-color:rgba(212,168,83,0.5);
}
.contact-error { color:#e08080; font-size:0.83rem; min-height:1rem; margin-bottom:0.5rem; }
.contact-success {
  background:rgba(80,200,80,0.1); border:1px solid rgba(80,200,80,0.25);
  border-radius:8px; padding:0.75rem 1rem; color:#80d080;
  font-size:0.9rem; margin-bottom:0.75rem; text-align:center;
}
.contact-submit {
  width:100%; background:#d4a853; color:#0d1117; font-weight:700;
  border:none; border-radius:10px; padding:0.8rem; font-size:1rem;
  cursor:pointer; font-family:inherit; transition:background 0.2s;
  margin-top:0.5rem;
}
.contact-submit:hover { background:#c4983f; }
.contact-submit:disabled { opacity:0.6; cursor:default; }
