/* Hafez Fal: scoped UI and editorial styles for /tools/hafez-fal. */
@font-face {
  font-family: 'Pish Hafez Naskh';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/noto-naskh-arabic/NotoNaskhArabic-Arabic-v44.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

.portal.portal--hafez-fal {
  --hf-teal: #176f6a;
  --hf-teal-dark: #115753;
  --hf-teal-soft: #edf8f6;
  --hf-wine: #923b54;
  --hf-wine-dark: #722b40;
  --hf-wine-soft: #fff2f5;
  --hf-gold: #a66f1f;
  --hf-gold-soft: #fff8e9;
  --hf-ink: #24383c;
  --hf-text: #445b60;
  --hf-muted: #687b7e;
  --hf-line: #dce7e5;
  --hf-surface: #f7faf9;
}

.portal.portal--hafez-fal .svc-shell > .svc-card {
  width: min(1020px, 100%);
  max-width: min(1020px, 100%);
  border-radius: 8px;
}

.portal.portal--hafez-fal .svc-shell > .svc-card:first-child {
  margin-top: -62px;
}

.portal.portal--hafez-fal .svc-head {
  padding: 12px 18px;
}

.portal.portal--hafez-fal .svc-head__logo,
.portal.portal--hafez-fal .svc-head__logo--art,
.portal.portal--hafez-fal .svc-head__logo img {
  border-radius: 8px;
}

.portal.portal--hafez-fal .svc-head__sub {
  color: var(--hf-muted);
}

.portal.portal--hafez-fal .svc-body {
  padding: 0;
}

.portal.portal--hafez-fal .svc-hero {
  height: 32vh;
  min-height: 242px;
  max-height: 340px;
  background: #233733;
}

.portal.portal--hafez-fal .hf-hero-media,
.portal.portal--hafez-fal .hf-hero-media img,
.portal.portal--hafez-fal .hf-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portal.portal--hafez-fal .hf-hero-media img {
  display: block;
  object-fit: cover;
  object-position: center 60%;
}

.portal.portal--hafez-fal .hf-hero-shade {
  z-index: 1;
  background: rgba(20, 39, 36, .59);
  pointer-events: none;
}

.portal.portal--hafez-fal .svc-hero__in {
  max-width: 780px;
  text-shadow: 0 2px 15px rgba(0, 0, 0, .42);
}

.portal.portal--hafez-fal .hf-tool,
.portal.portal--hafez-fal .hf-tool *,
.portal.portal--hafez-fal .hf-tool *::before,
.portal.portal--hafez-fal .hf-tool *::after {
  box-sizing: border-box;
}

.portal.portal--hafez-fal .hf-tool {
  overflow: hidden;
  color: var(--hf-text);
  background: #fff;
}

.portal.portal--hafez-fal .hf-tool [hidden] {
  display: none !important;
}

.portal.portal--hafez-fal .hf-tool button {
  font: inherit;
  letter-spacing: 0;
  touch-action: manipulation;
}

.portal.portal--hafez-fal .hf-tool button:focus-visible,
.portal.portal--hafez-fal .hf-tool a:focus-visible,
.portal.portal--hafez-fal .hf-reader:focus-visible,
.portal.portal--hafez-fal .hf-library-list:focus-visible {
  outline: 3px solid rgba(23, 111, 106, .25);
  outline-offset: 2px;
}

.portal.portal--hafez-fal .hf-tool button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.portal.portal--hafez-fal .hf-statusbar {
  min-height: 42px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--hf-line);
  color: var(--hf-muted);
  background: var(--hf-surface);
  font-size: .73rem;
  font-weight: 720;
}

.portal.portal--hafez-fal .hf-statusbar__state,
.portal.portal--hafez-fal .hf-statusbar__privacy {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.portal.portal--hafez-fal .hf-statusbar__state {
  color: var(--hf-ink);
}

.portal.portal--hafez-fal .hf-statusbar__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--hf-teal);
  box-shadow: 0 0 0 4px rgba(23, 111, 106, .12);
}

.portal.portal--hafez-fal .hf-tool[data-loading="true"] .hf-statusbar__dot {
  background: var(--hf-gold);
  box-shadow: 0 0 0 4px rgba(166, 111, 31, .14);
  animation: hf-pulse 1.1s ease-in-out infinite;
}

.portal.portal--hafez-fal .hf-statusbar__privacy svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--hf-teal-dark);
}

.portal.portal--hafez-fal .hf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(286px, .58fr);
  align-items: stretch;
}

.portal.portal--hafez-fal .hf-reader,
.portal.portal--hafez-fal .hf-side {
  min-width: 0;
}

.portal.portal--hafez-fal .hf-reader {
  padding: 20px;
  background: #fff;
}

.portal.portal--hafez-fal .hf-reader__head {
  min-height: 44px;
  margin-bottom: 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal.portal--hafez-fal .hf-reader__heading {
  min-width: 0;
}

.portal.portal--hafez-fal .hf-reader__eyebrow,
.portal.portal--hafez-fal .hf-panel__eyebrow,
.portal.portal--hafez-fal .hf-lens__eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--hf-teal-dark);
  font-size: .68rem;
  font-weight: 820;
  line-height: 1.6;
}

.portal.portal--hafez-fal .hf-reader__title,
.portal.portal--hafez-fal .hf-panel__title {
  margin: 0;
  color: var(--hf-ink);
  font-size: .96rem;
  font-weight: 850;
  line-height: 1.65;
  letter-spacing: 0;
}

.portal.portal--hafez-fal .hf-mode-copy--random {
  display: none;
}

.portal.portal--hafez-fal .hf-tool[data-mode="random"] .hf-mode-copy--daily {
  display: none;
}

.portal.portal--hafez-fal .hf-tool[data-mode="random"] .hf-mode-copy--random {
  display: inline;
}

.portal.portal--hafez-fal .hf-save-button {
  min-width: 0;
  min-height: 44px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--hf-line);
  border-radius: 8px;
  color: var(--hf-wine-dark);
  background: #fff;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 790;
  line-height: 1.5;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.portal.portal--hafez-fal .hf-save-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.portal.portal--hafez-fal .hf-save-button:hover {
  border-color: #ddb9c4;
  background: var(--hf-wine-soft);
  transform: translateY(-1px);
}

.portal.portal--hafez-fal .hf-save-button[data-saved="true"] {
  color: var(--hf-wine-dark);
  border-color: #dbadba;
  background: var(--hf-wine-soft);
}

.portal.portal--hafez-fal .hf-save-button[data-saved="true"] svg {
  fill: currentColor;
}

.portal.portal--hafez-fal .hf-poem {
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--hf-line);
  border-radius: 8px;
  background: #fcfdfc;
  transition: opacity .18s ease, transform .18s ease;
}

.portal.portal--hafez-fal .hf-poem.is-changing {
  opacity: .45;
  transform: translateY(4px);
}

.portal.portal--hafez-fal .hf-poem__meta {
  min-height: 52px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--hf-line);
  background: var(--hf-surface);
}

.portal.portal--hafez-fal .hf-poem__title {
  margin: 0;
  color: var(--hf-ink);
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.7;
  letter-spacing: 0;
}

.portal.portal--hafez-fal .hf-poem__link {
  min-height: 44px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 6px;
  color: var(--hf-teal-dark);
  font-size: .68rem;
  font-weight: 780;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}

.portal.portal--hafez-fal .hf-poem__link:hover {
  background: var(--hf-teal-soft);
}

.portal.portal--hafez-fal .hf-poem__link svg {
  width: 15px;
  height: 15px;
}

.portal.portal--hafez-fal .hf-verses {
  margin: 0;
  padding: 13px 17px 15px;
  list-style: none;
}

.portal.portal--hafez-fal .hf-beyt {
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 22px;
  border-radius: 6px;
}

.portal.portal--hafez-fal .hf-beyt:nth-child(even) {
  background: #f3f8f6;
}

.portal.portal--hafez-fal .hf-beyt::before {
  display: none;
}

.portal.portal--hafez-fal .hf-mesra {
  min-width: 0;
  color: #263a3a;
  font-family: 'Pish Hafez Naskh', 'Noto Naskh Arabic', 'Vazirmatn', serif !important;
  font-size: 1.11rem;
  font-weight: 700;
  line-height: 2.05;
  text-align: center;
  overflow-wrap: anywhere;
  text-rendering: optimizeLegibility;
}

.portal.portal--hafez-fal .hf-beyt--empty {
  grid-template-columns: 1fr;
  padding-block: 30px;
}

.portal.portal--hafez-fal .hf-lens {
  margin: 2px 17px 17px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid #ead9ad;
  border-radius: 8px;
  background: var(--hf-gold-soft);
}

.portal.portal--hafez-fal .hf-lens__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: var(--hf-gold);
}

.portal.portal--hafez-fal .hf-lens__icon svg {
  width: 19px;
  height: 19px;
}

.portal.portal--hafez-fal .hf-lens__eyebrow {
  color: #7e581c;
}

.portal.portal--hafez-fal .hf-lens__title {
  margin: 0;
  color: #5f4318;
  font-size: .85rem;
  font-weight: 850;
  line-height: 1.75;
  letter-spacing: 0;
}

.portal.portal--hafez-fal .hf-lens__text {
  margin: 4px 0 0;
  color: #64553c;
  font-size: .75rem;
  font-weight: 620;
  line-height: 1.95;
}

.portal.portal--hafez-fal .hf-actions {
  margin-top: 13px;
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(3, minmax(0, .75fr));
  gap: 7px;
}

.portal.portal--hafez-fal .hf-button {
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 810;
  line-height: 1.55;
  text-align: center;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.portal.portal--hafez-fal .hf-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.portal.portal--hafez-fal .hf-button [data-hf-label] {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal.portal--hafez-fal .hf-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.portal.portal--hafez-fal .hf-button--primary {
  color: #fff;
  border-color: var(--hf-wine);
  background: var(--hf-wine);
  box-shadow: 0 8px 17px -13px rgba(114, 43, 64, .95);
}

.portal.portal--hafez-fal .hf-button--primary:hover {
  border-color: var(--hf-wine-dark);
  background: var(--hf-wine-dark);
}

.portal.portal--hafez-fal .hf-button--secondary {
  color: var(--hf-teal-dark);
  border-color: #c7ddda;
  background: #fff;
}

.portal.portal--hafez-fal .hf-button--secondary:hover {
  border-color: #abd1cc;
  background: var(--hf-teal-soft);
}

.portal.portal--hafez-fal .hf-tool[data-loading="true"] #hf-again svg,
.portal.portal--hafez-fal .hf-tool[data-loading="true"] #hf-retry::before {
  animation: hf-spin .85s linear infinite;
}

.portal.portal--hafez-fal .hf-error {
  margin: 11px 0 0;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e5bdc8;
  border-radius: 8px;
  color: var(--hf-wine-dark);
  background: var(--hf-wine-soft);
  font-size: .75rem;
  font-weight: 690;
  line-height: 1.9;
}

.portal.portal--hafez-fal .hf-error__retry {
  min-width: 108px;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid #d7a8b5;
  border-radius: 6px;
  color: var(--hf-wine-dark);
  background: #fff;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
}

.portal.portal--hafez-fal .hf-side {
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid var(--hf-line);
  background: var(--hf-surface);
}

.portal.portal--hafez-fal .hf-mode-panel,
.portal.portal--hafez-fal .hf-library {
  padding: 15px;
}

.portal.portal--hafez-fal .hf-mode-panel {
  border-bottom: 1px solid var(--hf-line);
}

.portal.portal--hafez-fal .hf-mode-tabs {
  margin-top: 12px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--hf-line);
  border-radius: 8px;
  background: #edf2f0;
}

.portal.portal--hafez-fal .hf-mode-tab {
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--hf-text);
  background: transparent;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 790;
  line-height: 1.5;
}

.portal.portal--hafez-fal .hf-mode-tab svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.portal.portal--hafez-fal .hf-mode-tab[data-active="true"] {
  color: var(--hf-teal-dark);
  border-color: #bcd9d5;
  background: #fff;
  box-shadow: 0 2px 7px rgba(28, 72, 64, .07);
}

.portal.portal--hafez-fal .hf-mode-panel__hint {
  margin: 9px 0 0;
  color: var(--hf-muted);
  font-size: .67rem;
  font-weight: 620;
  line-height: 1.85;
}

.portal.portal--hafez-fal .hf-library {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
}

.portal.portal--hafez-fal .hf-library__section {
  min-width: 0;
}

.portal.portal--hafez-fal .hf-library__head {
  min-height: 44px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal.portal--hafez-fal .hf-library__title {
  margin: 0;
  color: var(--hf-ink);
  font-size: .78rem;
  font-weight: 830;
  line-height: 1.6;
  letter-spacing: 0;
}

.portal.portal--hafez-fal .hf-library__count {
  min-width: 24px;
  height: 24px;
  padding-inline: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--hf-wine-dark);
  background: var(--hf-wine-soft);
  font-size: .67rem;
  font-weight: 850;
}

.portal.portal--hafez-fal .hf-clear-button {
  min-height: 44px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 6px;
  color: var(--hf-muted);
  background: transparent;
  cursor: pointer;
  font-size: .65rem;
  font-weight: 720;
}

.portal.portal--hafez-fal .hf-clear-button svg {
  width: 15px;
  height: 15px;
}

.portal.portal--hafez-fal .hf-clear-button:not(:disabled):hover {
  color: var(--hf-wine-dark);
  background: var(--hf-wine-soft);
}

.portal.portal--hafez-fal .hf-library-list {
  width: 100%;
  max-height: 174px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.portal.portal--hafez-fal .hf-library-row {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 8px 9px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--hf-line);
  border-radius: 8px;
  color: var(--hf-text);
  background: #fff;
  cursor: pointer;
  text-align: right;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.portal.portal--hafez-fal .hf-library-row:hover {
  border-color: #b8d6d2;
  background: var(--hf-teal-soft);
}

.portal.portal--hafez-fal .hf-library-ref {
  min-width: 0;
  color: var(--hf-teal-dark);
  font-size: .68rem;
  font-weight: 830;
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal.portal--hafez-fal .hf-library-preview {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--hf-muted);
  font-family: 'Pish Hafez Naskh', 'Noto Naskh Arabic', serif !important;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.portal.portal--hafez-fal .hf-library-empty {
  margin: 0;
  padding: 9px;
  border: 1px dashed #cadbd8;
  border-radius: 8px;
  color: var(--hf-muted);
  background: rgba(255, 255, 255, .7);
  font-size: .67rem;
  font-weight: 640;
  line-height: 1.8;
  text-align: center;
}

.portal.portal--hafez-fal .hf-archive-link {
  min-height: 66px;
  margin: 0 15px 15px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8c9a6;
  border-radius: 8px;
  color: #634919;
  background: var(--hf-gold-soft);
  text-decoration: none;
}

.portal.portal--hafez-fal .hf-archive-link:hover {
  border-color: #c9ac69;
  background: #fff3d8;
}

.portal.portal--hafez-fal .hf-archive-link > svg {
  width: 21px;
  height: 21px;
}

.portal.portal--hafez-fal .hf-archive-link span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.portal.portal--hafez-fal .hf-archive-link strong {
  font-size: .75rem;
  font-weight: 840;
  line-height: 1.6;
}

.portal.portal--hafez-fal .hf-archive-link small {
  color: #816b45;
  font-size: .65rem;
  font-weight: 630;
  line-height: 1.6;
}

.portal.portal--hafez-fal .hf-context-note,
.portal.portal--hafez-fal .hf-noscript {
  margin: 0;
  padding: 11px 18px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-top: 1px solid var(--hf-line);
  color: #5e7072;
  background: #fff;
}

.portal.portal--hafez-fal .hf-context-note svg,
.portal.portal--hafez-fal .hf-noscript svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--hf-gold);
}

.portal.portal--hafez-fal .hf-context-note p,
.portal.portal--hafez-fal .hf-noscript p {
  margin: 0;
  font-size: .71rem;
  font-weight: 650;
  line-height: 1.9;
}

.portal.portal--hafez-fal .hf-context-note .hf-source-line {
  margin-top: 3px;
  color: var(--hf-muted);
  font-size: .67rem;
}

.portal.portal--hafez-fal .hf-context-note a {
  min-height: 44px;
  padding-inline: 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  color: var(--hf-teal-dark);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal.portal--hafez-fal .hf-noscript {
  color: var(--hf-wine-dark);
  background: var(--hf-wine-soft);
}

/* The long guide is a calm reading surface, with cards reserved for repeated items. */
.hafez-guide {
  --hf-article-line: #dce7e5;
  --hf-article-surface: #f7faf9;
  --hf-article-muted: #607477;
  padding-inline: clamp(14px, 3vw, 32px);
  border-block: 1px solid var(--hf-article-line);
  background: #fff;
}

.svc-article.hafez-guide a {
  color: #176f6a;
  text-decoration-line: underline;
  text-decoration-color: rgba(23, 111, 106, .45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.svc-article.hafez-guide a:hover {
  color: #115753;
  text-decoration-color: currentColor;
}

.svc-article.hafez-guide > * + * {
  margin-top: 0;
}

.hafez-guide > .art-card,
.hafez-guide > section.art-card {
  padding: 28px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hafez-guide > .art-card:not(:first-child),
.hafez-guide > section.art-card:not(:first-child) {
  border-top: 1px solid var(--hf-article-line);
}

.hafez-guide > .art-toc {
  margin: 4px 0 22px;
  border-radius: 8px;
}

.hafez-guide .art-callout,
.hafez-guide .art-tile,
.hafez-guide .art-step,
.hafez-guide .art-cta,
.hafez-guide blockquote {
  border-radius: 8px;
}

.hafez-guide .art-figure {
  margin: 18px 0 22px;
  overflow: hidden;
  border: 1px solid var(--hf-article-line);
  border-radius: 8px;
  background: var(--hf-article-surface);
}

.hafez-guide .art-figure picture,
.hafez-guide .art-figure img {
  display: block;
  width: 100%;
}

.hafez-guide .art-figure img {
  aspect-ratio: 3 / 2;
  border-radius: 0;
  object-fit: cover;
}

.hafez-guide .art-figure figcaption {
  padding: 9px 12px;
  color: var(--hf-article-muted);
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.9;
}

.hafez-guide .tc-table-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--hf-article-line);
  border-radius: 8px;
  background: #fff;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.hafez-guide .tc-table-wrap:focus-visible {
  outline: 3px solid rgba(23, 111, 106, .25);
  outline-offset: 2px;
}

.hafez-guide .tc-table-wrap table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  color: #445b60;
  font-size: .79rem;
  line-height: 1.8;
}

.hafez-guide .tc-table-wrap caption {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hf-article-line);
  color: #304e50;
  background: var(--hf-article-surface);
  font-weight: 800;
  text-align: right;
}

.hafez-guide .tc-table-wrap th,
.hafez-guide .tc-table-wrap td {
  padding: 9px 11px;
  border-inline-start: 1px solid var(--hf-article-line);
  border-top: 1px solid var(--hf-article-line);
  vertical-align: top;
  text-align: right;
}

.hafez-guide .tc-table-wrap th:first-child,
.hafez-guide .tc-table-wrap td:first-child {
  border-inline-start: 0;
}

.hafez-guide .tc-table-wrap thead th {
  border-top: 0;
  color: #115753;
  background: #edf8f6;
  font-weight: 850;
  white-space: nowrap;
}

.hafez-guide .tc-table-wrap tbody tr:nth-child(even) {
  background: #f8fbfa;
}

.hafez-guide .hf-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hafez-guide .hf-link-card {
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--hf-article-line);
  border-radius: 8px;
  color: #35575a;
  background: #fff;
  text-decoration: none;
}

.hafez-guide .hf-link-card:hover {
  border-color: #b8d6d2;
  background: #f2faf8;
}

.hafez-guide .hf-link-card strong {
  color: #115753;
  font-size: .82rem;
  line-height: 1.7;
}

.hafez-guide .hf-link-card span {
  color: var(--hf-article-muted);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.8;
}

.tool-faqs--hafez-fal {
  padding: 27px clamp(14px, 3vw, 32px);
  border-block: 1px solid #dce7e5;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.tool-faqs--hafez-fal > h2 {
  margin: 0 0 13px;
  color: #24383c;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.7;
  letter-spacing: 0;
}

.tool-faqs--hafez-fal .tool-faqs__list {
  display: grid;
  gap: 8px;
}

.tool-faqs--hafez-fal .tool-faqs__item {
  margin: 0;
  overflow: hidden;
  border: 1px solid #dce7e5;
  border-radius: 8px;
  background: #fff;
}

.tool-faqs--hafez-fal .tool-faqs__item[open] {
  border-color: #b8d6d2;
  background: #f7fbfa;
}

.tool-faqs--hafez-fal .tool-faqs__question {
  min-height: 52px;
  padding: 10px 13px;
  gap: 12px;
  color: #24383c;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.8;
}

.tool-faqs--hafez-fal .tool-faqs__question svg {
  width: 20px;
  height: 20px;
}

.tool-faqs--hafez-fal .tool-faqs__answer {
  padding: 0 13px 13px;
  color: #516a6e;
  font-size: .81rem;
  line-height: 2;
}

.tool-page--hafez-fal {
  padding-bottom: 3rem;
}

.tool-page--hafez-fal .page-breadcrumb__list {
  width: 100%;
  min-width: 0;
}

.tool-page--hafez-fal .page-breadcrumb__item > a,
.tool-page--hafez-fal .page-breadcrumb__item > span {
  min-height: 36px;
  box-sizing: border-box;
}

.tool-page--hafez-fal .page-breadcrumb__item > a {
  min-width: 0;
}

.tool-page--hafez-fal .page-breadcrumb__item:last-child {
  min-width: 0;
  flex: 1 1 auto;
}

.tool-page--hafez-fal .page-breadcrumb__item:last-child > span {
  width: 100%;
  max-width: 100%;
}

.hafez-guide .art-toc__list a {
  min-height: 44px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  box-sizing: border-box;
}

.portal.portal--hafez-fal .tc-actions .tc-btn {
  min-height: 44px;
}

.portal.portal--hafez-fal .tc-input {
  min-height: 44px;
}

.tool-page--hafez-fal #comments-section {
  border: 1px solid #dce7e5;
  border-radius: 8px;
  box-shadow: none;
}

.tool-page--hafez-fal #comments-section .comments-form-panel {
  border: 1px solid #dce7e5;
  border-radius: 8px;
  background: #f7faf9;
}

.tool-page--hafez-fal #comment-form input,
.tool-page--hafez-fal #comment-form textarea {
  min-height: 44px;
  border-radius: 6px;
}

.tool-page--hafez-fal .comments-rating-stars {
  gap: 4px;
}

.tool-page--hafez-fal .comments-rating-stars .star-rating {
  width: 44px;
  height: 44px;
  padding: 6px;
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  color: #d1d9d7;
  background: transparent;
  touch-action: manipulation;
}

.tool-page--hafez-fal .comments-rating-stars .star-rating svg {
  width: 28px;
  height: 28px;
}

.tool-page--hafez-fal .comments-form-submit {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background-color: #176f6a;
  cursor: pointer;
  touch-action: manipulation;
}

.tool-page--hafez-fal .comments-form-submit:hover {
  background-color: #115753;
}

@keyframes hf-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.78); }
}

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

@keyframes hf-enter {
  from { opacity: .15; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .portal.portal--hafez-fal .hf-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal.portal--hafez-fal .hf-side {
    border-top: 1px solid var(--hf-line);
    border-inline-start: 0;
  }

  .portal.portal--hafez-fal .hf-library {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal.portal--hafez-fal .hf-archive-link {
    margin-top: 0;
  }
}

@media (max-width: 660px) {
  .portal.portal--hafez-fal .svc-hero {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
  }

  .portal.portal--hafez-fal .hf-hero-media img {
    object-position: 50% center;
  }

  .portal.portal--hafez-fal .hf-hero-shade {
    background: rgba(18, 36, 33, .63);
  }

  .portal.portal--hafez-fal .svc-shell > .svc-card:first-child {
    margin-top: -42px;
  }

  .portal.portal--hafez-fal .hf-statusbar {
    padding-inline: 13px;
  }

  .portal.portal--hafez-fal .hf-statusbar__privacy {
    display: none;
  }

  .portal.portal--hafez-fal .hf-reader {
    padding: 14px;
  }

  .portal.portal--hafez-fal .hf-poem {
    min-height: 0;
  }

  .portal.portal--hafez-fal .hf-poem__meta {
    padding-inline: 11px;
  }

  .portal.portal--hafez-fal .hf-poem__link span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .portal.portal--hafez-fal .hf-poem__link {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .portal.portal--hafez-fal .hf-poem__link svg {
    width: 18px;
    height: 18px;
  }

  .portal.portal--hafez-fal .hf-verses {
    padding: 11px 10px 13px;
  }

  .portal.portal--hafez-fal .hf-beyt {
    padding: 8px 6px;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .portal.portal--hafez-fal .hf-mesra {
    font-size: 1.07rem;
    line-height: 2.05;
  }

  .portal.portal--hafez-fal .hf-lens {
    margin-inline: 10px;
  }

  .portal.portal--hafez-fal .hf-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal.portal--hafez-fal .hf-button--primary {
    grid-column: 1 / -1;
  }

  .portal.portal--hafez-fal .hf-button {
    padding-inline: 7px;
    font-size: .74rem;
  }

  .portal.portal--hafez-fal .hf-error {
    align-items: stretch;
    flex-direction: column;
  }

  .portal.portal--hafez-fal .hf-error__retry {
    width: 100%;
  }

  .portal.portal--hafez-fal .hf-library {
    grid-template-columns: minmax(0, 1fr);
  }

  .hafez-guide .art-grid,
  .hafez-guide .hf-link-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-page--hafez-fal .page-breadcrumb__list {
    gap: 0;
  }

  .tool-page--hafez-fal .page-breadcrumb__separator {
    width: 14px;
  }

  .tool-page--hafez-fal .page-breadcrumb__item > a,
  .tool-page--hafez-fal .page-breadcrumb__item > span {
    padding-inline: 4px;
    font-size: .7rem;
  }
}

@media (max-width: 390px) {
  .tool-page--hafez-fal .page-breadcrumb__item:first-child > a span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .tool-page--hafez-fal .page-breadcrumb__item:first-child > a {
    padding-inline: 2px;
  }

  .portal.portal--hafez-fal .hf-reader__head {
    align-items: stretch;
    flex-direction: column;
  }

  .portal.portal--hafez-fal .hf-save-button {
    width: 100%;
  }

  .portal.portal--hafez-fal .hf-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal.portal--hafez-fal .hf-button--primary,
  .portal.portal--hafez-fal #hf-daily {
    grid-column: 1 / -1;
  }

  .portal.portal--hafez-fal .hf-lens {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal.portal--hafez-fal .hf-lens__icon {
    display: none;
  }

  .tool-page--hafez-fal #comments-section {
    padding-inline: 12px !important;
  }

  .tool-page--hafez-fal #comments-section .comments-form-panel {
    padding-inline: 8px !important;
  }

  .tool-page--hafez-fal .comments-rating-stars {
    justify-content: space-between;
    gap: 0;
  }
}

@media (max-width: 360px) {
  .tool-page--hafez-fal .page-breadcrumb__item:first-child > a {
    width: 24px;
    padding-inline: 0;
    justify-content: center;
    gap: 0;
  }

  .tool-page--hafez-fal .page-breadcrumb__separator {
    width: 10px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .portal.portal--hafez-fal .hf-poem.is-entering {
    animation: hf-enter .28s ease both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal.portal--hafez-fal .hf-tool *,
  .portal.portal--hafez-fal .hf-tool *::before,
  .portal.portal--hafez-fal .hf-tool *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
