/* Farhetna Invitations — frontend design system
 * Follows the Farhetna Frontend Theme v1.6 direction.
 * Scoped to .fh-app so Bricks/WordPress styles remain untouched.
 */

.fh-app {
  --fh-navy: #003070;
  --fh-navy-strong: #00265a;
  --fh-gold: #DDAA5B;
  --fh-paper: #F7F5F0;
  --fh-ink: #172C47;
  --fh-muted: #52647B;
  --fh-border: #CCD6E2;
  --fh-porcelain: #FFFDF9;
  --fh-input: #FFF9ED;
  --fh-whatsapp: #116342;
  --fh-focus: #936018;
  --fh-danger: #8B2F2F;
  --fh-danger-soft: #FFF2F0;
  --fh-success: #246844;
  --fh-success-soft: #EEF8F2;
  --fh-warning: #71501B;
  --fh-warning-soft: #FFF7E8;
  --fh-shadow: 0 10px 28px rgba(23,44,71,.07);
  --fh-shadow-hover: 0 14px 36px rgba(23,44,71,.10);
  --fh-radius: 18px;
  --fh-radius-control: 12px;
  --fh-gutter: clamp(16px, 4vw, 72px);
  --fh-content: 1800px;

  width: min(100%, var(--fh-content));
  margin: 0 auto;
  padding: 28px var(--fh-gutter) 72px;
  color: var(--fh-ink);
  font-family: 'Almarai', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
}
.fh-app::before { content: ''; position: absolute; z-index: -1; inset-block: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: var(--fh-paper); }

.fh-app *, .fh-app *::before, .fh-app *::after { box-sizing: border-box; }
.fh-app [hidden] { display: none !important; }
.fh-app a { color: inherit; text-decoration: none; }
.fh-app button, .fh-app input, .fh-app select, .fh-app textarea { font: inherit; }
.fh-app img, .fh-app svg { max-width: 100%; }
.fh-app h1, .fh-app h2, .fh-app h3, .fh-app h4, .fh-app p { overflow-wrap: anywhere; }
.fh-app[dir="rtl"] { text-align: start; }

/* Shared focus */
.fh-app :where(a,button,input,select,textarea):focus-visible {
  outline: 3px solid var(--fh-focus);
  outline-offset: 3px;
}

/* App bar */
.fh-appbar {
  min-height: 72px;
  margin-bottom: 28px;
  padding: 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--fh-border);
}
.fh-appbar > div:first-child { min-width: 0; }
.fh-appbar strong { display: block; color: var(--fh-navy); font-size: 20px; line-height: 1.35; }
.fh-kicker { margin-bottom: 2px; color: var(--fh-gold); font-size: 12px; font-weight: 700; }
.fh-app[dir="ltr"] .fh-kicker { letter-spacing: .12em; }
.fh-appbar-actions, .fh-actions, .fh-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.fh-appbar-actions { justify-content: flex-end; }
.fh-autosave-status { min-width: 140px; color: var(--fh-muted); font-size: 12px; text-align: center; }
.fh-lang {
  min-height: 44px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-control);
  background: var(--fh-porcelain);
  color: var(--fh-navy) !important;
  font-size: 13px;
  font-weight: 700;
}
.fh-lang:hover { border-color: var(--fh-navy); background: #fff; }

/* Notices */
.fh-notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #BFDCC9;
  border-inline-start: 4px solid var(--fh-success);
  border-radius: 12px;
  background: var(--fh-success-soft);
  color: #1D5A39;
  font-size: 14px;
  font-weight: 700;
}
.fh-error { border-color: #E8C5C0; border-inline-start-color: var(--fh-danger); background: var(--fh-danger-soft); color: var(--fh-danger); }

/* Surfaces */
.fh-panel, .fh-invite-card, .fh-empty, .fh-auth-card {
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius);
  background: var(--fh-porcelain);
}
.fh-panel, .fh-invite-card, .fh-auth-card { padding: clamp(18px, 2.2vw, 28px); }
.fh-panel { box-shadow: 0 4px 14px rgba(23,44,71,.035); }
.fh-empty { padding: 56px 28px; color: var(--fh-muted); text-align: center; }
.fh-auth { max-width: 680px; margin-inline: auto; }
.fh-auth-card { box-shadow: var(--fh-shadow); }
.fh-auth-card::before { content: ''; display: block; width: 48px; height: 3px; margin-bottom: 18px; background: var(--fh-gold); border-radius: 2px; }
.fh-auth-card h2 { margin: 6px 0 10px; color: var(--fh-navy); font-size: clamp(28px, 4vw, 38px); }
.fh-auth-card p { color: var(--fh-muted); }

/* Buttons */
.fh-btn {
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--fh-radius-control);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.fh-primary { background: var(--fh-navy) !important; border-color: var(--fh-navy) !important; color: #fff !important; }
.fh-primary:hover { background: var(--fh-navy-strong) !important; border-color: var(--fh-navy-strong) !important; box-shadow: 0 8px 18px rgba(0,48,112,.16); }
.fh-secondary { background: var(--fh-porcelain) !important; border-color: var(--fh-border) !important; color: var(--fh-navy) !important; }
.fh-secondary:hover { border-color: var(--fh-navy) !important; background: #fff !important; }
.fh-danger { background: var(--fh-danger-soft) !important; border-color: #E8C5C0 !important; color: var(--fh-danger) !important; }
.fh-whatsapp { background: #EFF8F3 !important; border-color: #BFDCCB !important; color: var(--fh-whatsapp) !important; }
.fh-small, .fh-tiny { min-height: 44px; padding: 9px 13px; font-size: 13px; }
.fh-quiet { min-height: 44px; padding-inline: 4px; border: 0 !important; background: transparent !important; color: var(--fh-muted) !important; }

/* Home */
.fh-home-grid {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}
.fh-create-panel { position: sticky; top: 24px; box-shadow: var(--fh-shadow); }
.fh-create-panel::before { content: ''; display: block; width: 48px; height: 3px; margin-bottom: 18px; border-radius: 2px; background: var(--fh-gold); }
.fh-create-panel h2, .fh-step-title h2, .fh-editor-head h2, .fh-panel h3 { color: var(--fh-navy); }
.fh-create-panel h2 { margin: 4px 0 8px; font-size: clamp(24px, 3vw, 32px); line-height: 1.35; }
.fh-create-panel p, .fh-step-title p, .fh-publish-bar p, .fh-upload p { color: var(--fh-muted); font-size: 15px; line-height: 1.8; }
.fh-step-badge {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid rgba(221,170,91,.65); border-radius: 14px;
  background: #FFF8EA; color: var(--fh-navy); font-size: 24px; font-weight: 700;
}
.fh-inline-create { display: grid; gap: 16px; margin-top: 24px; }
.fh-invite-list { display: grid; gap: 16px; }
.fh-invite-card { position: relative; transition: border-color .16s ease, box-shadow .16s ease; }
.fh-invite-card:hover { border-color: #AEBCCD; box-shadow: var(--fh-shadow-hover); }
.fh-card-top, .fh-editor-head, .fh-publish-bar, .fh-table-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.fh-editor-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.fh-preview-toggle svg { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }
.fh-card-top > div { min-width: 0; }
.fh-invite-card h3 { margin: 9px 0 5px; color: var(--fh-navy); font-size: 20px; line-height: 1.5; }
.fh-invite-card small { color: var(--fh-muted); font-size: 13px; }
.fh-type-chip, .fh-status {
  display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px;
  border-radius: 8px; font-size: 12px; font-weight: 700;
}
.fh-type-chip { border: 1px solid #E8D2A7; background: #FFF8EA; color: #6B4A17; }
.fh-status { border: 1px solid transparent; }
.fh-status.draft, .fh-status.pending { background: var(--fh-warning-soft); border-color: #E8D7AD; color: var(--fh-warning); }
.fh-status.published, .fh-status.confirmed { background: var(--fh-success-soft); border-color: #BFDCC9; color: var(--fh-success); }
.fh-status.archived { background: #F1F3F5; border-color: #D8DEE5; color: #596A7D; }
.fh-status.declined { background: var(--fh-danger-soft); border-color: #E8C5C0; color: var(--fh-danger); }
.fh-progress { height: 6px; margin: 20px 0 8px; overflow: hidden; background: #E8EDF2; border-radius: 99px; }
.fh-progress > div { height: 100%; background: var(--fh-navy); border-radius: inherit; }
.fh-progress-label { display: flex; justify-content: space-between; gap: 12px; color: var(--fh-muted); font-size: 13px; }
.fh-mini-steps { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin: 16px 0 22px; }
.fh-mini-steps span { min-width: 0; padding: 8px 4px 6px; border-top: 2px solid #E4EAF0; color: var(--fh-muted); font-size: 11px; line-height: 1.5; }
.fh-mini-steps span.done { border-top-color: var(--fh-success); color: #2B6548; }

/* Editor */
.fh-editor-head {
  margin-bottom: 22px;
  padding: 18px 20px;
  align-items: center;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius);
  background: var(--fh-porcelain);
  box-shadow: 0 4px 14px rgba(23,44,71,.03);
}
.fh-editor-head h2 { margin: 8px 0 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.4; }
.fh-editor-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 3vw, 42px); align-items: start; }
.fh-editor-rail { position: sticky; top: 24px; min-width: 0; }
.fh-editor-content { min-width: 0; }

.fh-stepper { position: relative; display: grid; gap: 6px; margin: 0; padding: 4px 0; }
.fh-stepper::before { content: ''; position: absolute; inset-block: 28px; inset-inline-start: 21px; width: 1px; background: var(--fh-border); }
.fh-stepper a {
  position: relative; z-index: 1; min-width: 0;
  display: grid; grid-template-columns: 44px minmax(0,1fr); grid-template-rows: auto auto;
  gap: 1px 12px; align-items: center; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 14px; color: var(--fh-muted) !important;
}
.fh-stepper a > span {
  width: 44px; height: 44px; grid-row: 1 / 3; display: grid; place-items: center;
  border: 1px solid var(--fh-border); border-radius: 14px;
  background: var(--fh-porcelain); color: var(--fh-navy); font-size: 13px; font-weight: 700;
}
.fh-stepper b { min-width: 0; color: inherit; font-size: 14px; line-height: 1.45; }
.fh-stepper small { color: #76531C; font-size: 12px; }
.fh-stepper a:hover { border-color: var(--fh-border); background: #fff; }
.fh-stepper a.active { border-color: #B8C8D9; background: #F5F8FB; color: var(--fh-navy) !important; }
.fh-stepper a.active > span { border-color: var(--fh-navy); background: var(--fh-navy); color: #fff; }
.fh-stepper a.done > span { border-color: var(--fh-success); background: var(--fh-success-soft); color: var(--fh-success); }

.fh-step-title { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 14px; align-items: start; margin-bottom: 18px; }
.fh-step-title > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--fh-navy); color: #fff; font-size: 16px; font-weight: 700; }
.fh-step-title h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); line-height: 1.35; }
.fh-step-title p { max-width: 820px; margin: 4px 0 0; }

/* Forms */
.fh-form { min-width: 0; container-type: inline-size; container-name: fh-editor-form; }
.fh-inline-create label, .fh-form label { min-width: 0; display: grid; gap: 7px; }
.fh-inline-create label > span, .fh-form label > span, .fh-seal-language legend, .fh-seal-colors legend {
  color: var(--fh-ink); font-size: 14px; font-weight: 700; line-height: 1.5;
}
.fh-form input:not([type=checkbox]):not([type=radio]), .fh-form select, .fh-form textarea,
.fh-inline-create select, .fh-upload input[type=file] {
  width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--fh-border); border-radius: 12px;
  background: var(--fh-porcelain); color: var(--fh-ink); font-size: 16px; line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(23,44,71,.04);
}
.fh-form textarea { min-height: 110px; resize: vertical; }
.fh-form input:hover, .fh-form select:hover, .fh-form textarea:hover { border-color: #AAB9CA; }
.fh-form input:focus, .fh-form select:focus, .fh-form textarea:focus { border-color: var(--fh-focus); }
.fh-form input[type=date], .fh-form input[type=time] { color-scheme: light; }
.fh-form input[type=file] { padding: 10px; background: var(--fh-paper); }
.fh-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 20px; }
.fh-wide { grid-column: 1 / -1; }
.fh-two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fh-slug { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); border: 1px solid var(--fh-border); border-radius: 12px; overflow: hidden; background: var(--fh-porcelain); }
.fh-slug small { display: flex; align-items: center; padding-inline: 12px; color: var(--fh-muted); background: var(--fh-paper); border-inline-end: 1px solid var(--fh-border); direction: ltr; font-size: 12px; white-space: nowrap; }
.fh-slug input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.fh-next-actions { margin-top: 22px; justify-content: space-between; }
.fh-form > .fh-next-actions { margin-bottom: 0; }
.fh-field-hint { margin: 4px 0 0; color: var(--fh-muted); font-size: 13px; line-height: 1.7; }

/* Live editor + collapsible preview drawer */
.fh-live-editor { display: block; min-width: 0; }
.fh-editor-form-column { width: 100%; min-width: 0; }
.fh-live-preview-shell {
  position: fixed;
  z-index: 99999;
  inset-block: 20px;
  inset-inline-end: 20px;
  width: min(460px, calc(100vw - 40px));
  min-width: 0;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--fh-border);
  border-radius: 20px;
  background: var(--fh-porcelain);
  box-shadow: 0 24px 64px rgba(23,44,71,.22);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateX(calc(100% + 48px));
  transition: transform .22s ease, opacity .18s ease, visibility 0s linear .22s;
}
.fh-app[dir="rtl"] .fh-live-preview-shell { transform: translateX(calc(-100% - 48px)); }
.fh-live-preview-shell.is-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0) !important;
  transition: transform .22s ease, opacity .18s ease, visibility 0s;
}
.fh-live-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.fh-live-preview-head strong { display: block; color: var(--fh-navy); font-size: 15px; }
.fh-live-preview-head small { display: block; margin-top: 2px; color: var(--fh-muted); font-size: 12px; }
.fh-live-preview-head-actions { display: flex; align-items: center; gap: 8px; }
.fh-preview-lang-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--fh-border); border-radius: 12px; background: var(--fh-paper); }
.fh-preview-lang-switch button { min-width: 44px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--fh-muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.fh-preview-lang-switch button.active { background: var(--fh-navy); color: #fff; }
.fh-preview-close { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 1px solid var(--fh-border); border-radius: 12px; background: var(--fh-porcelain); color: var(--fh-navy); font-size: 25px; line-height: 1; cursor: pointer; }
.fh-preview-close:hover { border-color: var(--fh-navy); background: #fff; }
.fh-live-preview { --lp-bg:#F3E9D2; --lp-card:#C9A45D; --lp-text:#1F1F1F; --lp-muted:#2F2B28; --lp-accent:#4A3514; --lp-border:#4A3514; --lp-seal:#4A3514; overflow: hidden; border: 1px solid var(--fh-border); border-radius: var(--fh-radius); background: var(--fh-porcelain); box-shadow: var(--fh-shadow); }
.fh-live-canvas { padding: 16px; background: var(--lp-bg); }
.fh-live-sheet { min-height: 520px; padding: 30px 24px 24px; display: flex; flex-direction: column; justify-content: flex-start; border: 1px solid var(--lp-border); border-radius: 14px; background: var(--lp-card); color: var(--lp-text); text-align: center; box-shadow: 0 8px 20px rgba(23,44,71,.10); font-family: 'Almarai', Arial, sans-serif; }
.fh-live-seal { width: 100px; height: 100px; margin: 0 auto 12px; display: grid; place-items: center; color: var(--lp-seal); }
.fh-live-event { color: var(--lp-accent); font-size: 12px; font-weight: 700; line-height: 1.5; }
.fh-live-parents { display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); gap: 8px; align-items: center; margin: 16px 0 14px; padding-block: 10px; border-block: 1px solid color-mix(in srgb, var(--lp-border) 65%, transparent); color: var(--lp-muted); font-size: 12px; line-height: 1.55; }
.fh-live-parents span { min-width: 0; overflow-wrap: anywhere; }
.fh-live-parents i { width: 44px; height: 1px; background: var(--lp-accent); opacity: .65; }
.fh-live-couple { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: center; margin: 4px 0 10px; }
.fh-live-couple strong { min-width: 0; color: var(--lp-text); font-size: clamp(22px, 2.2vw, 32px); line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; word-break: normal; }
.fh-live-couple b { color: var(--lp-accent); font-size: 19px; }
.fh-live-couple.fh-couple-long strong { font-size: 22px; }
.fh-live-couple.fh-couple-stack { grid-template-columns: 1fr; gap: 2px; }
.fh-live-sheet h4 { margin: 0 0 9px; color: var(--lp-accent); font-size: 14px; line-height: 1.5; }
.fh-live-sheet p { margin: 0 auto 18px; max-width: 32ch; color: var(--lp-muted); font-size: 13px; line-height: 1.8; }
.fh-live-date { display: grid; grid-template-columns: 1fr 1fr; margin-top: auto; border-block: 1px solid color-mix(in srgb, var(--lp-border) 65%, transparent); }
.fh-live-date span { padding: 12px 10px; }
.fh-live-date span + span { border-inline-start: 1px solid color-mix(in srgb, var(--lp-border) 65%, transparent); }
.fh-live-date small, .fh-live-date b { display: block; }
.fh-live-date small { color: var(--lp-muted); font-size: 11px; }
.fh-live-date b { margin-top: 3px; color: var(--lp-text); font-size: 13px; }
.fh-live-preview-note { margin: 0; padding: 12px 14px; border-top: 1px solid var(--fh-border); background: var(--fh-porcelain); color: var(--fh-muted); font-size: 12px; line-height: 1.65; }

/* Theme picker */
.fh-theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 10px; }
.fh-theme { position: relative; min-width: 0; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--fh-border); border-radius: 16px; background: var(--fh-porcelain); cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.fh-theme:hover { border-color: #9FB0C3; background: #fff; }
.fh-theme input { position: absolute; opacity: 0; pointer-events: none; }
.fh-theme.selected, .fh-theme:has(input:checked) { border-color: var(--fh-navy); box-shadow: 0 0 0 2px rgba(0,48,112,.10); }
.fh-theme input:focus-visible + .fh-theme-block { outline: 3px solid var(--fh-focus); outline-offset: 3px; }
.fh-theme-block { position: relative; height: 104px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(23,44,71,.12); border-radius: 12px; background: var(--theme-bg); }
.fh-theme-block::before { content: ''; background: var(--theme-bg); }
.fh-theme-block::after { content: ''; background: var(--theme-card); }
.fh-theme-block i { position: absolute; inset: 20px 22px; display: grid; place-items: center; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-card); color: var(--theme-text); font-style: normal; box-shadow: 0 4px 12px rgba(23,44,71,.09); }
.fh-theme-block i em { width: 36px; height: 2px; background: var(--theme-accent); }
.fh-theme-block i small { color: var(--theme-text); font-size: 13px; font-weight: 700; }
.fh-theme-block b { position: absolute; inset-inline-end: 8px; inset-block-start: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--fh-navy); color: #fff; font-size: 13px; opacity: 0; box-shadow: 0 2px 6px rgba(0,0,0,.14); }
.fh-theme.selected .fh-theme-block b, .fh-theme:has(input:checked) .fh-theme-block b { opacity: 1; }
.fh-theme > strong { color: var(--fh-ink); font-size: 13px; line-height: 1.5; }
.fh-theme > small { display: flex; gap: 8px; flex-wrap: wrap; color: var(--fh-muted); font-size: 11px; line-height: 1.5; }
.fh-theme > small span { display: inline-flex; align-items: center; gap: 5px; }
.fh-theme > small i { width: 12px; height: 12px; border: 1px solid rgba(23,44,71,.2); border-radius: 3px; background: var(--swatch); }

/* Monogram builder */
.fh-monogram-builder { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--fh-border); }
.fh-monogram-builder__header { display: grid; grid-template-columns: minmax(0,1fr) 132px; gap: 20px; align-items: start; }
.fh-monogram-builder__intro { min-width: 0; }
.fh-monogram-builder__intro h3 { margin: 0 0 7px; font-size: 20px; }
.fh-monogram-builder__intro p { margin: 0; max-width: 640px; color: var(--fh-muted); font-size: 14px; line-height: 1.8; }
.fh-monogram-preview { width: 132px; min-height: 132px; padding: 10px; display: grid; grid-template-rows: 92px auto; place-items: center; border: 1px solid var(--fh-border); border-radius: 16px; background: var(--fh-paper); overflow: hidden; }
.fh-monogram-preview .fh-monogram-svg, .fh-monogram-preview .fh-monogram-fallback { width: 92px; height: 92px; }
.fh-monogram-preview small { width: 100%; overflow: hidden; color: var(--fh-muted); font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.fh-monogram-builder__controls { display: grid; gap: 22px; margin-top: 22px; }
.fh-monogram-builder fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.fh-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 8px; }
.fh-choice-grid label { position: relative; min-width: 0; display: block; cursor: pointer; }
.fh-choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.fh-choice-grid span { min-height: 72px; padding: 12px 14px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; align-items: center; border: 1px solid var(--fh-border); border-radius: 14px; background: var(--fh-porcelain); }
.fh-choice-grid b { color: var(--fh-navy); font-size: 24px; line-height: 1; }
.fh-choice-grid em { color: var(--fh-ink); font-size: 14px; font-style: normal; font-weight: 700; }
.fh-choice-grid input:checked + span { border-color: var(--fh-navy); background: #F5F8FB; box-shadow: 0 0 0 2px rgba(0,48,112,.08); }
.fh-choice-grid input:focus-visible + span { outline: 3px solid var(--fh-focus); outline-offset: 3px; }
.fh-monogram-letters select { min-height: 52px; font-size: 18px; font-weight: 700; text-align: center; }
.fh-seal-colors > div { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.fh-seal-colors label { position: relative; min-width: 0; display: block; cursor: pointer; }
.fh-seal-colors input { position: absolute; opacity: 0; pointer-events: none; }
.fh-seal-colors span { min-height: 72px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--fh-border); border-radius: 14px; background: var(--fh-porcelain); }
.fh-seal-colors i { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid rgba(23,44,71,.18); border-radius: 50%; background: var(--seal-swatch); box-shadow: inset 0 0 0 3px rgba(255,255,255,.4); }
.fh-seal-colors b { min-width: 0; color: var(--fh-ink); font-size: 13px; }
.fh-seal-colors input:checked + span { border-color: var(--fh-navy); background: #F5F8FB; box-shadow: 0 0 0 2px rgba(0,48,112,.08); }
.fh-seal-colors input:focus-visible + span { outline: 3px solid var(--fh-focus); outline-offset: 3px; }
.fh-monogram-svg, .fh-monogram-fallback { display: block; width: 100%; height: 100%; color: currentColor; }
.fh-monogram-fallback { display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid currentColor; border-radius: 50%; font-size: 28px; font-weight: 700; }

/* WhatsApp */
.fh-whatsapp-builder { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--fh-border); }
.fh-whatsapp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.fh-whatsapp-head h3 { margin: 0 0 5px; }
.fh-whatsapp-head p { margin: 0; color: var(--fh-muted); font-size: 14px; line-height: 1.75; }
.fh-whatsapp-head > span { min-height: 28px; padding: 5px 9px; display: inline-flex; align-items: center; border: 1px solid #BFDCCB; border-radius: 8px; background: #EFF8F3; color: var(--fh-whatsapp); font-size: 12px; font-weight: 700; }
.fh-whatsapp-default { margin-top: 14px; padding: 16px; border: 1px solid var(--fh-border); border-radius: 14px; background: var(--fh-paper); }
.fh-whatsapp-default small { display: block; margin-bottom: 8px; color: var(--fh-muted); font-size: 12px; font-weight: 700; }
.fh-whatsapp-default pre { margin: 0; color: var(--fh-ink); font: 400 14px/1.8 'Almarai', Arial, sans-serif; white-space: pre-wrap; word-break: break-word; }
.fh-whatsapp-checkbox { margin-top: 12px; padding: 14px 15px; display: flex !important; align-items: flex-start; gap: 11px; border: 1px solid var(--fh-border); border-radius: 14px; background: var(--fh-porcelain); cursor: pointer; }
.fh-whatsapp-checkbox input { width: 20px; height: 20px; min-height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--fh-navy); }
.fh-whatsapp-checkbox span { display: grid; gap: 3px; }
.fh-whatsapp-checkbox b { color: var(--fh-ink); font-size: 14px; }
.fh-whatsapp-checkbox small { color: var(--fh-muted); font-size: 12px; line-height: 1.65; }
.fh-whatsapp-checkbox:has(input:checked) { border-color: #9FB2C7; background: #F5F8FB; }
.fh-whatsapp-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; padding: 16px; border: 1px solid var(--fh-border); border-radius: 14px; background: var(--fh-paper); }
.fh-whatsapp-custom > p { grid-column: 1 / -1; margin: 0; color: var(--fh-muted); font-size: 12px; }
.fh-whatsapp-custom textarea { min-height: 150px; }

/* Journey */
.fh-journey-list { display: grid; gap: 14px; }
.fh-stop-form { position: relative; margin: 0; }
.fh-stop-form::before { content: ''; position: absolute; inset-inline-start: -1px; inset-block-start: 28px; width: 4px; height: 44px; border-radius: 99px; background: var(--fh-gold); }

/* Guests */
.fh-two-panels { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; }
.fh-upload { display: flex; flex-direction: column; gap: 14px; }
.fh-upload input[type=file] { background: var(--fh-paper); }
.fh-table-panel { margin-top: 18px; padding: 0; overflow: hidden; }
.fh-table-head { padding: 20px 22px 12px; align-items: center; }
.fh-table-head h3 { margin: 0; font-size: 18px; }
.fh-table-scroll { overflow-x: auto; }
.fh-table-scroll table { width: 100%; min-width: 960px; border-collapse: collapse; }
.fh-table-scroll th, .fh-table-scroll td { padding: 14px 14px; border-bottom: 1px solid #E6EBF0; text-align: start; vertical-align: middle; font-size: 13px; }
.fh-table-scroll th { background: var(--fh-paper); color: var(--fh-muted); font-size: 12px; font-weight: 700; }
.fh-table-scroll td strong, .fh-table-scroll td small { display: block; }
.fh-table-scroll td small { margin-top: 3px; color: var(--fh-muted); font-size: 12px; }
.fh-row-actions form { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; }
.fh-empty-cell { padding: 38px !important; color: var(--fh-muted); text-align: center !important; }

/* Publish / preview */
.fh-publish-bar { align-items: center; }
.fh-publish-bar p { max-width: 680px; margin: 7px 0 0; }
.fh-preview-frame { overflow: hidden; padding: 10px; border: 1px solid var(--fh-border); border-radius: var(--fh-radius); background: #E9EEF3; }
.fh-preview-frame iframe { width: 100%; height: 800px; display: block; border: 0; border-radius: 12px; background: #fff; }

/* RTL / bidi */
.fh-app[dir=rtl] .fh-slug { direction: ltr; }
.fh-app[dir=rtl] input[type=email], .fh-app[dir=rtl] input[type=url], .fh-app[dir=rtl] input[type=tel] { direction: ltr; text-align: left; }
.fh-app[dir=rtl] .fh-theme, .fh-app[dir=rtl] .fh-theme * { letter-spacing: 0; }

/* Component-width safeguards */
@container fh-editor-form (max-width: 640px) {
  .fh-theme-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fh-monogram-builder__header { grid-template-columns: minmax(0,1fr) 112px; }
  .fh-monogram-preview { width: 112px; min-height: 112px; grid-template-rows: 74px auto; }
  .fh-monogram-preview .fh-monogram-svg, .fh-monogram-preview .fh-monogram-fallback { width: 74px; height: 74px; }
  .fh-seal-colors > div { grid-template-columns: 1fr; }
}
@container fh-editor-form (max-width: 450px) {
  .fh-theme-grid { grid-template-columns: 1fr; }
  .fh-monogram-builder__header { grid-template-columns: 1fr; }
  .fh-monogram-preview { justify-self: start; }
  .fh-two-fields { grid-template-columns: 1fr; }
  .fh-choice-grid { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 1240px) {
  .fh-theme-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 1040px) {
  .fh-home-grid { grid-template-columns: 1fr; }
  .fh-create-panel { position: static; }
  .fh-editor-layout { grid-template-columns: 1fr; gap: 18px; }
  .fh-editor-rail { position: static; }
  .fh-stepper { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
  .fh-stepper::before { display: none; }
  .fh-stepper a { grid-template-columns: 40px minmax(0,1fr); padding: 8px; border: 1px solid var(--fh-border); }
  .fh-stepper a > span { width: 40px; height: 40px; }
  .fh-two-panels { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .fh-app { padding: 18px 16px 56px; }
  .fh-live-preview-shell { inset: 0; width: 100%; max-width: none; padding: 16px; border-width: 0; border-radius: 0; }
  .fh-editor-head { align-items: flex-start; }
  .fh-editor-head-actions { width: 100%; justify-content: space-between; }
  /* The same accessible preview control floats only on narrow screens. */
  .fh-preview-toggle {
    position: fixed;
    inset-inline-end: max(16px, env(safe-area-inset-right));
    inset-block-end: calc(16px + env(safe-area-inset-bottom));
    z-index: 1000;
    min-height: 52px;
    max-width: calc(100vw - 32px);
    width: auto;
    padding: 12px 18px;
    border: 1px solid #28558d;
    border-radius: 999px;
    background: var(--fh-navy);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0,48,112,.24), inset 0 1px 0 rgba(255,255,255,.14);
  }
  .fh-preview-toggle:hover, .fh-preview-toggle:focus-visible { background: var(--fh-navy-strong); color: #fff; }
  .fh-app:has(.fh-preview-toggle) { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .fh-live-preview-shell { padding-block: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-bottom)); }
  .fh-live-preview-head { position: sticky; top: 0; z-index: 2; background: var(--fh-porcelain); padding-bottom: 10px; }
  .fh-appbar { align-items: flex-start; }
  .fh-appbar-actions { max-width: 58%; }
  .fh-autosave-status { order: 3; width: 100%; min-width: 0; text-align: end; }
  .fh-panel, .fh-invite-card, .fh-auth-card { padding: 18px; }
  .fh-editor-head { padding: 16px; }
  .fh-stepper { grid-template-columns: 1fr 1fr; }
  .fh-stepper a:nth-child(5) { grid-column: 1 / -1; }
  .fh-form-grid { grid-template-columns: 1fr; }
  .fh-wide { grid-column: auto; }
  .fh-theme-grid { grid-template-columns: 1fr 1fr; }
  .fh-whatsapp-custom { grid-template-columns: 1fr; }
  .fh-whatsapp-custom > p { grid-column: auto; }
  .fh-slug { grid-template-columns: 1fr; }
  .fh-slug small { padding: 9px 11px; overflow: hidden; border-inline-end: 0; border-bottom: 1px solid var(--fh-border); text-overflow: ellipsis; }
  .fh-table-scroll { overflow: visible; }
  .fh-table-scroll table, .fh-table-scroll tbody { display: block; min-width: 0; width: 100%; }
  .fh-table-scroll thead { display: none; }
  .fh-table-scroll tr { display: block; padding: 14px 16px; border-top: 1px solid var(--fh-border); }
  .fh-table-scroll tr:first-child { border-top: 0; }
  .fh-table-scroll td { display: grid; grid-template-columns: minmax(112px, 34%) minmax(0,1fr); gap: 12px; align-items: start; padding: 9px 0; border: 0; font-size: 13px; }
  .fh-table-scroll td::before { content: attr(data-label); color: var(--fh-muted); font-size: 12px; font-weight: 700; line-height: 1.5; }
  .fh-table-scroll td.fh-empty-cell { display: block; }
  .fh-row-actions { justify-content: flex-start; }
  .fh-preview-frame { padding: 5px; }
  .fh-preview-frame iframe { height: 700px; }
  .fh-publish-bar { display: grid; }
  .fh-publish-bar .fh-btn { width: 100%; }
}

@media (max-width: 520px) {
  .fh-appbar { display: grid; grid-template-columns: 1fr auto; }
  .fh-appbar-actions { max-width: none; }
  .fh-mini-steps { grid-template-columns: 1fr; gap: 0; }
  .fh-mini-steps span { padding: 7px 0; border-top: 0; border-bottom: 1px solid #E6EBF0; }
  .fh-stepper { grid-template-columns: 1fr; }
  .fh-stepper a:nth-child(5) { grid-column: auto; }
  .fh-step-title { grid-template-columns: 42px 1fr; }
  .fh-step-title > span { width: 42px; height: 42px; }
  .fh-theme-grid { grid-template-columns: 1fr; }
  .fh-theme-block { height: 92px; }
  .fh-live-canvas { padding: 10px; }
  .fh-live-sheet { min-height: 410px; padding: 24px 15px 18px; }
  .fh-live-seal { width: 80px; height: 80px; }
  .fh-live-couple { gap: 6px; }
  .fh-live-couple strong { font-size: 22px; }
  .fh-whatsapp-head { display: grid; }
  .fh-whatsapp-head > span { justify-self: start; }
  .fh-next-actions { display: grid; grid-template-columns: 1fr; }
  .fh-next-actions .fh-btn { width: 100%; }
}

@media (max-width: 360px) {
  .fh-app { padding-inline: 16px; }
  .fh-card-top, .fh-editor-head { align-items: flex-start; }
  .fh-invite-card .fh-actions { display: grid; grid-template-columns: 1fr; }
  .fh-invite-card .fh-actions .fh-btn { width: 100%; }
  .fh-live-couple { grid-template-columns: 1fr; gap: 2px; }
  .fh-live-parents { grid-template-columns: 1fr; gap: 6px; }
  .fh-live-parents i { width: 44px; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .fh-app *, .fh-app *::before, .fh-app *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Visible save feedback and consistent upload controls. */
.fh-app .fh-autosave-status{font-size:13px;line-height:1.7;max-width:36ch;overflow-wrap:anywhere}
.fh-app .fh-autosave-status[data-state="error"]{color:#8e271f;background:#fff5f3;padding:10px 12px;border:1px solid #dfb9b2;border-radius:10px}
.fh-app .fh-autosave-status[data-state="saved"]{color:#195e39}
.fh-app .fh-autosave-retry{min-height:44px}
.fh-app .fh-upload-label{display:grid;gap:10px;text-align:start;font-weight:700}
.fh-app .fh-upload-label input{max-width:100%;min-height:48px}
.fh-app [hidden]{display:none!important}
/* Marketplace: consistent stationery previews, compact plan selection, readable RTL. */
.fh-marketplace{max-width:1440px;margin-inline:auto;padding:clamp(20px,4vw,64px)}.fh-marketplace-heading{max-width:820px;margin:0 auto 40px;text-align:center}.fh-marketplace-heading h1{font-size:clamp(30px,4vw,52px);line-height:1.35;color:#003070!important;margin:16px 0}.fh-marketplace-heading p{font-size:18px;line-height:1.8}.fh-marketplace-filters{display:flex;gap:10px;overflow-x:auto;padding:6px 2px 22px;white-space:nowrap}.fh-marketplace-filters a{padding:12px 18px;border:1px solid #dbdbdb;border-radius:30px;color:#003070;background:white;text-decoration:none}.fh-marketplace-filters a[aria-current]{background:#003070;color:white}.fh-design-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px}.fh-design-card{border:1px solid #dbdbdb;border-radius:20px;background:#fff;overflow:hidden;padding:12px 12px 20px;box-shadow:0 4px 12px #00307008}.fh-design-card img{width:100%;height:auto;border-radius:12px;aspect-ratio:480/580;object-fit:cover}.fh-design-card h2{font-size:19px;color:#003070;margin:18px 4px 8px}.fh-design-card p{font-size:12px;line-height:1.8;margin:8px 4px 18px}.fh-design-card a{text-decoration:none}.fh-marketplace-setup{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.85fr);gap:36px;align-items:start}.fh-design-preview{width:100%;height:680px;border:1px solid #dbdbdb;border-radius:20px;background:#f7f4ef}.fh-marketplace-setup .fh-panel{position:sticky;top:24px}.fh-marketplace-setup form>label{display:grid;gap:8px;margin-top:18px}.fh-plan-options{display:grid;gap:12px}.fh-plan{display:flex!important;align-items:center;gap:12px;padding:16px;border:1px solid #dbdbdb;border-radius:14px;cursor:pointer}.fh-plan:has(input:checked){border-color:#003070;background:rgba(221,170,91,.10)}.fh-plan>span{display:flex;flex:1;gap:12px;justify-content:space-between;align-items:center}.fh-plan input{width:20px;height:20px}.fh-plan del{color:#666;font-size:13px}.fh-plan strong{color:#003070}.fh-marketplace :focus-visible{outline:3px solid #DDAA5B;outline-offset:3px}.fh-form [hidden]{display:none!important}
@media(max-width:1100px){.fh-design-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:760px){.fh-design-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.fh-marketplace{padding:24px 16px}.fh-marketplace-setup{grid-template-columns:1fr;gap:24px}.fh-marketplace-setup .fh-panel{position:static}.fh-design-preview{height:600px}.fh-design-card h2{font-size:16px}.fh-design-card .fh-btn{width:100%;font-size:13px}}@media(max-width:380px){.fh-design-grid{grid-template-columns:1fr}}
