* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

html.drawer-open,
body.drawer-open {
  overflow-x: hidden;
}

a {
  color: var(--link);
}

.app-shell {
  min-height: 100dvh;
  display: flex;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--text-light);
  padding: var(--space-2);
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  transition: width 220ms ease;
  z-index: 30;
  overflow-x: hidden;
}

.sidebar-brand {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 252px;
  padding-top: var(--space-1);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-logo {
  width: var(--logo-width);
  max-width: 100%;
  height: auto;
  display: block;
}

.collapse-toggle,
.menu-toggle {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: inherit;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.collapse-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.collapse-toggle span {
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  flex-basis: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-brand {
  min-height: 96px;
}

body.sidebar-collapsed .brand-logo {
  width: 44px;
}

body.sidebar-collapsed .nav-label {
  display: none;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #F7FBFF;
  padding: 0.55rem 0.9rem;
  min-height: 44px;
  border-radius: var(--radius-button);
  border: 1px solid var(--button-border);
  background: transparent;
  font-weight: 600;
  transition: all 220ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--button-bg-hover);
  outline: none;
}

.nav-link.is-active {
  background: var(--button-bg-active);
  border-color: var(--button-border-active);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.content-shell {
  flex: 1;
  min-width: 0;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 25;
  background: var(--sidebar-bg);
  color: var(--text-light);
  box-shadow: var(--shadow-card);
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.main-content {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.page {
  max-width: var(--shell-max-width);
  margin: 0 auto;
}

.dashboard-banner {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto 0.95rem auto;
}

.hero-banner {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: block;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.8rem;
  color: #8C6E3E;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--text);
  letter-spacing: 0.2px;
}

h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
}

p,
li,
blockquote {
  font-family: var(--font-body);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.page-panel {
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.greeting-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-card-soft);
  box-shadow: var(--shadow-panel);
  padding: 22px 24px;
}

.home-intro-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.68rem);
  line-height: 1.22;
  letter-spacing: 0;
}

.home-intro-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.58;
}

.home-cards-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.home-progress-card,
.home-latest-card {
  background: #FFF9F0;
  border: 1px solid var(--border-warm);
  border-radius: 20px;
  padding: 1.15rem;
  box-shadow: var(--shadow-panel);
  position: relative;
  overflow: hidden;
}

.home-progress-card,
.home-latest-card {
  height: 100%;
}

.home-progress-card::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: 96px;
  height: 96px;
  background-image: url("/assets/journal-leaf-bottom-right.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.04;
  pointer-events: none;
  transform: rotate(-8deg);
}

.home-progress-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
  position: relative;
  z-index: 1;
}

.home-progress-icon {
  font-size: 1.05rem;
}

.home-progress-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
}

.home-progress-ring {
  --ring-track: #EADCC8;
  --ring-size: 170px;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  margin: 0 auto;
  background: conic-gradient(#C4935A calc(var(--progress) * 1%), var(--ring-track) 0);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.home-progress-ring-inner {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: #FFFDF9;
  border: 1px solid #EFE5D8;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.35rem;
}

.home-progress-value {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: #2F3B45;
  line-height: 1.2;
}

.home-progress-label {
  margin-top: 0.28rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #6B5C3E;
  font-family: var(--font-body);
  font-weight: 400;
}

.home-latest-card {
  background: #F7FBF4;
  border: 1px solid var(--border-warm);
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
}

.home-latest-card-kind {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: #8C6E3E;
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
}

.home-latest-card-meta {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  overflow-wrap: break-word;
}

.home-latest-card-excerpt {
  margin: 0.35rem 0 0.15rem;
  font-family: var(--font-body);
  font-size: 0.96rem;
  line-height: 1.62;
  font-weight: 400;
  text-align: center;
  align-self: stretch;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text);
}

.home-latest-card-date {
  margin: 0;
  color: #6F7780;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 500;
}

.home-latest-card h3 {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.35;
  font-weight: 500;
}

.home-latest-card-excerpt {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.home-latest-card-link {
  margin-top: 0.18rem;
  text-decoration: none;
  color: var(--link);
  font-weight: 500;
  align-self: flex-start;
}

.home-latest-card-link:hover,
.home-latest-card-link:focus-visible {
  text-decoration: underline;
}

.home-latest-card-fullwidth {
  grid-column: 1 / -1;
}

.journey-note-list-shell,
.journey-note-detail-shell {
  max-width: 760px;
  margin: 0 auto 2rem auto;
  width: min(760px, calc(100% - 2rem));
}

.journey-note-list-shell {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.journey-note-list-card,
.journey-note-opening-card,
.journey-note-body-card {
  border-radius: 22px;
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.journey-note-list-card,
.journey-note-body-card {
  background: #FFF9F0;
  padding: 1.4rem 1.45rem;
}

.journey-note-opening-card {
  margin: 0 0 1rem 0;
  padding: 1.9rem 1.6rem;
  text-align: center;
  background: linear-gradient(135deg, #FFFDF9 0%, #F8F3E7 100%);
  border: 2px solid var(--border-warm);
  box-shadow: var(--shadow-opening);
}

.journey-note-kicker,
.journey-note-list-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  color: #8C6E3E;
  font-weight: 600;
  text-transform: uppercase;
}

.journey-note-opening-card h1,
.journey-note-list-card h2 {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.24;
}

.journey-note-opening-card h1 {
  font-size: clamp(1.7rem, 1.2rem + 1.1vw, 2.3rem);
}

.journey-note-list-card h2 {
  font-size: 1.32rem;
  margin-bottom: 0.45rem;
}

.journey-note-date,
.journey-note-list-date {
  margin: 0;
  color: #6F7780;
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 500;
}

.journey-note-list-excerpt {
  margin: 0.75rem 0 0;
  color: var(--text);
  line-height: 1.68;
}

.journey-note-list-link,
.journey-note-related a,
.journey-note-backlink a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.journey-note-list-link {
  display: inline-flex;
  margin-top: 0.95rem;
}

.journey-note-list-link:hover,
.journey-note-list-link:focus-visible,
.journey-note-related a:hover,
.journey-note-related a:focus-visible,
.journey-note-backlink a:hover,
.journey-note-backlink a:focus-visible {
  text-decoration: underline;
}

.journey-note-body-card {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text);
}

.journey-note-body-card > :first-child {
  margin-top: 0;
}

.journey-note-body-card > :last-child {
  margin-bottom: 0;
}

.journey-note-body-card p {
  margin: 0 0 14px 0;
}

.journey-note-body-card h1,
.journey-note-body-card h2,
.journey-note-body-card h3,
.journey-note-body-card h4,
.journey-note-body-card h5,
.journey-note-body-card h6 {
  margin: 30px 0 12px 0;
  line-height: 1.35;
}

.journey-note-body-card ul,
.journey-note-body-card ol {
  margin: 10px 0 14px 0;
  padding-left: 1.25rem;
}

.journey-note-body-card a {
  color: var(--link);
  word-break: break-word;
}

.journey-note-related {
  margin: 1.2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(140, 110, 62, 0.16);
}

.journey-note-related-muted {
  color: var(--text-secondary);
}

.journey-note-backlink {
  margin: 1.1rem 0 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.browse-panel {
  background: linear-gradient(135deg, #FCF8F0 0%, #F6F0E5 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 24px rgba(70, 55, 25, 0.06);
  padding: 1.1rem 1.2rem;
}

.opening-panel {
  background: linear-gradient(135deg, #FFFDF9 0%, #F8F3E7 100%);
  border: 2px solid var(--border-warm);
  border-radius: 24px;
  box-shadow: var(--shadow-opening);
  padding: 32px;
}

.opening-panel::before,
.opening-panel::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  pointer-events: none;
}

.opening-panel::before {
  left: -12px;
  top: -14px;
  opacity: 0.16;
  background-image: url("/assets/journal-leaf-top-left.png");
}

.opening-panel::after {
  right: -12px;
  bottom: -14px;
  opacity: 0.22;
  background-image: url("/assets/journal-leaf-bottom-right.png");
}

.content-stack {
  display: grid;
  gap: 1.35rem;
}

.dashboard-stack {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-block {
  position: relative;
  margin: 0;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border-warm);
  background: var(--card-bg);
  box-shadow: var(--shadow-panel);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.content-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.page-tadabbur .content-block:nth-child(odd),
.page-about .content-block:nth-child(odd) {
  background: var(--card-warm);
}

.page-tadabbur .content-block:nth-child(even),
.page-journey-notes .content-block:nth-child(even),
.page-about .content-block:nth-child(even) {
  background: var(--card-sage);
}

.page-tadabbur .content-block,
.page-about .content-block,
.page-journey-notes .content-block {
  padding: 32px;
}

.page-tadabbur .content-block {
  line-height: 1.72;
}

.about-reading-shell {
  max-width: 760px;
  margin: 0 auto;
  width: min(760px, calc(100% - 2rem));
}

.page-about .content-block h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.36rem;
  line-height: 1.34;
  font-weight: 500;
  color: var(--text);
}

.page-about .content-block p {
  font-family: var(--font-body);
  line-height: 1.72;
}

.page-about .content-block p + p {
  margin-top: 0.85rem;
}

.about-contact-link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.about-contact-link:focus-visible {
  outline: 2px solid #6F88A1;
  outline-offset: 2px;
  border-radius: 3px;
}

.page-tadabbur .content-block::after,
.page-about .content-block::after,
.page-journey-notes .content-block::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: 118px;
  height: 118px;
  background-image: url("/assets/journal-leaf-bottom-right.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.03;
  pointer-events: none;
  transform: rotate(-8deg);
}

.content-block h3 {
  margin: 0 0 12px;
  font-size: 19.2px;
  line-height: 1.35;
  font-weight: 600;
}

.content-block p,
.content-block blockquote,
.content-block ul,
.content-block ol {
  margin: 0;
}

.content-block.quote {
  border-left: 4px solid var(--primary-blue);
}

.content-block.arabic {
  font-family: "Amiri", "Traditional Arabic", "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 2.05;
  text-align: right;
  direction: rtl;
}

.content-block.safe-link a {
  font-weight: 600;
  text-decoration: none;
}

.content-block.safe-link a:hover {
  text-decoration: underline;
}

.tadabbur-public-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.tadabbur-public-browse-card {
  background: linear-gradient(135deg, #FCF8F0 0%, #F6F0E5 100%);
  border: 1px solid #E8DCCB;
  border-radius: 22px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 24px rgba(70, 55, 25, 0.06);
  margin-bottom: 1rem;
}

.tadabbur-public-browse-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: #2F3B45;
  margin-bottom: 0.25rem;
}

.tadabbur-public-browse-subtitle {
  color: #5F6770;
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
}

.tadabbur-public-select-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: #2F3B45;
  font-weight: 600;
  font-size: 0.95rem;
}

.tadabbur-public-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #D8C39F;
  border-radius: 14px;
  background: #FFFDF9;
  color: #2F3B45;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  margin: 0;
}

.tadabbur-public-select:focus-visible {
  outline: 2px solid #6F88A1;
  outline-offset: 1px;
}

.tadabbur-public-read-button {
  margin-top: 0.8rem;
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid #5F7384;
  background: #4F6C89;
  color: #FFFFFF;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.tadabbur-public-read-button:hover,
.tadabbur-public-read-button:focus-visible {
  text-decoration: none;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(70, 55, 25, 0.12);
}

.tadabbur-public-read-button.is-disabled {
  pointer-events: none;
  opacity: 0.56;
}

.tadabbur-public-noscript-note {
  margin: 0.65rem 0 0;
  color: #5F6770;
  font-size: 0.9rem;
}

.tadabbur-public-surah-card,
.tadabbur-public-ayah-card {
  cursor: pointer;
}

.tadabbur-public-surah-card h3,
.tadabbur-public-ayah-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.tadabbur-public-surah-card p,
.tadabbur-public-ayah-card p,
.tadabbur-public-note p {
  margin: 0;
  color: var(--text-secondary);
}

.tadabbur-public-detail-shell {
  max-width: 1000px;
  margin: 0 auto 2rem auto;
  width: min(1000px, calc(100% - 2rem));
}

.tadabbur-public-opening-card {
  margin: 0 0 1.35rem 0;
  padding: 2rem;
  border-radius: 24px;
  border: 2px solid var(--border-warm);
  background: linear-gradient(135deg, #FFFDF9 0%, #F8F3E7 100%);
  box-shadow: var(--shadow-opening);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tadabbur-public-opening-leaf {
  position: absolute;
  right: -12px;
  bottom: -14px;
  width: 170px;
  height: 170px;
  background-image: url("/assets/journal-leaf-bottom-right.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

.tadabbur-public-opening-leaf-top {
  position: absolute;
  left: -12px;
  top: -14px;
  width: 170px;
  height: 170px;
  background-image: url("/assets/journal-leaf-top-left.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

.tadabbur-public-opening-card > :not(.tadabbur-public-opening-leaf):not(.tadabbur-public-opening-leaf-top) {
  position: relative;
  z-index: 1;
}

.tadabbur-public-opening-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8C6E3E;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.tadabbur-public-opening-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

.tadabbur-public-opening-subtitle {
  font-size: 1.08rem;
  color: #6B5C3E;
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.tadabbur-public-opening-arabic {
  font-family: "Amiri", "Traditional Arabic", "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 2.05;
  color: var(--text);
  margin: 0.9rem 0 0.75rem 0;
  font-weight: 600;
}

.tadabbur-public-opening-meta {
  font-size: 0.95rem;
  color: #7A7F86;
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tadabbur-public-detail-card {
  border-radius: 20px;
  padding: 2rem;
  margin: 0 0 1.35rem 0;
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  position: relative;
}

.tadabbur-public-card-warm {
  background: var(--card-warm);
}

.tadabbur-public-card-sage {
  background: var(--card-sage);
}

.tadabbur-public-detail-card-heading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 22px;
  letter-spacing: 0.01em;
}

.tadabbur-public-detail-card-heading {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.tadabbur-public-detail-icon {
  font-size: 0.92em;
  line-height: 1;
  flex: 0 0 auto;
}

.tadabbur-public-detail-card-content {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.72;
  font-weight: 400;
}

.tadabbur-public-detail-card-content > :first-child {
  margin-top: 0 !important;
}

.tadabbur-public-detail-card-content > :last-child {
  margin-bottom: 0 !important;
}

.tadabbur-public-detail-card-content p {
  margin: 0 0 14px 0;
}

.tadabbur-public-detail-card-content p:empty {
  display: none;
}

.tadabbur-public-detail-card-content p:has(> br:only-child) {
  display: none;
}

.tadabbur-public-detail-card-content h1,
.tadabbur-public-detail-card-content h2,
.tadabbur-public-detail-card-content h3,
.tadabbur-public-detail-card-content h4,
.tadabbur-public-detail-card-content h5,
.tadabbur-public-detail-card-content h6 {
  margin: 30px 0 12px 0;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
}

.tadabbur-public-detail-card-content h1 + p,
.tadabbur-public-detail-card-content h2 + p,
.tadabbur-public-detail-card-content h3 + p,
.tadabbur-public-detail-card-content h4 + p,
.tadabbur-public-detail-card-content h5 + p,
.tadabbur-public-detail-card-content h6 + p {
  margin-top: 0;
}

.tadabbur-public-detail-card-content p + ul,
.tadabbur-public-detail-card-content p + ol {
  margin-top: 10px;
}

.tadabbur-public-detail-card-content ul,
.tadabbur-public-detail-card-content ol {
  padding-left: 1.2rem;
  margin: 10px 0 14px 0;
}

.tadabbur-public-detail-card-content li {
  margin-bottom: 7px;
}

.tadabbur-public-detail-card-content li:last-child {
  margin-bottom: 0;
}

.tadabbur-public-detail-card-content a {
  color: var(--link);
  word-break: break-word;
}

.tadabbur-public-notebook-link-wrap {
  margin: -0.2rem 0 1.2rem;
}

.tadabbur-public-reflection-note {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.tadabbur-public-notebook-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.tadabbur-public-notebook-link:hover,
.tadabbur-public-notebook-link:focus-visible {
  text-decoration: underline;
}

.tadabbur-public-notebook-shell {
  max-width: 1000px;
  margin: 0 auto 2rem auto;
  width: min(1000px, calc(100% - 2rem));
}

.tadabbur-public-notebook-card {
  border-radius: 20px;
  padding: 1.4rem;
  border: 1px solid var(--border-warm);
  background: var(--card-warm);
  box-shadow: var(--shadow-panel);
}

.tadabbur-public-notebook-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.tadabbur-public-notebook-image {
  width: 100%;
  max-width: 920px;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid #E7DCC8;
  box-shadow: 0 8px 18px rgba(70, 55, 25, 0.08);
}

.tadabbur-public-notebook-back {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.tadabbur-public-notebook-back:hover,
.tadabbur-public-notebook-back:focus-visible {
  text-decoration: underline;
}

.tadabbur-public-keyword-chip {
  display: inline-block;
  margin: 0.2rem 0.3rem 0.2rem 0;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(117, 142, 103, 0.16);
  color: #4F5E47;
  font-size: 0.86rem;
}

.sidebar-backdrop {
  display: none;
  border: 0;
  position: fixed;
  inset: 0;
  background: rgba(8, 17, 35, 0.46);
  z-index: 20;
}

@media (max-width: 980px) {
  .menu-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 12px;
    top: 0;
    width: min(calc(86vw - 12px), 288px);
    max-width: 288px;
    min-width: min(calc(86vw - 12px), 288px);
    flex-basis: min(calc(86vw - 12px), 288px);
    transform: translateX(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, transform 220ms ease;
  }

  body.sidebar-collapsed .sidebar {
    width: min(calc(86vw - 12px), 288px);
    min-width: min(calc(86vw - 12px), 288px);
    flex-basis: min(calc(86vw - 12px), 288px);
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.drawer-open .sidebar-backdrop {
    display: block;
  }

  .main-content {
    padding: 72px var(--space-2) var(--space-3);
  }

  .opening-panel,
  .page-tadabbur .content-block,
  .page-about .content-block,
  .page-journey-notes .content-block {
    padding: 1.25rem;
  }

  .opening-panel::before,
  .opening-panel::after {
    width: 95px;
    height: 95px;
  }

  .tadabbur-public-detail-card {
    padding: 1.25rem;
  }

  .journey-note-list-card,
  .journey-note-opening-card,
  .journey-note-body-card {
    padding: 1.2rem;
  }

  .tadabbur-public-notebook-card {
    padding: 1.1rem;
  }

  .tadabbur-public-opening-card {
    padding: 1.25rem;
  }

  .tadabbur-public-opening-leaf {
    width: 95px;
    height: 95px;
    opacity: 0.14;
    right: -8px;
    bottom: -10px;
  }

  .tadabbur-public-opening-leaf-top {
    width: 95px;
    height: 95px;
    opacity: 0.10;
    left: -8px;
    top: -10px;
  }

  .tadabbur-public-detail-card-heading {
    font-size: 1.08rem;
    margin-bottom: 20px;
  }

  .tadabbur-public-opening-arabic {
    font-size: 1.55rem;
  }

  .opening-panel::before {
    opacity: 0.10;
    left: -8px;
    top: -10px;
  }

  .opening-panel::after {
    opacity: 0.14;
    right: -8px;
    bottom: -10px;
  }

  .home-cards-grid,
  .dashboard-stack,
  .home-latest-grid,
  .home-latest-grid-single {
    grid-template-columns: 1fr;
  }

  .home-intro-title {
    font-size: clamp(1.18rem, 4.6vw, 1.46rem);
    line-height: 1.24;
  }

  .home-intro-copy {
    font-size: 0.92rem;
    line-height: 1.56;
  }

  .home-progress-card {
    max-width: 100%;
    height: auto;
  }

  .home-latest-card {
    height: auto;
  }

  .home-progress-ring {
    --ring-size: 162px;
  }

  .home-progress-ring-inner {
    width: 124px;
    height: 124px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-latest-card,
  .home-progress-card,
  .home-latest-card-link {
    transition: none;
  }
}