/* Reuse the writing desk's colours and controls for the optional quick tour. */
/* The html element already clips sideways overflow. Repeating overflow-x:hidden
   on body creates a non-scrolling ancestor that prevents the pan bar sticking
   to the document viewport while reading a long ayah. */
body { overflow: visible; }
.quick-tour-dialog {
  width: min(480px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink, #102c2a);
  background: var(--paper, #fbf7ed);
  border: 1px solid var(--line, #d6c7a7);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgb(22 37 34 / 22%);
  font: 1rem/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
}
.quick-tour-dialog::backdrop { background: rgb(16 44 42 / 48%); }
.quick-tour-dialog[data-fallback][open] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  height: fit-content;
  box-shadow: 0 0 0 100vmax rgb(16 44 42 / 48%);
}
.quick-tour-header, .quick-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--paper, #fbf7ed);
}
.quick-tour-header { border-bottom: 1px solid var(--line, #d6c7a7); }
.quick-tour-header p { margin: 0; color: var(--muted, #58706b); font-size: .9rem; white-space: nowrap; }
.quick-tour-header .tool-btn { flex: 0 0 auto; width: auto; min-width: 68px; padding-inline: 12px; }
.quick-tour-body { padding: 20px 18px 8px; }
.quick-tour-body h2 { margin: 0 0 14px; font-size: 1.35rem; line-height: 1.3; }
.quick-tour-body p { margin: 0 0 14px; }
.quick-tour-footer { position: sticky; bottom: 0; border-top: 1px solid var(--line, #d6c7a7); }
.quick-tour-dialog .tool-btn { min-height: 44px; white-space: normal; }
.quick-tour-dialog :focus-visible { outline: 3px solid var(--teal, #0d514c); outline-offset: 3px; }
.quick-tour-dialog [hidden] { display: none !important; }
.quick-tour-replay-hint { color: var(--muted, #58706b); font-size: .85rem; }
.writing-menu-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.writing-menu-heading h2 { font-size: 1.1rem; }
.writing-menu-heading a, .writing-menu-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.writing-pan-control:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: var(--native-safe-top, env(safe-area-inset-top, 0px));
  z-index: 5;
  padding: 8px;
  background: var(--paper, #fbf7ed);
  color: var(--ink, #102c2a);
  font-size: .9rem;
}
.writing-pan-control input { flex: 1; min-width: 0; min-height: 44px; touch-action: pan-y; }
