/* Fulcrum Global platform chrome — light shell */

:root {
  /*
   * FGP CI (Logotype & CI Usage Guidelines) — shared with BMS:
   * Primary: dark turquoise + crimson
   * Graphic: teal-green / orange / salmon
   * Text/chrome: greys (avoid black as brand chrome)
   */
  --fg-primary: #22849c;
  --fg-secondary: #c5494d;
  --fg-tertiary: #37beca; /* graphic light-blue / cyan — tab secondary */
  --fg-teal: var(--fg-primary);
  --fg-teal-dark: #176579;
  --fg-teal-soft: rgba(34, 132, 156, 0.12);
  --fg-cyan: var(--fg-tertiary);
  --fg-cyan-soft: color-mix(in srgb, var(--fg-tertiary) 16%, #ffffff);
  --fg-cyan-soft-strong: color-mix(in srgb, var(--fg-tertiary) 24%, #ffffff);
  --fg-crimson: var(--fg-secondary);
  --fg-orange: #ff8c64;
  --fg-salmon: #f2af9d;
  --fg-grey: #b2b2b2;
  --fg-grey-mid: #7f7f7f;
  --fg-grey-deep: #555555;
  --fg-rich-black: #1a1a1a;
  --fg-ink: var(--fg-grey-deep);
  --fg-muted: var(--fg-grey-mid);
  --fg-line: #d8dfdf;
  --fg-line-strong: color-mix(in srgb, var(--fg-grey) 55%, #d8dfdf);
  --fg-paper: #f5f8fa; /* soft teal-tinted paper — shared with BMS */
  --fg-elevated: #eef5f7;
  --fg-white: #ffffff;
  --fg-danger: var(--fg-crimson);
  --fg-radius: 8px; /* match BMS card radius */
  --fg-radius-sm: 4px;
  --fg-shadow: 0 10px 28px rgba(34, 132, 156, 0.1);
  --fg-shadow-lg: 0 14px 32px rgba(26, 106, 124, 0.12);
  --fg-shadow-focus: 0 0 0 3px var(--fg-teal-soft);
  --fg-pad-x: clamp(1.25rem, 4vw, 2.75rem);
  /* FGP CI: Red Hat Display — Thin (300) body / Regular (400) headings */
  --fg-font: "Red Hat Display", Arial, Helvetica, sans-serif;
  --fg-display: "Red Hat Display", Arial, Helvetica, sans-serif;
  /* Shared chrome height — ribbon pins flush under the top banner */
  --fg-topbar-h: 3.75rem;
  --fg-tools-rail-w: 4.75rem;
  --fg-tools-ribbon-h: 0px;
  --fg-tools-well-top: calc(var(--fg-topbar-h) + var(--fg-tools-ribbon-h));
}

.fg-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  /* Fulcrum pages must scroll (portal, Why Thailand, projects). Toolkit shells
     that need locked viewport load main.css which overrides this for body only.
     Keep this resilient when main.css also loads (agent tools modals). */
  overflow-x: hidden;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y manipulation;
  font-family: var(--fg-font);
  font-weight: 300; /* FGP CI: Thin for body text */
  color: var(--fg-ink);
  background: var(--fg-paper);
  color-scheme: light;
}

.fg-body a { color: var(--fg-teal-dark); }

.fg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  box-sizing: border-box;
  height: var(--fg-topbar-h);
  min-height: var(--fg-topbar-h);
  max-height: var(--fg-topbar-h);
  padding: 0 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--fg-line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  /* Keep banner above the tools ribbon so they meet flush with no gap */
  z-index: 200;
}

.fg-topbar-frozen {
  position: sticky;
  top: 0;
  z-index: 200;
}

.fg-topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  width: 100%;
}

.fg-brand-block {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  min-width: 0;
}

.fg-titles {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.fg-system-name {
  margin: 0;
  font-family: var(--fg-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
  line-height: 1.1;
}

.fg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--fg-ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
  flex-shrink: 0;
}

.fg-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-left: auto;
}

.fg-tools-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.fg-tools-mode-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted, #6b7a86);
  white-space: nowrap;
}

.fg-tools-mode-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--fg-line, #d5dde3);
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg-line, #d5dde3) 22%, #fff);
  overflow: hidden;
}

.fg-tools-mode-btn {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.22rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg-muted, #6b7a86);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.fg-tools-mode-btn:hover {
  color: var(--fg-ink, #1a2430);
}

.fg-tools-mode-btn.is-active {
  color: #fff;
  background: var(--fg-brand, #22849c);
}

.fg-tools-mode-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--fg-brand, #22849c) 55%, #fff);
  outline-offset: 1px;
  z-index: 1;
}

/* Soft-hide removed: top marketing nav stays identical in every tools mode */

/* Dual-mode users (CM + Support Sub/Head): show only the active tools panel. */
.fg-library-tools-rail[data-fg-tools-rail-mode][data-tools-mode="sales"] [data-tools-mode-panel="admin"],
.fg-library-tools-rail[data-fg-tools-rail-mode][data-tools-mode="admin"] [data-tools-mode-panel="sales"] {
  display: none;
}

.fg-topbar-actions .fg-nav-notes,
.fg-topbar-actions .fg-esign-notify {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
}

/* Author display must not override UA [hidden] { display:none }. */
.fg-topbar-actions .fg-esign-notify[hidden],
.fg-esign-notify[hidden] {
  display: none !important;
}

.fg-esign-notify {
  position: relative;
  border: 1px solid color-mix(in srgb, #0d9488 32%, var(--fg-line, #d5dde3));
  background: color-mix(in srgb, #0d9488 10%, #fff);
  color: #0f766e;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  gap: 0.35rem;
  white-space: nowrap;
}

.fg-esign-notify:hover,
.fg-esign-notify.has-notification {
  border-color: color-mix(in srgb, #0d9488 48%, var(--fg-line, #d5dde3));
  background: color-mix(in srgb, #0d9488 16%, #fff);
}

.fg-esign-notify.has-notification {
  animation: fg-esign-pulse 1.4s ease-in-out infinite;
}

.fg-esign-notify-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #0d9488;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.fg-esign-notify-badge[hidden] {
  display: none !important;
}

.fg-esign-toast {
  position: fixed;
  top: calc(var(--fg-topbar-h) + 0.5rem);
  right: 1rem;
  z-index: 1200;
  max-width: min(22rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

/* Legacy toast retired — Alerts page (/alerts) replaces hover popup. */
.fg-esign-toast,
.fg-esign-toast[hidden] {
  display: none !important;
}

@keyframes fg-esign-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.35);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
  }
}

/* Full FGP primary logo (mark + stacked wordmark in one SVG) */
.fg-brand-lockup {
  display: block;
  height: 2.35rem;
  width: auto;
  max-width: 10.5rem;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

/* Shared FGP primary lockup (mark + stacked wordmark) — match Marketing Studio */
.fgp-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.2rem 0;
  text-decoration: none;
  color: var(--fg-primary, #22849c);
  line-height: 0;
}

.fgp-lockup-mark {
  display: block;
  width: 2.35rem;
  height: 2.35rem;
  min-width: 30px; /* FGP CI digital min height */
  min-height: 30px;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.fgp-lockup-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.02em;
  font-family: var(--fg-display);
  font-weight: 400; /* FGP CI: Regular for headings / lockup */
  font-size: 1rem;
  line-height: 1.05;
  letter-spacing: 0.14em;
  color: var(--fg-primary, #22849c);
  text-transform: none;
}

.fgp-lockup-line {
  display: block;
}

.fg-brand.fgp-lockup .fg-system-name {
  margin-left: 0.15rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--fg-line-strong);
  align-self: center;
  font-weight: 500;
  color: var(--fg-grey-mid);
}

.fgp-lockup--compact .fgp-lockup-mark {
  width: 1.75rem;
  height: 1.75rem;
}

.fgp-lockup--compact .fgp-lockup-text {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.fg-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.fg-nav::-webkit-scrollbar {
  display: none;
}

.fg-nav a,
.fg-nav button.fg-linkbtn {
  border: 0;
  background: transparent;
  font: inherit;
  font-family: var(--fg-display);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.fg-nav a:hover,
.fg-nav a.active,
.fg-nav button.fg-linkbtn:hover,
.fg-nav button.fg-linkbtn.active {
  color: var(--fg-teal-dark);
  background: var(--fg-teal-soft);
}

.fg-nav a.active,
.fg-nav button.fg-linkbtn.active {
  font-weight: 600;
}

/* Signed-in identity chip + demo user switcher */
.fg-identity {
  position: relative;
  margin-left: 0;
}

.fg-identity-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--fg-teal) 28%, var(--fg-line));
  background: color-mix(in srgb, var(--fg-teal) 8%, #fff);
  color: var(--fg-ink);
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.28rem 0.28rem;
  font: inherit;
  cursor: pointer;
  max-width: min(280px, 70vw);
}

.fg-identity-btn:hover {
  border-color: var(--fg-teal);
  box-shadow: var(--fg-shadow-focus);
}

.fg-identity.is-open .fg-identity-btn {
  border-color: var(--fg-teal);
  box-shadow: var(--fg-shadow-focus);
}

.fg-identity-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--fg-teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fg-identity-avatar-sm {
  width: 1.55rem;
  height: 1.55rem;
  font-size: 0.72rem;
}

.fg-identity-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
  line-height: 1.15;
}

.fg-identity-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.fg-identity-role {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--fg-teal-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.fg-identity-user {
  font-weight: 500;
  color: var(--fg-muted);
}

.fg-identity-caret {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--fg-teal-dark);
  border-bottom: 2px solid var(--fg-teal-dark);
  transform: rotate(45deg);
  margin: 0 0.25rem 0.2rem 0.1rem;
  flex-shrink: 0;
}

.fg-identity.is-open .fg-identity-caret {
  transform: rotate(-135deg);
  margin-bottom: 0;
  margin-top: 0.2rem;
}

.fg-identity-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 260px;
  background: var(--fg-white);
  border: 1px solid var(--fg-line-strong);
  border-radius: var(--fg-radius);
  box-shadow: var(--fg-shadow-lg);
  padding: 0.45rem;
  z-index: 60;
}

.fg-identity-group-label {
  margin: 0.55rem 0.65rem 0.2rem;
  padding: 0.35rem 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted, #6b7280);
  border-top: 1px solid var(--fg-line, #e5e7eb);
}

.fg-identity-menu-label + .fg-identity-group-label {
  border-top: 0;
  margin-top: 0.15rem;
  padding-top: 0;
}

.fg-page-intro {
  margin-bottom: 1.5rem;
  max-width: 42rem;
}

.fg-page-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-teal, #22849C);
}

.fg-page-intro h1 {
  margin: 0 0 0.5rem;
  font-family: "Red Hat Display", sans-serif;
  font-size: clamp(1.65rem, 2.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-ink, #1a1f24);
}

.fg-it-page .fg-lead {
  margin-bottom: 0;
  max-width: 52rem;
}

.fg-it-page {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

/* One button size across Access Control (forms, tables, catalogs). */
.fg-it-page .fg-btn,
.fg-it-page a.fg-btn,
.fg-it-page .it-pc-btn,
.fg-it-page .it-field-catalog-actions .fg-btn {
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.2;
  border-radius: 999px;
  box-sizing: border-box;
  max-width: 100%;
}

/* Keep panels/tables from letting controls spill outside the card. */
.fg-it-page .fg-panel,
.fg-it-page .fg-it-panel,
.fg-it-page .fg-it-main,
.fg-it-page .fg-it-side {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.fg-it-page .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Users: same panel/table language as other IT sections; scroll only when needed */
.fg-it-page .it-users-panel .table-scroll.it-users-scroll {
  max-height: 16rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.it-users-panel .fg-it-users {
  width: 100%;
  table-layout: fixed;
}

.it-users-panel .fg-it-users th,
.it-users-panel .fg-it-users td {
  vertical-align: middle;
  padding: 0.4rem 0.55rem;
  text-align: left;
}

.it-users-panel .fg-it-users thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--fg-white, #fff);
}

/* Even column rhythm: User · Roles · Status · Password · Edit */
.it-users-panel .fg-it-users th:nth-child(1),
.it-users-panel .fg-it-users td:nth-child(1) {
  width: 30%;
}

.it-users-panel .fg-it-users th:nth-child(2),
.it-users-panel .fg-it-users td:nth-child(2) {
  width: 22%;
}

.it-users-panel .fg-it-users th:nth-child(3),
.it-users-panel .fg-it-users td:nth-child(3) {
  width: 12%;
}

.it-users-panel .fg-it-users th:nth-child(4),
.it-users-panel .fg-it-users td:nth-child(4) {
  width: 22%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}

.it-users-panel .fg-it-users th:nth-child(5),
.it-users-panel .fg-it-users td:nth-child(5) {
  width: 14%;
  text-align: right;
  white-space: nowrap;
}

.fg-it-demo-password {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fg-teal, #22849c) 10%, #fff);
  color: var(--ink, #1a2330);
  font-size: 0.8rem;
  user-select: all;
}

.it-users-panel .fg-it-users td:nth-child(1) strong {
  font-weight: 600;
}

.it-users-panel .fg-it-users td:nth-child(1) .fg-muted {
  font-size: 0.8rem;
}

.fg-it-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.fg-it-layout-ops-only,
.fg-it-layout-users-only {
  grid-template-columns: minmax(0, 1fr);
}

.fg-it-main {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fg-it-main > .fg-it-panel,
.fg-it-main > .fg-panel {
  margin-top: 0;
}

.fg-it-panel-title {
  margin: 0;
  font-size: 1.05rem;
}

.fg-it-panel-lead {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.it-rule-dictionary,
.it-field-catalog,
.it-price-card-logic {
  display: block;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  /* Reinforce separate rectangle vs Booking form pricing above */
  background: var(--fg-white, #fff);
  border: 1px solid color-mix(in srgb, var(--fg-teal, #0f6e6e) 18%, var(--fg-line, #d8dfdf));
  border-radius: var(--fg-radius, 10px);
  box-shadow: var(--fg-shadow, 0 1px 2px rgba(15, 40, 40, 0.06));
  padding: 1.1rem 1.15rem;
}

.it-rule-dictionary-scroll {
  width: 100%;
  max-width: 100%;
  max-height: min(40vh, 18rem);
  min-height: 8rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.fg-it-rule-dictionary th:nth-child(1),
.fg-it-rule-dictionary td:nth-child(1) {
  width: 10rem;
  white-space: nowrap;
  vertical-align: top;
}

.fg-it-rule-dictionary th:nth-child(3),
.fg-it-rule-dictionary td:nth-child(3) {
  width: 5.5rem;
}

/* Table scrolls; header, meta, and remarks stay fully visible (no panel max-height trap). */
.it-field-catalog {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.it-field-catalog-head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--fg-teal, #0f6e6e) 12%, var(--fg-line, #d8dfdf));
}

.it-field-catalog-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.it-field-catalog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}


.it-fc-input {
  width: 100%;
  min-width: 4.5rem;
  box-sizing: border-box;
}

.it-field-actions {
  white-space: nowrap;
}

.it-field-catalog-remarks {
  flex-shrink: 0;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--fg-teal, #0f6e6e) 12%, var(--fg-line, #d8dfdf));
}

.it-remarks-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--fg-teal, #0f6e6e) 16%, var(--fg-line, #d8dfdf));
  border-radius: 10px;
  background: color-mix(in srgb, var(--fg-teal, #0f6e6e) 5%, #fff);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.it-remarks-toggle:hover {
  background: color-mix(in srgb, var(--fg-teal, #0f6e6e) 10%, #fff);
}

.it-field-catalog-remarks.is-open .it-remarks-toggle {
  border-color: color-mix(in srgb, var(--fg-teal, #0f6e6e) 28%, var(--fg-line, #d8dfdf));
  background: color-mix(in srgb, var(--fg-teal, #0f6e6e) 8%, #fff);
}

.it-field-catalog-remarks-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: inherit;
}

.it-remarks-toggle-hint {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
}

.it-field-catalog-remarks-body {
  margin-top: 0.55rem;
}

.it-field-catalog-remarks.is-collapsed .it-field-catalog-remarks-body {
  display: none;
}

.it-field-catalog-remarks-lead {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.it-field-catalog-remarks-list {
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.it-field-catalog-remarks-list > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem 0.75rem;
  align-items: start;
  font-size: 0.82rem;
}

.it-field-catalog-remarks-list dt {
  margin: 0;
}

.it-field-catalog-remarks-list dt code {
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  background: color-mix(in srgb, var(--fg-teal, #0f6e6e) 10%, #fff);
  border-radius: 4px;
}

.it-field-catalog-remarks-list dd {
  margin: 0;
  color: color-mix(in srgb, var(--fg-ink, #1a2a2a) 82%, #666);
}

.it-field-catalog-remarks-examples {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
}

.it-field-catalog-remarks-examples code {
  font-size: 0.76rem;
  padding: 0.08rem 0.3rem;
  background: color-mix(in srgb, var(--fg-teal, #0f6e6e) 8%, #fff);
  border-radius: 4px;
}

@media (max-width: 720px) {
  .it-field-catalog-remarks-list > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.it-field-catalog-meta {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
}

.it-field-catalog-scroll {
  width: 100%;
  max-width: 100%;
  max-height: min(55vh, 28rem);
  min-height: 12rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.fg-it-field-catalog th,
.fg-it-field-catalog td {
  vertical-align: top;
  font-size: 0.85rem;
}

.it-field-catalog .fg-it-field-catalog thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--fg-white, #fff);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--fg-teal, #0f6e6e) 12%, var(--fg-line, #d8dfdf));
}

.fg-it-field-catalog th:nth-child(1),
.fg-it-field-catalog td:nth-child(1) {
  width: 3.5rem;
  white-space: nowrap;
}

.fg-it-field-catalog th:nth-child(2),
.fg-it-field-catalog td:nth-child(2) {
  white-space: nowrap;
}

.it-field-sample {
  max-width: 16rem;
  color: color-mix(in srgb, var(--fg-ink, #1a2a2a) 88%, #666);
  font-size: 0.82rem;
}

.it-field-source {
  font-size: 0.78rem;
  word-break: break-all;
}

.it-field-rule {
  display: inline-block;
  margin: 0 0.2rem 0.2rem 0;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
  background: color-mix(in srgb, var(--fg-teal, #0f6e6e) 10%, #fff);
  border-radius: 4px;
}

.it-price-card-logic-head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--fg-teal, #0f6e6e) 12%, var(--fg-line, #d8dfdf));
}

.it-price-card-logic-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fg-it-side .fg-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted, #7f7f7f);
}

.fg-it-table {
  width: 100%;
  min-width: 640px;
}

.fg-it-projects {
  min-width: 52rem;
  width: 100%;
  table-layout: fixed;
}

.fg-it-projects th,
.fg-it-projects td {
  vertical-align: middle;
  padding: 0.55rem 0.5rem;
}

.fg-it-projects th:nth-child(1),
.fg-it-projects td:nth-child(1) {
  width: 22%;
}

.fg-it-projects th:nth-child(2),
.fg-it-projects td:nth-child(2) {
  width: 8%;
}

.fg-it-projects th:nth-child(3),
.fg-it-projects td:nth-child(3) {
  width: 8%;
}

.fg-it-projects th:nth-child(4),
.fg-it-projects td:nth-child(4) {
  width: 11%;
}

.fg-it-projects th:nth-child(5),
.fg-it-projects td:nth-child(5) {
  width: 12%;
}

.fg-it-projects th:nth-child(6),
.fg-it-projects td:nth-child(6) {
  width: 9%;
}

.fg-it-projects th:nth-child(7),
.fg-it-projects td:nth-child(7) {
  width: 30%;
  min-width: 14rem;
  text-align: left;
}

.fg-it-project-form {
  margin: 0;
  display: block;
  width: 100%;
}

.fg-it-inline-input,
.fg-it-inline-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--fg-line, #d8dfdf);
  border-radius: 4px;
  background: var(--fg-surface, #fff);
  color: var(--fg-ink, #1a1f24);
}

.fg-it-slug {
  font-size: 0.8rem;
  word-break: break-all;
}

.fg-it-desk-open {
  color: var(--fg-ink, #1a1f24);
  font-weight: 600;
  font-size: 0.85rem;
}

.fg-it-desk-hidden {
  color: var(--fg-muted, #7f7f7f);
  font-weight: 600;
  font-size: 0.85rem;
}

.fg-it-project-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.fg-it-page .fg-it-project-actions .fg-btn,
.fg-it-project-actions .fg-btn {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  min-height: 2rem;
  line-height: 1.2;
  border-radius: 6px;
}

.fg-it-project-actions .fg-it-project-remove {
  color: var(--fg-danger, #9b2c2c);
  border-color: color-mix(in srgb, var(--fg-danger, #9b2c2c) 35%, var(--fg-line, #d8dfdf));
}

.fg-it-booking-pricing th:nth-child(1),
.fg-it-booking-pricing td:nth-child(1) {
  min-width: 10rem;
}

.fg-it-booking-pricing th:nth-child(3),
.fg-it-booking-pricing td:nth-child(3) {
  min-width: 14rem;
}

.fg-it-booking-pricing .fg-it-inline-select {
  width: 100%;
  max-width: 22rem;
}

.fg-it-price-card-logic {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.fg-it-price-card-logic th,
.fg-it-price-card-logic td {
  vertical-align: top;
  overflow: hidden;
}

.fg-it-price-card-logic th:nth-child(1),
.fg-it-price-card-logic td:nth-child(1) {
  width: 30%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

.fg-it-price-card-logic th:nth-child(2),
.fg-it-price-card-logic td:nth-child(2) {
  width: 7%;
  white-space: nowrap;
}

.fg-it-price-card-logic th:nth-child(3),
.fg-it-price-card-logic td:nth-child(3) {
  width: 28%;
}

.fg-it-price-card-logic th:nth-child(4),
.fg-it-price-card-logic td:nth-child(4) {
  width: 35%;
}

.it-pc-sourcing-cell {
  overflow: hidden;
}

.it-pc-sourcing-actions,
.it-pc-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
  max-width: 100%;
}

.it-pc-sourcing-btns,
.it-pc-btn-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  width: auto;
  max-width: 100%;
}

.it-pc-btn-row:has(> :only-child) {
  grid-template-columns: unset;
}

.it-pc-btn {
  display: inline-flex;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

.it-pc-btn.is-disabled,
.it-pc-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.it-pc-file-meta,
.it-pc-empty {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  font-size: 0.65rem;
  line-height: 1.25;
  color: var(--fg-muted, #7f7f7f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.it-price-card-view-dialog {
  border: 0;
  padding: 0;
  border-radius: 12px;
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  background: #fff;
  box-shadow: 0 18px 48px rgba(18, 38, 48, 0.28);
}

.it-price-card-view-dialog::backdrop {
  background: rgba(16, 28, 36, 0.48);
}

.it-price-card-view-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}

.it-price-card-view-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid color-mix(in srgb, var(--fg-teal, #22849C) 16%, transparent);
}

.it-price-card-view-head h3 {
  margin: 0.15rem 0 0;
  font-size: 1.1rem;
}

.it-price-card-view-body {
  padding: 0.75rem;
  min-height: 60vh;
  background: #eef2f4;
}

.it-price-card-view-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.it-price-card-view-fallback {
  display: grid;
  gap: 0.85rem;
  place-items: start;
  padding: 1.25rem;
  background: #fff;
  border-radius: 8px;
}

@media (max-width: 960px) {
  .fg-it-layout {
    grid-template-columns: 1fr;
  }
}

.fg-identity-menu-label {
  margin: 0.2rem 0.55rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.fg-identity-menu form { margin: 0; }

.fg-identity-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.fg-identity-option:hover {
  background: var(--fg-teal-soft);
}

.fg-identity-option.is-current {
  background: rgba(34, 132, 156, 0.08);
}

.fg-identity-check {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--fg-teal-dark);
}

.fg-identity-signout {
  border-top: 1px solid var(--fg-line);
  margin-top: 0.35rem !important;
  padding-top: 0.35rem;
}

.fg-identity-signout button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--fg-danger);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.fg-identity-signout button:hover {
  background: rgba(209, 67, 67, 0.08);
}

.fg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.65rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

/* Reusable in-progress feedback (async actions) */
.fg-btn.is-loading:not(.fg-project-dl-btn),
.fg-btn[aria-busy="true"]:not(.fg-project-dl-btn) {
  cursor: wait;
  pointer-events: none;
  color: #fff;
  background: var(--fg-teal);
  border-color: var(--fg-teal);
  animation: fg-btn-pulse 1.15s ease-in-out infinite;
}

.fg-btn.is-loading:not(.fg-project-dl-btn)::before,
.fg-btn[aria-busy="true"]:not(.fg-project-dl-btn)::before {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fg-spin 0.7s linear infinite;
}

.fg-btn.fg-btn-outline.is-loading:not(.fg-project-dl-btn),
.fg-btn.fg-btn-outline[aria-busy="true"]:not(.fg-project-dl-btn) {
  color: #fff;
}

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

@keyframes fg-btn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

@keyframes fg-btn-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.fg-btn-primary {
  background: var(--fg-teal);
  color: #fff;
}

/* Beat .fg-body a so solid primary/danger link-buttons stay white on teal/red */
.fg-body a.fg-btn-primary,
.fg-body a.fg-btn-danger {
  color: #fff;
}

.fg-btn-primary:hover,
.fg-body a.fg-btn-primary:hover {
  background: var(--fg-teal-dark);
  color: #fff;
}

.fg-btn-outline {
  background: var(--fg-white);
  border-color: var(--fg-line-strong);
  color: var(--fg-ink);
}

.fg-btn-outline:hover {
  border-color: var(--fg-teal);
  color: var(--fg-teal-dark);
  background: var(--fg-teal-soft);
}

.fg-btn-danger {
  background: var(--fg-danger);
  color: #fff;
}

.fg-body a.fg-btn-danger:hover {
  color: #fff;
}

.fg-hero {
  position: relative;
  min-height: min(72vh, 640px);
  display: grid;
  align-items: end;
  padding: 3.5rem 1.5rem 2.5rem;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(23, 101, 121, 0.88) 0%, rgba(34, 132, 156, 0.55) 42%, rgba(20, 40, 50, 0.35) 100%),
    url("/static/assets/thailand/hero.jpg") center / cover no-repeat;
}

.fg-hero--guest {
  align-items: center;
  min-height: min(78vh, 700px);
  padding: 3rem 1.5rem 2.75rem;
}

.fg-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 30, 40, 0.55), transparent 55%);
  pointer-events: none;
}

.fg-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.fg-hero-inner--login {
  display: grid;
  gap: 1.75rem 2.5rem;
  align-items: center;
}

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

.fg-hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  font-family: var(--fg-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e8f6f9;
}

.fg-hero-brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 30px;
  min-height: 30px;
  border-radius: 0;
  display: block;
  object-fit: contain;
  background: transparent;
  /* CI: no drop shadow on logo */
  box-shadow: none;
}

.fg-hero h1 {
  font-family: var(--fg-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 0.75rem;
  max-width: 14ch;
}

.fg-hero p {
  margin: 0 0 1.25rem;
  max-width: 42ch;
  font-size: 1.05rem;
  opacity: 0.95;
}

.fg-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.fg-body a.fg-hero-explore {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 0.1rem;
  transition: opacity 0.15s, border-color 0.15s;
}

.fg-body a.fg-hero-explore:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

/* Guest sign-in: frosted panel overlaid on hero photo */
.fg-hero-login {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 1.55rem 1.85rem 1.4rem;
  border-radius: calc(var(--fg-radius) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.9);
  color: var(--fg-ink);
  box-shadow: 0 16px 40px rgba(10, 30, 40, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.fg-hero-login-title {
  margin: 0 0 0.2rem;
  font-family: var(--fg-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg-ink);
  opacity: 1;
  max-width: none;
}

.fg-hero-login-lead {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--fg-muted);
  opacity: 1;
  max-width: none;
}

.fg-hero-login label {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-ink);
}

.fg-hero-login input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--fg-line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--fg-ink);
}

.fg-hero-login input:focus {
  outline: none;
  border-color: var(--fg-teal);
  box-shadow: 0 0 0 3px var(--fg-teal-soft);
}

.fg-hero-login .fg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.35rem;
  text-decoration: none;
}

.fg-hero-login-hint {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--fg-muted);
  opacity: 1;
  max-width: none;
}

.fg-hero-login .fg-error {
  margin-top: 0.65rem;
}

@media (min-width: 860px) {
  .fg-hero-inner--login {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: 2rem 3rem;
  }

  .fg-hero-login {
    justify-self: end;
  }
}

@media (max-width: 859px) {
  .fg-hero--guest {
    align-items: stretch;
    min-height: 0;
    padding: 2.25rem 1.25rem 2rem;
  }

  .fg-hero-inner--login {
    gap: 1.35rem;
  }

  .fg-hero--guest h1 {
    font-size: clamp(1.85rem, 7vw, 2.6rem);
    max-width: 16ch;
  }

  .fg-hero--guest .fg-hero-copy > p {
    margin-bottom: 0.85rem;
    font-size: 0.98rem;
  }

  .fg-hero-login {
    max-width: none;
  }
}

.fg-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem var(--fg-pad-x, clamp(1.25rem, 4vw, 2.75rem)) 2.5rem;
}

/* Projects hub — match BMS: full-bleed pad, no max-width cage, no hero title */
.fg-hub-body .fg-section.fg-hub-section {
  max-width: none;
  margin: 0;
  padding: 0.5rem var(--fg-pad-x, clamp(1.25rem, 4vw, 2.75rem)) 2.5rem;
}

.fg-section h2 {
  font-family: var(--fg-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.35rem;
  color: var(--fg-ink);
}

.fg-section .fg-lead {
  color: var(--fg-muted);
  margin: 0.45rem 0 1.1rem;
  max-width: 42rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.fg-guide-grid,
.fg-card-grid,
/* Our Projects cards — synced visual parity with Marketing Studio */
.fg-project-grid {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  overflow: visible;
  padding: 0.15rem 0.1rem 0.5rem; /* room for card lift shadow */
}

.fg-guide-card,
.fg-metric,
.fg-panel {
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--fg-shadow);
}

.fg-guide-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid color-mix(in srgb, var(--fg-primary, #22849c) 22%, var(--fg-line));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    var(--fg-shadow);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .fg-guide-card:hover {
    transform: translateY(-3px);
    border-color: var(--fg-primary, #22849c);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.85) inset,
      var(--fg-shadow-lg);
  }
}

.fg-guide-card:active {
  transform: translateY(-1px);
  border-color: var(--fg-primary, #22849c);
}

.fg-guide-card:hover {
  border-color: var(--fg-teal);
  transform: translateY(-2px);
}

.fg-guide-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.fg-guide-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.fg-home-news {
  padding-top: 0.5rem;
  padding-bottom: 2.5rem;
}

.fg-home-news .fg-news-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  align-items: baseline;
}

.fg-home-news .fg-news-list strong {
  font-family: var(--fg-display);
  color: var(--fg-ink);
}

.fg-login-panel {
  box-sizing: border-box;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.35rem 1.4rem;
}

.fg-login-panel label {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.fg-login-panel input,
.fg-form input,
.fg-form select,
.fg-form textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--fg-line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  flex: none;
  align-self: stretch;
}

/* Single-line controls keep a fixed height so grid stretch cannot grow them. */
.fg-login-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.fg-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.fg-form select {
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  field-sizing: fixed;
}

.fg-form textarea {
  height: auto;
  min-height: 5.5rem;
  max-height: none;
  resize: vertical;
  field-sizing: content;
}

.fg-error {
  color: var(--fg-danger);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

.fg-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.fg-news-list li {
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--fg-shadow);
}

.fg-news-list .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-teal-dark);
  background: var(--fg-teal-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.35rem;
}

/* Projects hub — mirrors BMS Projects card structure */
.fg-project-card {
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--fg-white);
  border: 1px solid color-mix(in srgb, var(--fg-primary, #22849c) 26%, var(--fg-line));
  border-radius: var(--fg-radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    var(--fg-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

/* display:flex above beats the UA [hidden] rule — restore hide for visibility tabs. */
.fg-project-card[hidden] {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .fg-project-card:hover {
    transform: translateY(-4px) scale(1.008);
    border-color: var(--fg-primary, #22849c);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.9) inset,
      var(--fg-shadow-lg);
  }
}

.fg-project-card:focus-within {
  border-color: var(--fg-primary, #22849c);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    var(--fg-shadow-lg),
    0 0 0 3px color-mix(in srgb, var(--fg-tertiary, #37beca) 26%, transparent);
}

.fg-project-card.is-highlight {
  border-color: var(--fg-primary, #22849c);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    var(--fg-shadow-lg),
    0 0 0 3px color-mix(in srgb, var(--fg-tertiary, #37beca) 34%, transparent);
}

.fg-project-card:active {
  transform: translateY(-1px) scale(0.995);
  border-color: var(--fg-primary, #22849c);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 10px 22px rgba(34, 132, 156, 0.14);
}

.fg-project-card.hub-state-inactive {
  opacity: 0.72;
  filter: grayscale(0.28);
}

.fg-project-card.hub-state-inactive:hover,
.fg-project-card.hub-state-inactive:focus-within {
  opacity: 0.9;
  filter: grayscale(0.1);
}

@media (prefers-reduced-motion: reduce) {
  .fg-project-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .fg-project-card:hover,
  .fg-project-card:active,
  .fg-project-card:focus-within {
    transform: none;
  }
}

.fg-project-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--fg-elevated);
  overflow: hidden;
}

.fg-project-card-media > a {
  display: block;
  width: 100%;
  height: 100%;
}

.fg-project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #dfe8ed;
}

.fg-project-hub-status {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--fg-white);
  color: var(--fg-teal-dark);
  border: 1px solid var(--fg-line-strong);
}

.fg-project-card.status-inactive .fg-project-hub-status {
  background: color-mix(in srgb, #94a3b8 22%, #fff);
  color: #475569;
  border-color: color-mix(in srgb, #94a3b8 40%, var(--fg-line));
}

.fg-project-card.status-pending_materials .fg-project-hub-status,
.fg-project-card.status-setup .fg-project-hub-status {
  background: var(--fg-champagne-soft);
  color: var(--fg-champagne-deep);
  border-color: color-mix(in srgb, var(--fg-orange) 45%, var(--fg-line));
}

.fg-project-mkt-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* High contrast on dark cover photos (iPad-readable) */
  background: var(--fg-primary, #22849C);
  color: #fff;
  border: 1px solid var(--fg-primary, #22849C);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.fg-project-mkt-status.is-preview {
  background: #fff;
  color: var(--fg-primary, #22849C);
  border-color: #fff;
}

.fg-project-card-body {
  padding: 1rem 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.fg-project-developer-logo {
  display: block;
  height: 1.35rem;
  width: auto;
  max-width: 7.5rem;
  margin: 0 0 0.15rem;
  opacity: 0.92;
  object-fit: contain;
  object-position: left center;
}

.fg-project-name {
  margin: 0;
  font-family: var(--fg-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #15677b;
  text-transform: capitalize;
}

.fg-project-name a {
  text-decoration: none;
  color: inherit;
}

.fg-project-name a:hover {
  color: #15677b;
  opacity: 0.88;
}

.fg-project-location {
  margin: 0;
  font-size: calc(0.88rem + 1pt);
  color: #7f7f7f;
  font-weight: 600;
}

.fg-project-blurb {
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
  color: var(--fg-muted);
  line-height: 1.45;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.fg-project-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.fg-inventory-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.fg-inventory-badge.is-sold-out {
  color: #b42318;
  background: rgba(180, 35, 24, 0.1);
  border-color: rgba(180, 35, 24, 0.28);
}

.fg-inventory-badge.is-scarce {
  color: #8a5a12;
  background: rgba(196, 140, 48, 0.14);
  border-color: rgba(168, 112, 28, 0.28);
}

.fg-project-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0 1rem 1rem;
  margin-top: auto;
}

.fg-project-card-main-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
}

.fg-project-card-actions .fg-btn,
.fg-project-card .actions .fg-btn {
  box-sizing: border-box;
  min-height: 2rem;
  height: 2rem;
  padding: 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  width: auto;
  flex: 0 0 auto;
}

.fg-project-card .fg-project-open,
.fg-project-card .fg-project-edit,
.fg-project-card .pm-visibility-inline,
.fg-project-card .fg-project-visibility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
}

.fg-project-offline-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.fg-project-card-secondary {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.fg-project-card-actions .fg-project-dl-btn,
.fg-project-card-actions .fg-project-clear-btn,
.fg-project-card .actions .fg-project-dl-btn,
.fg-project-card .actions .fg-project-clear-btn,
.fg-project-dl-btn,
.fg-project-clear-btn {
  width: auto;
  min-width: 2rem;
  min-height: 2rem;
  height: auto;
  padding: 0.4rem 0.7rem;
  gap: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-teal-dark, #1a6f84);
  border-color: rgba(34, 133, 157, 0.45);
  --dl-progress: 0%;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.fg-project-dl-text {
  display: inline;
  line-height: 1;
}

.fg-project-card-actions .fg-project-clear-btn,
.fg-project-card .actions .fg-project-clear-btn,
.fg-project-clear-btn {
  --dl-progress: unset;
  width: auto;
  min-width: 2rem;
  gap: 0.3rem;
  padding: 0 0.55rem;
  color: #9b2c2c;
  border-color: rgba(155, 44, 44, 0.65);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(155, 44, 44, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.fg-project-clear-text {
  display: inline;
  line-height: 1;
}

/* Default: hide Clear. Show whenever pack is ready/busy/partial — same triggers as checkmark. */
.fg-project-clear-btn,
.fg-project-clear-btn[hidden] {
  display: none !important;
}

.fg-project-offline-inline.is-ready .fg-project-clear-btn,
.fg-project-offline-inline.is-busy .fg-project-clear-btn,
.fg-project-offline-inline.is-partial .fg-project-clear-btn,
.fg-project-clear-btn.is-visible {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.fg-project-clear-btn.is-cancel .fg-project-clear-text {
  /* keep label; JS updates aria/title to Cancel */
}

.fg-project-dl-btn:hover {
  border-color: var(--fg-teal);
  color: var(--fg-teal-dark);
  background: rgba(34, 133, 157, 0.06);
}

.fg-project-clear-btn:hover,
.fg-project-clear-btn:focus-visible {
  border-color: rgba(192, 86, 86, 0.7);
  color: #7a1f1f;
  background: rgba(192, 86, 86, 0.1);
}

.fg-project-dl-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.fg-project-offline-inline.is-ready .fg-project-dl-btn {
  color: #fff;
  background: var(--fg-teal);
  border-color: var(--fg-teal);
}

.fg-project-offline-inline.is-ready .fg-project-dl-btn:hover {
  background: var(--fg-teal-dark);
  border-color: var(--fg-teal-dark);
  color: #fff;
}

.fg-project-offline-inline.is-error .fg-project-dl-btn {
  border-color: #c05656;
  color: #9b2c2c;
}

/* Packing / caching: teal fill + pulse + spinner beside label */
.fg-project-offline-inline.is-busy .fg-project-dl-btn,
.fg-project-dl-btn.is-loading,
.fg-project-dl-btn[aria-busy="true"] {
  cursor: wait;
  pointer-events: none;
  color: #fff;
  opacity: 1;
  background: var(--fg-teal);
  border-color: var(--fg-teal-dark, #1a6f84);
  animation: fg-btn-pulse 1.15s ease-in-out infinite;
}

.fg-project-offline-inline.is-busy .fg-project-dl-btn::before,
.fg-project-dl-btn.is-loading::before,
.fg-project-dl-btn[aria-busy="true"]::before {
  content: "";
  position: static;
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin: 0;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fg-spin 0.7s linear infinite;
}

.fg-project-offline-inline.is-busy .fg-project-dl-icon,
.fg-project-offline-inline.is-busy .fg-project-dl-check {
  display: none;
}

.fg-project-dl-btn.is-error-flash {
  animation: fg-btn-shake 0.55s ease;
  background: #c05656 !important;
  border-color: #9b2c2c !important;
  color: #fff !important;
}

.fg-project-offline-inline.is-ready .fg-project-dl-icon,
.fg-project-offline-inline:not(.is-ready) .fg-project-dl-check {
  display: none;
}

.fg-project-offline-inline.is-ready .fg-project-dl-check {
  display: block;
}

.fg-project-dl-icon,
.fg-project-dl-check,
.fg-project-clear-icon {
  display: block;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .fg-btn.is-loading:not(.fg-project-dl-btn),
  .fg-btn[aria-busy="true"]:not(.fg-project-dl-btn),
  .fg-project-offline-inline.is-busy .fg-project-dl-btn,
  .fg-project-dl-btn.is-loading,
  .fg-project-dl-btn[aria-busy="true"] {
    animation: none;
  }

  .fg-btn.is-loading:not(.fg-project-dl-btn)::before,
  .fg-btn[aria-busy="true"]:not(.fg-project-dl-btn)::before,
  .fg-project-offline-inline.is-busy .fg-project-dl-btn::before,
  .fg-project-dl-btn.is-loading::before,
  .fg-project-dl-btn[aria-busy="true"]::before {
    animation: none;
    border-color: #fff;
    opacity: 0.85;
  }

  .fg-project-dl-btn.is-error-flash {
    animation: none;
  }
}

.fg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fg-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.fg-agent-shell.has-tools-rail .fg-project-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.fg-projects-hub {
  padding-top: 1.15rem;
}

.fg-projects-hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  min-height: 2.75rem;
}

.fg-projects-hub-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  line-height: 1.15;
  flex: 1 1 auto;
  min-width: 0;
  color: #15677b;
  text-transform: capitalize;
}

.fg-projects-hub-head .fg-tabs {
  margin: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}


.fg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fg-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.fg-metric {
  background: #fff;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  padding: 0.9rem 1rem;
  position: relative;
  overflow: hidden;
}

.fg-metric::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--fg-teal-soft), transparent 70%);
  pointer-events: none;
}

.fg-metric-accent {
  border-color: #b7d6de;
  background: linear-gradient(160deg, #fff 40%, #eef7f9 100%);
}

.fg-metric .label {
  color: var(--fg-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fg-metric .value {
  font-family: var(--fg-display);
  font-size: 1.7rem;
  margin-top: 0.2rem;
}

/* —— Agent portal dashboard —— */
.fg-portal {
  position: relative;
  max-width: 1180px;
}

.fg-portal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 280px;
  background:
    radial-gradient(ellipse 70% 80% at 12% -10%, rgba(34, 132, 156, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 60% at 92% 10%, rgba(58, 168, 190, 0.12), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent);
  pointer-events: none;
  z-index: 0;
}

.fg-portal > * {
  position: relative;
  z-index: 1;
}

.fg-portal-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.5rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--fg-line-strong);
  background: rgba(255, 255, 255, 0.82);
  width: fit-content;
  max-width: 100%;
}

.fg-portal-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.fg-portal-subnav a:hover {
  color: var(--fg-teal-dark);
  background: transparent;
}

.fg-portal-subnav a.is-active {
  color: var(--fg-teal-dark);
  background: transparent;
  box-shadow: none;
}

.fg-portal-subnav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg-tertiary) 28%, #fff);
  color: var(--fg-teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

.fg-portal-subnav a:not(.is-active) .fg-portal-subnav-count {
  background: var(--fg-danger);
  color: #fff;
}

.fg-portal-page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fg-portal-page-hero h2 {
  margin: 0;
  font-family: var(--fg-display);
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.fg-portal-page-hero .fg-lead {
  margin: 0.35rem 0 0;
}

.fg-portal-block {
  margin-bottom: 1.75rem;
}

.fg-portal-block-head {
  margin-bottom: 0.85rem;
}

.fg-portal-section-title {
  margin: 0;
  font-family: var(--fg-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-ink);
}

.fg-portal-section-sub {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
}

.fg-portal-footnote {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
}

.fg-portal-hero {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding: 1.5rem 1.5rem;
  border-radius: calc(var(--fg-radius) + 2px);
  border: 1px solid var(--fg-line-strong);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(238, 247, 249, 0.92) 55%, rgba(255, 255, 255, 0.88) 100%);
  box-shadow: var(--fg-shadow-lg);
}

.fg-portal-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-teal-dark);
}

.fg-portal-hero h2 {
  margin: 0;
  font-family: var(--fg-display);
  font-size: clamp(1.75rem, 2.4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.fg-portal-hero .fg-lead {
  margin: 0.4rem 0 0;
}

.fg-portal-am {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.fg-portal-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.fg-portal-hero-stats > div {
  padding: 0.85rem 0.95rem;
  border-radius: var(--fg-radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--fg-line-strong);
}

.fg-portal-hero-stats .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.fg-portal-hero-stats .value {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--fg-display);
  font-size: 1.25rem;
  color: var(--fg-ink);
}

.fg-portal-kpis {
  margin-bottom: 1rem;
}

.fg-metric-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.fg-metric-link:hover {
  border-color: var(--fg-teal);
  transform: translateY(-1px);
}

.fg-portal-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0;
}

.fg-portal-pipe-stage {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.95rem 1rem;
  border-radius: var(--fg-radius);
  border: 1px solid var(--fg-line);
  background: var(--fg-white);
  box-shadow: var(--fg-shadow);
  min-height: 76px;
}

.fg-portal-pipe-stage .count {
  font-family: var(--fg-display);
  font-size: 1.45rem;
  line-height: 1;
}

.fg-portal-pipe-stage .name {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 600;
}

.fg-portal-pipe-stage.tone-teal { border-left: 3px solid var(--fg-teal); }
.fg-portal-pipe-stage.tone-ink { border-left: 3px solid var(--fg-ink); }
.fg-portal-pipe-stage.tone-gold { border-left: 3px solid #b8892c; }
.fg-portal-pipe-stage.tone-warn { border-left: 3px solid #c45c26; }

.fg-portal-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 0;
}

.fg-portal-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.fg-portal-shortcut-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  /* Prevent grid stretch from matching the tallest shortcut card on scroll. */
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* Keep all three shortcut cards in normal flow: equal tracks, no overflow paint. */
.fg-portal-shortcut-grid > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: auto;
  height: auto;
  min-height: 0;
  align-self: start;
  position: relative;
}

.fg-portal-span-2,
.fg-portal-span-full {
  grid-column: auto;
}

.fg-table-wrap {
  overflow-x: auto;
}

.fg-portal-shortcut-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 0;
  align-self: start;
}

.fg-portal-teaser {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  /* Do not use min-height:100% here — it fights CSS grid row sizing and can
     stretch cards taller on every reflow/scroll (esp. mobile Safari). */
  min-height: 0;
  height: auto;
  align-self: start;
  min-width: 0;
  max-width: 100%;
  width: auto;
}

.fg-portal-teaser:hover {
  border-color: var(--fg-teal);
  transform: translateY(-2px);
  box-shadow: var(--fg-shadow-lg);
}

.fg-portal-teaser-lead {
  margin: 0;
  font-size: 0.88rem;
}

.fg-portal-teaser-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.fg-portal-teaser-list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--fg-radius-sm);
  background: var(--fg-elevated);
  border: 1px solid var(--fg-line);
}

.fg-portal-teaser-list li strong {
  font-size: 0.85rem;
}

.fg-portal-teaser-list li span {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.fg-portal-teaser-list li.is-unread {
  border-color: var(--fg-line-strong);
  background: linear-gradient(160deg, #eef8fa, var(--fg-elevated));
}

.fg-portal-teaser .fg-text-link {
  margin-top: auto;
  padding-top: 0.35rem;
}

.fg-portal-profile-summary {
  margin: 0;
  display: grid;
  gap: 0.65rem;
  flex: 0 0 auto;
  align-content: start;
}

.fg-portal-profile-summary div {
  display: grid;
  gap: 0.15rem;
  align-content: start;
  min-height: 0;
}

.fg-portal-profile-summary dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  font-weight: 700;
}

.fg-portal-profile-summary dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.fg-portal-profile-panel {
  max-width: 720px;
}

.fg-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem 1rem;
  align-items: start;
}

.fg-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: auto;
  flex: none;
  align-self: start;
  font-size: 0.85rem;
  font-weight: 600;
}

.fg-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.fg-form-grid select {
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
}

.fg-form-grid-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
  margin-top: 0.35rem;
  grid-column: 1 / -1;
}

.fg-form-grid-actions .fg-form-status {
  margin: 0;
  width: 100%;
}

.fg-chart-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.fg-chart-sub {
  margin: 0.2rem 0 0.65rem;
  font-size: 0.82rem;
}

.fg-chart-card canvas {
  width: 100%;
  display: block;
}

.fg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.fg-panel-head h3 {
  margin: 0;
}

.fg-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--fg-teal-soft);
  color: var(--fg-teal-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.fg-pill.soft {
  background: var(--fg-elevated);
  color: var(--fg-muted);
}

.fg-text-link {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.fg-case-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fg-case-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--fg-radius);
  border: 1px solid var(--fg-line);
  background: linear-gradient(180deg, var(--fg-white), var(--fg-elevated));
  box-shadow: var(--fg-shadow);
}

.fg-case-row h4 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.fg-case-row p {
  margin: 0;
  font-size: 0.82rem;
}

.fg-case-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.fg-case-meta .due {
  font-size: 0.78rem;
}

.fg-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--fg-elevated);
  color: var(--fg-muted);
}

.fg-status-chip.status-action-needed {
  background: rgba(196, 92, 38, 0.12);
  color: #9a3f12;
}

.fg-status-chip.status-pending {
  background: rgba(184, 137, 44, 0.14);
  color: #8a6718;
}

.fg-status-chip.status-follow-up {
  background: var(--fg-teal-soft);
  color: var(--fg-teal-dark);
}

.fg-row-highlight {
  background: var(--fg-teal-soft);
}

.fg-launch-grid {
  display: grid;
  gap: 0.75rem;
}

.fg-launch-grid-home {
  grid-template-columns: minmax(0, 1fr);
}

/* Nested inside Shortcuts: never expand to 3-across (blows the outer track). */
.fg-portal-shortcut-grid .fg-launch-grid-home {
  grid-template-columns: minmax(0, 1fr);
}

.fg-launch-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.95rem 1rem;
  border-radius: var(--fg-radius);
  border: 1px solid var(--fg-line);
  background: var(--fg-white);
  text-decoration: none;
  color: inherit;
  min-height: 88px;
  box-shadow: var(--fg-shadow);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.fg-launch-card:hover {
  border-color: var(--fg-teal);
  transform: translateY(-1px);
  box-shadow: var(--fg-shadow-lg);
}

.fg-launch-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-teal-dark);
}

.fg-launch-units {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-ink);
}

/* Inbox messaging */
.fg-inbox {
  margin-top: 0;
}

.fg-inbox-page {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.fg-inbox-head {
  margin-bottom: 0.75rem;
}

/*
  Inbox chat shell: fill remaining viewport (see body.fg-inbox-open), keep
  transcript scrollable, and pin compose so Send is never below the fold.
  Prior bug: fixed 70vh height sat under topbar/subnav/hero and overflowed.
*/
.fg-inbox-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 38%) minmax(0, 1fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: auto;
  max-height: none;
  border: 1px solid var(--fg-line-strong);
  border-radius: calc(var(--fg-radius) + 2px);
  overflow: hidden;
  background: var(--fg-white);
  box-shadow: var(--fg-shadow);
  box-sizing: border-box;
}

/* Viewport lock — same idea as Sales Support admin-chat-open */
body.fg-body.fg-inbox-open {
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

body.fg-body.fg-inbox-open > .fg-topbar {
  flex-shrink: 0;
}

body.fg-body.fg-inbox-open > .fg-footer {
  display: none;
}

body.fg-body.fg-inbox-open > .fg-inbox-section {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: min(1100px, 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 0.85rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  margin-left: auto;
  margin-right: auto;
}

body.fg-body.fg-inbox-open .fg-portal-subnav {
  flex-shrink: 0;
  margin-bottom: 0.55rem;
}

body.fg-body.fg-inbox-open .fg-inbox-hero {
  flex-shrink: 0;
  margin-bottom: 0.55rem;
  gap: 0.5rem;
}

body.fg-body.fg-inbox-open .fg-inbox-hero h2 {
  font-size: 1.35rem;
}

body.fg-body.fg-inbox-open .fg-inbox-hero .fg-lead {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.82rem;
}

.fg-inbox-list {
  border-bottom: 1px solid var(--fg-line);
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: var(--fg-elevated);
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 106, 122, 0.5) transparent;
}

.fg-inbox-list-empty {
  padding: 1rem;
  margin: 0;
}

.fg-inbox-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--fg-line);
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0.85rem 0.55rem 0.85rem 0.75rem;
  cursor: pointer;
  min-height: 88px;
  box-sizing: border-box;
}

.fg-inbox-item:hover,
.fg-inbox-item:focus-within {
  background: rgba(34, 132, 156, 0.06);
}

.fg-inbox-item:focus {
  outline: none;
}

.fg-inbox-item:focus-visible {
  outline: 2px solid var(--fg-teal);
  outline-offset: -2px;
}

.fg-inbox-item.is-active {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--fg-teal);
}

.fg-inbox-item.is-unread .fg-inbox-subject {
  font-weight: 700;
}

.fg-inbox-item.is-unread .fg-inbox-from {
  font-weight: 800;
}

.fg-inbox-unread-dot {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}

.fg-inbox-item.is-unread .fg-inbox-unread-dot {
  background: var(--fg-teal);
  box-shadow: 0 0 0 3px var(--fg-teal-soft);
}

.fg-inbox-item-main {
  min-width: 0;
  display: block;
}

.fg-inbox-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.fg-inbox-item:hover .fg-inbox-item-actions,
.fg-inbox-item:focus-within .fg-inbox-item-actions,
.fg-inbox-item.is-active .fg-inbox-item-actions {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .fg-inbox-item-actions {
    opacity: 0.85;
    pointer-events: auto;
  }
}

.fg-inbox-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--fg-muted);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(23, 101, 121, 0.08);
}

.fg-inbox-action:hover {
  color: var(--fg-teal-dark);
  border-color: rgba(34, 132, 156, 0.35);
  background: var(--fg-teal-soft);
}

.fg-inbox-action.is-danger:hover {
  color: var(--fg-danger, #b42318);
  border-color: rgba(180, 35, 24, 0.3);
  background: rgba(180, 35, 24, 0.08);
}

.fg-inbox-item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.fg-inbox-from {
  font-weight: 700;
  font-size: 0.88rem;
}

.fg-inbox-date {
  font-size: 0.75rem;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.fg-inbox-subject {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.fg-inbox-preview {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fg-inbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
  align-items: center;
}

.fg-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--fg-teal-soft);
  color: var(--fg-teal-dark);
}

.fg-chip.muted {
  background: var(--fg-elevated);
  color: var(--fg-muted);
}

.fg-inbox-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #f9fcfd 100%);
}

.fg-inbox-thread-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--fg-line);
}

.fg-inbox-thread-head-text {
  min-width: 0;
  flex: 1;
}

.fg-inbox-thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.fg-inbox-thread-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 2rem;
}

.fg-inbox-thread-btn.is-danger {
  color: var(--fg-danger, #b42318);
  border-color: rgba(180, 35, 24, 0.28);
}

.fg-inbox-thread-btn.is-danger:hover {
  background: rgba(180, 35, 24, 0.06);
  border-color: rgba(180, 35, 24, 0.45);
}

.fg-inbox-thread > [data-thread-pane] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.fg-inbox-thread > [data-thread-pane].hidden,
.fg-inbox-empty.hidden {
  display: none;
}

.fg-inbox-thread-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fg-inbox-thread-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.fg-inbox-thread-head p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

.fg-inbox-messages {
  flex: 1 1 auto;
  min-height: 8rem;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0.85rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 106, 122, 0.5) transparent;
}

/* Narrow phones: when a thread is open, collapse the list so transcript + compose fit */
@media (max-width: 719px) {
  body.fg-body.fg-inbox-open > .fg-inbox-section {
    padding-top: 0.55rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.fg-body.fg-inbox-open .fg-inbox-hero .fg-lead {
    display: none;
  }

  body.fg-body.fg-inbox-open .fg-inbox-hero h2 {
    font-size: 1.15rem;
  }

  body.fg-body.fg-inbox-open .fg-portal-subnav {
    margin-bottom: 0.4rem;
  }

  .fg-inbox-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .fg-inbox-shell.is-thread-open .fg-inbox-list {
    max-height: 4.5rem;
    flex: 0 0 auto;
  }

  /* Compact rows so the strip stays short but other threads stay reachable */
  .fg-inbox-shell.is-thread-open .fg-inbox-item {
    min-height: 0;
    padding: 0.45rem 0.5rem 0.45rem 0.65rem;
  }

  .fg-inbox-shell.is-thread-open .fg-inbox-item .fg-inbox-preview,
  .fg-inbox-shell.is-thread-open .fg-inbox-item .fg-inbox-tags {
    display: none;
  }

  .fg-inbox-shell.is-thread-open .fg-inbox-item .fg-inbox-subject {
    font-size: 0.82rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fg-inbox-shell.is-thread-open .fg-inbox-item-actions {
    opacity: 0.9;
    pointer-events: auto;
  }

  .fg-inbox-thread-head {
    padding: 0.55rem 0.75rem;
    gap: 0.45rem;
  }

  .fg-inbox-thread-head h4 {
    font-size: 0.95rem;
  }

  .fg-inbox-thread-btn {
    min-height: 1.85rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
  }

  .fg-inbox-messages {
    min-height: 10rem;
    padding: 0.65rem 0.75rem 1rem;
  }

  .fg-inbox-compose {
    padding: 0.5rem 0.75rem max(0.65rem, env(safe-area-inset-bottom));
  }

  .fg-inbox-compose textarea {
    min-height: 2.5rem;
    max-height: 5.5rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
  }

  .fg-inbox-compose-actions {
    margin-top: 0.45rem;
  }
}

.fg-inbox-messages::-webkit-scrollbar {
  width: 10px;
}

.fg-inbox-messages::-webkit-scrollbar-thumb {
  background: rgba(90, 106, 122, 0.4);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.chat-jump-latest,
.fg-chat-jump-latest {
  position: absolute;
  bottom: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  border: 1px solid var(--fg-line);
  background: #fff;
  color: var(--fg-ink, #1a2330);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(23, 101, 121, 0.12);
  min-height: 2.25rem;
  white-space: nowrap;
}

.chat-jump-latest:hover,
.fg-chat-jump-latest:hover {
  border-color: var(--fg-teal);
  color: var(--fg-teal-dark);
}

.chat-jump-latest.hidden,
.fg-chat-jump-latest.hidden {
  display: none;
}

.fg-msg {
  max-width: min(92%, 520px);
  padding: 0.75rem 0.9rem;
  border-radius: var(--fg-radius);
  border: 1px solid var(--fg-line);
  background: var(--fg-white);
}

.fg-msg.role-agent {
  align-self: flex-end;
  background: linear-gradient(160deg, #e8f5f8, #dff0f4);
  border-color: var(--fg-line-strong);
}

.fg-msg.role-desk,
.fg-msg.role-pm,
.fg-msg.role-it {
  background: var(--fg-elevated);
}

.fg-msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.fg-msg-meta time {
  color: var(--fg-muted);
}

.fg-msg p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.fg-inbox-compose {
  flex-shrink: 0;
  border-top: 1px solid var(--fg-line);
  padding: 0.65rem 1rem max(0.75rem, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
}

.fg-inbox-compose textarea {
  width: 100%;
  min-height: 2.75rem;
  max-height: 7rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--fg-line);
  border-radius: 12px;
  font: inherit;
  resize: vertical;
  background: #fff;
  box-sizing: border-box;
}

.fg-inbox-compose textarea:focus {
  outline: none;
  border-color: var(--fg-teal);
  box-shadow: 0 0 0 3px var(--fg-teal-soft);
}

.fg-inbox-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.fg-compose-hint {
  margin: 0;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.fg-inbox-empty {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 720px) {
  .fg-portal-hero {
    grid-template-columns: 1.35fr 1fr;
    align-items: end;
  }

  .fg-portal-charts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fg-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .fg-launch-grid-home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fg-inbox-shell {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    grid-template-rows: minmax(0, 1fr);
    height: auto;
    max-height: none;
  }

  .fg-inbox-list {
    border-bottom: 0;
    border-right: 1px solid var(--fg-line);
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }
}

.fg-portal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 960px) {
  .fg-portal-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .fg-portal-dashboard-grid {
    grid-template-columns: 1.35fr 0.9fr;
  }

  .fg-portal-dashboard-grid .fg-portal-span-full {
    grid-column: 1 / -1;
  }

  .fg-portal-shortcut-grid {
    /* minmax(0, …) is required — bare fr tracks keep min-width:auto and
       let the Personal information card overflow over Inbox. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

.fg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fg-table th,
.fg-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--fg-line);
}

.fg-table th {
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fg-muted { color: var(--fg-muted); }

.fg-footer {
  border-top: 1px solid var(--fg-line);
  padding: 1.5rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* Workspace rail lives in main.css — keep Fulcrum CSS free of a competing dark strip. */

.fg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--fg-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.fg-form-status.success { color: #1a7a4c; }
.fg-form-status.error { color: var(--fg-danger); }

.fg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.15rem;
  padding: 0.35rem 0 0.55rem;
}

.fg-country-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: -0.5rem 0 1.15rem;
}

.fg-country-filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-teal-dark);
}

.fg-country-filter-select {
  min-width: 11rem;
  border: 1px solid var(--fg-line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  background: var(--fg-white);
  color: var(--fg-ink);
}

.fg-project-country-chip {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  background: rgba(15, 23, 28, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.fg-tab {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--fg-muted);
  cursor: pointer;
  text-decoration: none;
}

.fg-tab:hover {
  color: var(--fg-teal-dark);
  background: transparent;
}

/* Filter tabs: darker text only (no soft pill) */
.fg-tab.active {
  color: var(--fg-teal-dark);
  background: transparent;
  box-shadow: none;
}

/* Agent portal + project library — iPad */
@media (min-width: 768px) and (max-width: 1180px) {
  .fg-topbar {
    padding: 0.3rem 0.85rem;
    min-height: 3.1rem;
    gap: 0.5rem;
  }

  .fg-system-name {
    font-size: 0.64rem;
    letter-spacing: 0.06em;
  }

  .fg-nav a,
  .fg-nav button.fg-linkbtn {
    padding: 0.45rem 0.55rem;
    font-size: 0.8rem;
    min-height: 2.65rem;
  }

  .fg-section {
    padding: 0.5rem 1.35rem 2.25rem;
  }

  /* Keep BMS-matching auto-fill grid (do not force 2 huge columns on iPad) */
  .fg-guide-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.35rem;
  }

  .fg-project-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.35rem;
  }

  .fg-agent-shell.has-tools-rail .fg-project-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  /* Match Marketing Studio project tile title size at tablet widths */
  .fg-project-card .fg-project-name,
  .fg-project-name {
    font-size: 1.15rem;
  }

  .fg-project-card .actions .fg-btn {
    min-height: 0;
  }

  .fg-project-card .fg-project-dl-btn,
  .fg-project-card .fg-project-clear-btn {
    width: auto;
    min-width: 2.15rem;
    min-height: 0;
    padding: 0.4rem 0.55rem;
  }

  .fg-metrics,
  .fg-portal-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .fg-metric {
    padding: 1rem 1rem 1.05rem;
  }

  .fg-metric .value {
    font-size: 1.85rem;
  }

  .fg-portal-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fg-portal-charts {
    grid-template-columns: 1fr;
  }

  .fg-portal-layout,
  .fg-portal-dashboard-grid,
  .fg-portal-shortcut-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
  }

  .fg-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .fg-launch-grid-home {
    grid-template-columns: 1fr;
  }

  .fg-inbox-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
    grid-template-rows: minmax(0, 1fr);
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .fg-inbox-item {
    min-height: 96px;
    padding: 1rem 0.75rem 1rem 1.05rem;
  }

  .fg-inbox-compose textarea {
    min-height: 3.25rem;
  }

  .fg-table th,
  .fg-table td {
    padding: 0.75rem 0.55rem;
    font-size: 0.92rem;
  }

  .fg-tab {
    min-height: 44px;
    padding: 0.55rem 1.05rem;
  }

  .fg-identity-btn {
    min-height: 44px;
  }
}

@media (orientation: landscape) and (min-width: 900px) and (max-width: 1180px) {
  .fg-portal-layout,
  .fg-portal-dashboard-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .fg-portal-shortcut-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .fg-portal-dashboard-grid .fg-portal-span-full {
    grid-column: 1 / -1;
  }

  .fg-portal-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .fg-portal-pipeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .fg-portal-charts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fg-launch-grid-home {
    grid-template-columns: 1fr;
  }
}

@media (hover: none), (pointer: coarse) {
  .fg-btn {
    min-height: 44px;
  }

  /* Keep hub card actions compact like BMS (do not inflate to 44px) */
  .fg-project-card .actions .fg-btn,
  .fg-project-card .fg-project-dl-btn,
  .fg-project-card .fg-project-clear-btn {
    min-height: 0;
  }

  .fg-identity-option {
    min-height: 52px;
    padding: 0.7rem 0.6rem;
  }

  .fg-country-tile {
    min-height: 176px;
  }
}

/* Country section — Why Thailand? */
.fg-country-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(340px, 58vh, 560px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #e8f0f3;
  color: var(--fg-rich-black, #1a1a1a);
}

.fg-country-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--country-hero) center / cover no-repeat;
  transform: scale(1.04);
  transform-origin: center center;
  animation: fg-country-kenburns 28s ease-in-out infinite alternate;
}

/* Why Thailand only — soften skyline contrast ~10% for type readability */
.fg-country-hero:not(.fg-story-hero)::before {
  filter: contrast(0.9);
}

.fg-country-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Soft left wash only — keep photo clear; readable type without silhouette */
  background: linear-gradient(
    105deg,
    rgba(245, 248, 250, 0.55) 0%,
    rgba(245, 248, 250, 0.22) 28%,
    transparent 55%
  );
  pointer-events: none;
}

/* Why Thailand — black bottom wash under the copy/CTAs */
.fg-country-hero:not(.fg-story-hero)::after {
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 32%,
    rgba(0, 0, 0, 0.28) 55%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

.fg-country-hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: none;
  animation: none;
  opacity: 1;
}

.fg-country-hero-inner {
  position: relative;
  z-index: 3;
  width: min(980px, 100%);
  padding: 3rem 1.5rem 2.6rem;
  text-align: left;
}

.fg-country-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.55rem;
  font-family: var(--fg-display);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg-primary, #22849c);
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.fg-country-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 16px rgba(34, 132, 156, 0.18);
}

.fg-country-eyebrow,
.fg-country-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-teal-dark);
}

.fg-country-story-band .fg-country-kicker,
#story .fg-country-kicker,
#explore .fg-country-kicker {
  color: #7f7f7f;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  font-size: 1rem;
}

.fg-country-hero .fg-country-eyebrow {
  color: #fff;
  opacity: 1;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.fg-country-hero h1 {
  margin: 0 0 0.55rem;
  font-family: var(--fg-display), "Red Hat Display", sans-serif;
  font-size: clamp(2.35rem, 5.2vw, 3.55rem);
  font-weight: 600;
  line-height: 1.08;
  max-width: 14ch;
  color: #fff;
  text-shadow: none;
  -webkit-text-stroke: 0;
  paint-order: normal;
}

.fg-country-hero-inner > p:not(.fg-country-brand):not(.fg-country-eyebrow) {
  margin: 0 0 1.25rem;
  max-width: 34rem;
  font-size: 1.08rem;
  line-height: 1.5;
  opacity: 1;
  color: #7f7f7f;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.fg-country-hero:not(.fg-story-hero) .fg-country-hero-inner > p:not(.fg-country-brand):not(.fg-country-eyebrow) {
  color: #fff;
}

.fg-country-hero .fg-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-start;
}

/* Ghost / outline CTA — FGP teal on clear daylight photos */
.fg-body a.fg-btn.fg-country-hero-outline,
.fg-country-hero-outline {
  background: rgba(255, 255, 255, 0.72);
  color: var(--fg-primary, #22849c);
  border-color: var(--fg-primary, #22849c);
  backdrop-filter: blur(6px);
}

.fg-body a.fg-btn.fg-country-hero-outline:hover,
.fg-country-hero-outline:hover {
  background: var(--fg-primary, #22849c);
  color: #fff;
  border-color: var(--fg-primary, #22849c);
}
.fg-section.fg-country-cinema {
  /* Full-bleed wash across main column (same width as hero); content stays 1100px */
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-top: 2.25rem;
  padding-bottom: 2.5rem;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

.fg-country-cinema {
  position: relative;
  background:
    linear-gradient(180deg, #e8f3f6 0%, var(--fg-paper) 42%, var(--fg-paper) 100%);
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
}

.fg-country-cinema::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 133, 157, 0.16), transparent 68%);
  pointer-events: none;
}

.fg-country-cinema-head {
  position: relative;
  /* Match #story / Talking Path band: 1100px content, 1.5rem side gutters */
  width: min(1100px, calc(100% - 3rem));
  max-width: 1100px;
  margin: 0 auto 1.35rem;
  padding: 0;
  box-sizing: content-box;
  text-align: left;
}

.fg-country-cinema-head .fg-lead {
  max-width: none;
  width: 100%;
}

.fg-country-cinema-head h2,
.fg-country-story h2,
.fg-section#explore h2 {
  font-family: var(--fg-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #15677b;
}

.fg-country-video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  /* Same outer width as Talking Path band */
  width: min(1100px, calc(100% - 3rem));
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  box-sizing: content-box;
}

@media (min-width: 960px) {
  .fg-country-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.fg-country-video {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--fg-white);
  border: 0;
  border-radius: calc(var(--fg-radius) + 2px);
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(12, 42, 52, 0.22);
}

.fg-country-video-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #061820;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.fg-country-video-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, filter 0.35s ease;
}

.fg-country-video-frame:hover img,
.fg-country-video-frame:focus-visible img {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.fg-country-video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(6, 24, 32, 0.72) 100%);
  pointer-events: none;
}

.fg-country-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-radius: 50%;
  background: rgba(34, 133, 157, 0.92);
  box-shadow: 0 10px 28px rgba(6, 24, 32, 0.45);
  pointer-events: none;
  transition: transform 0.25s ease, background 0.25s ease;
}

.fg-country-video-play::before {
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.9rem;
  border-color: transparent transparent transparent #fff;
}

.fg-country-video-frame:hover .fg-country-video-play,
.fg-country-video-frame:focus-visible .fg-country-video-play {
  transform: scale(1.06);
  background: rgba(34, 133, 157, 1);
}

.fg-country-video-watch {
  position: absolute;
  left: 1rem;
  bottom: 0.85rem;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.fg-country-video-frame:focus-visible {
  outline: 2px solid var(--fg-teal, #22849c);
  outline-offset: 3px;
}

/* Full-viewport YouTube theater (Why Thailand cinema) */
.fg-video-theater {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(0.5rem, env(safe-area-inset-top))
    max(0.5rem, env(safe-area-inset-right))
    max(0.5rem, env(safe-area-inset-bottom))
    max(0.5rem, env(safe-area-inset-left));
  background: rgba(4, 10, 14, 0.96);
  backdrop-filter: blur(10px);
}

.fg-video-theater[hidden] {
  display: none !important;
}

.fg-video-theater-close {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.fg-video-theater-close:hover,
.fg-video-theater-close:focus-visible {
  background: rgba(34, 133, 157, 0.55);
  outline: none;
}

.fg-video-theater-stage {
  position: relative;
  width: min(100%, 1600px);
  height: min(100%, calc(100vw * 9 / 16));
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.fg-video-theater-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 720px), (max-height: 520px) {
  .fg-video-theater {
    padding: 0;
  }

  .fg-video-theater-stage {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: unset;
    box-shadow: none;
  }
}

.fg-country-video figcaption {
  display: grid;
  gap: 0.3rem;
  flex: 1;
  align-content: start;
  padding: 0.95rem 1.05rem 1.1rem;
  background: var(--fg-white);
  border-top: 1px solid #c5dbe2;
}

.fg-country-video figcaption strong {
  font-size: 1.02rem;
  color: #15677b;
}

.fg-country-video figcaption span {
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.fg-country-video-credit {
  color: #7a8b99;
  font-size: 0.75rem;
}

.fg-country-story-band {
  margin-bottom: 1.15rem;
  padding: 1.15rem 1.25rem;
  border-radius: calc(var(--fg-radius) + 2px);
  border: 1px solid var(--fg-line-strong);
  background:
    linear-gradient(135deg, rgba(34, 133, 157, 0.1), rgba(255, 255, 255, 0.9) 48%),
    var(--fg-white);
  box-shadow: var(--fg-shadow);
}

.fg-country-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0 1.75rem;
}

.fg-country-stats-dense {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.fg-country-stat {
  background: linear-gradient(180deg, var(--fg-white) 0%, #f3f9fb 100%);
  border: 1px solid var(--fg-line-strong);
  border-radius: var(--fg-radius);
  padding: 1.1rem 1.05rem;
  box-shadow: var(--fg-shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.fg-country-stat:hover {
  transform: translateY(-2px);
  border-color: var(--fg-teal);
  box-shadow: var(--fg-shadow-lg);
}

.fg-country-stat .label,
.fg-country-stat-label,
.fg-country-stats .fg-country-stat .label,
.fg-country-dive-body .fg-country-stat .label {
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: #15677b !important;
}

.fg-country-stat .value {
  font-family: var(--fg-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: #15677b;
  line-height: 1.1;
}

.fg-country-stat .detail {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.35;
}

.fg-country-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.fg-country-insight {
  display: flex;
  gap: 0.85rem;
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-left: 4px solid var(--fg-teal);
  border-radius: var(--fg-radius);
  padding: 1.1rem 1.15rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fg-country-insight:hover {
  border-color: #b7d6de;
  box-shadow: 0 12px 28px rgba(26, 106, 124, 0.07);
}

.fg-country-insight .icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.fg-country-insight h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.fg-country-insight p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.fg-country-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.15rem 0 1.25rem;
}

.fg-country-tile {
  position: relative;
  display: block;
  width: 100%;
  min-height: 168px;
  /* Inactive: same light line as Due Diligence checklist cards */
  border: 2px solid var(--fg-line);
  border-radius: var(--fg-radius);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #0c2a34;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.2s ease;
}

.fg-country-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  transition: transform 0.55s ease;
}

.fg-country-tile:hover img {
  transform: scale(1.06);
}

.fg-country-tile-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  min-height: inherit;
  padding: 0.95rem 1rem;
  color: #fff;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 42%,
    rgba(0, 0, 0, 0.35) 72%,
    rgba(0, 0, 0, 0.62) 100%
  );
}

.fg-country-tile-overlay strong {
  font-size: calc(1.08rem + 2pt);
  color: #fff;
  text-transform: capitalize;
}

.fg-country-tile-overlay span {
  font-size: calc(0.82rem + 2pt);
  opacity: 1;
  color: #fff;
  text-transform: capitalize;
}

.fg-country-tile.is-active,
.fg-country-tile:focus-visible {
  border-color: var(--fg-teal);
  box-shadow: 0 0 0 3px var(--fg-teal-soft), 0 16px 32px rgba(26, 106, 124, 0.18);
  outline: none;
  transform: translateY(-2px);
}

.fg-country-dive {
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-radius: calc(var(--fg-radius) + 2px);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(26, 106, 124, 0.06);
}

.fg-country-dive-hero {
  min-height: 190px;
  background: center / cover no-repeat;
}

.fg-country-dive-body {
  padding: 1.35rem 1.35rem 1.6rem;
}

.fg-country-dive-body h3 {
  margin: 0 0 0.25rem;
  font-family: var(--fg-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: #15677b;
  text-transform: capitalize;
}

.fg-country-dive-sub {
  margin: 0 0 0.85rem;
  color: #15677b;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: capitalize;
}

.fg-country-dive-body > p.fg-country-dive-intro,
.fg-country-dive-intro {
  margin: 0 0 1rem;
  color: #7f7f7f;
  line-height: 1.5;
  max-width: 52rem;
  text-align: justify !important;
  text-align-last: justify;
  text-justify: inter-word;
  -webkit-text-align-last: justify;
}
.fg-country-points {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--fg-ink);
  line-height: 1.45;
}

.fg-country-points li + li {
  margin-top: 0.4rem;
}

.fg-country-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.fg-country-card {
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  overflow: hidden;
  background: var(--fg-paper);
}

.fg-country-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.fg-country-card .body {
  padding: 0.9rem 1rem 1.05rem;
}

.fg-country-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.fg-country-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.fg-country-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.fg-country-steps li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  background: var(--fg-paper);
}

.fg-country-steps .step-num {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--fg-teal-soft);
  color: var(--fg-teal-dark);
  font-weight: 800;
  font-size: 0.82rem;
}

.fg-country-steps strong {
  display: block;
  margin-bottom: 0.25rem;
}

.fg-country-steps p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.fg-country-cta .fg-panel,
.fg-country-cta-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-color: #b7d6de;
  background:
    linear-gradient(135deg, rgba(34, 132, 156, 0.12), transparent 42%),
    var(--fg-white);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* If reveal JS fails to load, still show Fulcrum film tiles after a beat
   (avoids a permanently blank “Watch Fulcrum’s Thailand story” section). */
@keyframes fg-reveal-fallback {
  to {
    opacity: 1;
    transform: none;
  }
}
[data-reveal]:not(.is-visible) {
  animation: fg-reveal-fallback 0.01s ease forwards;
  animation-delay: 2.5s;
}

@keyframes fg-country-kenburns {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

@keyframes fg-country-glow {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .fg-country-hero::before,
  .fg-country-hero-atmosphere {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .fg-country-tile img,
  .fg-country-stat,
  .fg-country-tile {
    transition: none;
  }
}

/* Agent surfaces left tools rail — Why Thailand / Projects (matches workspace strip) */
.fg-agent-shell,
.fg-projects-shell {
  position: relative;
}

.fg-agent-shell.has-tools-rail,
.fg-projects-shell.has-tools-rail {
  /* Reserve ribbon width via padding — rail is position:fixed and out of flow */
  display: block;
  padding-left: var(--fg-tools-rail-w);
  box-sizing: border-box;
  min-height: calc(100vh - var(--fg-topbar-h));
  min-height: calc(100dvh - var(--fg-topbar-h));
}

.fg-agent-shell-main {
  min-width: 0;
}

.fg-library-tools-rail {
  /* Fixed flush under sticky .fg-topbar — same in every marketing/desk/IT view.
     Stay above content-well tool modals (110) and default dialogs (220) so icons
     remain clickable while Project Viewing / Availability / Book Unit / Contact
     are open. Confirm sheets (#res-release-confirm etc. at 240+) still stack above. */
  position: fixed;
  left: 0;
  top: var(--fg-topbar-h);
  bottom: 0;
  width: var(--fg-tools-rail-w);
  z-index: 230;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.35rem 0.75rem;
  box-sizing: border-box;
  height: auto;
  max-height: none;
  min-height: 0;
  /* Default = Sales (primary teal). Admin / Access override via data-rail-chrome */
  --rail-chrome-top: #1a6f86;
  --rail-chrome-mid: var(--fg-primary, #22849c);
  --rail-chrome-bottom: var(--fg-teal-dark, #176579);
  --rail-chrome-edge: #145a6c;
  background:
    linear-gradient(180deg, var(--rail-chrome-top) 0%, var(--rail-chrome-mid) 42%, var(--rail-chrome-bottom) 100%);
  border-right: 1px solid var(--rail-chrome-edge);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.12);
  /* Visible so the identity persona menu can escape the ribbon */
  overflow: visible;
  color: #e8f4f7;
  transition: background 0.28s ease, border-color 0.28s ease;
}

/* Sales tools — Fulcrum primary (dark turquoise) */
.fg-library-tools-rail[data-rail-chrome="sales"],
.fg-library-tools-rail[data-tools-mode="sales"]:not([data-rail-chrome="access"]) {
  --rail-chrome-top: #1a6f86;
  --rail-chrome-mid: var(--fg-primary, #22849c);
  --rail-chrome-bottom: var(--fg-teal-dark, #176579);
  --rail-chrome-edge: #145a6c;
}

/* Desk Admin — Fulcrum secondary (crimson) */
.fg-library-tools-rail[data-rail-chrome="admin"],
.fg-library-tools-rail[data-tools-mode="admin"]:not([data-rail-chrome="access"]) {
  --rail-chrome-top: #a83d41;
  --rail-chrome-mid: var(--fg-secondary, #c5494d);
  --rail-chrome-bottom: #8f3438;
  --rail-chrome-edge: #7a2c30;
  color: #fceeee;
}

/* Access Control (IT) — deep primary so it stays brand-teal but distinct from Sales */
.fg-library-tools-rail[data-rail-chrome="access"] {
  --rail-chrome-top: #0f4a58;
  --rail-chrome-mid: var(--fg-teal-dark, #176579);
  --rail-chrome-bottom: #0c3a45;
  --rail-chrome-edge: #0a323c;
  color: #e4f1f4;
}

.fg-library-tools-rail .rail-tools-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0.35rem;
}

.fg-library-tools-rail .rail-account {
  margin-top: 0;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding-top: 0;
  border-top: 0;
  position: relative;
  z-index: 80;
  overflow: visible;
}

.fg-library-tools-rail .rail-account-stack {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
  z-index: 80;
}

/* Discrete Sales/Admin switch mounted on the blue ribbon (near account) */
.fg-library-tools-rail .fg-tools-mode--rail {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  margin: 0;
  padding: 0 0 0.15rem;
  border-bottom: 0;
}

.fg-library-tools-rail .fg-tools-mode-rail-hint {
  display: block;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}

.fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-switch {
  flex-direction: column;
  width: 100%;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-btn {
  width: 100%;
  padding: 0.28rem 0.2rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 0;
}

.fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-btn + .fg-tools-mode-btn {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Active pill must beat the generic teal .is-active (which blended into the rail) */
.fg-library-tools-rail[data-rail-chrome="sales"] .fg-tools-mode--rail .fg-tools-mode-btn.is-active,
.fg-library-tools-rail[data-tools-mode="sales"]:not([data-rail-chrome="access"]):not([data-rail-chrome="admin"]) .fg-tools-mode--rail .fg-tools-mode-btn.is-active {
  color: var(--fg-primary, #22849c);
  background: rgba(255, 255, 255, 0.95);
}

.fg-library-tools-rail[data-rail-chrome="admin"] .fg-tools-mode--rail .fg-tools-mode-btn.is-active,
.fg-library-tools-rail[data-tools-mode="admin"]:not([data-rail-chrome="access"]) .fg-tools-mode--rail .fg-tools-mode-btn.is-active {
  color: var(--fg-secondary, #c5494d);
  background: rgba(255, 255, 255, 0.95);
}

.fg-library-tools-rail[data-rail-chrome="access"] .fg-tools-mode--rail .fg-tools-mode-btn.is-active {
  color: var(--fg-teal-dark, #176579);
  background: rgba(255, 255, 255, 0.95);
}

.fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: -2px;
}

.fg-library-tools-rail .rail-account .rail-btn,
.fg-library-tools-rail .rail-account-esign {
  position: relative;
}

.fg-library-tools-rail .rail-account-esign.fg-esign-notify {
  border-color: transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  animation: none;
  padding: 0.4rem 0.15rem;
  border-radius: 12px;
  width: 4.15rem;
  min-height: 3.5rem;
  font-size: 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
}

.fg-library-tools-rail .rail-account-esign.fg-esign-notify:hover,
.fg-library-tools-rail .rail-account-esign.fg-esign-notify.has-notification {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
}

.fg-library-tools-rail .rail-account-esign .fg-esign-notify-badge {
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
}

.fg-library-tools-rail .rail-identity {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 90;
  overflow: visible;
}

.fg-library-tools-rail .rail-identity-btn {
  width: 4.15rem;
  min-height: 3.5rem;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem 0.2rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.fg-library-tools-rail .rail-identity-btn:hover,
.fg-library-tools-rail .rail-identity.is-open .rail-identity-btn {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
}

.fg-library-tools-rail .rail-identity-meta {
  display: none;
}

.fg-library-tools-rail .rail-identity-btn .fg-identity-caret {
  display: none;
}

.fg-library-tools-rail .rail-identity-menu {
  left: calc(100% + 0.45rem);
  right: auto;
  bottom: 0;
  top: auto;
  min-width: 16rem;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  transform: none;
  z-index: 200;
  /* Solid light menu over blue ribbon / main content */
  background: var(--fg-white, #fff);
  color: var(--fg-ink, #1a2b32);
}

.fg-library-tools-rail .rail-icon-notes {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3Cpath d='M10 9H8'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3Cpath d='M10 9H8'/%3E%3C/svg%3E");
}

.fg-library-tools-rail .rail-icon-alert {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.fg-esign-toast.rail-anchored {
  display: none !important;
}

/* Action Required → Alerts page (right pane) */
.fg-alerts-page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.25rem 1.35rem 2rem;
}

.fg-alerts-head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--fg-display);
  font-size: 1.45rem;
  font-weight: 650;
  color: var(--fg-ink, #1a2330);
}

.fg-alerts-head .fg-lead {
  margin: 0;
  max-width: 40rem;
  font-size: 0.92rem;
  color: var(--fg-muted, #5a646e);
}

.fg-alerts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.1rem 0 0.65rem;
}

.fg-alerts-count {
  margin: 0;
  font-size: 0.88rem;
}

.fg-alerts-table-wrap {
  border: 1px solid var(--fg-line, #d8dfdf);
  border-radius: 10px;
  overflow: hidden;
  background: var(--fg-white, #fff);
}

.fg-alerts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fg-alerts-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted, #5a646e);
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--fg-line, #d8dfdf);
  background: color-mix(in srgb, var(--fg-paper, #f5f8fa) 80%, #fff);
}

.fg-alerts-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--fg-line, #d8dfdf);
  vertical-align: middle;
}

.fg-alerts-table tr:last-child td {
  border-bottom: none;
}

.fg-alerts-col-view {
  width: 4.5rem;
  white-space: nowrap;
}

.fg-alerts-row:hover {
  background: color-mix(in srgb, var(--fg-teal, #22849c) 5%, #fff);
}

.fg-alerts-row.is-attention {
  background: color-mix(in srgb, #c45c26 8%, #fff);
}

.fg-alerts-row.is-attention:hover {
  background: color-mix(in srgb, #c45c26 12%, #fff);
}

.fg-alerts-title-cell {
  min-width: 0;
}

.fg-alerts-title {
  display: block;
  font-weight: 700;
  color: var(--fg-teal-dark, #176579);
}

.fg-alerts-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  line-height: 1.3;
}

.fg-alerts-when {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted, #5a646e);
  width: 7.5rem;
}

.fg-alerts-empty {
  text-align: center;
  padding: 1.5rem 1rem !important;
}

.rail-account-esign.is-alerts-page,
.fg-esign-notify.is-alerts-page {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 1px;
}

.fg-library-tools-rail .rail-account-esign.is-alerts-page {
  background: rgba(255, 255, 255, 0.16);
}

.fg-library-tools-rail .rail-hint {
  width: 100%;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 0.2rem;
  opacity: 1;
}

.fg-library-tools-rail .rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.fg-library-tools-rail .rail-group-admin,
.fg-library-tools-rail .rail-group-hr,
.fg-library-tools-rail .rail-group-pm {
  /* No divider line — keep spacing consistent with other tool groups */
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.fg-library-tools-rail .rail-group-label {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 0.15rem;
  text-align: center;
  max-width: 4.15rem;
  line-height: 1.15;
  white-space: normal;
}

.fg-library-tools-rail .rail-btn {
  width: 4.15rem;
  min-height: 3.9rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.12;
  padding: 0.4rem 0.15rem;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  text-align: center;
  text-decoration: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  /* Room for inset notification badges without clipping. */
  overflow: visible;
}

/* Badges must sit inside the button — rail-tools-main uses overflow-x: hidden,
   so top/right:-10px hangs off the ribbon and gets cut in half. */
.fg-library-tools-rail .rail-btn .banner-badge {
  top: 0.1rem;
  right: 0.08rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.28rem;
  line-height: 1.35rem;
  font-size: 0.66rem;
  box-shadow:
    0 0 0 2px rgba(255, 45, 45, 0.45),
    0 0 10px rgba(255, 45, 45, 0.55);
  z-index: 5;
}

.fg-library-tools-rail .rail-btn:hover,
.fg-library-tools-rail .rail-btn:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

/* Active tool = left click-in border (matches open modal), not permanent accent. */
.fg-library-tools-rail .rail-btn.is-active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  box-shadow: inset 3px 0 0 #fff;
}

.fg-library-tools-rail .rail-btn.is-active:hover,
.fg-library-tools-rail .rail-btn.is-active:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
  box-shadow: inset 3px 0 0 #fff;
}

.fg-library-tools-rail .rail-btn-accent {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.fg-library-tools-rail .rail-btn-accent:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.fg-library-tools-rail .rail-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  background: currentColor;
  opacity: 0.95;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.fg-library-tools-rail .rail-icon-chat {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-call {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M15 10a3 3 0 1 0-6 0'/%3E%3Cpath d='M12 2a8 8 0 0 0-8 8v1a3 3 0 0 0 3 3h1l2 5h4l2-5h1a3 3 0 0 0 3-3v-1a8 8 0 0 0-8-8z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M15 10a3 3 0 1 0-6 0'/%3E%3Cpath d='M12 2a8 8 0 0 0-8 8v1a3 3 0 0 0 3 3h1l2 5h4l2-5h1a3 3 0 0 0 3-3v-1a8 8 0 0 0-8-8z'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-visit {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l2-5h14l2 5'/%3E%3Cpath d='M3 9v12h18V9'/%3E%3Cpath d='M3 9h18'/%3E%3Cpath d='M9 21v-8h6v8'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l2-5h14l2 5'/%3E%3Cpath d='M3 9v12h18V9'/%3E%3Cpath d='M3 9h18'/%3E%3Cpath d='M9 21v-8h6v8'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-availability {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-hold {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-pm-hold {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-contact {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.8 19.8 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.77.62 2.6a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.48-1.48a2 2 0 0 1 2.11-.45c.83.29 1.7.5 2.6.62A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.8 19.8 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.77.62 2.6a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.48-1.48a2 2 0 0 1 2.11-.45c.83.29 1.7.5 2.6.62A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-support {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-reservations {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2'/%3E%3Crect x='9' y='3' width='6' height='4' rx='1'/%3E%3Cpath d='M9 12h6'/%3E%3Cpath d='M9 16h6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2'/%3E%3Crect x='9' y='3' width='6' height='4' rx='1'/%3E%3Cpath d='M9 12h6'/%3E%3Cpath d='M9 16h6'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-head {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l3 7h7l-5.5 4.5L18 21l-6-4-6 4 1.5-7.5L2 9h7z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l3 7h7l-5.5 4.5L18 21l-6-4-6 4 1.5-7.5L2 9h7z'/%3E%3C/svg%3E");
}
.fg-library-tools-rail .rail-icon-access {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.fg-library-tools-rail .rail-icon-ingest {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}

.fg-library-tools-rail .rail-icon-sync {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 2v6h-6'/%3E%3Cpath d='M3 12a9 9 0 0 1 15-6.7L21 8'/%3E%3Cpath d='M3 22v-6h6'/%3E%3Cpath d='M21 12a9 9 0 0 1-15 6.7L3 16'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 2v6h-6'/%3E%3Cpath d='M3 12a9 9 0 0 1 15-6.7L21 8'/%3E%3Cpath d='M3 22v-6h6'/%3E%3Cpath d='M21 12a9 9 0 0 1-15 6.7L3 16'/%3E%3C/svg%3E");
}

.fg-library-tools-rail .rail-sync-form {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.fg-library-tools-rail .rail-sync-form .rail-btn {
  width: 4.15rem;
}

.fg-library-tools-rail .rail-sync-form .rail-btn[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.92;
}

.fg-library-tools-rail .rail-sync-form .rail-btn[aria-busy="true"] .rail-icon-sync,
.fg-library-tools-rail .rail-sync-form .rail-btn[aria-busy="true"] .rail-icon-ingest {
  animation: fg-rail-sync-spin 0.75s linear infinite;
  transform-origin: center center;
  will-change: transform;
}

.fg-library-tools-rail .rail-sync-label {
  display: block;
  line-height: 1.1;
}

@keyframes fg-rail-sync-spin {
  to {
    transform: rotate(360deg);
  }
}

.fg-mirror-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
  padding: 0.75rem 1.25rem 0.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
.fg-mirror-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg-muted, #5a6b73);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 0.2rem 0;
}
.fg-mirror-nav a:hover,
.fg-mirror-nav a.active {
  color: var(--fg-teal-dark, #176579);
  border-bottom-color: var(--fg-teal, #22849c);
}

.fg-nav-slim:empty,
.fg-nav.fg-nav-slim:not(:has(a)) {
  display: none;
}

/* Workspace shares the blue ribbon — fixed flush under topbar (same as library/IT) */
.project-shell.has-tools-rail {
  display: block;
  padding-left: var(--fg-tools-rail-w);
  box-sizing: border-box;
}
.project-shell.has-tools-rail > .fg-library-tools-rail {
  top: var(--fg-topbar-h);
}
.project-shell.has-tools-rail > .project-main {
  min-width: 0;
}

@media (max-width: 900px) {
  .fg-country-stats,
  .fg-country-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fg-country-video-grid {
    grid-template-columns: 1fr;
    width: min(100% - 1.25rem, 900px);
  }

  .fg-country-insights,
  .fg-country-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Narrow phones only: top tools strip (never right/bottom). Matches workspace. */
@media (max-width: 767px) {
  :root {
    --fg-tools-ribbon-h: 3.7rem;
  }

  .fg-agent-shell.has-tools-rail,
  .fg-projects-shell.has-tools-rail {
    display: block;
    min-height: 0;
    padding-left: 0;
    padding-top: var(--fg-tools-ribbon-h);
  }

  .fg-library-tools-rail {
    /* Horizontal strip: stay visible over Availability / Book Unit content wells */
    position: fixed;
    top: var(--fg-topbar-h);
    left: 0;
    right: 0;
    bottom: auto;
    align-self: stretch;
    min-height: var(--fg-tools-ribbon-h);
    height: auto;
    max-height: none;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    min-width: 0;
    z-index: 230;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #145a6c;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
    padding: 0.45rem 0.55rem;
    gap: 0.35rem;
  }

  .fg-library-tools-rail .rail-tools-main {
    /* Only the tool buttons scroll; SALES/ADMIN + Action stay pinned */
    flex-direction: row;
    flex-wrap: nowrap;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }

  .fg-library-tools-rail .rail-tools-main::-webkit-scrollbar {
    height: 3px;
  }

  .fg-library-tools-rail .rail-tools-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 99px;
  }

  .fg-library-tools-rail .rail-account {
    margin-top: 0;
    margin-left: 0;
    flex-direction: row;
    width: auto;
    padding-top: 0;
    padding-left: 0;
    border-top: 0;
    border-left: 0;
    flex-shrink: 0;
  }

  .fg-library-tools-rail .rail-account-stack {
    margin-top: 0;
    margin-left: 0;
    flex-direction: row;
    flex-shrink: 0;
    width: auto;
    padding-top: 0;
    padding-left: 0.55rem;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
    gap: 0.35rem;
    align-self: stretch;
    align-items: center;
    background: var(--rail-chrome-mid, #22849c);
    z-index: 3;
  }

  .fg-library-tools-rail .fg-tools-mode--rail {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    border-bottom: 0;
    border-right: 0;
    flex-shrink: 0;
  }

  .fg-library-tools-rail .fg-tools-mode-rail-hint {
    display: none;
  }

  .fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-switch {
    flex-direction: row;
    width: auto;
    border-radius: 999px;
  }

  .fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-btn {
    width: auto;
    padding: 0.28rem 0.5rem;
    font-size: 0.62rem;
  }

  .fg-library-tools-rail .fg-tools-mode--rail .fg-tools-mode-btn + .fg-tools-mode-btn {
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
  }

  .fg-library-tools-rail .rail-account-esign.fg-esign-notify,
  .fg-library-tools-rail .rail-identity-btn {
    width: auto;
    min-width: 3.5rem;
    min-height: 2.75rem;
    flex-direction: row;
  }

  .fg-library-tools-rail .rail-identity-menu {
    left: auto;
    right: 0;
    bottom: auto;
    top: calc(100% + 0.35rem);
  }

  .fg-esign-toast.rail-anchored {
    display: none !important;
  }

  .fg-library-tools-rail .rail-group {
    flex-direction: row;
    flex-wrap: nowrap;
    flex-shrink: 0;
    width: auto;
    gap: 0.35rem;
  }

  .fg-library-tools-rail .rail-group-admin,
  .fg-library-tools-rail .rail-group-hr,
  .fg-library-tools-rail .rail-group-pm {
    margin-top: 0;
    padding-top: 0;
    padding-left: 0;
    border-top: 0;
    border-left: 0;
  }

  .fg-library-tools-rail .rail-group-label {
    display: none;
  }

  .fg-library-tools-rail .rail-hint {
    width: auto;
    margin: 0 0.35rem 0 0;
    padding-right: 0.2rem;
    flex-shrink: 0;
    align-self: center;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--rail-chrome-mid, #22849c);
    box-shadow: 0.45rem 0 0.55rem var(--rail-chrome-mid, #22849c);
  }

  .fg-library-tools-rail .rail-btn {
    width: auto;
    min-width: 4.25rem;
    min-height: 2.75rem;
    flex-direction: row;
    flex-shrink: 0;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.72rem;
  }

  .project-shell.has-tools-rail {
    display: block;
    padding-left: 0;
    padding-top: var(--fg-tools-ribbon-h);
  }
}

@media (max-width: 560px) {
  .fg-country-stats,
  .fg-country-video-grid {
    grid-template-columns: 1fr;
  }

  .fg-country-tiles {
    grid-template-columns: 1fr;
  }

  .fg-country-hero {
    min-height: clamp(300px, 52vh, 460px);
  }
}

@media (min-width: 768px) and (max-width: 1180px) {
  .fg-country-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fg-country-tile {
    min-height: 176px;
  }

  .fg-country-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ——— PM Studio Add project cover dropzone ——— */
.pm-cover-field {
  display: block;
  margin-bottom: 0.85rem;
}

.pm-cover-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--fg-muted, #5c6b73);
}

.pm-cover-dropzone {
  padding: 1.15rem 1rem;
  border: 2px dashed rgba(34, 132, 156, 0.4);
  border-radius: var(--fg-radius, 12px);
  text-align: center;
  background: rgba(34, 132, 156, 0.04);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.pm-cover-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.pm-cover-dropzone-label {
  margin: 0;
  font-size: 0.92rem;
}

.pm-cover-dropzone-hint {
  margin: 0;
  font-size: 0.78rem;
}

.pm-cover-dropzone-status {
  margin: 0.2rem 0 0 !important;
  font-size: 0.8rem;
  color: var(--fg-teal, #22849c);
  font-weight: 500;
}

.pm-cover-dropzone-status.is-error {
  color: var(--fg-danger, #b42318);
}

.pm-cover-dropzone.is-dragover {
  border-color: var(--fg-teal, #22849c);
  background: rgba(34, 132, 156, 0.12);
}

.pm-cover-dropzone.is-uploading {
  border-color: var(--fg-teal, #22849c);
  background: rgba(34, 132, 156, 0.15);
  pointer-events: none;
  opacity: 0.9;
}

.pm-cover-dropzone #pm-cover-browse,
.pm-cover-dropzone #pm-cover-file,
.pm-cover-dropzone #pm-news-browse,
.pm-cover-dropzone #pm-news-clear,
.pm-cover-dropzone #pm-news-file {
  pointer-events: auto;
}

.pm-cover-preview {
  width: 100%;
  max-width: 220px;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--fg-radius-sm);
  margin-bottom: 0.35rem;
  border: 1px solid var(--fg-line-strong);
}

.pm-cover-preview.hidden,
.pm-cover-dropzone-status.hidden,
#pm-cover-file.hidden,
#pm-news-file.hidden,
#pm-news-clear.hidden {
  display: none !important;
}

.pm-cover-dropzone.has-preview .pm-cover-dropzone-label {
  font-size: 0.85rem;
}

.pm-news-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.15rem;
}

/* ——— PM Studio slot editor ——— */
.pm-studio-edit .pm-edit-title {
  font-family: var(--fg-display);
  margin: 0.35rem 0 0.5rem;
}

.pm-banner-warn {
  background: #fff6e8;
  border: 1px solid #f0d4a8;
  color: #7a4e12;
  border-radius: var(--fg-radius);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
}

.pm-section-heading {
  font-family: var(--fg-display);
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
}

.pm-meta-form,
.pm-upgrade-panel,
.pm-section {
  margin-bottom: 1.25rem;
}

.pm-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.pm-featured-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.85rem 0 0.35rem;
}

.pm-featured-check input {
  width: auto;
}

.pm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.85rem;
}

.pm-slots-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
  margin: 1.5rem 0 0.75rem;
}

.pm-slots-lead {
  margin: 0;
  max-width: 42rem;
}

.pm-section-head h4 {
  font-family: var(--fg-display);
  margin: 0.15rem 0 0.35rem;
  font-size: 1.25rem;
  color: var(--fg-teal-dark);
}

.pm-section-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-teal);
  font-weight: 600;
}

/* ——— Design toolkit canvas + ribbon ——— */
.pm-canvas-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.pm-canvas-crumb { margin: 0 0 0.25rem; }
.pm-canvas-sub {
  margin: 0.2rem 0 0;
  color: var(--fg-muted);
  font-size: 0.92rem;
}
.pm-canvas-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.pm-publish-actions .pm-action-save,
.pm-publish-actions .pm-action-preview,
.pm-publish-actions .pm-action-live {
  min-width: 5.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pm-publish-actions .pm-action-live {
  background: var(--fg-teal);
  border-color: var(--fg-teal);
  color: #fff;
}

.pm-publish-actions .pm-action-live:hover {
  background: var(--fg-teal-dark, #1a6a7d);
  border-color: var(--fg-teal-dark, #1a6a7d);
  color: #fff;
}

.pm-action-hide.is-active {
  background: #f4e8e6;
  border-color: #c45c4a;
  color: #8a2f22;
}

.pm-hidden-badge {
  color: #8a2f22;
  font-weight: 600;
}
.pm-hidden-badge.is-off {
  display: none;
}

.pm-canvas-panel-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem;
  justify-content: flex-end;
}

.pm-layout-preset-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin: 0;
}

.pm-layout-preset {
  min-width: 12rem;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--fg-line);
  background: var(--fg-white);
  color: var(--fg-ink);
}

.pm-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1.25rem;
}

.pm-preview-modal.hidden,
.pm-preview-modal[hidden] {
  display: none !important;
}

.pm-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 28, 0.55);
}

.pm-preview-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1280px, 100%);
  max-height: calc(100vh - 2rem);
  background: var(--fg-white);
  border-radius: var(--fg-radius);
  box-shadow: var(--fg-shadow);
  overflow: hidden;
  border: 1px solid var(--fg-line);
}

.pm-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--fg-line);
}

.pm-preview-head h3 {
  margin: 0.15rem 0 0;
}

.pm-preview-note {
  margin: 0;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  background: #f4f8f9;
  border-bottom: 1px solid var(--fg-line);
}

.pm-preview-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #111;
}

.pm-about-hero-editor {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
}

.pm-about-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0.65rem 1rem;
  margin-top: 0.75rem;
  align-items: start;
}

.pm-about-hero-media {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pm-about-hero-preview {
  position: relative;
  min-height: 140px;
  border-radius: 10px;
  overflow: hidden;
  background: #e8eef1;
  border: 1px solid var(--fg-line);
}

.pm-about-hero-preview img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.pm-about-hero-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  color: var(--fg-muted);
  font-size: 0.88rem;
  padding: 1rem;
  text-align: center;
}

.pm-about-hero-span {
  grid-column: 1 / -1;
}

.pm-about-fact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.pm-about-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.pm-slot-setup-label {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-teal-dark);
}

.pm-canvas-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0;
  min-height: 70vh;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  overflow: hidden;
  background: var(--fg-white);
  box-shadow: var(--fg-shadow);
}

.pm-ribbon {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.7rem;
  background: linear-gradient(180deg, #f4f7f8 0%, #eef3f5 100%);
  border-right: 1px solid var(--fg-line);
}

.pm-ribbon-label {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-teal-dark);
}

.pm-ribbon-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pm-ribbon-btn {
  flex: 1 1 calc(50% - 0.2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--fg-line);
  background: var(--fg-white);
  color: var(--fg-ink);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.45rem 0.3rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 52px;
}

.pm-ribbon-btn:hover:not(:disabled) {
  border-color: var(--fg-teal);
  color: var(--fg-teal-dark);
}

.pm-ribbon-btn.is-active {
  background: var(--fg-teal);
  border-color: var(--fg-teal);
  color: #fff;
}

.pm-ribbon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pm-ribbon-btn.pm-ribbon-danger:not(:disabled):hover {
  border-color: var(--fg-danger, #c5494d);
  color: var(--fg-danger, #c5494d);
}

.pm-ribbon-ico { font-size: 1rem; line-height: 1; }

.pm-palette {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pm-palette-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px dashed var(--fg-line-strong);
  background: var(--fg-white);
  color: var(--fg-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  cursor: grab;
  text-align: left;
}

.pm-palette-item:hover,
.pm-palette-item.is-dragging {
  border-style: solid;
  border-color: var(--fg-teal);
  background: rgba(34, 132, 156, 0.06);
}

.pm-palette-ico { width: 1.25rem; text-align: center; }

.pm-ribbon-hint {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--fg-muted);
}

.pm-size-tools .pm-ribbon-btn {
  flex: 1 1 calc(25% - 0.3rem);
  min-height: 40px;
  font-size: 0.68rem;
  padding: 0.35rem 0.15rem;
}

.pm-canvas-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(34, 132, 156, 0.04), transparent 120px),
    #f7fafb;
}

.pm-canvas-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--fg-line);
  background: var(--fg-white);
}

.pm-canvas-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.pm-canvas-tab:hover { color: var(--fg-teal-dark); }
.pm-canvas-tab.is-active {
  color: var(--fg-teal-dark);
  border-bottom-color: var(--fg-teal);
}

.pm-canvas-panel {
  padding: 1rem 1.1rem 1.4rem;
  flex: 1;
}

.pm-canvas-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.pm-canvas-panel-title {
  margin: 0.15rem 0 0;
  font-family: var(--fg-display);
  font-size: 1.25rem;
  color: var(--fg-ink);
}

.pm-tile-grid,
.pm-canvas-grid {
  /* Match Sales Portal flexible tile grid: 4 tracks, col1 = 2, col2 = 4 */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(100px, auto);
  grid-auto-flow: dense;
  gap: 1.15rem;
  margin-top: 0.5rem;
  min-height: 340px;
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed transparent;
  align-content: start;
  background:
    linear-gradient(90deg, rgba(34, 132, 156, 0.04) 1px, transparent 1px) 0 0 / calc(25% - 0.1px) 100%,
    linear-gradient(rgba(34, 132, 156, 0.04) 1px, transparent 1px) 0 0 / 100% 100px,
    var(--fg-paper);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pm-canvas-grid.is-palette-target {
  border-color: var(--fg-teal);
  background: rgba(34, 132, 156, 0.05);
}

.pm-slot {
  position: relative;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  background: var(--fg-white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--fg-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  touch-action: manipulation;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}

.pm-slot.is-design { border-color: var(--fg-line-strong); }
.pm-slot.is-dragover,
.pm-slot.is-selected {
  border-color: var(--fg-teal);
  box-shadow: 0 0 0 2px rgba(34, 132, 156, 0.25), var(--fg-shadow);
  z-index: 2;
}
.pm-slot.is-dragover .pm-slot-preview::after {
  content: "Drop photo here";
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 132, 156, 0.72);
  color: #fff;
  font-family: var(--fg-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.pm-slot[data-media-type="video"].is-dragover .pm-slot-preview::after {
  content: "Drop video here";
}
.pm-slot[data-media-type="pdf"].is-dragover .pm-slot-preview::after {
  content: "Drop PDF here";
}
.pm-slot.is-dragging { opacity: 0.55; transform: scale(0.98); }
.pm-slot.is-drop-target { outline: 2px dashed var(--fg-teal); }
.pm-slot.is-resizing { z-index: 4; box-shadow: 0 0 0 2px var(--fg-teal), var(--fg-shadow); }

.pm-tool-move .pm-slot { cursor: grab; }
.pm-tool-move .pm-slot.is-dragging { cursor: grabbing; }

/* Distinct footprints — match frontend: col1 half-width, col2 full-width */
.pm-slot-size-col1,
.pm-slot-size-square,
.pm-slot-size-tall {
  grid-column: span 2;
  grid-row: span 1;
  min-height: 280px;
}
.pm-slot-size-col2,
.pm-slot-size-wide,
.pm-slot-size-hero {
  grid-column: span 4;
  grid-row: span 1;
  min-height: 280px;
}

/* Section layout presets (Design toolkit canvas) */
.pm-layout-grid-3x2 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.pm-layout-grid-3x2 .pm-slot {
  grid-column: auto !important;
  min-height: 240px;
}
.pm-layout-hero-single {
  grid-template-columns: 1fr !important;
}
.pm-layout-hero-single .pm-slot {
  grid-column: 1 / -1 !important;
  min-height: 280px;
}
.pm-layout-stacked-bars {
  grid-template-columns: 1fr !important;
}
.pm-layout-stacked-bars .pm-slot {
  grid-column: 1 / -1 !important;
  min-height: 200px;
}
.pm-layout-split-left-hero-right {
  grid-template-columns: 1fr 1.2fr !important;
  grid-auto-rows: minmax(140px, auto);
}
.pm-layout-split-left-hero-right .pm-slot { grid-column: auto !important; min-height: 200px; }
.pm-layout-split-left-hero-right .pm-slot:nth-child(1) { grid-column: 1; grid-row: 1; }
.pm-layout-split-left-hero-right .pm-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.pm-layout-split-left-hero-right .pm-slot:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; min-height: 420px; }

.pm-layout-hero-left-split-right {
  grid-template-columns: 1.2fr 1fr !important;
  grid-auto-rows: minmax(140px, auto);
}
.pm-layout-hero-left-split-right .pm-slot { grid-column: auto !important; min-height: 200px; }
.pm-layout-hero-left-split-right .pm-slot:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; min-height: 420px; }
.pm-layout-hero-left-split-right .pm-slot:nth-child(2) { grid-column: 2; grid-row: 1; }
.pm-layout-hero-left-split-right .pm-slot:nth-child(3) { grid-column: 2; grid-row: 2; }

.pm-layout-wide-narrow {
  grid-template-columns: 1.65fr 1fr !important;
}
.pm-layout-wide-narrow .pm-slot {
  grid-column: auto !important;
  min-height: 220px;
}
.pm-layout-narrow-wide {
  grid-template-columns: 1fr 1.65fr !important;
}
.pm-layout-narrow-wide .pm-slot {
  grid-column: auto !important;
  min-height: 220px;
}

.pm-slot-chrome {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--fg-line);
  z-index: 2;
}

.pm-slot-drag {
  border: 0;
  background: transparent;
  cursor: grab;
  color: var(--fg-muted);
  font-size: 0.9rem;
  letter-spacing: -0.08em;
  user-select: none;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}
.pm-slot-drag:active { cursor: grabbing; }
.pm-slot-drag:hover { background: rgba(34, 132, 156, 0.08); color: var(--fg-teal-dark); }

.pm-size-chips {
  display: flex;
  gap: 0.2rem;
  flex: 1;
}

.pm-size-chip {
  border: 1px solid var(--fg-line);
  background: var(--fg-paper);
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 2rem;
  height: 1.85rem;
  border-radius: 4px;
  cursor: pointer;
  padding: 0 0.35rem;
}
.pm-size-chip.is-active {
  background: var(--fg-teal);
  border-color: var(--fg-teal);
  color: #fff;
}

.pm-slot-remove {
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.pm-slot-remove:hover {
  color: var(--fg-danger, #c5494d);
  background: rgba(197, 73, 77, 0.08);
}

.pm-slot-drop {
  cursor: pointer;
  touch-action: manipulation;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.pm-slot-preview {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(34, 132, 156, 0.08), transparent 55%),
    #e8eef1;
  overflow: hidden;
}

.pm-slot-preview img,
.pm-slot-preview video {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  display: block;
}

/* PDF / empty media: keep tile footprint stable (no layout collapse) */
.pm-slot[data-media-type="pdf"] .pm-slot-preview {
  min-height: 180px;
}

.pm-slot-upload-btn {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%);
  z-index: 4;
  border: 0;
  background: var(--fg-teal);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 32, 42, 0.2);
  pointer-events: auto;
}
.pm-slot-upload-btn:hover {
  background: var(--fg-teal-dark);
}
.pm-slot.has-media .pm-slot-upload-btn {
  opacity: 0;
  pointer-events: none;
}
.pm-slot.has-media:hover .pm-slot-upload-btn,
.pm-slot.has-media.is-selected .pm-slot-upload-btn,
.pm-slot.has-media.is-dragover .pm-slot-upload-btn {
  opacity: 1;
  pointer-events: auto;
}

.pm-slot-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--fg-muted);
  padding: 1rem;
  text-align: center;
  border: 1px dashed rgba(34, 132, 156, 0.35);
  margin: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

.pm-slot-empty-label {
  font-family: var(--fg-display);
  font-weight: 600;
  color: var(--fg-teal-dark);
}

.pm-slot-empty-hint {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pm-slot-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 1.4rem 0.75rem 0.65rem;
  background: linear-gradient(180deg, transparent, rgba(20, 32, 42, 0.72));
  color: #fff;
  pointer-events: none;
  z-index: 1;
}

.pm-slot-title-display {
  margin: 0;
  font-family: var(--fg-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.pm-slot-sub-display {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  opacity: 0.85;
}

.pm-slot-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(26, 35, 48, 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  z-index: 2;
  pointer-events: none;
}

.pm-slot-badge.play {
  left: 0.5rem;
  right: auto;
  background: var(--fg-teal);
}

.pm-slot-badge.featured {
  top: auto;
  bottom: 0.5rem;
  right: 0.5rem;
  background: var(--fg-teal-dark);
}

.pm-slot-body {
  padding: 0.55rem 0.7rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--fg-white);
  border-top: 1px solid var(--fg-line);
  max-height: 220px;
  overflow-y: auto;
  flex: 0 1 auto;
}

.pm-slot-body label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.pm-slot-body input {
  font: inherit;
  font-weight: 500;
  color: var(--fg-ink);
  border: 1px solid var(--fg-line);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  background: var(--fg-paper);
}

.pm-slot-body input:focus {
  outline: 2px solid var(--fg-teal-soft);
  border-color: var(--fg-teal);
}

.pm-media-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.pm-media-switch-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-teal);
  width: 100%;
}

.pm-media-btn {
  border: 1px solid var(--fg-line);
  background: var(--fg-white);
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
}

.pm-media-btn.is-active {
  background: var(--fg-teal);
  border-color: var(--fg-teal);
  color: #fff;
}

.pm-media-tools {
  flex-wrap: wrap;
}
.pm-media-tools .pm-ribbon-btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 0;
  font-size: 0.72rem;
  padding: 0.35rem 0.4rem;
}

.pm-slot-status {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
}
.pm-slot-status.is-ok { color: #1a7a4c; }
.pm-slot-status.is-error { color: var(--fg-danger); }

.pm-resize-handle {
  position: absolute;
  z-index: 6;
  background: var(--fg-teal);
  border: 2px solid #fff;
  border-radius: 4px;
  opacity: 0.35;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(20, 32, 42, 0.25);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.pm-slot.is-selected .pm-resize-handle,
.pm-slot:hover .pm-resize-handle {
  opacity: 1;
}
.pm-resize-e {
  width: 14px;
  height: 44px;
  top: 50%;
  right: -7px;
  transform: translateY(-50%);
  cursor: ew-resize;
}
.pm-resize-s {
  width: 44px;
  height: 14px;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  cursor: ns-resize;
}
.pm-resize-se {
  width: 18px;
  height: 18px;
  right: -8px;
  bottom: -8px;
  border-radius: 4px;
  cursor: nwse-resize;
}

.pm-meta-details {
  margin-top: 1.5rem;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  background: var(--fg-white);
  padding: 0.35rem 0.85rem 0.85rem;
}
.pm-meta-details > summary {
  cursor: pointer;
  font-family: var(--fg-display);
  font-weight: 600;
  color: var(--fg-teal-dark);
  padding: 0.65rem 0.15rem;
}
.pm-meta-details[open] > summary { margin-bottom: 0.5rem; }

.pm-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
}

.pm-price-card-panel {
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .pm-canvas-shell {
    grid-template-columns: 1fr;
  }
  .pm-ribbon {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--fg-line);
  }
  .pm-palette {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .pm-palette-item { flex: 1 1 120px; }
}

.pm-pc-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.pm-pc-fieldset {
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  padding: 0.85rem 1rem 1rem;
  margin: 0;
}

.pm-pc-fieldset legend {
  font-family: var(--fg-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-teal-dark);
  padding: 0 0.35rem;
}

.pm-pc-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.35rem 0.75rem;
}

.pm-span-2 {
  grid-column: span 2;
}

.pm-pc-fieldset textarea {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
}

.pm-canvas-tab--studio {
  margin-left: auto;
  color: var(--fg-teal-dark);
  font-style: italic;
}

.pm-canvas-shell.is-price-card-tab .pm-ribbon {
  opacity: 0.45;
  pointer-events: none;
}

.pm-price-card-standalone {
  margin-top: 1.25rem;
}

.pm-pc-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.pm-pc-help {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}

.pm-pc-layout-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pm-pc-layout-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  background: #fff;
}

.pm-pc-layout-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: #eef2f4;
}

.pm-pc-layout-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pm-pc-layout-meta input {
  width: 100%;
}

.pm-pc-layout-empty {
  color: var(--fg-muted);
  font-size: 0.85rem;
  padding: 0.35rem 0;
}

.pm-pc-layout-add {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
}

.pm-pc-preview-wrap {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--fg-line);
}

.pm-pc-preview-title {
  margin: 0 0 0.25rem;
  font-family: var(--fg-display);
  font-size: 1rem;
  color: var(--fg-teal-dark);
}

/* Quotation price card — 3-row / 2-column product layout (studio preview) */
.pc-quote-preview {
  margin-top: 0.75rem;
  overflow: auto;
}

.pc-quote-card {
  background: #fff;
  color: #111;
  border: 1px solid #cfd6db;
  padding: 1rem 1.1rem 1.25rem;
  font-family: "Red Hat Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.35;
  min-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pc-quote-band {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 0.75rem 1rem;
  align-items: stretch;
}

.pc-quote-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.pc-quote-box1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0;
}

.pc-quote-meta-line {
  font-size: 13px;
}

.pc-quote-image {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pc-quote-image--logo {
  align-items: flex-end;
  justify-content: center;
}

.pc-quote-logo {
  max-height: 64px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.pc-quote-logo-fallback {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  text-align: right;
}

.pc-quote-box {
  border: 1px solid #111;
  padding: 0.45rem 0.55rem 0.55rem;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.pc-quote-box .pc-quote-table {
  max-width: 100%;
}

.pc-quote-box * {
  max-width: 100%;
}

.pc-quote-k {
  font-weight: 600;
}

.pc-quote-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pc-quote-table th,
.pc-quote-table td {
  padding: 0.18rem 0.3rem;
  vertical-align: top;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.pc-quote-table th {
  font-weight: 600;
  color: #222;
}

.pc-quote-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pc-quote-table tr.is-promo th,
.pc-quote-table tr.is-promo td {
  background: rgba(55, 190, 202, 0.2);
}

.pc-quote-promo-cell {
  background: rgba(55, 190, 202, 0.2);
}

.pc-quote-special {
  overflow: hidden;
}

.pc-quote-special-table th:nth-child(1),
.pc-quote-special-table td:nth-child(1) { width: 60%; }

.pc-quote-special-table th:nth-child(2),
.pc-quote-special-table td:nth-child(2) { width: 40%; }

.pc-quote-rebate {
  font-weight: 700;
}

.pc-quote-comments {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pc-quote-table tr.is-emphasis th,
.pc-quote-table tr.is-emphasis td {
  font-weight: 700;
}

.pc-quote-table tr.is-total td {
  font-weight: 700;
  border-top: 1px solid #bbb;
}

.pc-quote-table tr.is-total .pc-quote-amt {
  border-bottom: 3px double #111;
  display: inline-block;
  min-width: 5.5rem;
}

.pc-quote-note {
  font-size: 10px;
  color: #444;
  margin-top: 0.1rem;
  font-weight: 400;
}

.pc-quote-terms {
  border: 1px solid #111;
  padding: 0.45rem 0.55rem 0.55rem;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.pc-quote-terms h4 {
  margin: 0 0 0.35rem;
  font-size: 12px;
}

.pc-quote-terms ol {
  margin: 0;
  padding-left: 1.1rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pc-quote-terms li {
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
}

.pc-quote-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  min-width: 0;
  padding: 0.35rem;
  box-sizing: border-box;
  background: transparent;
}

.pc-quote-visual-label {
  display: none;
}

.pc-quote-visual img,
.pc-quote-visual img.pc-layout-trim {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 140px;
  max-height: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #fff;
  border: 1px solid var(--fg-line, #d8e0e6);
  padding: 0.25rem;
  box-sizing: border-box;
  border-radius: 2px;
}

.pc-quote-visual--multi {
  gap: 0.5rem;
}

.pc-quote-visual--multi img {
  flex: 0 1 auto;
  min-height: 110px;
  max-height: 220px;
}

.pc-quote-visual-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 120px;
  border: 0;
  color: #6a7782;
  background: transparent;
  font-size: 12px;
}

@media (max-width: 980px) {
  .pm-pc-studio-grid {
    grid-template-columns: 1fr;
  }
  .pm-pc-layout-add {
    grid-template-columns: 1fr;
  }
  .pc-quote-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .pc-quote-card {
    display: flex;
    flex-direction: column;
  }
  .pc-quote-band,
  .pc-quote-stack {
    display: contents;
  }
  /* Text boxes first, then image boxes on mobile. */
  .pc-quote-box1,
  .pc-quote-box,
  .pc-quote-terms,
  .pc-campaign-offers {
    order: 1;
    margin-bottom: 0.65rem;
  }
  .pc-quote-image {
    order: 2;
    margin-bottom: 0.65rem;
  }
  .pc-quote-image--logo {
    align-items: flex-start;
  }
  .pc-quote-unit-table th,
  .pc-quote-unit-table td {
    width: auto;
  }
  .pc-quote-visual img {
    min-height: 160px;
    max-height: 280px;
  }
}

@media (max-width: 720px) {
  .pm-meta-grid {
    grid-template-columns: 1fr;
  }

  .pm-tile-grid,
  .pm-canvas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(100px, auto);
    gap: 1rem;
  }

  .pm-slot-size-col1,
  .pm-slot-size-square,
  .pm-slot-size-tall {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 240px;
  }
  .pm-slot-size-col2,
  .pm-slot-size-wide,
  .pm-slot-size-hero {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 240px;
  }

  .pm-span-2 {
    grid-column: span 1;
  }
}

/* Agent portal + PM news (additive — do not alter .fg-portal-teaser) */
.fg-portal-news {
  margin-top: 0.25rem;
}

.fg-portal-news .fg-news-list {
  gap: 0.75rem;
}

.fg-portal-news-list li,
.fg-portal-news-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fg-portal-news-item.has-image {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
}

.fg-portal-news-thumb,
.pm-news-thumb,
.fg-home-news-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--fg-radius-sm);
  border: 1px solid var(--fg-line-strong);
  background: var(--fg-teal-soft);
}

.fg-portal-news-thumb {
  width: 96px;
  height: 72px;
}

.fg-portal-news-content,
.pm-news-item-body,
.fg-home-news-content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fg-portal-news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  align-items: center;
}

.fg-portal-news-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.pm-news-panel {
  margin-top: 1.5rem;
}

.pm-news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}

.pm-news-form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.pm-news-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pm-news-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  align-items: center;
}

.pm-news-list li,
.pm-news-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pm-news-item.has-image {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
}

.pm-news-list li strong,
.pm-news-item-body strong {
  font-family: var(--fg-display);
  color: var(--fg-ink);
}

.fg-home-news-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fg-home-news-item.has-image {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
}

.fg-home-news-thumb {
  width: 64px;
  height: 48px;
}

@media (max-width: 900px) {
  .pm-news-layout {
    grid-template-columns: 1fr;
  }

  .pm-news-form-row {
    grid-template-columns: 1fr;
  }
}

/* —— In-app Notes (/notes) — match BMS chrome notes (teal soft, not cyan) —— */
.fg-nav-notes {
  border: 1px solid color-mix(in srgb, var(--fg-teal) 28%, var(--fg-line));
  background: color-mix(in srgb, var(--fg-teal) 8%, #fff);
  color: var(--fg-teal-dark) !important;
  font-weight: 600;
}

.fg-nav-notes:hover,
.fg-nav-notes.active,
.fg-nav a.fg-nav-notes:hover,
.fg-nav a.fg-nav-notes.active {
  border-color: color-mix(in srgb, var(--fg-teal) 42%, var(--fg-line));
  background: color-mix(in srgb, var(--fg-teal) 14%, #fff);
  color: var(--fg-teal-dark) !important;
}

.fg-notes-page {
  max-width: 920px;
}

.fg-notes-hero {
  margin-bottom: 1rem;
}

.fg-notes-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.fg-notes-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.75rem;
}

.fg-notes-jump a {
  text-decoration: none;
  color: var(--fg-teal-dark);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--fg-teal-soft);
  border: 1px solid var(--fg-line-strong);
}

.fg-notes-jump a:hover {
  background: #d5ebf0;
  border-color: var(--fg-teal);
}

.fg-notes-block {
  margin-bottom: 1.75rem;
}

.fg-notes-block h3 {
  font-family: var(--fg-display);
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
  color: var(--fg-ink);
}

.fg-notes-section-lead {
  margin: 0 0 0.9rem;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.fg-notes-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-teal-dark);
  background: var(--fg-teal-soft);
  border: 1px solid var(--fg-line-strong);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.fg-notes-bg-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.fg-notes-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fg-notes-card {
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--fg-teal);
  box-shadow: var(--fg-shadow);
}

.fg-notes-card h4 {
  font-family: var(--fg-display);
  font-size: 1.05rem;
  margin: 0.35rem 0 0.45rem;
}

.fg-notes-card-wide h4 {
  margin-top: 0;
}

.fg-notes-prose {
  font-size: 0.95rem;
  color: var(--fg-ink);
  line-height: 1.5;
}

.fg-notes-prose p {
  margin: 0 0 0.5rem;
}

.fg-notes-prose p:last-child {
  margin-bottom: 0;
}

.fg-notes-prose code {
  font-size: 0.86em;
  background: var(--fg-elevated);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.fg-notes-todo-list,
.fg-notes-living {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fg-notes-todo {
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  padding: 1rem 1.1rem;
  border-left: 3px solid #c9852a;
  box-shadow: var(--fg-shadow);
}

.fg-notes-todo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.fg-notes-living li {
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius);
  padding: 0.9rem 1.05rem;
  border-left: 3px solid var(--fg-teal);
  box-shadow: var(--fg-shadow);
}

.fg-notes-date {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 0.2rem;
}

.fg-notes-living strong {
  display: inline-block;
  margin: 0.15rem 0 0.35rem;
}

@media (max-width: 640px) {
  .fg-notes-jump {
    gap: 0.3rem;
  }

  .fg-notes-jump a {
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
  }

  .fg-tools-mode-label {
    display: none;
  }

  .fg-tools-mode-btn {
    padding: 0.22rem 0.55rem;
    font-size: 0.74rem;
  }
}


/* Studio — text tiles + multi-media extras */
.pm-slot-drop.is-text-slot .pm-slot-upload-btn { display: none; }
.pm-slot-text-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 8rem;
  padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--fg-paper, #f5f8fa) 80%, #fff);
  font-family: var(--fg-font, "Red Hat Display", sans-serif);
}
.pm-slot-text-body {
  margin: 0;
  color: var(--pm-text-color, #555);
  font-family: inherit;
  line-height: 1.35;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  font-size: 1rem;
}
.pm-slot-text-preview[style*="--pm-text-size:sm"] .pm-slot-text-body { font-size: 0.85rem; }
.pm-slot-text-preview[style*="--pm-text-size:md"] .pm-slot-text-body { font-size: 1rem; }
.pm-slot-text-preview[style*="--pm-text-size:lg"] .pm-slot-text-body { font-size: 1.2rem; }
.pm-slot-text-preview[style*="--pm-text-size:xl"] .pm-slot-text-body { font-size: 1.45rem; font-weight: 600; }

.pm-text-fields {
  display: grid;
  gap: 0.55rem;
  margin: 0.35rem 0 0.65rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--fg-line, #d8dfdf);
  border-radius: 10px;
  background: color-mix(in srgb, var(--fg-paper, #f5f8fa) 55%, #fff);
}
.pm-text-fields.is-collapsed { display: none; }
.pm-text-fields textarea,
.pm-text-fields select,
.pm-text-fields input[type="color"] {
  width: 100%;
  font: inherit;
  font-family: var(--fg-font, "Red Hat Display", sans-serif);
}
.pm-text-fields textarea {
  min-height: 4.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--fg-line, #d8dfdf);
  border-radius: 8px;
  resize: vertical;
}
.pm-text-style-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}
.pm-text-style-row label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #7f7f7f);
}
.pm-text-style-row input[type="color"] {
  width: 2.5rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--fg-line, #d8dfdf);
  border-radius: 6px;
  background: #fff;
}
.pm-text-style-row select {
  min-height: 2.2rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--fg-line, #d8dfdf);
  border-radius: 6px;
  background: #fff;
}
.pm-text-font-hint {
  font-size: 0.75rem;
  color: var(--muted, #7f7f7f);
  align-self: center;
}
.pm-save-text-btn { justify-self: start; }

.pm-extra-blocks {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--fg-line, #d8dfdf);
}
.pm-extra-blocks-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.pm-extra-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.pm-extra-add-btn {
  appearance: none;
  border: 1px solid var(--fg-line, #d8dfdf);
  background: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--fg-teal-dark, #176579);
}
.pm-extra-add-btn:hover {
  border-color: var(--fg-teal, #22849c);
}
.pm-extra-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.pm-extra-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--fg-paper, #f5f8fa) 70%, #fff);
  font-size: 0.8rem;
}
.pm-extra-kind {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg-teal-dark, #176579);
}
.pm-extra-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink, #555);
}
.pm-extra-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted, #888);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.pm-extra-empty {
  font-size: 0.78rem;
  color: var(--muted, #7f7f7f);
  font-style: italic;
  padding: 0.2rem 0;
}

/* About Us — hero + org sections */
.fg-about-hero .fg-country-hero-inner {
  width: min(28rem, calc(100% - 2rem));
  margin: 0 0 1.35rem 1.25rem;
  padding: 1.35rem 1.35rem 1.2rem;
  border-radius: calc(var(--fg-radius) + 2px);
  background: color-mix(in srgb, var(--fg-primary, #22849c) 92%, #0c2a34);
  box-shadow: 0 16px 40px rgba(12, 42, 52, 0.28);
}

.fg-about-hero .fg-country-eyebrow {
  color: #fff;
}

.fg-about-hero h1 {
  color: #fff;
  max-width: none;
}

.fg-about-hero .fg-country-hero-inner > p:not(.fg-country-brand):not(.fg-country-eyebrow) {
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0;
}

.fg-story-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 1.25rem;
}

.fg-story-card-grid--about {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fg-story-card {
  display: flex;
  flex-direction: column;
  background: var(--fg-white);
  border: 1px solid var(--fg-line);
  border-radius: calc(var(--fg-radius) + 2px);
  overflow: hidden;
  box-shadow: var(--fg-shadow);
  min-height: 0;
}

.fg-story-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0c2a34;
  overflow: hidden;
}

.fg-story-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.fg-story-card-body {
  padding: 0.95rem 1.05rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.fg-story-card-body h3 {
  margin: 0;
  font-family: var(--fg-display);
  font-size: 1.08rem;
  color: var(--fg-ink);
}

.fg-story-card-body p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.fg-about-org {
  scroll-margin-top: 5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--fg-line);
}

.fg-about-org--first {
  border-top: 0;
  padding-top: 2rem;
}

.fg-about-org-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.fg-about-org-logo {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  margin-bottom: 0.25rem;
}

.fg-about-org-head h2 {
  margin: 0;
  color: var(--fg-rich-black);
}

.fg-about-org-sub {
  margin: 0;
  color: var(--fg-teal-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.fg-about-vision {
  margin: 0 0 1.25rem;
  padding: 1.15rem 1.25rem;
  max-width: 48rem;
  border: 0;
  border-left: 3px solid var(--fg-primary);
  background: color-mix(in srgb, var(--fg-primary) 6%, #ffffff);
  border-radius: 0 var(--fg-radius) var(--fg-radius) 0;
}

.fg-about-vision-headline {
  margin: 0 0 0.55rem;
  font-family: var(--fg-display);
  font-size: 1.2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--fg-teal-dark);
  line-height: 1.35;
}

.fg-about-vision-text {
  margin: 0;
  color: var(--fg-rich-black);
  font-size: 0.92rem;
  line-height: 1.55;
}

.fg-about-org-links {
  margin: 1.15rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.fg-about-org-sep {
  color: var(--fg-grey);
}

@media (max-width: 720px) {
  .fg-story-card-grid,
  .fg-story-card-grid--about {
    grid-template-columns: 1fr;
  }
}

.fg-bangkok-map-section {
  max-width: min(1180px, 100%);
}

.fg-bkk-map {
  margin-top: 1.25rem;
  background: #fbfaf7;
  border: 1px solid var(--fg-line);
  border-radius: calc(var(--fg-radius) + 4px);
  box-shadow: var(--fg-shadow);
  overflow: hidden;
}

.fg-bkk-edit-bar {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--fg-secondary, #c5494d) 35%, var(--fg-line));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--fg-secondary, #c5494d) 10%, #fff) 0%,
    #fff 100%
  );
}

.fg-bkk-edit-bar p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--fg-rich-black);
}

.fg-bkk-edit-bar code {
  font-size: 0.8em;
}

.fg-bkk-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.fg-bkk-edit-status {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.fg-bkk-edit-status.is-error {
  color: var(--fg-secondary, #c5494d);
}

.fg-bkk-map.is-editing-pins .fg-bkk-canvas-wrap,
.fg-bkk-map.is-editing-pins .fg-bkk-canvas,
.fg-bkk-map.is-editing-pins .fg-bkk-hit-svg,
.fg-bkk-map.is-editing-pins .fg-bkk-pins-layer,
.fg-bkk-map.is-editing-pins .fg-bkk-district-pin,
.fg-bkk-map.is-editing-pins 
.fg-bkk-projects-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.fg-bkk-projects-layer .fg-bkk-project-hit {
  pointer-events: auto;
}

.fg-bkk-project-hit {
  touch-action: none;
}

.fg-bkk-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--fg-line);
  background: linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--fg-primary) 4%, #f7f6f2) 100%);
}

.fg-bkk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fg-bkk-legend-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.2rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--fg-rich-black);
  cursor: pointer;
  min-height: 40px;
}

.fg-bkk-legend-btn:hover,
.fg-bkk-legend-btn:focus-visible {
  color: var(--fg-primary, #22849c);
  outline: none;
}

.fg-bkk-swatch {
  display: inline-block;
  width: 1.05rem;
  height: 0.45rem;
  margin-right: 0.3rem;
  border-radius: 999px;
  background: var(--swatch, var(--fg-primary));
  vertical-align: 0.05em;
  box-shadow: 0 0 0 2px #fff;
}

.fg-bkk-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.fg-bkk-canvas-wrap {
  position: relative;
  padding: 0.55rem 0.45rem 0.45rem;
  background:
    radial-gradient(ellipse 85% 70% at 48% 42%, #fffcf7 0%, #e7eef2 100%);
  overflow: visible;
  touch-action: pan-y;
}

.fg-bkk-zoom-controls {
  position: absolute;
  right: 0.85rem;
  bottom: 0.95rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: auto;
}

.fg-bkk-zoom-btn {
  appearance: none;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--fg-primary, #22849c) 28%, #c5ced6);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--fg-rich-black, #1a2428);
  font: 600 1.25rem/1 var(--font-sans, "Red Hat Display", system-ui, sans-serif);
  box-shadow: 0 2px 10px rgba(15, 40, 50, 0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.fg-bkk-zoom-btn:hover,
.fg-bkk-zoom-btn:focus-visible {
  color: var(--fg-primary, #22849c);
  border-color: var(--fg-primary, #22849c);
  outline: none;
}

.fg-bkk-zoom-btn:active {
  transform: translateY(1px);
}

.fg-bkk-zoom-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.fg-bkk-zoom-reset {
  font-size: 0.95rem;
}

.fg-bkk-zoom-viewport {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: calc(var(--fg-radius) - 2px);
  touch-action: none;
  cursor: grab;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(34, 132, 156, 0.08);
}

.fg-bkk-zoom-viewport.is-panning {
  cursor: grabbing;
}

.fg-bkk-zoom-viewport.is-zoomed {
  overscroll-behavior: contain;
}

.fg-bkk-zoom-stage {
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform, width, height;
}

.fg-bkk-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
  contain: layout paint;
  touch-action: none;
  /* Pin size tracks map (and baked-in station text) across layout zoom */
  container-type: size;
  container-name: bkk-map;
}

.fg-bkk-map-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}

.fg-bkk-hit-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  /* Only project marks capture hits — empty SVG must not block district pins */
  pointer-events: none;
  /* Allow vertical page scroll to start on top of hit polygons */
  touch-action: pan-y;
}

.fg-bkk-pins-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.fg-bkk-district-pin {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08cqw;
  margin: 0;
  padding: 0.2cqw 0.25cqw 0.1cqw;
  border: 0;
  background: transparent;
  transform: translate(-50%, -92%);
  transform-origin: 50% 92%;
  cursor: pointer;
  pointer-events: auto;
  touch-action: pan-y;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.fg-bkk-pin-glyph {
  /* ~1.5–2× a station-name glyph on the map art — scales with layout zoom */
  width: 1.25cqw;
  height: 1.85cqw;
  min-width: 11px;
  min-height: 16px;
  flex: 0 0 auto;
  display: block;
  position: relative;
  color: var(--pin-fill, #c5494d);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
  transition: transform 0.12s ease, filter 0.12s ease;
}

.fg-bkk-pin-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fg-bkk-pin-body {
  fill: currentColor;
}

.fg-bkk-pin-shade {
  fill: color-mix(in srgb, currentColor 68%, #1a1a1a);
  pointer-events: none;
}

.fg-bkk-pin-hole {
  fill: #fff;
}

.fg-bkk-pin-label {
  font-size: 0.95cqw;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--fg-rich-black);
  text-shadow: 0 1px 0 #fff, 0 0 4px #fff;
  white-space: nowrap;
  max-width: 12cqw;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.15rem);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.fg-bkk-district-pin:hover .fg-bkk-pin-label,
.fg-bkk-district-pin:focus-visible .fg-bkk-pin-label,
.fg-bkk-district-pin.is-active .fg-bkk-pin-label,
.fg-bkk-map.is-editing-pins .fg-bkk-pin-label {
  opacity: 1;
  transform: none;
}

.fg-bkk-district-pin:hover .fg-bkk-pin-glyph,
.fg-bkk-district-pin:focus-visible .fg-bkk-pin-glyph,
.fg-bkk-district-pin.is-active .fg-bkk-pin-glyph {
  transform: scale(1.12);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.32)) brightness(1.04);
}

.fg-bkk-district-pin.is-dragging .fg-bkk-pin-glyph,
.fg-bkk-project-hit.is-dragging rect {
  opacity: 0.92;
}

.fg-bkk-map.is-editing-pins .fg-bkk-district-pin,
.fg-bkk-map.is-editing-pins .fg-bkk-project-hit {
  cursor: grab;
}

.fg-bkk-map.is-editing-pins .fg-bkk-district-pin.is-dragging,
.fg-bkk-map.is-editing-pins .fg-bkk-project-hit.is-dragging {
  cursor: grabbing;
  z-index: 5;
}

.fg-bkk-project-hit {
  cursor: pointer;
  touch-action: pan-y;
  pointer-events: auto;
}

.fg-bkk-project-hit rect {
  fill: color-mix(in srgb, var(--fg-primary, #22849c) 12%, transparent);
  stroke: var(--fg-primary, #22849c);
  stroke-width: 0.35;
  transition: fill 0.12s ease, stroke-width 0.12s ease;
}

.fg-bkk-project-hit:hover rect,
.fg-bkk-project-hit:focus-visible rect,
.fg-bkk-project-hit.is-active rect {
  fill: color-mix(in srgb, var(--fg-tertiary, #37beca) 35%, transparent);
  stroke-width: 0.55;
  outline: none;
}

.fg-bkk-project-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem 1.1rem;
  border-top: 1px solid var(--fg-line);
  background: #fff;
}

.fg-bkk-pill {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--fg-primary) 28%, var(--fg-line));
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  min-height: 44px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fg-bkk-pill:hover,
.fg-bkk-pill:focus-visible {
  border-color: var(--fg-primary);
  box-shadow: var(--fg-shadow-focus);
  outline: none;
}

.fg-bkk-pill-station {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #37beca);
}

.fg-bkk-pill strong {
  display: block;
  font-size: 0.88rem;
  color: var(--fg-rich-black);
}

/* District popup — Why Thailand / FGP CI (#22849C) wireframe layout */
.fg-bkk-district-dialog,
.fg-bkk-project-dialog {
  border: 0;
  border-radius: calc(var(--fg-radius) + 6px);
  padding: 0;
  max-width: min(920px, 96vw);
  width: min(920px, 96vw);
  background: transparent;
  box-shadow: none;
}

.fg-bkk-district-dialog::backdrop,
.fg-bkk-project-dialog::backdrop {
  background: rgba(8, 28, 36, 0.52);
}

.fg-bkk-district-panel,
.fg-bkk-project-panel {
  margin: 0;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: calc(var(--fg-radius) + 6px);
  background: linear-gradient(165deg, #1a6f84 0%, #22849c 48%, #1c7288 100%);
  color: #fff;
  box-shadow: 0 22px 48px rgba(8, 28, 36, 0.28);
  font-family: var(--fg-display), "Red Hat Display", sans-serif;
}

.fg-bkk-district-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.fg-bkk-district-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, #fff 78%, #37beca);
}

.fg-bkk-district-head h3 {
  margin: 0;
  font-family: var(--fg-display), "Red Hat Display", sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 700;
  color: #fff;
}

.fg-bkk-dialog-close {
  appearance: none;
  border: 0;
  background: color-mix(in srgb, #fff 14%, transparent);
  border-radius: 999px;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  min-width: 44px;
  min-height: 44px;
}

.fg-bkk-district-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.95fr) minmax(0, 1.55fr);
  grid-template-areas:
    "photo metrics"
    "photo features"
    "photo intro";
  gap: 0.65rem;
  align-items: stretch;
}

.fg-bkk-district-photo {
  grid-area: photo;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, #0e4a58 55%, #22849c);
  min-height: 220px;
}

.fg-bkk-district-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 220px;
}

.fg-bkk-district-metrics {
  grid-area: metrics;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.fg-bkk-metric {
  background: color-mix(in srgb, #0f5564 70%, #22849c);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}

.fg-bkk-metric-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: color-mix(in srgb, #fff 72%, #37beca);
}

.fg-bkk-metric-value {
  margin: 0.35rem 0 0.15rem;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  line-height: 1.2;
}

.fg-bkk-metric-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: color-mix(in srgb, #fff 70%, transparent);
}

.fg-bkk-district-features {
  grid-area: features;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.fg-bkk-feature {
  background: color-mix(in srgb, #0f5564 70%, #22849c);
  border-radius: 10px;
  padding: 0.7rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.fg-bkk-district-intro {
  grid-area: intro;
  margin: 0;
  background: color-mix(in srgb, #0f5564 70%, #22849c);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: color-mix(in srgb, #fff 92%, transparent);
}

.fg-bkk-project-dialog {
  max-width: min(460px, 94vw);
  width: min(460px, 94vw);
}

.fg-bkk-project-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border-radius: 10px;
  background: color-mix(in srgb, #0f5564 70%, #22849c);
}

.fg-bkk-project-card img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  background: #0e4a58;
}

.fg-bkk-project-card p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: color-mix(in srgb, #fff 88%, transparent);
}

.fg-bkk-project-nearest {
  font-size: 0.78rem !important;
  color: color-mix(in srgb, #fff 70%, #37beca) !important;
}

.fg-bkk-project-card .fg-btn {
  margin-top: 0.15rem;
}

@media (max-width: 767px) {
  .fg-bkk-district-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "metrics"
      "features"
      "intro";
  }

  .fg-bkk-district-photo,
  .fg-bkk-district-photo img {
    min-height: 180px;
    max-height: 220px;
  }

  .fg-bkk-district-features {
    grid-template-columns: 1fr;
  }

  .fg-bkk-project-card {
    grid-template-columns: 1fr;
  }

  .fg-bkk-project-card img {
    width: 100%;
    height: 140px;
  }

  .fg-bkk-canvas-wrap {
    padding: 0.35rem 0.2rem;
  }
}
