/* Fulcrum Global platform chrome — light shell */

:root {
  /*
   * FGP CI (Logotype & CI Usage Guidelines):
   * Primary backgrounds: dark turquoise + crimson
   * Graphic accents: teal-green / orange / salmon
   * Text: rich black + light grey (greys for chrome, not brand fill)
   */
  --fg-primary: #22849c;
  --fg-secondary: #c5494d;
  --fg-tertiary: #37beca; /* graphic teal-green / cyan */
  --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-champagne-soft: color-mix(in srgb, var(--fg-salmon) 28%, #ffffff);
  --fg-champagne-deep: color-mix(in srgb, var(--fg-orange) 72%, #8a4030);
  --fg-grey: #b2b2b2;
  --fg-grey-mid: #7f7f7f;
  --fg-grey-deep: #555555;
  --fg-rich-black: #1a1a1a;
  --fg-ink: var(--fg-rich-black);
  --fg-muted: var(--fg-grey-mid);
  --fg-line: #d8dfdf;
  --fg-line-strong: color-mix(in srgb, var(--fg-grey) 55%, #d8dfdf);
  --fg-paper: #f5f8fa;
  --fg-elevated: #eef5f7;
  --fg-white: #ffffff;
  --fg-danger: var(--fg-crimson);
  --fg-radius: 8px;
  --fg-radius-sm: 4px;
  --fg-shadow: 0 8px 20px rgba(34, 132, 156, 0.1);
  --fg-shadow-lg: 0 14px 32px rgba(34, 132, 156, 0.16);
  --fg-shadow-focus: 0 0 0 3px var(--fg-teal-soft);
  /* 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 heights — tools rail pins flush under the top banner */
  --fg-topbar-h: 4rem;
  --fg-tools-rail-w: 4.75rem;
}

.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;
  overscroll-behavior-y: contain;
  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: calc(var(--fg-topbar-h) + env(safe-area-inset-top, 0px));
  min-height: calc(var(--fg-topbar-h) + env(safe-area-inset-top, 0px));
  max-height: calc(var(--fg-topbar-h) + env(safe-area-inset-top, 0px));
  padding: 0 1rem;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--fg-line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  /* Always above the fixed tools rail so a 1px misalignment never covers the brand */
  z-index: 250;
}

.fg-topbar .fgp-lockup-mark {
  width: 32px;
  height: 32px;
}

.fg-brand-block {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  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-nav a.fg-nav-external {
  color: var(--fg-teal-dark);
  border: 1px solid var(--fg-line);
}

.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;
}

/* Shared FGP primary lockup (mark + stacked wordmark) */
.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);
}

.fg-brand-lockup {
  display: block;
  height: 1.85rem;
  width: auto;
  max-width: 7.5rem;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.fg-brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  padding: 0.2rem;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(26, 35, 48, 0.08);
}

.fg-brand-word {
  font-family: var(--fg-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.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 {
  color: var(--fg-teal-dark);
  background: var(--fg-teal-soft);
}

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

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

.fg-identity-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--fg-line-strong);
  background: linear-gradient(180deg, #eef7f9 0%, #e3f1f5 100%);
  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: var(--fg-display);
  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;
}

.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, 133, 157, 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;
  text-transform: capitalize;
}

/* display:inline-flex above beats the UA [hidden] rule — restore hide. */
.fg-btn[hidden] {
  display: none !important;
}

/* 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);
}

/* Beat .fg-body a so outline link-buttons match outline <button> ink */
.fg-body a.fg-btn-outline {
  color: var(--fg-ink);
}

.fg-btn-outline:hover,
.fg-body a.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: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  color: #fff;
  overflow: hidden;
  background-color: #eef5f7;
  background-image: url("/static/assets/fulcrum/exteriors/form-thonglor-exterior-21.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center left;
}

.fg-hero--guest {
  align-items: stretch;
  min-height: min(78vh, 700px);
  padding: 0;
  color: #fff;
  background-color: #eef5f7;
  background-image: url("/static/assets/fulcrum/exteriors/form-thonglor-exterior-21.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center left;
}

.fg-hero--guest::after {
  background: none;
}

.fg-hero--guest h1 {
  color: #fff;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.fg-hero--guest p {
  color: #e8f7f9;
  text-shadow: none;
  opacity: 1;
}

.fg-hero--guest .fg-hero-brand {
  color: #e8f7f9;
}

.fg-hero::after {
  content: none;
}

.fg-hero-inner {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(40%, 28rem);
  min-width: min(100%, 17.5rem);
  max-width: 100%;
  margin: 0;
  min-height: inherit;
  display: flex;
  align-items: stretch;
}

.fg-hero-inner--login {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.fg-hero-copy {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1.35rem, 3vw, 2.5rem);
  background: var(--fg-primary, #22849C);
}

.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: #e8f7f9;
}

.fg-hero-brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.fg-hero h1 {
  font-family: var(--fg-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 0.75rem;
  max-width: 14ch;
  color: #fff;
  text-shadow: none;
  -webkit-text-stroke: 0;
  paint-order: normal;
}

.fg-hero p {
  margin: 0;
  max-width: 42ch;
  font-size: 1.05rem;
  line-height: 1.45;
  opacity: 1;
  color: #e8f7f9;
  text-shadow: none;
}

.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 {
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.35rem;
}

.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-login {
    /* Login panel sits over photo (left) when present; copy stays on blue band (right) */
    position: absolute;
    left: clamp(1.25rem, 4vw, 3rem);
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    justify-self: unset;
  }
}

@media (max-width: 859px) {
  .fg-hero,
  .fg-hero--guest {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    min-height: min(70vh, 560px);
    background-position: center top;
  }

  .fg-hero-inner,
  .fg-hero-inner--login {
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
  }

  .fg-hero-copy {
    padding: 1.85rem 1.25rem 1.65rem;
  }

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

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

  .fg-hero-login {
    max-width: none;
    margin: 1rem 1.25rem 1.5rem;
  }
}

.fg-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.fg-section h2 {
  font-family: var(--fg-display);
  font-size: 1.65rem;
  margin: 0 0 0.35rem;
}

.fg-section .fg-lead {
  color: var(--fg-muted);
  margin: 0 0 1.25rem;
}

.fg-guide-grid,
.fg-card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.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-mkt-status.is-soft_live {
  background: color-mix(in srgb, var(--fg-orange, #c47a3a) 88%, #000);
  color: #fff;
  border-color: color-mix(in srgb, var(--fg-orange, #c47a3a) 88%, #000);
}

.fg-project-info-badges {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: calc(100% - 1.5rem);
  pointer-events: none;
}

.fg-project-info-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.fg-project-info-badge.is-ready {
  background: var(--fg-primary, #22849c);
  border-color: var(--fg-primary, #22849c);
}

.fg-project-info-badge.is-off-plan {
  background: var(--fg-orange, #ff8c64);
  border-color: var(--fg-orange, #ff8c64);
}

.fg-project-info-badge.is-eia {
  background: var(--fg-tertiary, #37beca);
  border-color: var(--fg-tertiary, #37beca);
}

.fg-project-card-media-static {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

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

.fg-project-pack-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 35, 42, 0.48);
  pointer-events: none;
}

.fg-project-pack-overlay-label {
  max-width: 90%;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.fg-project-card.is-soft-live .fg-project-open:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fg-project-card.is-soft-live .fg-project-name span {
  color: inherit;
}

.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.3rem;
  padding: 0 0.85rem 0.9rem;
  margin-top: auto;
}

.fg-project-card-main-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 100%;
  width: 100%;
}

.fg-project-card-actions .fg-btn,
.fg-project-card .actions .fg-btn {
  box-sizing: border-box;
  min-height: 1.65rem;
  height: 1.65rem;
  padding: 0 0.28rem;
  font-size: 0.58rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: none;
}

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

.fg-project-card .pm-visibility-inline {
  display: contents;
}

.fg-project-card .pm-card-badges-inline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-top: 0.15rem;
  min-width: 0;
}

.pm-card-badge-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pm-card-badge-label {
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--fg-ink-muted, #5b6b73);
}

.pm-card-badge-select {
  box-sizing: border-box;
  width: 100%;
  min-height: 1.65rem;
  height: 1.65rem;
  padding: 0 0.4rem;
  border: 1px solid var(--fg-line-strong, #c5d0d6);
  border-radius: 0.35rem;
  background: #fff;
  color: var(--fg-ink, #1a2a32);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
}
.fg-project-card .fg-project-soft-live,
.fg-project-card .fg-project-soft-live:hover,
.fg-project-card .fg-project-soft-live:focus-visible,
.fg-project-soft-live,
.fg-project-soft-live:hover,
.fg-project-soft-live:focus-visible,
.fg-project-card .fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"],
.fg-project-card .fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"]:hover,
.fg-project-card .fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"]:focus-visible,
.fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"],
.fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"]:hover,
.fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"]:focus-visible {
  background: var(--fg-orange, #ff8c64) !important;
  border-color: var(--fg-orange, #ff8c64) !important;
  color: #fff !important;
}

.fg-project-card .fg-project-soft-live:disabled,
.fg-project-soft-live:disabled,
.fg-project-card .fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"]:disabled,
.fg-btn.fg-btn-outline.fg-project-visibility[value="soft_live"]:disabled {
  background: color-mix(in srgb, var(--fg-orange, #ff8c64) 55%, #fff) !important;
  border-color: color-mix(in srgb, var(--fg-orange, #ff8c64) 55%, #fff) !important;
  color: #fff !important;
  opacity: 0.75;
}

.fg-project-offline-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  flex: 1 1 100%;
  margin-left: 0;
}

.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: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--fg-teal-dark, #1a6f84);
  border-color: rgba(34, 133, 157, 0.45);
  --dl-progress: 0%;
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
}

.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 (progress ring via --dl-progress) */
.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:
    radial-gradient(circle at center, var(--fg-teal) 52%, transparent 53%),
    conic-gradient(#fff var(--dl-progress, 0%), rgba(255, 255, 255, 0.22) 0);
  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: absolute;
  inset: 0;
  margin: auto;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fg-spin 0.7s linear infinite;
  flex: none;
}

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

.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-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, 133, 157, 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: rgba(34, 133, 157, 0.08);
}

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

.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: rgba(255, 255, 255, 0.22);
  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, 133, 157, 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(26, 106, 124, 0.08);
}

.fg-inbox-action:hover {
  color: var(--fg-teal-dark);
  border-color: rgba(34, 133, 157, 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(26, 106, 124, 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: 0.85rem 1rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
}

/* 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-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-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.fg-tab {
  border: 1px solid var(--fg-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  min-width: 3.25rem;
  min-height: 2.5rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
}

.fg-tab.active {
  color: var(--fg-teal-dark);
  border-color: var(--fg-teal);
  background: var(--fg-teal-soft);
}

/* Agent portal + project library — iPad */
@media (min-width: 768px) and (max-width: 1180px) {
  .fg-topbar {
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
    gap: 0.5rem;
  }

  .fg-brand-lockup {
    height: 1.7rem;
    max-width: 6.75rem;
  }

  .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: 1.1rem 1.15rem 1.75rem;
    max-width: none;
  }

  .fg-projects-hub-head {
    margin-bottom: 0.7rem;
  }

  .fg-projects-hub-head .fg-tab {
    padding: 0.4rem 1rem;
    min-width: 3.25rem;
    min-height: 2.45rem;
  }

  .fg-guide-grid,
  .fg-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .fg-project-card-media {
    aspect-ratio: 16 / 10;
    min-height: 168px;
  }

  .fg-project-card-body {
    padding: 1rem 1.05rem 0.85rem;
    gap: 0.4rem;
  }

  .fg-project-name {
    font-size: 1.15rem;
  }

  .fg-project-card-actions .fg-btn {
    min-height: 1.65rem;
    height: 1.65rem;
    padding: 0 0.28rem;
    font-size: 0.58rem;
    width: 100%;
  }

  .fg-project-card-main-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    flex: 1 1 100%;
  }

  .fg-project-card .pm-visibility-inline {
    display: contents;
  }

  .fg-project-offline-inline {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .fg-project-card .fg-project-dl-btn {
    width: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    height: 2rem;
    padding: 0;
  }

  .fg-project-card .fg-project-clear-btn {
    width: auto;
    min-width: 2rem;
    min-height: 2rem;
    height: 2rem;
    padding: 0 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;
    min-width: 3.5rem;
    padding: 0.55rem 1.15rem;
  }

  .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;
  }

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

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

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

  .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: calc(1rem + 4pt);
  color: #15677b;
  text-transform: capitalize;
}

.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;
  color: #15677b;
  font-size: calc(1rem + 4pt);
  text-transform: capitalize;
}

.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(55, 190, 202, 0.14), 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;
}

@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;
  }

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

/* Agent surfaces left tools rail — Sales Toolkit blue ribbon parity */
.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.has-tools-rail > .fg-library-tools-rail,
.fg-projects-shell.has-tools-rail > .fg-library-tools-rail {
  grid-column: auto;
  grid-row: auto;
}

.fg-agent-shell.has-tools-rail > .fg-agent-shell-main,
.fg-projects-shell.has-tools-rail > .fg-agent-shell-main {
  grid-column: auto;
  grid-row: auto;
  min-width: 0;
  width: auto;
}

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

.fg-library-tools-rail {
  /* Fixed flush under sticky .fg-topbar — never overlap the banner */
  position: fixed;
  top: calc(var(--fg-topbar-h) + env(safe-area-inset-top, 0px));
  left: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.35rem 0.75rem;
  width: var(--fg-tools-rail-w);
  height: auto;
  max-height: none;
  min-height: 0;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, #1a6f86 0%, #22849c 42%, #176579 100%);
  border-right: 1px solid #145a6c;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
  color: #e8f4f7;
}

body.has-studio-tools-rail .fg-topbar {
  position: sticky;
  top: 0;
  z-index: 250;
}

.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-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 {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.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;
}

.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.2rem;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  text-align: center;
  text-decoration: none;
  flex-shrink: 0;
  box-sizing: border-box;
}

.fg-library-tools-rail a.rail-btn {
  cursor: pointer;
}

.fg-library-tools-rail .rail-btn:hover,
.fg-library-tools-rail .rail-btn:focus-visible,
.fg-library-tools-rail .rail-btn.is-active {
  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;
}

.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;
}

/* Text-only ribbon (no icon glyphs) — keep Sales Toolkit button footprint */
.fg-tools-ribbon--text .rail-btn {
  gap: 0;
  font-size: 0.62rem;
  line-height: 1.2;
  padding: 0.55rem 0.25rem;
}

.fg-tools-ribbon--text .rail-icon {
  display: none;
}

.fg-library-tools-rail .rail-btn.is-inactive,
.fg-library-tools-rail .rail-btn.is-inactive:hover,
.fg-library-tools-rail .rail-btn.is-inactive:focus-visible {
  color: rgba(255, 255, 255, 0.38);
  border-color: transparent;
  background: transparent;
  outline: none;
  cursor: default;
  pointer-events: none;
}

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

@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(1100px, calc(100% - 3rem));
  }

  .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) {
  .fg-agent-shell.has-tools-rail,
  .fg-projects-shell.has-tools-rail {
    display: block;
    padding-left: 0;
    min-height: 0;
  }

  .fg-agent-shell.has-tools-rail > .fg-library-tools-rail,
  .fg-projects-shell.has-tools-rail > .fg-library-tools-rail,
  .fg-agent-shell.has-tools-rail > .fg-agent-shell-main,
  .fg-projects-shell.has-tools-rail > .fg-agent-shell-main {
    grid-column: auto;
    grid-row: auto;
  }

  .fg-library-tools-rail {
    position: sticky;
    top: calc(var(--fg-topbar-h) + env(safe-area-inset-top, 0px));
    left: auto;
    bottom: auto;
    align-self: stretch;
    min-height: 0;
    height: auto;
    max-height: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: 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;
    -webkit-overflow-scrolling: touch;
  }

  .fg-library-tools-rail .rail-tools-main {
    flex-direction: row;
    flex: 0 1 auto;
    overflow: visible;
    width: auto;
    padding-bottom: 0;
  }

  .fg-library-tools-rail .rail-group {
    flex-direction: row;
    width: auto;
  }

  .fg-library-tools-rail .rail-group-admin,
  .fg-library-tools-rail .rail-group-hr {
    margin-top: 0;
    margin-left: 0.35rem;
    padding-top: 0;
    padding-left: 0.45rem;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
  }

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

  .fg-library-tools-rail .rail-hint {
    width: auto;
    margin: 0 0.35rem 0 0;
    flex-shrink: 0;
    align-self: center;
  }

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

@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, 133, 157, 0.4);
  border-radius: var(--fg-radius, 12px);
  text-align: center;
  background: rgba(34, 133, 157, 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(55, 190, 202, 0.14);
}

.pm-cover-dropzone.is-uploading {
  border-color: var(--fg-teal, #22849c);
  background: rgba(34, 133, 157, 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-visibility-toggle {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.2rem;
  border: 1px solid var(--fg-border, #d8dde6);
  border-radius: 10px;
  background: var(--fg-surface-2, #f4f6f9);
}

.pm-visibility-option {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.pm-visibility-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pm-visibility-option span {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted, #5b6472);
}

.pm-visibility-option input:checked + span {
  background: #fff;
  color: var(--fg-ink, #1a1f2b);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.pm-visibility-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
}

.pm-visibility-inline .fg-project-visibility:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

/* ——— Marketing Studio Edit (/pm/<slug>) ——— */
.marketing-studio-page .marketing-studio {
  margin-top: 1rem;
}

.marketing-studio-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.marketing-studio-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.marketing-studio.is-editing {
  background: color-mix(in srgb, var(--fg-teal, #22849c) 4%, #fff);
  border-color: color-mix(in srgb, var(--fg-teal, #22849c) 28%, var(--fg-line, #d8e0e6));
}

.ms-edit-unlock-hint {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--fg-muted);
}

.marketing-studio.is-editing .ms-edit-unlock-hint {
  display: none;
}

.marketing-studio-field {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-ink);
}

.marketing-studio-field .field-optional,
.project-asset-field .field-optional {
  font-weight: 400;
  color: var(--fg-muted);
}

.marketing-studio-field textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-weight: 400;
  font-size: 0.95rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius-sm);
  resize: vertical;
  min-height: 3.2rem;
  background: var(--fg-white);
  color: var(--fg-ink);
}

.marketing-studio-field textarea[readonly] {
  background: color-mix(in srgb, var(--fg-paper) 70%, #fff);
  cursor: default;
}

.project-asset-uploads {
  display: grid;
  gap: 1rem;
}

.project-asset-field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-ink);
}

.project-asset-field input[type="file"],
.project-asset-field select {
  font: inherit;
  font-weight: 400;
  font-size: 0.9rem;
}

.project-asset-field select {
  width: 100%;
  max-width: 14rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius-sm);
  background: var(--fg-white);
  color: var(--fg-ink);
}

.project-asset-field select:disabled,
.project-asset-field input[type="file"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: color-mix(in srgb, var(--fg-paper) 70%, #fff);
}

/* Marketing Studio: hero/logo file pickers stay clickable (not locked behind Edit). */
.marketing-studio .project-asset-field input[type="file"] {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
}

.project-asset-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--fg-muted);
}

.ms-asset-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7.5rem;
  max-width: 22rem;
  border: 1px solid var(--fg-line);
  border-radius: var(--fg-radius-sm);
  background: var(--fg-elevated);
  overflow: hidden;
}

.ms-asset-preview img {
  display: block;
  width: 100%;
  height: 7.5rem;
  object-fit: cover;
}

.ms-asset-preview-logo {
  min-height: 4.5rem;
  max-width: 12rem;
  background: #fff;
}

.ms-asset-preview-logo img {
  height: 4.5rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

.ms-asset-empty {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--fg-muted);
  padding: 1rem;
}

.marketing-studio .fg-form-status {
  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;
}

.pm-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pm-slot {
  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;
}

.pm-slot.is-design {
  border-color: var(--fg-line-strong);
}

.pm-slot.is-dragover {
  border-color: var(--fg-teal);
  box-shadow: var(--fg-shadow-focus);
}

.pm-slot-drop {
  cursor: pointer;
  touch-action: manipulation;
}

.pm-slot-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(34, 133, 157, 0.08), transparent 55%),
    #e8eef1;
  overflow: hidden;
}

.pm-slot-preview img,
.pm-slot-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.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;
}

.pm-slot-empty-label {
  font-family: var(--fg-display);
  font-weight: 600;
  color: var(--fg-teal-dark);
}

.pm-slot-empty-hint {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.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;
}

.pm-slot-badge.play {
  left: 0.5rem;
  right: auto;
  background: var(--fg-teal);
}

.pm-slot-badge.featured {
  top: auto;
  bottom: 0.5rem;
  background: var(--fg-teal-dark);
}

.pm-slot-body {
  padding: 0.75rem 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.pm-slot-guide {
  margin: 0;
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.35;
  min-height: 2.5em;
}

.pm-slot-body label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  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.45rem 0.55rem;
  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.35rem;
  margin-top: 0.15rem;
}

.pm-media-switch-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-teal);
  margin-right: 0.25rem;
}

.pm-media-btn {
  border: 1px solid var(--fg-line);
  background: var(--fg-white);
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 36px;
}

.pm-media-btn.is-active {
  background: var(--fg-teal);
  border-color: var(--fg-teal);
  color: #fff;
}

.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-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.pm-about-hero-editor {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--fg-line);
  border-radius: 12px;
  background: rgba(34, 132, 156, 0.04);
}

.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-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-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);
}

.pm-slot-chrome-spacer { flex: 1; }

.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-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.is-dragging {
  opacity: 0.55;
}
.pm-slot.is-drop-target {
  outline: 2px dashed var(--fg-teal);
  outline-offset: 2px;
}

.pm-embed-field {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.pm-embed-field.is-collapsed {
  display: none;
}

@media (max-width: 720px) {
  .pm-about-hero-grid {
    grid-template-columns: 1fr;
  }

  .pm-meta-grid {
    grid-template-columns: 1fr;
  }

  .pm-tile-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .pm-tile-grid {
    grid-template-columns: 1fr;
  }
}

/* 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) —— */
.fg-nav-notes {
  border: 1px solid var(--fg-line-strong);
  background: linear-gradient(180deg, #f4fafb 0%, #e8f4f7 100%);
  color: var(--fg-teal-dark) !important;
  font-weight: 600;
}

.fg-nav a.fg-nav-notes:hover,
.fg-nav a.fg-nav-notes.active {
  border-color: var(--fg-teal);
  background: var(--fg-teal-soft);
  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;
  }
}

/* —— Story pages (About Bangkok / About Us) —— */
.fg-story-hero {
  min-height: clamp(240px, 36vh, 380px);
}

.fg-story-hero .fg-country-hero-inner {
  padding: 2.1rem 1.25rem 1.75rem;
}

.fg-story-hero h1 {
  max-width: 14ch;
}

/* About Us — same bottom wash + type colors as Why Thailand */
.fg-about-hero {
  align-items: flex-end;
  min-height: clamp(280px, 42vh, 440px);
  color: var(--fg-rich-black, #1a1a1a);
}

.fg-about-hero::before {
  filter: contrast(0.9);
}

.fg-about-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-about-hero .fg-country-hero-inner {
  width: min(980px, 100%);
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 2.1rem 1.25rem 1.75rem;
  min-height: 0;
  display: block;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.fg-about-hero .fg-country-eyebrow {
  color: #fff;
  opacity: 1;
}

.fg-about-hero h1 {
  color: #fff;
  max-width: 14ch;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

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

@media (max-width: 859px) {
  .fg-about-hero {
    min-height: clamp(240px, 48vh, 420px);
  }

  .fg-about-hero .fg-country-hero-inner {
    padding: 1.65rem 1.25rem 1.5rem;
  }

  .fg-about-hero h1 {
    font-size: clamp(1.85rem, 7vw, 2.55rem);
    max-width: 14ch;
  }
}

/* About Bangkok — same bottom wash + type colors as Why Thailand */
.fg-bangkok-hero {
  align-items: flex-end;
  min-height: clamp(280px, 42vh, 440px);
  color: var(--fg-rich-black, #1a1a1a);
}

.fg-bangkok-hero::before {
  background-position: center right;
  filter: contrast(0.9);
}

.fg-bangkok-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-bangkok-hero .fg-country-hero-inner {
  width: min(980px, 100%);
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 2.1rem 1.25rem 1.75rem;
  min-height: 0;
  display: block;
}

.fg-bangkok-hero .fg-country-eyebrow {
  color: #fff;
  opacity: 1;
}

.fg-bangkok-hero h1 {
  color: #fff;
  max-width: 14ch;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.fg-bangkok-hero .fg-country-hero-inner > p:not(.fg-country-eyebrow),
.fg-bangkok-hero .fg-bangkok-hero-copy > p:not(.fg-country-eyebrow) {
  margin: 0;
  max-width: 34rem;
  font-size: 1.08rem;
  line-height: 1.5;
  color: #fff;
  opacity: 1;
  text-shadow: none;
}

@media (max-width: 859px) {
  .fg-bangkok-hero {
    min-height: clamp(240px, 48vh, 420px);
  }

  .fg-bangkok-hero::before {
    background-position: center top;
  }

  .fg-bangkok-hero .fg-country-hero-inner {
    padding: 1.65rem 1.25rem 1.5rem;
  }

  .fg-bangkok-hero h1 {
    font-size: clamp(1.85rem, 7vw, 2.55rem);
    max-width: 14ch;
  }
}

.fg-story-section {
  max-width: 1180px;
  padding-top: 1.35rem;
}

.fg-story-intro {
  max-width: 52rem;
  margin-bottom: 1.15rem !important;
}

.fg-story-stats {
  margin: 0 0 1.35rem;
}

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

.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: #15677b;
  text-transform: capitalize;
}

.fg-about-org .fg-story-card-body h3 {
  color: #15677b;
  text-transform: capitalize;
}

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

.fg-story-footnote {
  margin: 1.35rem 0 0;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* About Us — Fulcrum + Noble brand sections */
.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 .fg-country-stat .label,
.fg-about-org .fg-country-stat-label {
  text-transform: capitalize;
}

.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);
}

.fg-country-tile-overlay {
  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 {
  color: #fff;
  text-shadow: none;
  text-transform: capitalize;
}

.fg-country-tile-overlay span {
  color: #fff;
  text-shadow: none;
  text-transform: capitalize;
}

.fg-hero h1 {
  color: #fff;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.fg-hero p {
  color: #e8f7f9;
  text-shadow: none;
}

@media (min-width: 960px) {
  .fg-story-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fg-story-card-grid--about {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .fg-story-card-media {
    aspect-ratio: 4 / 3;
  }
}

@media (min-width: 768px) and (max-width: 1180px) {
  .fg-story-hero {
    min-height: clamp(220px, 32vh, 320px);
  }

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

  .fg-story-card-media {
    aspect-ratio: 16 / 10;
  }

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

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

@media (max-width: 719px) {
  .fg-topbar {
    flex-wrap: wrap;
    padding: 0.4rem 0.75rem;
    gap: 0.25rem 0.5rem;
  }

  .fg-brand {
    width: 100%;
  }

  .fg-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .fg-nav a {
    padding: 0.5rem 0.55rem;
    font-size: 0.78rem;
    min-height: 2.6rem;
  }

  .fg-projects-hub-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .fg-projects-hub-head .fg-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .fg-story-card-grid,
  .fg-story-card-grid--about {
    grid-template-columns: 1fr;
  }
}

/* Marketing Studio Admin — tab access matrix */
.fg-studio-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.fg-studio-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.fg-tab-access-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--fg-line);
  border-radius: 12px;
  background: #fff;
  max-width: 100%;
}

.fg-tab-access-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 52rem;
  font-size: 0.88rem;
}

.fg-tab-access-matrix th,
.fg-tab-access-matrix td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--fg-line);
  text-align: center;
  vertical-align: middle;
}

.fg-tab-access-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7fafb;
  color: var(--fg-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  line-height: 1.25;
  min-width: 5.5rem;
}

.fg-tab-access-matrix .fg-tab-access-project {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: #fff;
  min-width: 12rem;
  max-width: 16rem;
}

.fg-tab-access-matrix thead .fg-tab-access-project {
  z-index: 3;
  background: #f7fafb;
}

.fg-tab-access-name {
  display: block;
  font-weight: 600;
  color: var(--fg-ink);
}

.fg-tab-access-meta {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.fg-tab-access-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
}

.fg-tab-access-cell:hover {
  background: color-mix(in srgb, var(--fg-primary, #22849c) 8%, transparent);
}

.fg-tab-access-cell input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  border: 2px solid color-mix(in srgb, var(--fg-primary, #22849c) 45%, var(--fg-line, #d8dfdf));
  border-radius: 5px;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  accent-color: var(--fg-primary, #22849c);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.fg-tab-access-cell input[type="checkbox"]::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  transform: scale(0);
  transition: transform 0.12s ease;
  box-shadow: inset 1em 1em #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}

.fg-tab-access-cell input[type="checkbox"]:checked {
  background: var(--fg-primary, #22849c);
  border-color: var(--fg-primary, #22849c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg-tertiary, #37beca) 28%, transparent);
}

.fg-tab-access-cell input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.fg-tab-access-cell input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg-tertiary, #37beca) 40%, transparent);
}

/* Studio / IT admin checkboxes — FGP teal, not browser blue */
.fg-body input[type="checkbox"] {
  accent-color: var(--fg-primary, #22849c);
}

#tab-access-status.is-ok { color: var(--fg-teal-dark, #176579); }
#tab-access-status.is-error { color: #b42318; }

body.fg-embed > .fg-topbar,
body.fg-embed > .fg-footer {
  display: none !important;
}

body.fg-embed {
  background: #fff;
}

.fg-section-embed {
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

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



/* —— About Bangkok interactive district map —— */
.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 {
  /* Keep page from fighting map pan/zoom gestures */
  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;
  /* Smooth resampling from the hi-res source (layout zoom supplies the pixels) */
  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;
  }
}
