:root {
  --theme-accent: #0b3b2e;
  --theme-light-bg: #f6f3ec;
  --theme-light-surface: #ffffff;
  --theme-dark-bg: #0c1210;
  --theme-dark-surface: #111a16;

  --bg-top: var(--theme-light-bg);
  --bg-bottom: color-mix(in srgb, var(--theme-light-bg) 88%, white 12%);
  --arabic-top: color-mix(in srgb, var(--theme-light-surface) 84%, white 16%);
  --arabic-bottom: color-mix(in srgb, var(--theme-light-bg) 82%, var(--theme-light-surface) 18%);
  --panel-top: color-mix(in srgb, var(--theme-light-surface) 86%, var(--theme-light-bg) 14%);
  --panel-bottom: color-mix(in srgb, var(--theme-light-bg) 82%, var(--theme-light-surface) 18%);
  --sticky-top: color-mix(in srgb, var(--theme-light-surface) 98%, transparent);
  --sticky-bottom: color-mix(in srgb, var(--theme-light-surface) 88%, transparent);

  --dock-bg: color-mix(in srgb, var(--theme-light-surface) 96%, transparent);
  --overlay-bg: color-mix(in srgb, var(--theme-light-bg) 55%, transparent);
  --overlay-spinner: rgba(31, 42, 36, 0.12);

  --bg: var(--theme-light-bg);
  --surface: var(--theme-light-surface);
  --surface-soft: color-mix(in srgb, var(--theme-light-surface) 72%, var(--theme-light-bg) 28%);
  --text: #1f2a24;
  --muted: #5e6a63;
  --accent: var(--theme-accent);
  --accent-soft: color-mix(in srgb, var(--theme-accent) 16%, white 84%);
  --link-color: #2a69c7;
  --border: color-mix(in srgb, var(--theme-light-bg) 62%, #b3a794 38%);
  --shadow: 0 14px 34px rgba(24, 35, 28, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --dock-height: 154px;
}


html[data-theme="dark"] {
  --bg-top: color-mix(in srgb, var(--theme-dark-bg) 92%, black 8%);
  --bg-bottom: color-mix(in srgb, var(--theme-dark-bg) 72%, black 28%);
  --arabic-top: color-mix(in srgb, var(--theme-dark-surface) 86%, var(--theme-dark-bg) 14%);
  --arabic-bottom: color-mix(in srgb, var(--theme-dark-surface) 62%, black 38%);
  --panel-top: color-mix(in srgb, var(--theme-dark-surface) 90%, var(--theme-dark-bg) 10%);
  --panel-bottom: color-mix(in srgb, var(--theme-dark-surface) 68%, black 32%);
  --sticky-top: color-mix(in srgb, var(--theme-dark-surface) 92%, transparent);
  --sticky-bottom: color-mix(in srgb, var(--theme-dark-surface) 82%, transparent);

  --bg: var(--theme-dark-bg);
  --surface: var(--theme-dark-surface);
  --surface-soft: color-mix(in srgb, var(--theme-dark-surface) 82%, var(--theme-dark-bg) 18%);
  --text: #eef2f0;
  --muted: #a6b3ad;
  --accent: color-mix(in srgb, var(--theme-accent) 68%, white 32%);
  --accent-soft: color-mix(in srgb, var(--theme-accent) 18%, black 82%);
  --link-color: color-mix(in srgb, var(--theme-accent) 28%, #8ec9ff 72%);
  --border: color-mix(in srgb, var(--theme-dark-surface) 74%, #2d3b35 26%);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --dock-bg: color-mix(in srgb, var(--theme-dark-surface) 92%, transparent);
  --overlay-bg: rgba(0,0,0,0.40);
  --overlay-spinner: rgba(238, 242, 240, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  transition: background-color 200ms ease, color 200ms ease;

  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

button,
a {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.home-shell,
.reader-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.hero-card,
.info-card,
.progress-card,
.athkar-card,
.empty-card,
.action-dock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card,
.info-card,
.progress-card,
.athkar-card,
.empty-card {
  padding: 20px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hero-card h1,
.reader-header h1 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.05;
}

.hero-text,
.hero-note,
.info-card p,
.progress-label,
.counter-subtext,
.source-box p,
.text-block p {
  color: var(--muted);
}



.home-shell-app {
  display: grid;
  gap: 16px;
}

.home-hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.home-hero-brand {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bottom) 100%);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.home-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-hero-copy {
  min-width: 0;
}

.home-section-heading h2,
.home-content-card h2,
.page-content-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
}

.home-links-section,
.home-sections-section {
  display: grid;
  gap: 12px;
}

.section-grid-pages {
  margin: 0;
}

.section-tile-page {
  min-height: 120px;
}

.home-content-card > :last-child,
.page-content-card > :last-child {
  margin-bottom: 0;
}

.page-content-card {
  line-height: 1.7;
}


.page-content-card a,
.home-content-card a,
.info-card a:not(.primary-button):not(.ghost-button),
.athkar-card a:not(.primary-button):not(.ghost-button) {
  color: var(--link-color);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.breadcrumb-nav {
  font-weight: 600;
}

.breadcrumb-nav a {
  text-decoration: none;
}

.breadcrumb-current {
  color: var(--text);
}

.brand-logo-link {
  display: inline-flex;
  text-decoration: none;
}

.brand-logo-link:focus-visible .home-hero-brand,
.brand-logo-link:hover .home-hero-brand {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 16px 30px rgba(11, 59, 46, 0.12);
}

.public-brand-card {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr;
  gap: 18px;
  align-items: center;
}

.public-brand-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
  font-weight: 800;
  color: var(--text);
}

.public-brand-card .hero-text {
  margin-bottom: 0;
}

.athkar-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.athkar-card-head h2 {
  margin: 0;
}

.athkar-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-content-card ul,
.home-content-card ul {
  padding-left: 18px;
}

.page-content-card a,
.home-content-card a {
  color: var(--link-color);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.section-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 132px;
}

.tile-icon {
  font-size: 1.6rem;
}

.tile-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.tile-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.info-card ul {
  margin: 0 0 14px;
  padding-left: 18px;
}

.reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.reader-title-wrap {
  flex: 1;
  min-width: 0;
}

.back-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.progress-card {
  margin-bottom: 16px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.progress-bar.is-complete {
  box-shadow: 0 0 0 4px rgba(11, 59, 46, 0.16);
}

html[data-theme="dark"] .progress-bar.is-complete {
  box-shadow: 0 0 0 4px rgba(46, 229, 157, 0.18);
}


.item-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.badge.subtle {
  background: var(--surface-soft);
  color: var(--muted);
}

.arabic-box,
.source-box,
.counter-card,
.text-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.arabic-box {
  margin: 16px 0;
  background: linear-gradient(180deg, var(--arabic-top) 0%, var(--arabic-bottom) 100%);
}

.arabic-text {
  direction: rtl;
  text-align: right;
  font-size: clamp(1.425rem, 3.8vw, 1.9rem);
  line-height: 1.9;
  margin-bottom: 0;
}

.text-block {
  margin-bottom: 12px;
}

.text-block h3,
.source-box strong,
.counter-label {
  display: block;
  margin-bottom: 8px;
}

.counter-card {
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bottom) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.counter-number {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
}

.counter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 132px;
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  padding: 12px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.ghost-button {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

a.ghost-button {
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.navigation-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.grow {
  flex: 1;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.empty-card {
  text-align: center;
}

.tap-safe,
button,
a,
.tab-button {
  touch-action: manipulation;
}

.tap-safe {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.reader-body {
  min-height: 100svh;
}

.reader-shell-app {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.compact-header {
  margin-bottom: 0;
  align-items: center;
}

.compact-header .eyebrow {
  margin-bottom: 4px;
}

.compact-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.compact-button {
  padding: 10px 14px;
  min-height: 44px;
}

.progress-card-compact {
  padding: 14px 16px;
  margin-bottom: 0;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-card-compact .progress-label {
  margin: 0;
  font-size: 0.85rem;
}

.progress-card-compact strong {
  white-space: nowrap;
  font-size: 0.95rem;
}

.progress-card-compact .progress-track {
  margin-top: 10px;
  height: 8px;
}

.athkar-card-app {
  overflow: auto;
  min-height: 0;
  padding-bottom: 16px;
  scroll-padding-bottom: calc(var(--dock-height) + 24px);
}

.item-meta-row-sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--sticky-top) 0%, var(--sticky-bottom) 100%);
  padding-bottom: 8px;
  backdrop-filter: blur(8px);
}

.athkar-card-app h2 {
  margin-bottom: 12px;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.compact-block {
  padding: 14px;
}

.compact-block h3,
.compact-block strong {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.compact-block p {
  margin-bottom: 0;
  line-height: 1.55;
}


.detail-tabs {
  display: grid;
  gap: 12px;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  position: sticky;
  top: 48px;
  z-index: 1;
  background: linear-gradient(180deg, var(--sticky-top) 0%, var(--sticky-bottom) 100%);
  padding: 6px 0 2px;
  backdrop-filter: blur(10px);
}

.tab-button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tab-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab-panel {
  margin-bottom: 0;
}

.tab-panel p {
  margin: 0;
}

.action-dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px;
  background: var(--dock-bg);
  backdrop-filter: blur(16px);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(24, 35, 28, 0.1);
  margin-bottom: calc(-12px - env(safe-area-inset-bottom));
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.dock-counter-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.dock-counter-number {
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-weight: 800;
  line-height: 1;
}

.dock-counter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dock-count-button {
  min-width: 124px;
  min-height: 50px;
}

.dock-navigation {
  margin-top: 12px;
}

@media (max-width: 560px) {
  .home-hero-card,
  .brand-logo-link {
  display: inline-flex;
  text-decoration: none;
}

.brand-logo-link:focus-visible .home-hero-brand,
.brand-logo-link:hover .home-hero-brand {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 16px 30px rgba(11, 59, 46, 0.12);
}

.public-brand-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  :root {
  --dock-bg: color-mix(in srgb, var(--theme-light-surface) 96%, transparent);
  --overlay-bg: color-mix(in srgb, var(--theme-light-bg) 55%, transparent);
  --overlay-spinner: color-mix(in srgb, var(--theme-dark-bg) 12%, transparent);

    --dock-height: 164px;
  }

  .home-shell,
  .reader-shell {
    padding: 14px 12px 24px;
  }

  

.home-shell-app {
  display: grid;
  gap: 16px;
}

.home-hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.home-hero-brand {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bottom) 100%);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.home-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-hero-copy {
  min-width: 0;
}

.home-section-heading h2,
.home-content-card h2,
.page-content-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
}

.home-links-section,
.home-sections-section {
  display: grid;
  gap: 12px;
}

.section-grid-pages {
  margin: 0;
}

.section-tile-page {
  min-height: 120px;
}

.home-content-card > :last-child,
.page-content-card > :last-child {
  margin-bottom: 0;
}

.page-content-card {
  line-height: 1.7;
}


.page-content-card a,
.home-content-card a,
.info-card a:not(.primary-button):not(.ghost-button),
.athkar-card a:not(.primary-button):not(.ghost-button) {
  color: var(--link-color);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.breadcrumb-nav {
  font-weight: 600;
}

.breadcrumb-nav a {
  text-decoration: none;
}

.breadcrumb-current {
  color: var(--text);
}

.brand-logo-link {
  display: inline-flex;
  text-decoration: none;
}

.brand-logo-link:focus-visible .home-hero-brand,
.brand-logo-link:hover .home-hero-brand {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 16px 30px rgba(11, 59, 46, 0.12);
}

.public-brand-card {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr;
  gap: 18px;
  align-items: center;
}

.public-brand-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
  font-weight: 800;
  color: var(--text);
}

.public-brand-card .hero-text {
  margin-bottom: 0;
}

.athkar-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.athkar-card-head h2 {
  margin: 0;
}

.athkar-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-content-card ul,
.home-content-card ul {
  padding-left: 18px;
}

.page-content-card a,
.home-content-card a {
  color: var(--link-color);
}

.section-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reader-header {
    gap: 10px;
  }

  .compact-header {
    align-items: flex-start;
    flex-wrap: nowrap;
  }

  .compact-header h1 {
    line-height: 1.08;
  }

  .progress-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .athkar-card-app {
    padding: 14px;
  }
  .tab-row {
    top: 44px;
    gap: 6px;
  }

  .tab-button {
    min-height: 42px;
    padding: 9px 10px;
    font-size: 0.9rem;
  }


  .arabic-box {
    margin: 12px 0;
    padding: 14px;
  }

  .arabic-text {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    line-height: 1.7;
  }

  .dock-counter-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dock-counter-actions {
    width: 100%;
  }

  .dock-counter-actions .ghost-button,
  .dock-counter-actions .primary-button {
    flex: 1;
  }
}

@media (max-width: 430px) {
  .tab-button {
    font-size: 0.84rem;
  }
}

@media (max-width: 380px) {
  .compact-header {
    flex-wrap: wrap;
  }

  .compact-button,
  .dock-count-button {
    min-height: 46px;
  }

  .dock-navigation {
    flex-direction: row;
  }
}


/* Polished mobile dock v4 */
:root {
  --dock-bg: color-mix(in srgb, var(--theme-light-surface) 96%, transparent);
  --overlay-bg: color-mix(in srgb, var(--theme-light-bg) 55%, transparent);
  --overlay-spinner: color-mix(in srgb, var(--theme-dark-bg) 12%, transparent);

  --dock-height: 138px;
}

.reader-shell-app {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.athkar-card-app {
  padding: 16px;
  scroll-padding-bottom: calc(var(--dock-height) + 24px);
}

.athkar-card-app h2 {
  margin-bottom: 10px;
}

.action-dock-polished {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-bottom: calc(-12px - env(safe-area-inset-bottom));
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--dock-bg);
  backdrop-filter: blur(16px);
  box-shadow: 0 -12px 36px rgba(18, 32, 25, 0.14);
  border-top: 1px solid rgba(0,0,0,0.06);
}

.dock-topbar {
  margin-bottom: 10px;
}

.dock-progress-wrap {
  display: grid;
  gap: 8px;
}

.dock-progress-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dock-progress-text {
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.dock-chip-soft {
  background: var(--surface-soft);
  color: var(--muted);
}

.dock-chip-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.dock-progress-track {
  margin-top: 0;
  height: 6px;
}

.dock-main-controls {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px 56px;
  gap: 10px;
  align-items: stretch;
}

.dock-icon-button,
.dock-counter-button {
  border: 1px solid var(--border);
  border-radius: 20px;
  min-height: 64px;
  background: var(--surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dock-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 10px 20px rgba(18, 32, 25, 0.06);
  color: var(--text);
}

.dock-undo-button {
  background: linear-gradient(180deg, #fff5e7 0%, #f8ead2 100%);
  border-color: #ead5b2;
  color: #8a5a14;
  box-shadow: 0 10px 22px rgba(138, 90, 20, 0.14);
}

html[data-theme="dark"] .dock-undo-button {
  background: linear-gradient(180deg, rgba(138, 90, 20, 0.22) 0%, rgba(138, 90, 20, 0.10) 100%);
  border-color: rgba(234, 213, 178, 0.22);
  color: #ffd19a;
  box-shadow: 0 12px 24px rgba(0,0,0,0.38);
}

.dock-undo-button:disabled {
  opacity: 0.45;
  color: #ae915e;
  background: #f6efe2;
}

.dock-icon-button svg,
.dock-counter-mini svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock-counter-button {
  background: linear-gradient(180deg, #124536 0%, #0b3b2e 100%);
  color: #fff;
  border-color: rgba(11, 59, 46, 0.65);
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    'mini value'
    'mini note';
  align-items: center;
  justify-content: center;
  column-gap: 14px;
  row-gap: 2px;
  padding: 10px 16px;
  box-shadow: 0 14px 24px rgba(11, 59, 46, 0.24);
}

.dock-counter-mini {
  grid-area: mini;
  align-self: center;
  justify-self: start;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dock-counter-value {
  grid-area: value;
  font-size: clamp(1.85rem, 7vw, 2.55rem);
  font-weight: 800;
  line-height: 1;
  min-width: 1.5ch;
  text-align: left;
}

.dock-counter-note {
  grid-area: note;
  font-size: 0.8rem;
  opacity: 0.88;
  text-align: left;
}

.dock-counter-button.is-complete {
  background: linear-gradient(180deg, #166048 0%, #0f4d3b 100%);
}

.dock-counter-button.is-complete .dock-counter-mini {
  background: rgba(255,255,255,0.18);
}

.dock-icon-button,
.dock-counter-button,
.dock-counter-value,
.dock-counter-mini {
  transition: transform 0.16s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
}

.dock-counter-button {
  position: relative;
  overflow: hidden;
}

.dock-counter-button::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 72%);
  opacity: 0;
  transform: scale(0.82);
  pointer-events: none;
}

.dock-icon-button:active,
.dock-counter-button:active {
  transform: translateY(1px) scale(0.992);
}

.dock-counter-button.is-tapped {
  animation: counterPress 220ms ease-out;
}

.dock-counter-button.is-tapped::after {
  animation: counterGlow 240ms ease-out;
}

.dock-counter-value.is-bump {
  animation: counterNumberBump 180ms ease-out;
}

.dock-counter-mini.is-bump {
  animation: counterMiniBump 180ms ease-out;
}

.dock-icon-button.is-tapped,
.dock-icon-button:focus-visible,
.dock-counter-button:focus-visible {
  box-shadow: 0 0 0 4px rgba(11, 59, 46, 0.12), 0 10px 22px rgba(18, 32, 25, 0.12);
}

.dock-undo-button.is-tapped,
.dock-undo-button:focus-visible {
  box-shadow: 0 0 0 4px rgba(138, 90, 20, 0.14), 0 10px 22px rgba(138, 90, 20, 0.16);
}

.dock-icon-button:disabled,
.dock-counter-button:disabled {
  opacity: 0.5;
  box-shadow: none;
}

@keyframes counterPress {
  0% { transform: scale(1); }
  45% { transform: scale(0.975); }
  100% { transform: scale(1); }
}

@keyframes counterGlow {
  0% { opacity: 0; transform: scale(0.82); }
  35% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes counterNumberBump {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-1px) scale(1.08); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes counterMiniBump {
  0% { transform: scale(1); }
  40% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .dock-icon-button,
  .dock-counter-button,
  .dock-counter-value,
  .dock-counter-mini,
  .progress-bar {
    transition: none;
    animation: none !important;
  }

  .dock-counter-button::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .home-hero-card,
  .brand-logo-link {
  display: inline-flex;
  text-decoration: none;
}

.brand-logo-link:focus-visible .home-hero-brand,
.brand-logo-link:hover .home-hero-brand {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 16px 30px rgba(11, 59, 46, 0.12);
}

.public-brand-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  :root {
  --dock-bg: color-mix(in srgb, var(--theme-light-surface) 96%, transparent);
  --overlay-bg: color-mix(in srgb, var(--theme-light-bg) 55%, transparent);
  --overlay-spinner: color-mix(in srgb, var(--theme-dark-bg) 12%, transparent);

    --dock-height: 132px;
  }

  .dock-progress-line {
    gap: 6px;
  }

  .dock-progress-text {
    font-size: 0.78rem;
  }

  .dock-chip {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 0.77rem;
  }

  .dock-main-controls {
    grid-template-columns: 52px minmax(0, 1fr) 52px 52px;
    gap: 8px;
  }

  .dock-icon-button,
  .dock-counter-button {
    min-height: 60px;
    border-radius: 18px;
  }

  .dock-counter-button {
    padding: 10px 14px;
    column-gap: 10px;
  }

  .dock-counter-mini {
    width: 34px;
    height: 34px;
    font-size: 0.68rem;
  }
}

@media (max-width: 420px) {
  .dock-progress-line {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'position count'
      'progress progress';
  }

  #item-position { grid-area: position; }
  #item-count-badge { grid-area: count; justify-self: end; }
  .dock-progress-text { grid-area: progress; text-align: left; }

  .dock-main-controls {
    grid-template-columns: 48px minmax(0, 1fr) 48px 48px;
  }

  .dock-icon-button,
  .dock-counter-button {
    min-height: 58px;
  }

  .dock-counter-mini {
    width: 32px;
    height: 32px;
  }

  .dock-counter-value {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }
}


.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 180ms ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-bubble {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
}

html[data-theme="dark"] .loading-bubble {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid var(--overlay-spinner);
  border-top-color: var(--accent);
  animation: spin 0.95s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}



.theme-toggle-fab {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  z-index: 30;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.lang-toggle-fab {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  min-width: 54px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  z-index: 30;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

html[dir="rtl"] .lang-toggle-fab {
  left: calc(12px + env(safe-area-inset-left));
}

html[dir="rtl"] .hero-card,
html[dir="rtl"] .info-card,
html[dir="rtl"] .section-tile,
html[dir="rtl"] .reader-title-wrap,
html[dir="rtl"] .tab-panel,
html[dir="rtl"] .text-block {
  text-align: right;
}

html[dir="rtl"] .info-card ul {
  padding-left: 0;
  padding-right: 18px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  color: inherit;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}


html[data-theme="dark"] .action-dock-polished {
  border-top-color: rgba(255,255,255,0.10);
  box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.60);
}

.skeleton-card {
  display: grid;
  gap: 10px;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
  position: relative;
}

html[data-theme="dark"] .skeleton-line {
  background: rgba(255,255,255,0.10);
}

.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: shimmer 1.1s infinite;
}

html[data-theme="dark"] .skeleton-line::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.skeleton-line.w-55 { width: 55%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-80 { width: 80%; }


.lang-select-fab {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  min-width: 74px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  z-index: 30;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.lang-select {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-weight: 800;
  letter-spacing: 0.2px;
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 18px;
  cursor: pointer;
}

.lang-select-fab::after,
.lang-select-inline::after {
  content: '';
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
  pointer-events: none;
  margin-inline-start: -14px;
}

.lang-select-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 10px 14px;
  min-width: 92px;
}

.lang-select-inline-control {
  min-width: 56px;
  font-weight: 700;
}

html[dir="rtl"] .lang-select-fab {
  left: calc(12px + env(safe-area-inset-left));
}

.public-page-shell {
  padding-top: 20px;
}

.public-menu-button {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  inset-inline-start: calc(12px + env(safe-area-inset-left));
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  z-index: 54;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.public-menu-button svg,
.public-sidebar-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.public-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.public-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 320px);
  padding: calc(18px + env(safe-area-inset-top)) 14px 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-inline-end: 1px solid var(--border);
  box-shadow: 0 22px 44px rgba(0,0,0,0.18);
  transform: translateX(calc(-100% - 24px));
  transition: transform .24s ease;
  z-index: 56;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[dir="rtl"] .public-sidebar {
  left: auto;
  right: 0;
  border-inline-end: 0;
  border-inline-start: 1px solid var(--border);
  transform: translateX(calc(100% + 24px));
}

body.public-sidebar-open .public-sidebar {
  transform: translateX(0);
}

body.public-sidebar-open .public-sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.public-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.public-sidebar-brand__row,
.public-sidebar-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.public-sidebar-brand h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.public-sidebar-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.public-sidebar-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.public-sidebar-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
}

.public-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.public-sidebar-link:hover,
.public-sidebar-link:focus-visible {
  background: var(--surface-soft);
  border-color: color-mix(in srgb, var(--accent) 14%, var(--border));
}

.public-sidebar-link.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  color: var(--accent);
}

.public-sidebar-link span {
  min-width: 0;
}

.public-sidebar-tools {
  display: grid;
  gap: 12px;
}

.public-sidebar-tool__label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.public-sidebar-select-wrap {
  min-width: 118px;
}

.public-sidebar-select {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  padding: 0 14px;
}

.public-sidebar-theme-button {
  flex: 0 0 auto;
}

/* Public pages now use a shared sidebar menu instead of floating controls. */

.home-shell-simple {
  gap: 18px;
}

.home-hero-card-welcome {
  grid-template-columns: minmax(0, auto) 1fr;
  align-items: center;
}

.home-section-heading-simple {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.home-section-heading-simple .hero-text {
  margin-bottom: 0;
}

.home-footer-links {
  display: grid;
  gap: 10px;
  padding: 4px 2px 0;
}

.home-footer-links-head .eyebrow {
  margin-bottom: 0;
  text-align: center;
}

.home-link-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.home-link-chip-icon {
  font-size: 0.95rem;
}

.home-link-chip-text {
  font-size: 0.94rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .public-page-shell {
    padding-top: 14px;
  }

  .home-hero-card-welcome {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .home-hero-brand {
    margin: 0 auto;
  }

  .home-link-chips {
    justify-content: stretch;
  }

  .home-link-chip {
    width: 100%;
    justify-content: center;
  }
}


.brand-logo-link {
  display: inline-flex;
  text-decoration: none;
}

.brand-logo-link:focus-visible .home-hero-brand,
.brand-logo-link:hover .home-hero-brand {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 16px 30px rgba(11, 59, 46, 0.12);
}

.public-page-shell > .public-brand-card {
  margin-bottom: 22px;
}

.reader-header-centered {
  justify-content: center;
}

.sitemap-pages-card {
  margin-top: 10px;
  margin-bottom: 16px;
}

.public-footer-note {
  margin: 22px 4px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}




@media (max-width: 640px) {
  .public-sidebar { width: min(90vw, 320px); }
}


/* Report feature */
.detail-tabs-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.detail-tabs-head .tab-row { top: 48px; }
.report-trigger-button { align-self: start; min-height: 44px; padding-inline: 14px; white-space: nowrap; }
.report-inline-row { margin-top: 14px; display: flex; justify-content: flex-end; }
.text-block .report-inline-row,
.source-box .report-inline-row,
.tab-panel .report-inline-row { border-top: 1px solid var(--border); padding-top: 12px; }
.report-inline-row .report-trigger-button { min-height: 40px; }
.report-accent-button {
  background: color-mix(in srgb, #f4d06f 28%, var(--surface));
  border-color: color-mix(in srgb, #d4a32f 38%, var(--border));
  color: color-mix(in srgb, #764b00 82%, var(--text));
  box-shadow: 0 8px 18px rgba(212, 163, 47, 0.16);
}
.report-accent-button:hover,
.report-accent-button:focus-visible {
  background: color-mix(in srgb, #f4d06f 38%, var(--surface));
  border-color: color-mix(in srgb, #d4a32f 54%, var(--border));
}
html[data-theme="dark"] .report-accent-button {
  background: color-mix(in srgb, #d4a32f 16%, var(--surface));
  border-color: color-mix(in srgb, #f4d06f 34%, var(--border));
  color: #ffd978;
  box-shadow: 0 12px 26px rgba(212, 163, 47, 0.12);
}
.report-honeypot {
  position: absolute !important;
  inset-inline-start: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.item-meta-row-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-modal { position: fixed; inset: 0; z-index: 60; }
.report-modal.is-hidden { display: none; }
.report-modal-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--theme-dark-bg) 44%, transparent); backdrop-filter: blur(8px); }
.report-modal-dialog { position: relative; width: min(100% - 24px, 520px); margin: max(40px, 6vh) auto; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22); padding: 22px; }
.report-modal-open { overflow: hidden; }
.report-modal-close { position: absolute; top: 16px; inset-inline-end: 16px; }
.report-modal-copy { padding-inline-end: 44px; margin-bottom: 14px; }
.report-modal-copy h3 { margin-bottom: 8px; }
.report-form { display: grid; gap: 12px; }
.report-field { display: grid; gap: 7px; font-weight: 700; }
.report-input { width: 100%; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-soft); color: var(--text); padding: 12px 14px; font: inherit; }
.report-textarea { min-height: 120px; resize: vertical; }
.report-form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.report-form-status { margin: 0; border-radius: 14px; padding: 10px 12px; font-weight: 700; }
.report-form-status.is-error { background: #fff0ee; color: #8d2d22; border: 1px solid #f0c6bf; }
.report-form-status.is-success { background: #edf8f1; color: #21613a; border: 1px solid #c9e6d1; }
html[data-theme="dark"] .report-modal-dialog { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42); }
@media (max-width: 640px) {
  .detail-tabs-head { grid-template-columns: 1fr; }
  .report-trigger-button { width: fit-content; justify-self: end; }
  .report-inline-row { margin-top: 12px; }
  .report-modal-dialog { width: min(100% - 16px, 520px); margin: 14px auto; padding: 18px; border-radius: 22px; }
  .report-form-actions > * { flex: 1 1 auto; }
}
